笔记 评论

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

View File

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