评论管理

This commit is contained in:
yanran200730
2023-02-14 15:37:49 +08:00
parent 0a0913d922
commit 6302d125e8
3 changed files with 43 additions and 19 deletions

View File

@@ -18,10 +18,10 @@
:current.sync="search.current"
:size.sync="search.size"
@getList="getList">
<el-table-column slot="options" width="90px" fixed="right" label="操作" align="center">
<el-table-column slot="options" width="120px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="toAdd(row.id)">显示</el-button>
<el-button type="text" @click="show(row.id, row.isShow)">{{ row.isShow === '1' ? '隐藏' : '显示' }}</el-button>
</div>
</template>
</el-table-column>
@@ -36,7 +36,8 @@
props: {
instance: Function,
dict: Object
dict: Object,
params: Object
},
data () {
@@ -49,23 +50,21 @@
},
total: 10,
colConfigs: [
{ prop: 'title', label: '微信昵称', align: 'left' },
{ prop: 'createUserName', label: '评论', align: 'center' },
{ prop: 'beginTime', label: '状态', align: 'center' },
{ prop: 'endTime', label: '已学习人数', align: 'center' },
{ prop: 'createTime', label: '评论数', align: 'center' }
{ prop: 'name', label: '微信昵称', align: 'left' },
{ prop: 'content', label: '评论', align: 'center' },
{ prop: 'commentTime', label: '评论时间', align: 'center' }
],
tableData: []
}
},
created() {
created () {
this.getList()
},
methods: {
getList() {
this.instance.post(`/app/appmarketingactivityinfo/list`, null, {
this.instance.post(`/app/appcoursecomment/list?courseId=${this.params.id}`, null, {
params: {
...this.search
}
@@ -83,11 +82,11 @@
})
},
remove (id) {
this.$confirm('确定删除该活动?').then(() => {
this.instance.post(`/app/appmarketingactivityinfo/delete?id=${id}`).then(res => {
show (id, isShow) {
this.$confirm(isShow === '1' ? '确定隐藏该留言?' : '确定隐藏该留言').then(() => {
this.instance.post(`/app/appcoursecomment/configCommentById?id=${id}&status=${isShow === '1' ? '0' : '1'}`).then(res => {
if (res.code == 0) {
this.$message.success('删除成功')
this.$message.success('操作成功')
this.getList()
}
})

View File

@@ -13,7 +13,9 @@
<ai-info-item label="排序" :value="info.showIndex"></ai-info-item>
<ai-info-item label="状态" :value="dict.getLabel('qjExamineStatus', info.examineStatus)"></ai-info-item>
<ai-info-item label="已学习人数" :value="info.learnerNumber"></ai-info-item>
<ai-info-item label="评论数" :value="info.msgCount"></ai-info-item>
<ai-info-item label="评论数" :value="info.msgCount">
<el-link type="primary" @click="toComment">{{ info.msgCount }}</el-link>
</ai-info-item>
<ai-info-item label="课程类型" :value="dict.getLabel('qjCourseType', info.courseType)"></ai-info-item>
<ai-info-item label="正文" v-if="info.courseType === '0'" isLine>
<AiArticle :value="info.content"></AiArticle>
@@ -59,14 +61,12 @@
data () {
return {
info: {},
id: ''
info: {}
}
},
created () {
if (this.params && this.params.id) {
this.id = this.params.id
this.getInfo(this.params.id)
}
},
@@ -80,6 +80,15 @@
})
},
toComment () {
this.$emit('change', {
type: 'Comment',
params: {
id: this.params.id
}
})
},
cancel (isRefresh) {
this.$emit('change', {
type: 'List',

View File

@@ -36,6 +36,13 @@
:current.sync="search.current"
:size.sync="search.size"
@getList="getList">
<el-table-column slot="comment" label="评论数" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="toComment(row.id)">{{ row.msgCount }}</el-button>
</div>
</template>
</el-table-column>
<el-table-column slot="options" width="160px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
@@ -93,7 +100,7 @@
{ prop: 'courseType', label: '课程类型', align: 'center', format: v => this.dict.getLabel('qjCourseType', v) },
{ prop: 'examineStatus', label: '状态', align: 'center', format: v => this.dict.getLabel('qjExamineStatus', v) },
{ prop: 'learnerNumber', label: '已学习人数', align: 'center' },
{ prop: 'msgCount', label: '评论数', align: 'center' }
{ slot: 'comment', label: '评论数', align: 'center' }
],
id: '',
tableData: []
@@ -120,6 +127,15 @@
})
},
toComment (id) {
this.$emit('change', {
type: 'Comment',
params: {
id: id || ''
}
})
},
onClose () {
this.id = ''
this.form.examineStatus = ''