列表
This commit is contained in:
@@ -6,20 +6,14 @@
|
||||
<ai-search-bar>
|
||||
<template #left>
|
||||
<el-button size="small" type="primary" icon="iconfont iconAdd" @click="toAdd('')" >创建活动</el-button>
|
||||
<!-- <ai-select v-model="search.status" @change=";(page.current = 1), getList()" placeholder="请选择状态" :selectList="dict.getDict('electionStatus')"></ai-select> -->
|
||||
</template>
|
||||
<!-- <template #right>
|
||||
<el-input v-model="search.title" class="search-input" size="small" v-throttle="() => {(page.current = 1), getList()} " placeholder="标题" clearable @change="getList" @clear="page.current = 1, (search.title = ''), getList()" suffix-icon="iconfont iconSearch">
|
||||
</el-input>
|
||||
</template> -->
|
||||
</ai-search-bar>
|
||||
<ai-table :tableData="tableData" :total="page.total" :current.sync="page.current" :size.sync="page.size" @getList="getList" :col-configs="colConfigs" :dict="dict">
|
||||
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<el-button type="text" @click.native="toAdd(row.id)">详情</el-button>
|
||||
<el-button type="text" v-show="row.status!=2" :disabled="row.status==2" @click.native="startEnd(row.id, row.status)">{{row.status == 0? '开启':'结束'}}</el-button>
|
||||
<!-- <el-button type="text" v-show="row.status != 0" @click.native="toStatistics(row.id)">统计</el-button> -->
|
||||
<!-- <el-button type="text" @click.native="handleDelete(row.id)">删除</el-button> -->
|
||||
<el-button type="text" @click.native="handleDelete(row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
@@ -37,10 +31,6 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
search: {
|
||||
status: '', // 0、未开始;1、进行中;2、已结束
|
||||
title: '',
|
||||
},
|
||||
page: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
@@ -57,20 +47,20 @@ export default {
|
||||
computed: {
|
||||
colConfigs() {
|
||||
return [
|
||||
{prop: "", label: "活动名称", align: "left", showOverflowTooltip: true},
|
||||
{prop: "", label: "创建人", align: "center"},
|
||||
{prop: "", label: "开始结束时间", align: "center",dict:"electionMethod"},
|
||||
{prop: "", label: "活动状态", align: "center"},
|
||||
{prop: "title", label: "活动名称", align: "left", showOverflowTooltip: true},
|
||||
{prop: "createUserName", label: "创建人", align: "center"},
|
||||
{prop: "intoBegintime", label: "开始结束时间", align: "center", render: (h, {row}) => h('p',{textAlign:'center'},
|
||||
`${row.intoBegintime}至${row.exitEndtime}`)},
|
||||
{prop: "status", label: "活动状态", align: "center",dict:"electionMethod"},
|
||||
{ slot: "options", },
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.instance.post(`/app/appgeneralelectioninfo/list`,null,{
|
||||
this.instance.post(`/appactivityinfo/list`,null, {
|
||||
params: {
|
||||
...this.page,
|
||||
...this.search,
|
||||
}
|
||||
}).then(res=> {
|
||||
if(res?.data) {
|
||||
@@ -89,7 +79,7 @@ export default {
|
||||
},
|
||||
handleDelete(id) {
|
||||
this.$confirm('确定删除该数据?').then(() => {
|
||||
this.instance.post(`/app/appgeneralelectioninfo/delete?ids=${id}`).then(res=>{
|
||||
this.instance.post(`/appactivityinfo/delete?ids=${id}`).then(res=>{
|
||||
if(res.code == 0) {
|
||||
this.$message.success('删除成功!')
|
||||
this.getList()
|
||||
@@ -97,13 +87,6 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
reset() {
|
||||
this.search = {
|
||||
status: '',
|
||||
title: '',
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
// 开启、结束
|
||||
startEnd(id, status) {
|
||||
let title = ''
|
||||
@@ -127,15 +110,6 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
// 统计
|
||||
toStatistics(id) {
|
||||
this.$emit('change', {
|
||||
type: 'Statistics',
|
||||
params: {
|
||||
id: id || '',
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user