|
@@ -92,6 +92,7 @@ export default {
|
|
showSelectTable: false,
|
|
showSelectTable: false,
|
|
showSelectKnow: false,
|
|
showSelectKnow: false,
|
|
selectKnowType:0,
|
|
selectKnowType:0,
|
|
|
|
+ getKnowledgeLoading:false,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -117,15 +118,18 @@ export default {
|
|
async handleKnowList(){
|
|
async handleKnowList(){
|
|
let item = this.boardDataList.find(_=>_.Type == 3);
|
|
let item = this.boardDataList.find(_=>_.Type == 3);
|
|
if(!item) return;
|
|
if(!item) return;
|
|
|
|
+ this.getKnowledgeLoading = true;
|
|
let res = await apiBiBoard.getKnowledge({ BiDashboardDetailId:item.BiDashboardDetailId });
|
|
let res = await apiBiBoard.getKnowledge({ BiDashboardDetailId:item.BiDashboardDetailId });
|
|
|
|
+ this.getKnowledgeLoading = false;
|
|
if(res.Ret != 200) return;
|
|
if(res.Ret != 200) return;
|
|
- this.knowledgeList = res.Data.KnowledgeResourceList || [];
|
|
|
|
|
|
+ this.knowledgeList = (res.Data && res.Data.KnowledgeResourceList) || [];
|
|
this.cacheSaveKnowList(); //首次请求暂存,否则后端获取不到
|
|
this.cacheSaveKnowList(); //首次请求暂存,否则后端获取不到
|
|
if(this.knowledgeList.length > 0) this.setFirstKnow();
|
|
if(this.knowledgeList.length > 0) this.setFirstKnow();
|
|
},
|
|
},
|
|
|
|
|
|
async cacheSaveKnowList(){
|
|
async cacheSaveKnowList(){
|
|
let knowItem = this.boardDataList.find(_=>_.Type == 3);
|
|
let knowItem = this.boardDataList.find(_=>_.Type == 3);
|
|
|
|
+ this.getKnowledgeLoading = true;
|
|
await apiBiBoard.saveKnowledge({
|
|
await apiBiBoard.saveKnowledge({
|
|
BiDashboardDetailId:knowItem ? (/^selfId_\d+$/.test(knowItem.BiDashboardDetailId) ? 0 : knowItem.BiDashboardDetailId) : 0,
|
|
BiDashboardDetailId:knowItem ? (/^selfId_\d+$/.test(knowItem.BiDashboardDetailId) ? 0 : knowItem.BiDashboardDetailId) : 0,
|
|
KnowledgeResourceList:this.knowledgeList.map(_=>({
|
|
KnowledgeResourceList:this.knowledgeList.map(_=>({
|
|
@@ -133,6 +137,7 @@ export default {
|
|
KnowledgeResourceId:_.KnowledgeResourceId
|
|
KnowledgeResourceId:_.KnowledgeResourceId
|
|
}))
|
|
}))
|
|
});
|
|
});
|
|
|
|
+ this.getKnowledgeLoading = false
|
|
},
|
|
},
|
|
|
|
|
|
setFirstKnow(){
|
|
setFirstKnow(){
|
|
@@ -150,6 +155,9 @@ export default {
|
|
this.$message.warning('请至少选择一个图表或表格!')
|
|
this.$message.warning('请至少选择一个图表或表格!')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ if(this.getKnowledgeLoading){
|
|
|
|
+ return this.$message.warning('请等待数据加载完成之后再操作')
|
|
|
|
+ }
|
|
const arr=this.boardDataList.map(item=>{
|
|
const arr=this.boardDataList.map(item=>{
|
|
return {
|
|
return {
|
|
Type:item.Type,
|
|
Type:item.Type,
|