北尚诉办前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

137 lines
4.3 KiB

6 years ago
<template>
6 years ago
<el-dialog :visible.sync="visible" :title="$t('look')" :close-on-click-modal="false" :close-on-press-escape="false">
6 years ago
<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.issueContent}}</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="(feedbackDTO, index) in dataForm.feedbackDTOList" :key="index" :timestamp="feedbackDTO.createdTime" placement="top">
<el-card>
6 years ago
<p>{{feedbackDTO.stateName}}{{feedbackDTO.createdTime}}</p>
6 years ago
<p>{{feedbackDTO.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>
6 years ago
</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: '',
issueContent: '',
feedbackDTOList: []
},
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/issue/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(() => {})
6 years ago
},
getInfo () {
this.$http.get(`/events/issue/issueContentDetail/${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/issue/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>