活动管理
This commit is contained in:
@@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import List from './components/List'
|
import List from './components/List'
|
||||||
import Detail from './components/Detail'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AppActiveAnalysis',
|
name: 'AppActiveAnalysis',
|
||||||
@@ -27,17 +26,11 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
Detail,
|
|
||||||
List
|
List
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onChange (data) {
|
onChange (data) {
|
||||||
if (data.type === 'Detail') {
|
|
||||||
this.component = 'Detail'
|
|
||||||
this.params = data.params
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.type === 'List') {
|
if (data.type === 'List') {
|
||||||
this.component = 'List'
|
this.component = 'List'
|
||||||
this.params = data.params
|
this.params = data.params
|
||||||
|
|||||||
@@ -1,106 +0,0 @@
|
|||||||
<template>
|
|
||||||
<ai-detail>
|
|
||||||
<template slot="title">
|
|
||||||
<ai-title title="规则设置" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
|
|
||||||
</ai-title>
|
|
||||||
</template>
|
|
||||||
<template slot="content">
|
|
||||||
<ai-card title="规则设置">
|
|
||||||
<template #content>
|
|
||||||
<el-form ref="form" class="ai-form" :model="form" label-width="110px" label-position="right">
|
|
||||||
<el-form-item label="投票设置" style="width: 100%" prop="voteLimitNumber" :rules="[{required: true, message: '请输入投票设置', trigger: 'blur'}]">
|
|
||||||
<el-input-number v-model="form.voteLimitNumber" :min="1" size="small" placeholder="请输入投票设置"></el-input-number>
|
|
||||||
<span style="margin-left: 10px;">票/人天</span>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="前言设置" style="width: 100%" prop="preface" :rules="[{required: true, message: '请输入前言设置', trigger: 'change'}]">
|
|
||||||
<ai-editor v-model="form.preface" :instance="instance"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="结尾设置" style="width: 100%" prop="ending" :rules="[{required: true, message: '请输入结尾设置', trigger: 'change'}]">
|
|
||||||
<ai-editor v-model="form.ending" :instance="instance"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
|
||||||
</ai-card>
|
|
||||||
</template>
|
|
||||||
<template slot="footer">
|
|
||||||
<el-button @click="cancel" style="width: 100px">取消</el-button>
|
|
||||||
<el-button type="primary" @click="onConfirm" style="width: 100px">确认</el-button>
|
|
||||||
</template>
|
|
||||||
</ai-detail>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'Detail',
|
|
||||||
|
|
||||||
props: {
|
|
||||||
instance: Function,
|
|
||||||
dict: Object,
|
|
||||||
params: Object
|
|
||||||
},
|
|
||||||
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
form: {
|
|
||||||
day: '',
|
|
||||||
preface: '',
|
|
||||||
ending: '',
|
|
||||||
id: ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
created () {
|
|
||||||
this.getInfo()
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
getInfo () {
|
|
||||||
this.instance.post(`/app/appvideovoteconfig/queryDetailByCorpId`).then(res => {
|
|
||||||
if (res.code == 0) {
|
|
||||||
if (res.data) {
|
|
||||||
this.id = res.data.id
|
|
||||||
this.form = {
|
|
||||||
...res.data
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
onConfirm () {
|
|
||||||
this.$refs.form.validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
if (!this.form.preface) {
|
|
||||||
return this.$message.error('请输入前言设置')
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.form.ending) {
|
|
||||||
return this.$message.error('请输入前言设置')
|
|
||||||
}
|
|
||||||
|
|
||||||
this.instance.post(`/app/appvideovoteconfig/addOrUpdate`, {
|
|
||||||
...this.form,
|
|
||||||
id: this.id || ''
|
|
||||||
}).then(res => {
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.$message.success('提交成功!')
|
|
||||||
this.cancel()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
cancel () {
|
|
||||||
this.$emit('change', {
|
|
||||||
type: 'List',
|
|
||||||
isRefresh: true
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
</style>
|
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import Detail from './components/Detail'
|
||||||
import List from './components/List'
|
import List from './components/List'
|
||||||
import Add from './components/Add'
|
import Add from './components/Add'
|
||||||
|
|
||||||
@@ -29,7 +30,8 @@
|
|||||||
|
|
||||||
components: {
|
components: {
|
||||||
Add,
|
Add,
|
||||||
List
|
List,
|
||||||
|
Detail
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@@ -39,7 +41,12 @@
|
|||||||
this.params = data.params
|
this.params = data.params
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.type === 'list') {
|
if (data.type === 'Detail') {
|
||||||
|
this.component = 'Detail'
|
||||||
|
this.params = data.params
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.type === 'List') {
|
||||||
this.component = 'List'
|
this.component = 'List'
|
||||||
this.params = data.params
|
this.params = data.params
|
||||||
|
|
||||||
|
|||||||
@@ -22,12 +22,6 @@
|
|||||||
:limit="9">
|
:limit="9">
|
||||||
</ai-uploader>
|
</ai-uploader>
|
||||||
</el-form-item>
|
</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>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
</ai-card>
|
</ai-card>
|
||||||
@@ -55,8 +49,6 @@
|
|||||||
form: {
|
form: {
|
||||||
title: '',
|
title: '',
|
||||||
content: '',
|
content: '',
|
||||||
beginTime: '',
|
|
||||||
endTime: '',
|
|
||||||
files: []
|
files: []
|
||||||
},
|
},
|
||||||
id: ''
|
id: ''
|
||||||
@@ -102,7 +94,7 @@
|
|||||||
|
|
||||||
cancel (isRefresh) {
|
cancel (isRefresh) {
|
||||||
this.$emit('change', {
|
this.$emit('change', {
|
||||||
type: 'list',
|
type: 'List',
|
||||||
isRefresh: !!isRefresh
|
isRefresh: !!isRefresh
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
113
project/activeAnalysis/app/AppActivity/components/Detail.vue
Normal file
113
project/activeAnalysis/app/AppActivity/components/Detail.vue
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
<template>
|
||||||
|
<ai-detail class="detail">
|
||||||
|
<template slot="title">
|
||||||
|
<ai-title title="活动详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
|
||||||
|
</ai-title>
|
||||||
|
</template>
|
||||||
|
<template slot="content">
|
||||||
|
<ai-card title="基本信息">
|
||||||
|
<template #content>
|
||||||
|
<ai-wrapper
|
||||||
|
label-width="120px">
|
||||||
|
<ai-info-item label="活动标题" :value="info.title"></ai-info-item>
|
||||||
|
<ai-info-item label="活动内容" isLine>
|
||||||
|
<AiArticle :value="info.content"></AiArticle>
|
||||||
|
</ai-info-item>
|
||||||
|
<ai-info-item label="附件" isLine>
|
||||||
|
<AiFileList :fileList="info.files"></AiFileList>
|
||||||
|
</ai-info-item>
|
||||||
|
</ai-wrapper>
|
||||||
|
</template>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="报名列表">
|
||||||
|
<template #content>
|
||||||
|
<ai-table
|
||||||
|
:tableData="tableData"
|
||||||
|
:col-configs="colConfigs"
|
||||||
|
:total="total"
|
||||||
|
style="margin-top: 6px;"
|
||||||
|
:current.sync="search.current"
|
||||||
|
:size.sync="search.size"
|
||||||
|
@getList="getList">
|
||||||
|
<!-- <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="toAdd(row.id)">编辑</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
</ai-table>
|
||||||
|
</template>
|
||||||
|
</ai-card>
|
||||||
|
</template>
|
||||||
|
</ai-detail>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'Detail',
|
||||||
|
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
params: Object
|
||||||
|
},
|
||||||
|
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
colConfigs: [
|
||||||
|
{ prop: 'userName', label: '姓名', align: 'left', width: '200px' },
|
||||||
|
{ prop: 'userPhone', label: '手机号', align: 'center' },
|
||||||
|
{ prop: 'createTime', label: '报名时间', align: 'center' }
|
||||||
|
],
|
||||||
|
search: {
|
||||||
|
size: 10,
|
||||||
|
current: 1
|
||||||
|
},
|
||||||
|
tableData: [],
|
||||||
|
total: 0,
|
||||||
|
info: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
created () {
|
||||||
|
this.getInfo()
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
getList() {
|
||||||
|
this.instance.post(`/app/appactivityinfo/signUpList?activityId=${this.params.id}`, null, {
|
||||||
|
params: {
|
||||||
|
...this.search
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.tableData = res.data.records
|
||||||
|
this.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getInfo () {
|
||||||
|
this.instance.post(`/app/appactivityinfo/queryDetailById?id=${this.params.id}`).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
if (res.data) {
|
||||||
|
this.info = res.data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
cancel () {
|
||||||
|
this.$emit('change', {
|
||||||
|
type: 'List',
|
||||||
|
isRefresh: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
</style>
|
||||||
@@ -37,10 +37,12 @@
|
|||||||
:current.sync="search.current"
|
:current.sync="search.current"
|
||||||
:size.sync="search.size"
|
:size.sync="search.size"
|
||||||
@getList="getList">
|
@getList="getList">
|
||||||
<el-table-column slot="options" width="140px" fixed="right" label="操作" align="center">
|
<el-table-column slot="options" width="180px" fixed="right" label="操作" align="center">
|
||||||
<template slot-scope="{ row }">
|
<template slot-scope="{ row }">
|
||||||
<div class="table-options">
|
<div class="table-options">
|
||||||
<el-button type="text" @click="toAdd(row.id)">编辑</el-button>
|
<el-button type="text" @click="toAdd(row.id)">编辑</el-button>
|
||||||
|
<el-button type="text" @click="toDetail(row.id)">详情</el-button>
|
||||||
|
<el-button type="text" :disabled="row.status !== '1'" @click="stop(row.id)">停止</el-button>
|
||||||
<el-button type="text" @click="remove(row.id)">删除</el-button>
|
<el-button type="text" @click="remove(row.id)">删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -70,9 +72,7 @@
|
|||||||
total: 10,
|
total: 10,
|
||||||
colConfigs: [
|
colConfigs: [
|
||||||
{ prop: 'title', label: '活动标题', align: 'left', width: '200px' },
|
{ prop: 'title', label: '活动标题', align: 'left', width: '200px' },
|
||||||
{ prop: 'signUpCount', label: '报名人数', align: 'center' },
|
{ prop: 'signUpCount', label: '报名人数', align: 'center', format: e => e },
|
||||||
{ 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 }
|
{ prop: 'status', label: '活动状态', align: 'center', format: e => this.statusList.filter(v => v.dictValue === e)[0].dictName }
|
||||||
],
|
],
|
||||||
tableData: [],
|
tableData: [],
|
||||||
@@ -94,9 +94,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.dict.load('epidemicDangerousAreaLevel').then(() => {
|
this.getList()
|
||||||
this.getList()
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@@ -113,8 +111,19 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
remove(id) {
|
stop (id) {
|
||||||
this.$confirm('确定删除该数据?').then(() => {
|
this.$confirm('确定停止该活动?').then(() => {
|
||||||
|
this.instance.post(`/app/appactivityinfo/stop?id=${id}`).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$message.success('停止成功!')
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
remove (id) {
|
||||||
|
this.$confirm('确定删除该活动?').then(() => {
|
||||||
this.instance.post(`/app/appactivityinfo/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('删除成功!')
|
||||||
@@ -124,6 +133,15 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
toDetail (id) {
|
||||||
|
this.$emit('change', {
|
||||||
|
type: 'Detail',
|
||||||
|
params: {
|
||||||
|
id: id || ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
toAdd(id) {
|
toAdd(id) {
|
||||||
this.$emit('change', {
|
this.$emit('change', {
|
||||||
type: 'Add',
|
type: 'Add',
|
||||||
|
|||||||
Reference in New Issue
Block a user