2021-12-18 17:16:42 +08:00
|
|
|
<template>
|
2022-03-18 13:47:30 +08:00
|
|
|
<ai-list class="notice" isTabs>
|
2021-12-18 17:16:42 +08:00
|
|
|
<template slot="content">
|
|
|
|
|
<ai-search-bar class="search-bar">
|
|
|
|
|
<template #left>
|
|
|
|
|
<el-button size="small" type="primary" icon="iconfont iconAdd" @click="toAdd('')">添加</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
<template #right>
|
2023-02-21 14:21:29 +08:00
|
|
|
<ai-download
|
|
|
|
|
v-if="permissions('app_appcontentinfo_export')"
|
|
|
|
|
:instance="instance"
|
|
|
|
|
url="/app/appcontentinfo/export"
|
|
|
|
|
:params="params"
|
|
|
|
|
fileName="数据列表"
|
|
|
|
|
:disabled="tableData.length == 0">
|
2022-11-24 16:39:22 +08:00
|
|
|
<el-button icon="iconfont iconExported" :disabled="tableData.length == 0">导出</el-button>
|
|
|
|
|
</ai-download>
|
2021-12-18 17:16:42 +08:00
|
|
|
<el-input
|
|
|
|
|
v-model="search.title"
|
|
|
|
|
class="search-input"
|
|
|
|
|
size="small"
|
2022-03-22 14:37:09 +08:00
|
|
|
v-throttle="() => {search.current = 1, getList()}"
|
2021-12-18 17:16:42 +08:00
|
|
|
placeholder="请输入标题"
|
|
|
|
|
clearable
|
|
|
|
|
@clear="search.current = 1, search.title = '', getList()"
|
|
|
|
|
suffix-icon="iconfont iconSearch">
|
|
|
|
|
</el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</ai-search-bar>
|
|
|
|
|
<ai-table
|
|
|
|
|
:tableData="tableData"
|
|
|
|
|
:col-configs="colConfigs"
|
|
|
|
|
:total="total"
|
|
|
|
|
style="margin-top: 6px;"
|
|
|
|
|
:current.sync="search.current"
|
|
|
|
|
:size.sync="search.size"
|
|
|
|
|
@getList="getList">
|
2023-02-21 13:50:22 +08:00
|
|
|
<el-table-column slot="comment" label="评论数" align="center" v-if="permissions('app_appcontentcomment_detail')">
|
2021-12-18 17:16:42 +08:00
|
|
|
<template slot-scope="{ row }">
|
2023-02-20 11:02:21 +08:00
|
|
|
<div class="table-options">
|
|
|
|
|
<el-button type="text" @click="toComment(row.id)">{{ row.msgCount }}</el-button>
|
2021-12-18 17:16:42 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2023-02-21 13:50:22 +08:00
|
|
|
<el-table-column slot="options" width="160px" fixed="right" label="操作" align="center">
|
2021-12-18 17:16:42 +08:00
|
|
|
<template slot-scope="{ row }">
|
|
|
|
|
<div class="table-options">
|
|
|
|
|
<el-button type="text" @click="toAdd(row.id)">编辑</el-button>
|
2022-03-18 13:47:30 +08:00
|
|
|
<el-button type="text" @click="toDetail(row.id)">详情</el-button>
|
2021-12-18 17:16:42 +08:00
|
|
|
<el-button type="text" @click="remove(row.id)">删除</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</ai-table>
|
|
|
|
|
</template>
|
|
|
|
|
</ai-list>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { mapState } from 'vuex'
|
|
|
|
|
export default {
|
|
|
|
|
name: 'List',
|
|
|
|
|
|
|
|
|
|
props: {
|
|
|
|
|
instance: Function,
|
2021-12-24 20:01:48 +08:00
|
|
|
dict: Object,
|
2022-03-18 13:47:30 +08:00
|
|
|
moduleName: String,
|
2022-11-24 16:39:22 +08:00
|
|
|
areaId: String,
|
|
|
|
|
permissions: Function
|
2021-12-18 17:16:42 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
search: {
|
|
|
|
|
current: 1,
|
|
|
|
|
size: 10,
|
2022-03-18 13:47:30 +08:00
|
|
|
title: ''
|
2021-12-18 17:16:42 +08:00
|
|
|
},
|
|
|
|
|
currIndex: -1,
|
|
|
|
|
areaList: [],
|
|
|
|
|
total: 10,
|
|
|
|
|
colConfigs: [
|
|
|
|
|
{ prop: 'title', label: '标题', align: 'left', width: '200px' },
|
2021-12-22 13:35:20 +08:00
|
|
|
{ prop: 'areaName', label: '地区', align: 'left' },
|
2023-01-09 09:36:10 +08:00
|
|
|
{ prop: 'examineStatus', label: '状态', align: 'center', format: v => this.dict.getLabel('auditStatus', v) },
|
2022-03-29 16:43:05 +08:00
|
|
|
{ prop: 'examineOpinion', label: '审核意见', align: 'center' },
|
2021-12-24 14:48:13 +08:00
|
|
|
{ prop: 'viewCount', label: '浏览次数', align: 'center' },
|
2023-02-20 11:02:21 +08:00
|
|
|
{ slot: 'comment', label: '评论次数', align: 'center' },
|
2021-12-18 17:16:42 +08:00
|
|
|
{ prop: 'createUserName', label: '发布人', align: 'center' },
|
2023-02-20 11:02:21 +08:00
|
|
|
{ prop: 'createTime', label: '发布时间', align: 'center' }
|
2021-12-18 17:16:42 +08:00
|
|
|
],
|
|
|
|
|
areaName: '',
|
|
|
|
|
unitName: '',
|
|
|
|
|
tableData: []
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
computed: {
|
2022-11-25 15:25:17 +08:00
|
|
|
...mapState(['user']),
|
|
|
|
|
|
|
|
|
|
params () {
|
|
|
|
|
return {
|
|
|
|
|
...this.search,
|
|
|
|
|
moduleId: this.$route.query.moduleId
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-12-18 17:16:42 +08:00
|
|
|
},
|
|
|
|
|
|
2021-12-22 11:05:25 +08:00
|
|
|
created() {
|
2022-03-18 14:30:56 +08:00
|
|
|
this.dict.load('auditStatus').then(() => {
|
|
|
|
|
this.getList()
|
|
|
|
|
})
|
2021-12-18 17:16:42 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
getList() {
|
2023-10-23 15:33:31 +08:00
|
|
|
this.instance.post(`/app/appcontentinfo/list-web2`, null, {
|
2021-12-18 17:16:42 +08:00
|
|
|
params: {
|
2021-12-22 11:14:42 +08:00
|
|
|
moduleId: this.$route.query.moduleId,
|
2022-03-18 13:47:30 +08:00
|
|
|
...this.search,
|
|
|
|
|
areaId: this.areaId
|
2021-12-18 17:16:42 +08:00
|
|
|
}
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if (res.code == 0) {
|
|
|
|
|
this.tableData = res.data.records
|
|
|
|
|
this.total = res.data.total
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
remove(id) {
|
|
|
|
|
this.$confirm('确定删除该数据?').then(() => {
|
2021-12-24 14:31:24 +08:00
|
|
|
this.instance.post(`/app/appcontentinfo/delete?ids=${id}`).then(res => {
|
2021-12-18 17:16:42 +08:00
|
|
|
if (res.code == 0) {
|
|
|
|
|
this.$message.success('删除成功!')
|
|
|
|
|
this.getList()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
2023-02-20 10:13:27 +08:00
|
|
|
toComment(id) {
|
|
|
|
|
this.$emit('change', {
|
|
|
|
|
type: 'Comment',
|
|
|
|
|
params: {
|
|
|
|
|
id
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
2021-12-18 17:16:42 +08:00
|
|
|
toAdd(id) {
|
|
|
|
|
this.$emit('change', {
|
|
|
|
|
type: 'Add',
|
|
|
|
|
params: {
|
|
|
|
|
id: id || ''
|
|
|
|
|
}
|
|
|
|
|
})
|
2022-03-18 13:47:30 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
toDetail(id) {
|
|
|
|
|
this.$emit('change', {
|
|
|
|
|
type: 'Detail',
|
|
|
|
|
params: {
|
|
|
|
|
id: id || ''
|
|
|
|
|
}
|
|
|
|
|
})
|
2021-12-18 17:16:42 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.notice {
|
|
|
|
|
}
|
|
|
|
|
</style>
|