同步一下

This commit is contained in:
daihh
2022-11-06 18:34:58 +08:00
parent f5b7697e0d
commit a48d581219

View File

@@ -27,7 +27,7 @@
</div> </div>
</div> </div>
<!-- 回复框 --> <!-- 回复框 -->
<div class="replys-input" style="padding-left: 60px;margin:10px 0" v-if="item.isReplys"> <div class="replys-input" style="padding-left: 60px;margin:10px 0" v-if="item.isReplys">
<el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="replysContent" maxlength="200" show-word-limit></el-input> <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="replysContent" maxlength="200" show-word-limit></el-input>
<el-button class="lea-btn" type="primary" @click="addReplys()">回复</el-button> <el-button class="lea-btn" type="primary" @click="addReplys()">回复</el-button>
</div> </div>
@@ -45,7 +45,7 @@
</div> </div>
</div> </div>
</div> </div>
</li> </li>
</ul> </ul>
<div style="text-align: center; margin-top:57px;" v-show="count > 0"> <div style="text-align: center; margin-top:57px;" v-show="count > 0">
@@ -110,6 +110,14 @@
this.$router.go(-1); this.$router.go(-1);
}, },
delReplySon(item,index) { //子级的删除手动删掉,调用保存接口 delReplySon(item,index) { //子级的删除手动删掉,调用保存接口
//修改后,替换为下面的情况
// apiGuestbook.del(item.id).then(res=>{
// if(res.status==200){
// item.replysList.splice(index,1);
// }else{
// this.$message.error('删除失败'+res.message);
// }
// });
item.replysList.splice(index,1); item.replysList.splice(index,1);
let replysData = { let replysData = {
id:item.id, id:item.id,
@@ -134,7 +142,7 @@
} }
}) })
}).catch(() => { }).catch(() => {
this.$message({type: 'info', message: '已取消删除'}); this.$message({type: 'info', message: '已取消删除'});
}); });
}, },
isReplys(item,idx) { isReplys(item,idx) {
@@ -168,12 +176,15 @@
if(res.status == 200) { if(res.status == 200) {
this.count = res.result.count; this.count = res.result.count;
res.result.list.forEach(item=>{ res.result.list.forEach(item=>{
item.replysList = []; if(!item.replysList){
item.replysList = [];
}
item.isReplys = false; item.isReplys = false;
item.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null,sign:'' } item.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null,sign:'' }
if(item.replys != '') { if(item.replys != '' && item.replys.length>10) {
item.replysList = JSON.parse(item.replys); item.replysList = JSON.parse(item.replys);
} }
//if()
}) })
this.leavingList = res.result.list; this.leavingList = res.result.list;
this.getUserData(res.result.list); this.getUserData(res.result.list);
@@ -252,7 +263,7 @@
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.backbut{ .backbut{
position: absolute; position: absolute;
@@ -332,4 +343,3 @@
} }
} }
</style> </style>