This commit is contained in:
yanran200730
2023-04-03 16:28:52 +08:00
parent dd4ab4ec0d
commit 5e7ef3d27a
5 changed files with 248 additions and 439 deletions

View File

@@ -1,71 +1,52 @@
<template>
<ai-detail class="detail">
<template slot="title">
<ai-title title="帖子详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
<ai-title title="积分审核" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
</ai-title>
</template>
<template slot="content">
<ai-card title="帖子信息">
<ai-card title="基本信息">
<template #right>
<el-button size="small" type="primary" @click="isShow = true" v-if="info.status === '0'">审核</el-button>
</template>
<template #content>
<div class="talk-info">
<div class="user">
<img :src="info.createUserAvatar" alt="">
<div class="info">
<h2>{{info.createUserName}}</h2>
<div class="time-flex">
<span class="area-name">{{info.publishDepartName}}</span>
<span>{{info.createTime}}</span>
</div>
</div>
</div>
<div class="content">
<span v-if="info.themeId">#{{info.themeInfo.title}}</span>{{info.content}}
</div>
<ai-uploader :instance="instance" disabled v-model="info.files">
</ai-uploader>
</div>
</template>
</ai-card>
<ai-card title="评论信息">
<template #content>
<div class="comment-list" v-if="commontList.length">
<div class="title">评论</div>
<div class="item" v-for="(item, index) in commontList" :key="index">
<div class="user">
<img :src="item.createUserAvatar" alt="">
<div class="info-flex">
<h2>{{item.createUserName}}</h2>
<span>{{item.createTime}}</span>
</div>
</div>
<div class="content-flex">
<p>{{item.content}}</p>
<div @click="delCommontOrReply('评论', item.id)">删除</div>
</div>
<div class="reply-list" v-if="item.replyList && item.replyList.length && item.isShowReply">
<div class="reply-item" v-for="(reply, indexs) in item.replyList" :key="indexs">
<div class="reply-user">
<img :src="item.createUserAvatar" alt="">
<div class="reply-name">
<span>{{reply.createUserName}}</span>回复<span>{{item.createUserName}}</span>
</div>
<span class="reply-time">{{reply.createTime}}</span>
</div>
<div class="content-flex">
<p>{{reply.content}}</p>
<div @click="delCommontOrReply('回复', reply.id)">删除</div>
</div>
</div>
</div>
<div class="reply-more" @click="item.isShowReply = !item.isShowReply" :class="[item.isShowReply ? 'active' : '']">
<span class="line"></span>{{item.isShowReply ? '收起' : `展开${item.replyList.length}条回复`}}
<i class="el-icon-arrow-down"></i>
</div>
</div>
</div>
<ai-empty v-else>暂无评论</ai-empty>
<ai-wrapper>
<ai-info-item label="事件类型" isLine :value="info.applyItemName"></ai-info-item>
<ai-info-item label="申请人" :value="info.createUserName"></ai-info-item>
<ai-info-item label="手机号" :value="info.detail"></ai-info-item>
<ai-info-item label="所属地区" :value="info.areaName"></ai-info-item>
<ai-info-item label="所属网格" :value="info.girdName"></ai-info-item>
<ai-info-item label="审核时间" :value="info.auditTime"></ai-info-item>
<ai-info-item label="状态" :value="dict.getLabel('appIntegralApplyEventStatus', info.status)"></ai-info-item>
<ai-info-item label="事件描述" isLine :value="info.content"></ai-info-item>
<ai-info-item label="活动图片" isLine>
<ai-uploader
disabled
:instance="instance"
:value="info.files">
</ai-uploader>
</ai-info-item>
</ai-wrapper>
</template>
</ai-card>
<ai-dialog
:visible.sync="isShow"
@onConfirm="onConfirm"
@close="onClose"
width="890px"
title="审核">
<el-form class="ai-form" :model="form" label-width="120px" ref="form">
<el-form-item label="是否通过" prop="auditStatus" style="width: 100%;" :rules="[{required: true, message: '请选择是否通过', trigger: 'change'}]">
<el-radio-group v-model="form.auditStatus">
<el-radio label="0"></el-radio>
<el-radio label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="auditDesc" v-if="form.auditStatus === '0'" label="审批意见" style="width: 100%" :rules="[{required: true, message: '请输入审批意见', trigger: 'blur'}]">
<el-input size="small" type="textarea" :rows="5" v-model="form.auditDesc" clearable placeholder="请输入审批意见"></el-input>
</el-form-item>
</el-form>
</ai-dialog>
</template>
</ai-detail>
</template>
@@ -82,36 +63,22 @@
data () {
return {
commontList: [],
info: {},
}
},
computed: {
getAvatar(row){
return row.avatar||row.photo||'https://cdn.cunwuyun.cn/dvcp/h5/defaultAvatar.png'
form: {
auditDesc: '',
auditStatus: ''
},
isShow: false
}
},
created () {
this.getInfo()
this.getList()
},
methods: {
getList() {
this.instance.post(`/app/appneighborhoodassistance/commontList?id=${this.params.id}&size=100`).then(res => {
if (res.code == 0) {
res.data.records.map((item) => {
item.isShowReply = false
})
this.commontList = res.data.records
}
})
},
getInfo () {
this.instance.post(`/app/appneighborhoodassistance/queryDetailById?id=${this.params.id}`).then(res => {
this.instance.post(`/app/appintegraluserapply/queryDetailById?id=${this.params.id}`).then(res => {
if (res.code == 0) {
if (res.data) {
this.info = res.data
@@ -120,175 +87,40 @@
})
},
onClose () {
this.id = ''
this.form.auditDesc = ''
this.form.auditStatus = ''
},
onConfirm () {
this.$refs.form.validate((valid) => {
if (valid) {
this.instance.post(`/app/appintegraluserapply/auditById`, {
...this.form,
id: this.params.id
}).then(res => {
if (res.code == 0) {
this.$message.success('审核成功!')
this.isShow = false
this.getInfo()
}
})
}
})
},
cancel () {
this.$emit('change', {
type: 'List',
isRefresh: true
})
},
delCommontOrReply(text, id) {
this.$confirm(`确定删除该${text}`).then(() => {
this.instance.post(`/app/appneighborhoodassistance/delComment?id=${id}`).then(res => {
if (res.code == 0) {
this.$message.success('删除成功!')
this.getList()
}
})
})
},
}
}
}
</script>
<style scoped lang="scss">
.detail {
.talk-info {
.user {
display: flex;
margin-bottom: 8px;
img {
width: 60px;
height: 60px;
margin-right: 16px;
border-radius: 50%;
}
.info {
width: calc(100% - 76px);
h2 {
font-size: 20px;
line-height: 30px;
font-weight: 400;
}
.time-flex {
display: flex;
justify-content: space-between;
color: #999;
font-size: 14px;
line-height: 30px;
.area-name {
color: #666;
}
}
}
}
.content {
font-size: 16px;
line-height: 32px;
word-break: break-all;
span {
color: #26f;
}
}
}
.comment-list {
.title {
color: #333;
font-size: 16px;
font-weight: 700;
line-height: 40px;
margin-bottom: 8px;
}
.item {
border-bottom: 1px solid #ddd;
padding-bottom: 16px;
.user {
display: flex;
margin-bottom: 8px;
img {
width: 60px;
height: 60px;
margin-right: 16px;
border-radius: 50%;
}
.info-flex {
width: calc(100% - 76px);
display: flex;
justify-content: space-between;
line-height: 60px;
h2 {
font-size: 20px;
font-weight: 400;
}
span {
color: #999;
font-size: 14px;
}
}
}
.content-flex {
display: flex;
font-size: 16px;
line-height: 30px;
margin-bottom: 8px;
padding-left: 76px;
p {
width: calc(100% - 50px);
word-break: break-all;
}
div {
color: #26f;
width: 50px;
text-align: right;
cursor: pointer;
}
}
.reply-list {
padding-left: 100px;
.reply-item {
margin-bottom: 8px;
.reply-user {
font-size: 14px;
img {
width: 50px;
height: 50px;
border-radius: 50%;
vertical-align: middle;
}
.reply-name {
display: inline-block;
color: #333;
width: 300px;
span {
display: inline-block;
color: #666;
margin: 0 8px;
}
}
.reply-time {
color: #999;
}
}
.content-flex {
font-size: 14px;
line-height: 24px;
padding-left: 58px;
}
}
}
.reply-more {
font-size: 14px;
line-height: 28px;
color: #333;
.line {
display: inline-block;
width: 120px;
border-top: 1px solid #eee;
vertical-align: middle;
margin-right: 8px;
}
.el-icon-arrow-down {
transition: all ease 0.5s;
transform: rotate(0);
margin-left: 8px;
}
&.active .el-icon-arrow-down {
transform: rotate(180deg);
}
}
}
}
}
</style>