活动管理

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 customFooter
title="成员活跃明细"> title="成员活跃明细">
<ai-search-bar bottomBorder> <ai-search-bar bottomBorder>
<template #left> <template #right>
<ai-select <el-select @change="getActiveList" v-model="search.status" size="small" placeholder="请选择活跃状态">
v-model="search.status" <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 clearable
placeholder="请选择活跃状态" v-throttle="() => {search.current = 1, getActiveList()}"
:selectList="statusList" @clear="search.current = 1, search.name = '', getActiveList()"
@change="getActiveList"> suffix-icon="iconfont iconSearch">
</ai-select> </el-input>
</template> </template>
</ai-search-bar> </ai-search-bar>
<ai-table <ai-table
@@ -116,11 +126,48 @@
:current.sync="search.current" :current.sync="search.current"
:size.sync="search.size" :size.sync="search.size"
@getList="getActiveList"> @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> </ai-table>
<div class="dialog-footer" slot="footer"> <div class="dialog-footer" slot="footer">
<el-button @click="isShowList = false">关闭</el-button> <el-button @click="isShowList = false">关闭</el-button>
</div> </div>
</ai-dialog> </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> </template>
</ai-list> </ai-list>
</template> </template>
@@ -139,12 +186,22 @@
data () { data () {
return { return {
userSearch: {
status: '',
size: 10,
total: 0,
current: 1,
wxUserId: ''
},
search: { search: {
status: '', status: '',
size: 10, size: 10,
total: 0, total: 0,
name: '',
current: 1 current: 1
}, },
isShowDetail: false,
userDetailList: [],
activeList: [], activeList: [],
loading: false, loading: false,
isShowList: 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 () { getActiveList () {
if (!this.search.status && this.statusList.length) {
this.search.status = this.statusList[0].dictName
}
this.instance.post(`/app/wxuseruselog/active-log-list`, null, { this.instance.post(`/app/wxuseruselog/active-log-list`, null, {
params: { params: {
...this.search, ...this.search,
ymd: this.today, 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 => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {

View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="AppActivity"> <div class="AppActivity">
<keep-alive :include="['List']"> <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> </keep-alive>
</div> </div>
</template> </template>

View File

@@ -1,26 +1,32 @@
<template> <template>
<ai-detail class="content-add"> <ai-detail class="content-add">
<template slot="title"> <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> </ai-title>
</template> </template>
<template slot="content"> <template slot="content">
<ai-card title="基本信息"> <ai-card title="基本信息">
<template #content> <template #content>
<el-form class="ai-form" :model="form" label-width="120px" ref="form"> <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'}]"> <el-form-item prop="title" 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-input size="small" placeholder="请输入活动标题" v-model="form.title"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="address" style="width: 100%;" label="详细地址"> <el-form-item label="内容" prop="content" style="width: 100%;" :rules="[{required: true, message: '请输入内容', trigger: 'change'}]">
<el-input size="small" type="textarea" :rows="5" placeholder="请输入详细地址" v-model="form.address"></el-input> <ai-editor v-model="form.content" :instance="instance"/>
</el-form-item> </el-form-item>
<el-form-item label="风险等级" style="width: 100%;" prop="level" :rules="[{required: true, message: '请选择风险等级', trigger: 'change'}]"> <el-form-item label="附件" prop="files" style="width: 100%;">
<ai-select <ai-uploader
v-model="form.level" :instance="instance"
clearable v-model="form.files"
placeholder="请选择风险等级" fileType="file"
:selectList="dict.getDict('epidemicDangerousAreaLevel')"> :limit="9">
</ai-select> </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-item>
</el-form> </el-form>
</template> </template>
@@ -41,17 +47,17 @@
props: { props: {
instance: Function, instance: Function,
dict: Object, dict: Object,
params: Object, params: Object
moduleName: String
}, },
data () { data () {
return { return {
info: {}, info: {},
form: { form: {
level: '', title: '',
areaId: '', content: '',
areaName: '', beginTime: '',
address: '' endTime: '',
files: []
}, },
id: '' id: ''
} }
@@ -62,17 +68,15 @@
}, },
created () { created () {
this.dict.load('epidemicDangerousAreaLevel').then(() => { if (this.params && this.params.id) {
if (this.params && this.params.id) { this.id = this.params.id
this.id = this.params.id this.getInfo(this.params.id)
this.getInfo(this.params.id) }
}
})
}, },
methods: { methods: {
getInfo (id) { 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) { if (res.code === 0) {
this.form = res.data this.form = res.data
} }
@@ -82,7 +86,7 @@
confirm () { confirm () {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
this.instance.post(`/app/appepidemicpreventionriskarea/addOrUpdate`, { this.instance.post(`/app/appactivityinfo/addOrUpdate`, {
...this.form ...this.form
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {
@@ -107,52 +111,4 @@
</script> </script>
<style scoped lang="scss"> <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> </style>

View File

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