|
|
@ -82,13 +82,13 @@ |
|
|
|
fixed="right" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
width="150"> |
|
|
|
width="180"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button v-if="$hasPermission('news:notice:update')" |
|
|
|
type="text" |
|
|
|
size="small" |
|
|
|
@click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> |
|
|
|
<el-button v-if="$hasPermission('news:notice:publish') && scope.row.noticeReleaseState === '0'" |
|
|
|
<el-button v-if="$hasPermission('news:notice:publish')" |
|
|
|
type="text" |
|
|
|
size="small" |
|
|
|
@click="noticePublishHandle(scope.row.id)">发布</el-button> |
|
|
@ -96,6 +96,9 @@ |
|
|
|
type="text" |
|
|
|
size="small" |
|
|
|
@click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> |
|
|
|
<el-button type="text" |
|
|
|
size="small" |
|
|
|
@click="noticeComments(scope.row.id)">评论管理</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
@ -111,6 +114,30 @@ |
|
|
|
<add-or-update v-if="addOrUpdateVisible" |
|
|
|
ref="addOrUpdate" |
|
|
|
@refreshDataList="getDataList"></add-or-update> |
|
|
|
<el-dialog width="90%" title="评论" :visible.sync="noticeCommentVisible" append-to-body> |
|
|
|
<el-table :data="noticeCommentsData" border style="width: 100%;"> |
|
|
|
<el-table-column prop="user.userName" label="发言人" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="commentTime" label="发言时间" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="content" label="发言内容" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="replyComment.userName" label="被回复人" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="replyComment.content" label="被回复内容" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column :label="$t('handle')" header-align="center" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button v-if="scope.row.shieldFlag === '0'" type="button" size="small" @click="shieldComment(scope.row.commentId)">屏蔽</el-button> |
|
|
|
<el-button v-if="scope.row.shieldFlag === '1'" type="text" size="small">已屏蔽</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<el-pagination |
|
|
|
:current-page="pageIndex" |
|
|
|
:page-sizes="[10, 20, 50, 100]" |
|
|
|
:page-size="limitVal" |
|
|
|
:total="total" |
|
|
|
layout="total, sizes, prev, pager, next, jumper" |
|
|
|
@size-change="pageSizeChangeHandleNew" |
|
|
|
@current-change="pageCurrentChangeHandleNew"> |
|
|
|
</el-pagination> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
</template> |
|
|
@ -137,7 +164,15 @@ export default { |
|
|
|
optionProps: { |
|
|
|
checkStrictly: true, |
|
|
|
value: 'categoryCode' |
|
|
|
} |
|
|
|
}, |
|
|
|
noticeCommentVisible: false, |
|
|
|
noticeCommentsData: [], |
|
|
|
showNoticeCommentsNoticeId: '', |
|
|
|
order: '', |
|
|
|
orderField: '', |
|
|
|
pageIndex: 1, |
|
|
|
limitVal: 10, |
|
|
|
total: 0 |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: { |
|
|
@ -221,6 +256,48 @@ export default { |
|
|
|
this.getSelectedNode(item.children, item) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
noticeComments (id) { |
|
|
|
this.noticeCommentVisible = true |
|
|
|
this.showNoticeCommentsNoticeId = id |
|
|
|
this.getNoticeCommentList() |
|
|
|
}, |
|
|
|
pageSizeChangeHandleNew (val) { |
|
|
|
this.pageIndex = 1 |
|
|
|
this.limitVal = val |
|
|
|
this.getNoticeCommentList() |
|
|
|
}, |
|
|
|
pageCurrentChangeHandleNew (val) { |
|
|
|
this.pageIndex = val |
|
|
|
this.getNoticeCommentList() |
|
|
|
}, |
|
|
|
getNoticeCommentList () { |
|
|
|
this.$http.get('/news/noticecomment/comments', { params: { id: this.showNoticeCommentsNoticeId, order: this.order, orderField: this.orderField, page: this.pageIndex, limit: this.limitVal } |
|
|
|
}).then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
this.noticeCommentsData = [] |
|
|
|
this.total = 0 |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
this.noticeComments = res.data.list |
|
|
|
this.total = res.data.total |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
shieldComment (val) { |
|
|
|
this.$http['post']( |
|
|
|
'/news/noticecomment/shieldComment', { commentIds: [val] }).then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
this.$message({ |
|
|
|
message: this.$t('prompt.success'), |
|
|
|
type: 'success', |
|
|
|
duration: 500, |
|
|
|
onClose: () => { |
|
|
|
this.getNoticeCommentList() |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(() => {}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|