Commit d5154675 authored by 冷玲鹏's avatar 冷玲鹏

修改:banner管理、活动管理、公告管理

parent b72bd30d
import request from '@/utils/request'
import Qs from 'qs'
/**
* 1. 列表查询
* 2. 查询详细信息
* 3. 新增
* 4. 修改
* 5. 逻辑删除
* 6. 导出
*
*/
// 1. 查询报名表
export function listCmsApplication(query) {
return request({
url: '/cmsApplication/queryCmsApplicationByPagination',
method: 'get',
params: query
})
}
// 2. 查询报名表详细信息
export function getCmsApplication(businessId) {
return request({
url: '/cmsApplication/detail/' + businessId,
method: 'get'
})
}
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
<!-- <span>{{ scope.row.isForntPage === 1 ? '是' : '否' }}</span>--> <!-- <span>{{ scope.row.isForntPage === 1 ? '是' : '否' }}</span>-->
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<el-table-column align="center" prop="isTop" min-width="100" label="置顶" show-overflow-tooltip> <el-table-column align="center" prop="isTop" min-width="80" label="置顶" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<!-- 只显示 isTop === 1 时,显示标签 --> <!-- 只显示 isTop === 1 时,显示标签 -->
<el-tag v-if="scope.row.isTop === 1" type="success" size="medium ">置顶</el-tag> <el-tag v-if="scope.row.isTop === 1" type="success" size="medium ">置顶</el-tag>
...@@ -109,14 +109,14 @@ ...@@ -109,14 +109,14 @@
<span>{{ scope.row.isTop === 1 ? '是' : '否' }}</span> <span>{{ scope.row.isTop === 1 ? '是' : '否' }}</span>
</template>--> </template>-->
</el-table-column> </el-table-column>
<el-table-column align="center" prop="isRecommended" min-width="100" label="推荐" show-overflow-tooltip> <el-table-column align="center" prop="isRecommended" min-width="80" label="推荐" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.isRecommended === 1" type="warning" size="medium ">推荐</el-tag> <el-tag v-if="scope.row.isRecommended === 1" type="warning" size="medium ">推荐</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="participants" label="报名人数" min-width="80"> <el-table-column align="center" prop="participantCount" label="报名人数" min-width="80">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link type="primary" @click="handleClick">{{ scope.row.participants || 0 }}</el-link> <el-link type="primary" @click="handleClick(scope.row)">{{ scope.row.participantCount || 0 }}</el-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="排序" prop="weight" :show-overflow-tooltip="true" min-width="55"> <el-table-column label="排序" prop="weight" :show-overflow-tooltip="true" min-width="55">
...@@ -137,8 +137,11 @@ ...@@ -137,8 +137,11 @@
</el-table-column> </el-table-column>
<el-table-column align="center" prop="registrationFee" label="报名费用" show-overflow-tooltip> <el-table-column align="center" prop="registrationFee" label="报名费用" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.registrationFee }}</span> {{ numberFormatter(scope.row.registrationFee, 2) || '-' }}
</template> </template>
<!-- <template slot-scope="scope">
<span>{{ scope.row.registrationFee }}</span>
</template>-->
</el-table-column> </el-table-column>
<!-- <el-table-column align="center" prop="createUser" label="提交人" show-overflow-tooltip> <!-- <el-table-column align="center" prop="createUser" label="提交人" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -194,22 +197,118 @@ ...@@ -194,22 +197,118 @@
/> />
<footer /> <footer />
</div> </div>
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
<div> <el-form ref="queryForm" style="margin: 0 0 0 -15px" :model="queryParams1" :inline="true">
<p>报名人数</p> <el-form-item>
<p>取消报名人数</p> <!-- 发布状态下拉框-->
<el-select v-model="queryParams1.registration">
<el-option
v-for="item in registrationOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="姓名:" prop="name">
<el-input
v-model.trim="queryParams1.name"
placeholder="请输入姓名"
clearable
:maxlength="500"
size="small"
style="width: 220px"
/>
</el-form-item>
<el-form-item>
<!-- //查询按钮-->
<el-button
:class="commonField.queryClass"
:type="commonField.typePrimary"
:icon="commonField.queryIcon"
:size="commonField.smallSize"
@click="loadData1"
>{{ commonField.queryName }}</el-button>
<!-- //重置按钮-->
<el-button
:class="commonField.resetClass"
:icon="commonField.resetIcon"
:size="commonField.smallSize"
@click="resetQuery1"
>{{ commonField.resetName }}</el-button>
</el-form-item>
</el-form>
<div v-if="queryParams1.registration ==='已报名'" class="app-container1">
<el-table :data="gridData" height="300px">
<el-table-column align="center" prop="id" label="序号" min-width="55px">
<template slot-scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column property="name" label="姓名" min-width="120" :header-cell-style="{ display: 'none' }"/>
<el-table-column property="createDate" label="报名日期" min-width="150"></el-table-column>
<el-table-column property="phone" label="联系方式" min-width="220"></el-table-column>
<el-table-column property="applicationFee" label="缴费" min-width="120">
<template slot-scope="scope">
{{ numberFormatter(scope.row.payment, 2) || '-' }}
</template>
</el-table-column>
<el-table-column align="center" label="操作" min-width="100">
<template slot-scope="scope">
<el-button
v-has-permi="hasDetailPerm"
:class="commonField.updateClass"
:type="commonField.typeParent"
:size="commonField.size"
@click="handleViewGridData(scope.row)"
>查看</el-button>
</template>
</el-table-column>
</el-table>
<pagination
:key="pageKey"
v-show="total1>0"
:total="total1"
:page.sync="queryParams1.page"
:limit.sync="queryParams1.rows"
@pagination="loadData1"
/>
</div> </div>
<div class="app-container"> <div v-if="queryParams1.registration ==='取消报名'" class="app-container1">
<el-table :data="gridData"> <el-table :data="gridData1" height="300px">
<el-table-column align="center" prop="id" label="序号" min-width="55px"> <el-table-column align="center" prop="id" label="序号" min-width="55px">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.$index + 1 }}</span> <span>{{ scope.$index + 1 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column property="name" label="姓名" min-width="120"></el-table-column> <el-table-column property="name" label="姓名" min-width="120"></el-table-column>
<el-table-column property="date" label="报名日期" min-width="150"></el-table-column> <el-table-column property="createDate" label="报名日期" min-width="150"></el-table-column>
<el-table-column property="phoneNumber" label="联系方式" min-width="220"></el-table-column> <el-table-column property="phone" label="联系方式" min-width="220"></el-table-column>
</el-table> <el-table-column property="applicationFee" label="缴费" min-width="120">
<template slot-scope="scope">
{{ numberFormatter(scope.row.payment, 2) || '-' }}
</template>
</el-table-column>
<el-table-column align="center" label="操作" min-width="100">
<template slot-scope="scope">
<el-button
v-has-permi="hasDetailPerm"
:class="commonField.updateClass"
:type="commonField.typeParent"
:size="commonField.size"
@click="handleViewGridData(scope.row)"
>查看</el-button>
</template>
</el-table-column>
</el-table>
<pagination
:key="pageKey"
v-show="total2>0"
:total="total2"
:page.sync="queryParams1.page"
:limit.sync="queryParams1.rows"
@pagination="loadData1"
/>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
...@@ -225,6 +324,7 @@ import { updateResponseUrl } from '@/utils/updateUrl' ...@@ -225,6 +324,7 @@ import { updateResponseUrl } from '@/utils/updateUrl'
import { error } from 'autoprefixer/lib/utils' import { error } from 'autoprefixer/lib/utils'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
import { getDataCache, setDataCache } from '@/assets/js/filterData' import { getDataCache, setDataCache } from '@/assets/js/filterData'
import {getCmsApplication, listCmsApplication} from "@/api/contentManagement/application";
export default { export default {
name: 'Index', name: 'Index',
// components: { // components: {
...@@ -254,8 +354,6 @@ export default { ...@@ -254,8 +354,6 @@ export default {
credit: 0, credit: 0,
totalStuHours: 0 totalStuHours: 0
}, },
// 课程方向
courseDirection: [],
formLabelWidth: '90px', formLabelWidth: '90px',
// 表格 // 表格
tableData: [], tableData: [],
...@@ -263,28 +361,11 @@ export default { ...@@ -263,28 +361,11 @@ export default {
title: '', title: '',
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
// 报名人数总
gridAllData: [],
// 报名人数 // 报名人数
gridData: [{ gridData: [],
id: 1, gridData1: [],
date: '2016-05-02',
name: '王小虎',
phoneNumber: '13882996954'
}, {
id: 2,
date: '2016-05-04',
name: '王小虎',
phoneNumber: '13882996954'
}, {
id: 3,
date: '2016-05-01',
name: '王小虎',
phoneNumber: '13882996954'
}, {
id: 4,
date: '2016-05-03',
name: '王小虎',
phoneNumber: '13882996954'
}],
lineindex: 0, lineindex: 0,
teacode: '', teacode: '',
...@@ -325,7 +406,17 @@ export default { ...@@ -325,7 +406,17 @@ export default {
value: '0' value: '0'
} }
], ],
// 发布状态
registrationOptions: [
{
label: '已报名',
value: '已报名'
},
{
label: '取消报名',
value: '取消报名'
}
],
// 上传提交 // 上传提交
uploadList: { uploadList: {
fm: '' fm: ''
...@@ -339,9 +430,16 @@ export default { ...@@ -339,9 +430,16 @@ export default {
rows: 10, rows: 10,
flag: '' flag: ''
}, },
queryParams1: {
page: 1,
rows: 10,
flag: '',
registration: '已报名'
},
// pagination // pagination
total: 0, total: 0,
total1:0,
total2:0,
actionUrl: '', actionUrl: '',
filelist: [], filelist: [],
bussid: [], bussid: [],
...@@ -383,6 +481,15 @@ export default { ...@@ -383,6 +481,15 @@ export default {
this.loadData() this.loadData()
}, },
methods: { methods: {
numberFormatter(content, bit) {
if (!content) {
return ''
}
return new Intl.NumberFormat('zh-CN', {
minimumFractionDigits: bit,
maximumFractionDigits: bit
}).format(content.toFixed(bit))
},
step(index) { step(index) {
return 'step' + index return 'step' + index
}, },
...@@ -425,7 +532,7 @@ export default { ...@@ -425,7 +532,7 @@ export default {
this.queryParams = { this.queryParams = {
page: 1, page: 1,
rows: 10, rows: 10,
flag: '' registration: '已报名'
} }
this.dateRange = [] this.dateRange = []
this.loadData() this.loadData()
...@@ -439,6 +546,24 @@ export default { ...@@ -439,6 +546,24 @@ export default {
this.queryParams.endTime = '' this.queryParams.endTime = ''
} }
}, },
loadData1() {
// 列表渲染数据
var data = []
const _this = this
this.gridData = []
_this.fullscreenLoading = true
_this.fullscreenLoading = false
},
resetQuery1() {
this.queryParams1 = {
page: 1,
rows: 10,
registration: '已报名'
}
this.dateRange = []
this.loadData1()
},
loadData() { loadData() {
// 列表渲染数据 // 列表渲染数据
var data = [] var data = []
...@@ -491,10 +616,54 @@ export default { ...@@ -491,10 +616,54 @@ export default {
_this.dataIsReady = true _this.dataIsReady = true
_this.uploadList.fm = this.interfaceUrl + 'BLesson/picImport' _this.uploadList.fm = this.interfaceUrl + 'BLesson/picImport'
}, },
/** 查看报名人数*/ /** 查看报名人数 */
handleClick() { // 查看报名人数并查询子表数据
this.open = true handleClick(row) {
this.title = '报名人数' this.open = true;
this.queryParams1 = {
page: 1,
rows: 10,
registration: '已报名'
}
this.title = '报名人数';
const activityId = row.businessId
const participantCount = row.participantCount || 0
console.log('打印打印', activityId)
// 调用后端接口查询与该活动对应的子表数据
this.fetchSubTableData(activityId)
// 显示报名人数
this.participantCount = participantCount
},
// 查询子表数据
fetchSubTableData(activityId) {
// 将 activityId 传递给后端,查询子表数据
listCmsApplication({ activityId: activityId })
.then(response => {
// 假设返回的数据是一个数组
const data = response.rows || [];
console.log('data', data)
// 清空原始数据(如果有需要的话)
this.gridData = [];
this.gridData1 = [];
// 根据 status 将数据分类
data.forEach(item => {
if (item.status === '1' && item.activityId === activityId) {
this.gridData.push(item);
this.total1 = this.gridData.length; // 假设你需要显示 gridData 的分页
} else if (item.status === '2' && item.activityId === activityId) {
this.gridData1.push(item); // 将 status = 2 的数据添加到 gridData1
this.total2 = this.gridData1.length; // 假设你需要显示 gridData 的分页
}
});
})
.catch(error => {
console.error('获取子表数据失败:', error);
});
},
handleViewGridData() {
}, },
// 修改状态 // 修改状态
handleStatusChange(row) { handleStatusChange(row) {
...@@ -615,6 +784,15 @@ export default { ...@@ -615,6 +784,15 @@ export default {
text-align: center !important; text-align: center !important;
}*/ }*/
} }
app-container1{
font-size: 18px;
padding: 0;
::v-deep .el-table td:nth-child(2) .cell {
margin: 10px;
height: 25px;
}
}
/*.courseContent{ /*.courseContent{
!*padding-left: 15px;*! !*padding-left: 15px;*!
width:100%; width:100%;
......
...@@ -100,12 +100,12 @@ ...@@ -100,12 +100,12 @@
<el-form-item <el-form-item
label="排序:" label="排序:"
prop="weight" prop="weight"
:disabled="secondFromDisabled"
:rules="{ required: !(controls.isOperation === '3'), message: '请选择排序号', trigger: 'change' }" :rules="{ required: !(controls.isOperation === '3'), message: '请选择排序号', trigger: 'change' }"
> >
<el-input-number <el-input-number
v-model.trim="form.weight" v-model.trim="form.weight"
style="width: 100%" style="width: 100%"
:disabled="secondFromDisabled"
controls-position="right" controls-position="right"
placeholder="请选择排序号" placeholder="请选择排序号"
:min="0" :min="0"
...@@ -212,7 +212,7 @@ ...@@ -212,7 +212,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="报名费用:" label="报名费用:"
......
<template> <template>
<div class="app-container"> <div class="app-container">
<div v-show="showSwitch.courseContent" class="courseContent">
<div class="search">
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true"> <el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true">
<el-form-item label="名称:" prop="bannerName"> <el-form-item label="名称:" prop="bannerName">
<el-input <el-input
...@@ -11,7 +13,7 @@ ...@@ -11,7 +13,7 @@
style="width: 150px" style="width: 150px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="链接地址:" prop="linkUrl"> <!-- <el-form-item label="链接地址:" prop="linkUrl">
<el-input <el-input
v-model.trim="queryParams.linkUrl" v-model.trim="queryParams.linkUrl"
placeholder="请输入链接地址" placeholder="请输入链接地址"
...@@ -20,7 +22,7 @@ ...@@ -20,7 +22,7 @@
size="small" size="small"
style="width: 150px" style="width: 150px"
/> />
</el-form-item> </el-form-item>-->
<el-form-item> <el-form-item>
<el-button <el-button
:class="commonField.queryClass" :class="commonField.queryClass"
...@@ -49,7 +51,9 @@ ...@@ -49,7 +51,9 @@
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
<div style="padding:5px 10px"> </div>
<div style="padding:5px 10px">
<div class="tableTitle">banner管理</div>
<el-table v-loading="loading" border :data="cmsBannerList" :row-style="{'textAlign': 'center'}"> <el-table v-loading="loading" border :data="cmsBannerList" :row-style="{'textAlign': 'center'}">
<el-table-column prop="id" label="序号" min-width="55px"> <el-table-column prop="id" label="序号" min-width="55px">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -87,10 +91,15 @@ ...@@ -87,10 +91,15 @@
</div> </div>
</template>--> </template>-->
<el-table-column align="center" label="分类" prop="type" :show-overflow-tooltip="true" min-width="80"> <el-table-column align="center" label="分类" prop="type" :show-overflow-tooltip="true" min-width="80">
<!-- <template slot-scope="scope">
<span>
{{ getTypeValue(scope.row.type) || '-' }}
</span>
</template>-->
<template slot-scope="scope"> <template slot-scope="scope">
<span> <span v-if="scope.row.type=='0'">首页</span>
{{ getTypeValue(scope.row.type) || '-' }} <span v-else-if="scope.row.type=='1'">活动</span>
</span> <span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
<!-- <template slot-scope="scope"> <!-- <template slot-scope="scope">
...@@ -109,11 +118,11 @@ ...@@ -109,11 +118,11 @@
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<el-table-column label="链接地址" prop="linkUrl" min-width="250" :show-overflow-tooltip="true"> <!-- <el-table-column label="链接地址" prop="linkUrl" min-width="250" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.linkUrl || '-' }} {{ scope.row.linkUrl || '-' }}
</template> </template>
</el-table-column> </el-table-column>-->
<el-table-column label="排序" prop="weight" :show-overflow-tooltip="true" min-width="55"> <el-table-column label="排序" prop="weight" :show-overflow-tooltip="true" min-width="55">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.weight || '-' }} {{ scope.row.weight || '-' }}
...@@ -165,6 +174,7 @@ ...@@ -165,6 +174,7 @@
:limit.sync="queryParams.rows" :limit.sync="queryParams.rows"
@pagination="getList" @pagination="getList"
/> />
</div>
<!-- 添加或修改banner管理配置对话框 --> <!-- 添加或修改banner管理配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="90px"> <el-form ref="form" :model="form" :rules="rules" size="small" label-width="90px">
...@@ -204,9 +214,9 @@ ...@@ -204,9 +214,9 @@
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label="链接地址:" prop="linkUrl"> <!-- <el-form-item label="链接地址:" prop="linkUrl">
<el-input v-model.trim="form.linkUrl" show-word-limit :maxlength="255" placeholder="请输入链接地址" /> <el-input v-model.trim="form.linkUrl" show-word-limit :maxlength="255" placeholder="请输入链接地址" />
</el-form-item> </el-form-item>-->
<el-form-item label="排序:" prop="weight"> <el-form-item label="排序:" prop="weight">
<el-input-number v-model.trim="form.weight" style="width: 100%" controls-position="right" :min="0" /> <el-input-number v-model.trim="form.weight" style="width: 100%" controls-position="right" :min="0" />
</el-form-item> </el-form-item>
...@@ -253,9 +263,14 @@ export default { ...@@ -253,9 +263,14 @@ export default {
name: 'CmsBanner', name: 'CmsBanner',
data() { data() {
return { return {
// 显示开关
showSwitch: {
courseContent: true,
curCat: false
},
imageUrl: '', imageUrl: '',
fileUpload: '/dev-api/common/fileUpload?file=' + this.file + '&temp=' + 'development', /*fileUpload: '/dev-api/common/fileUpload?file=' + this.file + '&temp=' + 'development',*/
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 总条数 // 总条数
...@@ -366,6 +381,18 @@ export default { ...@@ -366,6 +381,18 @@ export default {
* @return: * @return:
**/ **/
handleUpload(file) { handleUpload(file) {
// 获取上传的文件
const formData = new FormData();
formData.append('file', file.file);
// 模拟本地上传,将图片保存到本地某个目录(如:assets/images)
const localPath = this.getImagePath(file.file); // 获取本地存储的路径
// 假设你将本地路径保存到 form.bannerPicture 中
this.imageUrl = localPath; // 显示图片路径
this.form.bannerPicture = localPath; // 保存到表单字段中
},
/* handleUpload(file) {
const formData = new FormData() const formData = new FormData()
formData.append('file', file.file) formData.append('file', file.file)
formData.append('temp', 'CmsBanner') formData.append('temp', 'CmsBanner')
...@@ -375,7 +402,7 @@ export default { ...@@ -375,7 +402,7 @@ export default {
this.showImg = true this.showImg = true
this.form.bannerPicture = res.data.businessId this.form.bannerPicture = res.data.businessId
}) })
}, },*/
handleAvatarSuccess(res, file) { handleAvatarSuccess(res, file) {
console.log('res', res) console.log('res', res)
// this.imageUrl = URL.createObjectURL(file.raw) // this.imageUrl = URL.createObjectURL(file.raw)
......
...@@ -156,7 +156,7 @@ ...@@ -156,7 +156,7 @@
import { import {
addCmsNotice, addCmsNotice,
getCmsNotice, updateCmsNotice getCmsNotice, updateCmsNotice
} from '@/api/contentManagement/activity' } from '@/api/contentManagement/notice'
import {updatePagesRes, updateRes, updateResonseUrl, updateResponseUrl} from '@/utils/updateUrl' import {updatePagesRes, updateRes, updateResonseUrl, updateResponseUrl} from '@/utils/updateUrl'
import { VueEditor } from 'vue2-editor' import { VueEditor } from 'vue2-editor'
import { yesOrNo, enableOrDisable} from "@/utils/allPageData"; import { yesOrNo, enableOrDisable} from "@/utils/allPageData";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment