3 changed files with 203 additions and 3 deletions
@ -0,0 +1,136 @@ |
|||
<template> |
|||
<el-dialog :visible.sync="visible" :title="$t('look')" :close-on-click-modal="false" :close-on-press-escape="false"> |
|||
<el-form :model="dataForm" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'"> |
|||
<el-form-item label="发布人"> |
|||
<p>{{dataForm.nickName}}</p> |
|||
</el-form-item> |
|||
<el-form-item label="发布时间"> |
|||
<p>{{dataForm.distributeTime}}</p> |
|||
</el-form-item> |
|||
<el-form-item label="议题内容"> |
|||
<p>{{dataForm.itemContent}}</p> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<span>支持 {{dataForm.approveNum}}</span> |
|||
<span>反对 {{dataForm.opposeNum}}</span> |
|||
<span>评论 {{dataForm.commentNum}}</span> |
|||
</el-form-item> |
|||
<el-form-item label="工作反馈"> |
|||
<el-timeline :reverse="false"> |
|||
<el-timeline-item v-for="(handleProgressResultDTO, index) in dataForm.handleProgressResultDTOS" :key="index" :timestamp="handleProgressResultDTO.createdTime" placement="top"> |
|||
<el-card> |
|||
<p>【{{handleProgressResultDTO.progressName}}】{{handleProgressResultDTO.createdTime}}</p> |
|||
<p>{{handleProgressResultDTO.advice}}</p> |
|||
</el-card> |
|||
</el-timeline-item> |
|||
</el-timeline> |
|||
</el-form-item> |
|||
<el-form-item label="评论"> |
|||
<el-collapse v-for="(commentsDTO, index) in commentsDTOs" :key="index" :name="index"> |
|||
<el-collapse-item> |
|||
<template slot="title"> |
|||
{{commentsDTO.content}} |
|||
</template> |
|||
<div>{{commentsDTO.replyComment ? commentsDTO.replyComment.content : ''}}</div> |
|||
</el-collapse-item> |
|||
<el-button @click="deleteComment(commentsDTO.commentId)">屏蔽评论</el-button> |
|||
</el-collapse> |
|||
<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-form-item> |
|||
</el-form> |
|||
<template slot="footer"> |
|||
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
dataForm: { |
|||
id: '', |
|||
nickName: '', |
|||
distributeTime: '', |
|||
itemContent: '', |
|||
handleProgressResultDTOS: [] |
|||
}, |
|||
order: '', |
|||
orderField: '', |
|||
pageIndex: 1, |
|||
limitVal: 10, |
|||
total: 0, |
|||
commentsDTOs: [] |
|||
} |
|||
}, |
|||
methods: { |
|||
init () { |
|||
this.visible = true |
|||
this.$nextTick(() => { |
|||
this.$refs['dataForm'].resetFields() |
|||
if (this.dataForm.id) { |
|||
this.getInfo() |
|||
this.getCommentList() |
|||
} |
|||
}) |
|||
}, |
|||
deleteComment (val) { |
|||
this.$http['post']( |
|||
'/events/item/deleteComment', { 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.getCommentList() |
|||
} |
|||
}) |
|||
}).catch(() => {}) |
|||
}, |
|||
getInfo () { |
|||
this.$http.get(`/events/item/contentDetail/${this.dataForm.id}`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.dataForm = { |
|||
...this.dataForm, |
|||
...res.data |
|||
} |
|||
}).catch(() => {}) |
|||
}, |
|||
pageSizeChangeHandleNew (val) { |
|||
this.pageIndex = 1 |
|||
this.limitVal = val |
|||
this.getCommentList() |
|||
}, |
|||
pageCurrentChangeHandleNew (val) { |
|||
this.pageIndex = val |
|||
this.getCommentList() |
|||
}, |
|||
getCommentList () { |
|||
this.$http.get('/events/item/comments', { params: { id: this.dataForm.id, order: this.order, orderField: this.orderField, page: this.pageIndex, limit: this.limitVal } |
|||
}).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
this.commentsDTOs = [] |
|||
this.total = 0 |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.commentsDTOs = res.data.list |
|||
this.total = res.data.total |
|||
}).catch(() => {}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
Loading…
Reference in new issue