mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 11:26:43 +08:00
笔记 评论
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
//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);
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user