笔记 评论

This commit is contained in:
daihh
2022-11-03 11:45:42 +08:00
parent 842ae0858b
commit c1cd481cbd
2 changed files with 22 additions and 15 deletions

View File

@@ -1,6 +1,15 @@
/* 评论的相关处理*/
import ajax from '@/utils/xajax.js'
/*
查询评论
objType
objId
*/
const listQuery=function(query){
return ajax.post('/xboe/m/comment/list',query);
}
/*
查询评论
get post请求都可以
@@ -101,6 +110,7 @@ export default{
del,
update,
add,
listQuery,
pagelist,
pageQuery,
reply,

View File

@@ -368,20 +368,17 @@
}
let query={
pageIndex:this.pageIndex,
pageSize:this.pageSize,
type:6,
id:item.id,
// author: this.author,
objType:6,
objId:item.id
}
//console.log(item,'item'); 去读取回复
//2022-11-2日与产品润博确认笔记回复只显示一级不显示二级: "value",
//直接修改后台,查询全部
apiComment.pageQuery(query).then(res=>{
if(res.status == 200 && res.result.list.length > 0) {
apiComment.listQuery(query).then(res2=>{
if(res2.status == 200 && res2.result.length > 0) {
let ids = [];
let allList=[];
res.result.list.forEach(it=>{
//let allList=[];
res2.result.forEach(it=>{
ids.push(it.sysCreateAid);
it.answers=it.replys;
it.replyList = [];
@@ -389,15 +386,15 @@
it.orgInfo='';
it.name='';
it.isAll=false;
allList.push(it);
//allList.push(it);
//二级
});
//let ids = res.result.list.map(item=>item.sysCreateAid);
const noReapetIds=[...new Set(ids)]
this.loadAuthorInfo(res.result.list,noReapetIds);
this.loadAuthorInfo(res2.result,noReapetIds);
//加载回复内容
item.replyList.push(...res.result.list);
item.replyList.push(...res2.result);
}
})
});