活动管理

This commit is contained in:
yanran200730
2023-01-29 11:46:13 +08:00
parent cfcbef14c5
commit 22f3a52a14
4 changed files with 147 additions and 108 deletions

View File

@@ -98,14 +98,24 @@
customFooter
title="成员活跃明细">
<ai-search-bar bottomBorder>
<template #left>
<ai-select
v-model="search.status"
<template #right>
<el-select @change="getActiveList" v-model="search.status" size="small" placeholder="请选择活跃状态">
<el-option
v-for="item in statusList"
:key="item.dictName"
:label="item.dictName"
:value="item.dictName">
</el-option>
</el-select>
<el-input
v-model="search.name"
size="small"
placeholder="请输入成员姓名"
clearable
placeholder="请选择活跃状态"
:selectList="statusList"
@change="getActiveList">
</ai-select>
v-throttle="() => {search.current = 1, getActiveList()}"
@clear="search.current = 1, search.name = '', getActiveList()"
suffix-icon="iconfont iconSearch">
</el-input>
</template>
</ai-search-bar>
<ai-table
@@ -116,11 +126,48 @@
:current.sync="search.current"
:size.sync="search.size"
@getList="getActiveList">
<el-table-column slot="options" width="90px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="userSearch.wxUserId = row.wxUserId, isShowDetail = true, getUserActiveList()">详情</el-button>
</div>
</template>
</el-table-column>
</ai-table>
<div class="dialog-footer" slot="footer">
<el-button @click="isShowList = false">关闭</el-button>
</div>
</ai-dialog>
<ai-dialog
:visible.sync="isShowDetail"
width="1090px"
customFooter
title="成员活跃明细">
<ai-search-bar bottomBorder>
<template #right>
<el-select @change="getUserActiveList" v-model="userSearch.status" size="small" placeholder="请选择活跃状态">
<el-option
v-for="item in statusList"
:key="item.dictName"
:label="item.dictName"
:value="item.dictName">
</el-option>
</el-select>
</template>
</ai-search-bar>
<ai-table
:tableData="userDetailList"
:col-configs="activeColConfigs"
:total="userSearch.total"
style="margin-top: 16px;"
:current.sync="userSearch.current"
:size.sync="userSearch.size"
@getList="getUserActiveList">
</ai-table>
<div class="dialog-footer" slot="footer">
<el-button @click="isShowDetail = false">关闭</el-button>
</div>
</ai-dialog>
</template>
</ai-list>
</template>
@@ -139,12 +186,22 @@
data () {
return {
userSearch: {
status: '',
size: 10,
total: 0,
current: 1,
wxUserId: ''
},
search: {
status: '',
size: 10,
total: 0,
name: '',
current: 1
},
isShowDetail: false,
userDetailList: [],
activeList: [],
loading: false,
isShowList: false,
@@ -203,12 +260,34 @@
})
},
getUserActiveList () {
if (!this.userSearch.status && this.statusList.length) {
this.userSearch.status = this.statusList[0].dictName
}
this.instance.post(`/app/wxuseruselog/list`, null, {
params: {
...this.userSearch,
status: this.userSearch.status ? this.userSearch.status : this.statusList.length ? this.statusList[0].dictName : ''
}
}).then(res => {
if (res.code === 0) {
this.userDetailList = res.data.records
this.userSearch.total = res.data.total
}
})
},
getActiveList () {
if (!this.search.status && this.statusList.length) {
this.search.status = this.statusList[0].dictName
}
this.instance.post(`/app/wxuseruselog/active-log-list`, null, {
params: {
...this.search,
ymd: this.today,
status: this.search.status ? this.search.status : (!this.search.status && this.statusList.length) ? this.statusList[0] : ''
status: this.search.status ? this.search.status : this.statusList.length ? this.statusList[0].dictName : ''
}
}).then(res => {
if (res.code === 0) {

View File

@@ -1,7 +1,7 @@
<template>
<div class="AppActivity">
<keep-alive :include="['List']">
<component ref="component" :moduleName="moduleName" :moduleId="moduleId" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"></component>
<component ref="component" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"></component>
</keep-alive>
</div>
</template>

View File

@@ -1,26 +1,32 @@
<template>
<ai-detail class="content-add">
<template slot="title">
<ai-title :title="params.id ? '编辑风险区域' : '添加风险区域'" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
<ai-title :title="params.id ? '编辑活动' : '添加活动'" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
</ai-title>
</template>
<template slot="content">
<ai-card title="基本信息">
<template #content>
<el-form class="ai-form" :model="form" label-width="120px" ref="form">
<el-form-item prop="areaId" style="width: 100%;" label="选择地区" :rules="[{required: true, message: '请选择地区', trigger: 'change'}]">
<ai-area-select clearable @fullname="v => form.areaName = v" always-show :instance="instance" v-model="form.areaId"></ai-area-select>
<el-form-item prop="title" style="width: 100%;" label="标题" :rules="[{required: true, message: '请输入活动标题', trigger: 'change'}]">
<el-input size="small" placeholder="请输入活动标题" v-model="form.title"></el-input>
</el-form-item>
<el-form-item prop="address" style="width: 100%;" label="详细地址">
<el-input size="small" type="textarea" :rows="5" placeholder="请输入详细地址" v-model="form.address"></el-input>
<el-form-item label="内容" prop="content" style="width: 100%;" :rules="[{required: true, message: '请输入内容', trigger: 'change'}]">
<ai-editor v-model="form.content" :instance="instance"/>
</el-form-item>
<el-form-item label="风险等级" style="width: 100%;" prop="level" :rules="[{required: true, message: '请选择风险等级', trigger: 'change'}]">
<ai-select
v-model="form.level"
clearable
placeholder="请选择风险等级"
:selectList="dict.getDict('epidemicDangerousAreaLevel')">
</ai-select>
<el-form-item label="附件" prop="files" style="width: 100%;">
<ai-uploader
:instance="instance"
v-model="form.files"
fileType="file"
:limit="9">
</ai-uploader>
</el-form-item>
<el-form-item prop="beginTime" style="width: 100%;" label="开始时间">
<el-date-picker type="datetime" size="small" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择开始时间" v-model="form.beginTime"></el-date-picker>
</el-form-item>
<el-form-item prop="address" style="width: 100%;" label="结束时间">
<el-date-picker type="datetime" size="small" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择结束时间" v-model="form.endTime"></el-date-picker>
</el-form-item>
</el-form>
</template>
@@ -41,17 +47,17 @@
props: {
instance: Function,
dict: Object,
params: Object,
moduleName: String
params: Object
},
data () {
return {
info: {},
form: {
level: '',
areaId: '',
areaName: '',
address: ''
title: '',
content: '',
beginTime: '',
endTime: '',
files: []
},
id: ''
}
@@ -62,17 +68,15 @@
},
created () {
this.dict.load('epidemicDangerousAreaLevel').then(() => {
if (this.params && this.params.id) {
this.id = this.params.id
this.getInfo(this.params.id)
}
})
if (this.params && this.params.id) {
this.id = this.params.id
this.getInfo(this.params.id)
}
},
methods: {
getInfo (id) {
this.instance.post(`/app/appepidemicpreventionriskarea/queryDetailById?id=${id}`).then(res => {
this.instance.post(`/app/appactivityinfo/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.form = res.data
}
@@ -82,7 +86,7 @@
confirm () {
this.$refs.form.validate((valid) => {
if (valid) {
this.instance.post(`/app/appepidemicpreventionriskarea/addOrUpdate`, {
this.instance.post(`/app/appactivityinfo/addOrUpdate`, {
...this.form
}).then(res => {
if (res.code == 0) {
@@ -107,52 +111,4 @@
</script>
<style scoped lang="scss">
.content-add {
.video {
width: 640px;
height: 360px;
border-radius: 4px;
border: 1px dashed #D0D4DC;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.icon {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
span:nth-child(2) {
display: inline-block;
font-size: 16px;
color: #333333;
line-height: 30px;
}
.iconfont {
display: inline-block;
font-size: 40px;
color: #2266FF;
}
}
.tips {
display: inline-block;
font-size: 12px;
color: #999999;
line-height: 26px;
}
}
.video-com {
width: 640px;
height: 360px;
background: rgba(0, 0, 0, 0.5);
border-radius: 2px;
border: 1px solid #D0D4DC;
margin-top: -40px;
}
}
</style>

View File

@@ -8,21 +8,21 @@
<ai-search-bar class="search-bar">
<template #left>
<ai-select
v-model="search.level"
v-model="search.status"
clearable
placeholder="请选择风险等级"
:selectList="dict.getDict('epidemicDangerousAreaLevel')"
placeholder="请选择活动状态"
:selectList="statusList"
@change="search.current = 1, getList()">
</ai-select>
<el-button size="small" type="primary" icon="iconfont iconAdd" @click="toAdd('')">添加</el-button>
</template>
<template #right>
<el-input
v-model="search.province"
v-model="search.title"
class="search-input"
size="small"
v-throttle="() => {search.current = 1, getList()}"
placeholder="省级名称/市级名称/区级名称"
placeholder="请选择活动标题"
clearable
@clear="search.current = 1, search.province = '', getList()"
suffix-icon="iconfont iconSearch">
@@ -64,28 +64,32 @@
search: {
current: 1,
size: 10,
level: '',
province: ''
title: '',
status: ''
},
isLoading: false,
currIndex: -1,
areaList: [],
total: 10,
colConfigs: [
{ prop: 'province', label: '', align: 'left', width: '200px' },
{ prop: 'city', label: '地市', align: 'center' },
{ prop: 'district', label: '区县', align: 'center' },
{ prop: 'town', label: '镇街', align: 'center' },
{ prop: 'village', label: '村社区', align: 'center' },
{ prop: 'address', label: '详细地址', align: 'center' },
{ prop: 'level', label: '等级', align: 'center', format: v => this.dict.getLabel('epidemicDangerousAreaLevel', v) },
{ prop: 'createTime', label: '设置时间', align: 'center' },
{ prop: 'createUserName', label: '添加人', align: 'center' },
{ slot: 'options', label: '操作', align: 'center' }
{ prop: 'title', label: '活动标题', align: 'left', width: '200px' },
{ prop: 'signUpCount', label: '报名人数', align: 'center' },
{ prop: 'beginTime', label: '开始时间', align: 'center' },
{ prop: 'endTime', label: '结束时间', align: 'center' },
{ prop: 'status', label: '活动状态', align: 'center', format: e => this.statusList.filter(v => v.dictValue === e)[0].dictName }
],
areaName: '',
unitName: '',
tableData: []
tableData: [],
statusList: [
{
dictValue: '0',
dictName: '未开始'
},
{
dictValue: '1',
dictName: '进行中'
},
{
dictValue: '2',
dictName: '已结束'
}
]
}
},
@@ -97,7 +101,7 @@
methods: {
getList() {
this.instance.post(`/app/appepidemicpreventionriskarea/list`, null, {
this.instance.post(`/app/appactivityinfo/list`, null, {
params: {
...this.search
}
@@ -111,7 +115,7 @@
remove(id) {
this.$confirm('确定删除该数据?').then(() => {
this.instance.post(`/app/appepidemicpreventionriskarea/delete?ids=${id}`).then(res => {
this.instance.post(`/app/appactivityinfo/delete?ids=${id}`).then(res => {
if (res.code == 0) {
this.$message.success('删除成功!')
this.getList()