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