Преглед на файлове

Merge branch 'gn2.2' into debug

cldu преди 1 седмица
родител
ревизия
8d9043633b

+ 10 - 0
src/views/BI_manage/components/BoardContent.vue

@@ -170,6 +170,9 @@ export default {
       return type === 1 ? ChartBox : type === 2 ? TableBox : KnowBox;
     },
     handleDel(item){
+      if(item.Type == 3) {
+        this.deleteKnowBox(item)
+      };
       let index = this.dataList.findIndex(_=>_.BiDashboardDetailId == item.BiDashboardDetailId);
       this.dataList.splice(index,1);
       this.handleChangeDataList();
@@ -188,6 +191,13 @@ export default {
       });
       this.$emit('input',this.dataList)
     },
+    deleteKnowBox(v){
+      this.$emit('update:knowList',[]);
+      apiBiBoard.saveKnowledge({
+          BiDashboardDetailId:v ? (/^selfId_\d+$/.test(v.BiDashboardDetailId) ? 0 : v.BiDashboardDetailId) : 0,
+          KnowledgeResourceList:[]
+      });
+    },
     async deleteKnowledge(item,v){
       let index = this.knowList.findIndex(_=>_.KnowledgeResourceId == item.KnowledgeResourceId && _.ResourceType == item.ResourceType)
       if(index >= 0){

+ 1 - 1
src/views/BI_manage/components/ChartBox.vue

@@ -10,8 +10,8 @@
           v-permission="permissionBtn.BIBoardPermission.BIBoard_refresh"
           @click="refreshHandle"
         />
-        <slot name="drag"></slot>
         <slot name="delete"></slot>
+        <slot name="drag"></slot>
       </div>
     </div>
     <!-- 无权限 -->

+ 17 - 3
src/views/BI_manage/components/KnowBox.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="know-box" v-if="compData" ref="compRef">
-    <div class="top-title-box">
+    <div class="top-title-box min-width">
       <div class="title">知识资源</div>
       <div class="types">
         <div
@@ -13,9 +13,12 @@
           {{ item.title }}
         </div>
       </div>
-      <slot name="drag"></slot>
+      <div class="icons">
+        <slot name="delete"></slot>
+        <slot name="drag"></slot>
+      </div>
     </div>
-    <div class="list-wrap">
+    <div class="list-wrap min-width">
       <div
         v-for="item in showKnowList"
         :key="item.KnowledgeResourceId"
@@ -149,6 +152,13 @@ export default {
         color: #fff;
       }
     }
+    .icons{
+      .icon{
+        width: 24px;
+        height: 24px;
+        margin-left: 5px;
+      }
+    }
     .title {
       font-size: 20px;
       font-weight: bold;
@@ -176,6 +186,7 @@ export default {
         cursor: pointer;
         color: #666666;
         margin-right: 20px;
+        white-space: nowrap;
       }
       .item-title {
         cursor: pointer;
@@ -199,5 +210,8 @@ export default {
       }
     }
   }
+  .min-width{
+    min-width: 380px;
+  }
 }
 </style>

+ 7 - 1
src/views/BI_manage/components/TableBox.vue

@@ -16,8 +16,8 @@
           v-permission="permissionBtn.BIBoardPermission.BIBoard_refresh"
           @click="handleRefresh"
         />
-        <slot name="drag"></slot>
         <slot name="delete"></slot>
+        <slot name="drag"></slot>
       </div>
     </div>
     <!-- 无权限 -->
@@ -208,6 +208,12 @@ export default {
       font-size: 20px;
       font-weight: bold;
       flex: 1;
+      display: -webkit-box;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      -webkit-line-clamp: 1;
+      line-break: anywhere;
+      -webkit-box-orient: vertical;
       &::before {
         content: "";
         display: inline-block;

+ 9 - 1
src/views/BI_manage/editBoard.vue

@@ -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,

+ 1 - 1
src/views/BI_manage/index.vue

@@ -252,7 +252,7 @@ export default {
       if(!item) return;
       let res = await apiBiBoard.getKnowledge({ BiDashboardDetailId:item.BiDashboardDetailId });
       if(res.Ret != 200) return;
-      this.knowledgeList = res.Data.KnowledgeResourceList || [];
+      this.knowledgeList = (res.Data && res.Data.KnowledgeResourceList) || [];
       if(this.knowledgeList.length > 0) this.setFirstKnow();
     },
 

+ 1 - 1
src/views/approve_manage/approveDetail.vue

@@ -186,7 +186,7 @@ export default {
             if(!item) return;
             let res = await apiBiBoard.getKnowledge({ BiDashboardDetailId:item.BiDashboardDetailId });
             if(res.Ret != 200) return;
-            this.knowledgeList = res.Data.KnowledgeResourceList || [];
+            this.knowledgeList = (res.Data && res.Data.KnowledgeResourceList) || [];
             if(this.knowledgeList.length > 0) this.setFirstKnow();
         },
         

+ 1 - 1
src/views/home_manage/index.vue

@@ -59,7 +59,7 @@ export default {
       if(!item) return;
       let res = await apiBiBoard.getKnowledge({ BiDashboardDetailId:item.BiDashboardDetailId });
       if(res.Ret != 200) return;
-      this.knowledgeList = res.Data.KnowledgeResourceList || [];
+      this.knowledgeList = (res.Data && res.Data.KnowledgeResourceList) || [];
       if(this.knowledgeList.length > 0) this.setFirstKnow();
     },
 

+ 3 - 0
src/views/ppt_manage/newVersion/components/editor/InsertKnowledge.vue

@@ -406,6 +406,9 @@ export default {
         margin-top: 10px;
         color: #666666;
         line-height: 20px;
+        white-space: nowrap;
+        overflow: hidden;
+        text-overflow: ellipsis;
       }
     }
   }