This commit is contained in:
yanran200730
2023-04-19 09:48:04 +08:00
parent 2daeb761b1
commit 908a11d268
2 changed files with 19 additions and 21 deletions

View File

@@ -31,7 +31,7 @@
<el-table-column slot="options" width="100px" fixed="right" label="操作" align="center"> <el-table-column slot="options" width="100px" 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="remove(row.id)">解除禁言</el-button> <el-button type="text" @click="remove(row.createUserId)">解除禁言</el-button>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@@ -58,9 +58,9 @@
}, },
total: 0, total: 0,
colConfigs: [ colConfigs: [
{ prop: 'commentCount', label: '用户昵称', align: 'left' }, { prop: 'createUserName', label: '用户昵称', align: 'left' },
{ prop: 'commentCount', label: '所属地区', align: 'center' }, { prop: 'areaName', label: '所属地区', align: 'center' },
{ prop: 'commentCount', label: '被禁言时间', align: 'center' } { prop: 'createTime', label: '被禁言时间', align: 'center' }
], ],
tableData: [] tableData: []
} }
@@ -72,12 +72,9 @@
methods: { methods: {
getList() { getList() {
this.instance.post(`/app/appneighborhoodassistance/list`, null, { this.instance.post(`/app/appneighborhoodassistance/blacklist`, null, {
params: { params: {
...this.search, ...this.search
createUserAreaId: this.search.areaId,
beginDate: this.dateList[0] || '',
endDate: this.dateList[1] || '',
} }
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {
@@ -88,10 +85,10 @@
}, },
remove (id) { remove (id) {
this.$confirm('确定删除该帖子').then(() => { this.$confirm('确定对该用户解除禁言').then(() => {
this.instance.post(`/app/appneighborhoodassistance/delete?id=${id}`).then(res => { this.instance.post(`/app/appneighborhoodassistance/addBlacklist?userId=${id}`).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.$message.success('除成功!') this.$message.success('除成功!')
this.getList() this.getList()
} }
}) })

View File

@@ -48,7 +48,7 @@
<div class="table-options"> <div class="table-options">
<el-button type="text" @click="toDetail(row.id)">详情</el-button> <el-button type="text" @click="toDetail(row.id)">详情</el-button>
<el-button type="text" @click="remove(row.id)">删除</el-button> <el-button type="text" @click="remove(row.id)">删除</el-button>
<el-button type="text" @click="gag(row.id)">禁言</el-button> <el-button type="text" @click="gag(row.createUserId, row.blacklist)">{{ row.blacklist ? '解除禁言' : '禁言' }}</el-button>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@@ -77,13 +77,14 @@
}, },
total: 0, total: 0,
colConfigs: [ colConfigs: [
{ prop: 'content', label: '内容', align: 'left', 'show-overflow-tooltip': true }, { prop: 'content', label: '内容', align: 'left' },
{ prop: 'createUserName', label: '发帖人', align: 'center', width: '120' },
{ prop: 'createUserAreaName', label: '所属地区', align: 'center' },
{ prop: 'createTime', label: '创建时间', align: 'center' },
{ prop: 'commentCount', label: '评论数', align: 'center', width: '120' }, { prop: 'commentCount', label: '评论数', align: 'center', width: '120' },
{ prop: 'appreciateCount', label: '点赞数', align: 'center', width: '120' }, { prop: 'appreciateCount', label: '点赞数', align: 'center', width: '120' },
{ prop: 'sharedCount', label: '分享数', align: 'center', width: '120' }, { prop: 'sharedCount', label: '分享数', align: 'center', width: '120' },
{ prop: 'createUserName', label: '发帖人', align: 'center', width: '120' }, { prop: 'blacklist', label: '状态', align: 'center', format: v => v ? '禁言' : '正常' },
{ prop: 'createUserAreaName', label: '所在地区', align: 'center', width: '120' },
{ prop: 'createTime', label: '创建时间', align: 'center', width: '180' },
{ slot: 'options'}, { slot: 'options'},
], ],
tableData: [], tableData: [],
@@ -133,11 +134,11 @@
}) })
}, },
gag (id) { gag (id, status) {
this.$confirm('确定禁言该用户?').then(() => { this.$confirm(`确定${status ? '解除禁言' : '禁言'}该用户?`).then(() => {
this.instance.post(`/app/appneighborhoodassistance/delete?id=${id}`).then(res => { this.instance.post(`/app/appneighborhoodassistance/addBlacklist?userId=${id}`).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.$message.success('禁言成功!') this.$message.success(`${status ? '解除禁言' : '禁言'}成功!`)
this.getList() this.getList()
} }
}) })