This commit is contained in:
hanjian 2024-09-09 16:39:55 +08:00
parent ce04b79efd
commit f7fac6e633
2 changed files with 28 additions and 14 deletions

View File

@ -2584,7 +2584,6 @@ body .login-page .loright .locont .el-form--label-top .el-form-item .el-form-ite
.fbox1 .fr{
display: block;
padding: 16px 32px;
width: 420px;
}
body .el-drawer .el-drawer__body .fbox1 .fl,
body .el-drawer .el-drawer__body .fbox1 .fr{

View File

@ -76,7 +76,7 @@
</div><!--fl 左侧页签-->
<div class="fr" v-if="isComment">
<div class="tboper">
<div class="tit">评论</div>
<div class="tit">评论{{ reviewTotal }}</div>
</div><!--tboper 标题与操作按钮-->
<div class="pltextarea">
<el-input v-model="discussionContent" type="textarea" placeholder="请输入您的意见" :rows="4" maxlength="1000" show-word-limit></el-input>
@ -104,10 +104,19 @@
</div>
<!--第二层级-->
<template v-if="item.repliesList && item.repliesList.length > 0">
<div class="list" v-for="(repItem,repIdex) in item.repliesList" :key="repItem.id">
<div class="luser"><span class="xuser" :style="{backgroundColor: extractColorByName(repItem.nickName)}">{{getFirstChar(repItem.nickName)}}</span></div>
<div class="list" v-for="(repItem, repIdex) in item.repliesList" :key="repItem.id">
<div class="luser">
<span class="xuser" :style="{width:'28px',height:'28px',lineHeight:'28px',backgroundColor: extractColorByName(repItem.nickName)}">{{getFirstChar(repItem.nickName)}}</span>
</div>
<div class="ltext">
<div class="nt"><span class="name">{{repItem.nickName}}</span><span class="time">{{ parseTime(repItem.createTime, '{y}-{m}-{d} {h}:{i}') }}</span></div>
<div class="nt">
<span class="name">{{repItem.nickName}}</span>
<template v-if="repItem.repTargetNickName">
<span>回复</span>
<span class="name">{{ repItem.repTargetNickName }}</span>
</template>
<span class="time">{{ parseTime(repItem.createTime, '{y}-{m}-{d} {h}:{i}') }}</span>
</div>
<div class="te">{{repItem.content}}</div>
<div class="hb"><a class="btn" @click="toggleReplyFormSon(index,repIdex)"><i class="el-icon-chat-line-round"></i>回复</a></div>
<div class="pltextarea" v-if="item.showReplyFormSon[repIdex]">
@ -115,7 +124,7 @@
<div class="plbtn">
<el-button @click="cancelReplySon(index,repIdex)">取消</el-button>
<el-divider direction="vertical"></el-divider>
<el-button @click="submitReplySon(index,repIdex, item)">发布</el-button>
<el-button @click="submitReplySon(index, repIdex, item, repItem.id)">发布</el-button>
</div>
</div>
</div>
@ -218,6 +227,7 @@
pageSize: 10,
toolId: ''
},
reviewTotal: 0,
previewUrl: '',
viewDialogTitle: "",
viewDialogOpen: false,
@ -342,18 +352,22 @@
},1000)
},
getDiscussionsList() {
let self = this
let _this = this
_this.reviewTotal = 0
listDiscussions({businessId:this.toolDetail.toolId}).then(res => {
self.discussionsList = res.rows
self.discussionsList.forEach(item => {
_this.discussionsList = res.rows
let reviewTotal = 0
_this.discussionsList.forEach(item => {
reviewTotal += item.repliesList.length
if(item.repliesList && item.repliesList.length > 0){
self.$set(item, 'showReplyFormSon', new Array(item.repliesList.length).fill(false))
self.$set(item, 'replyContentSon', new Array(item.repliesList.length).fill(''))
_this.$set(item, 'showReplyFormSon', new Array(item.repliesList.length).fill(false))
_this.$set(item, 'replyContentSon', new Array(item.repliesList.length).fill(''))
}else{
self.$set(item, 'showReplyFormSon', false)
self.$set(item, 'replyContentSon', '')
_this.$set(item, 'showReplyFormSon', false)
_this.$set(item, 'replyContentSon', '')
}
});
_this.reviewTotal = _this.discussionsList.length + reviewTotal
});
},
/** 评论 **/
@ -459,7 +473,7 @@
this.$set(parentItem.replyContentSon, repIndex, '');
},
/** 第二级回复 **/
submitReplySon(parentIndex, repIndex, repItem) {
submitReplySon(parentIndex, repIndex, repItem, repId) {
let self = this
const parentItem = this.discussionsList[parentIndex];
const content = parentItem.replyContentSon[repIndex];
@ -473,6 +487,7 @@
}
let data = {
"discussionId": repItem.id,
"repId": repId,
"content": content,
}