Эх сурвалжийг харах

Merge branch 'debug' of http://8.136.199.33:3000/eta_gn_front/eta_front into debug

shanbinzhang 1 өдөр өмнө
parent
commit
a0750d754d

BIN
src/assets/img/data_m/white_delete_icon.png


+ 30 - 1
src/views/BI_manage/components/BoardContent.vue

@@ -28,7 +28,8 @@
                 :knowList="knowList"
                 :ref="'item' + item.i"
                 :canDelete="canDelete"
-                @deleteKnowledge="deleteKnowledge($event,item)">
+                @deleteKnowledge="deleteKnowledge($event,item)"
+                @deleteKnowledgeType="deleteKnowledgeType($event,item)">
                 <template v-slot:drag>
                   <img
                     v-if="canDrag"
@@ -170,6 +171,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 +192,31 @@ 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 deleteKnowledgeType(item,v){
+      let { type } = item;
+      let knowList = this.knowList.filter(_=>_.ResourceType != type);
+      let res = await apiBiBoard.saveKnowledge({
+          BiDashboardDetailId:v ? (/^selfId_\d+$/.test(v.BiDashboardDetailId) ? 0 : v.BiDashboardDetailId) : 0,
+          KnowledgeResourceList:knowList.map(_=>({
+            ResourceType:_.ResourceType,
+            KnowledgeResourceId:_.KnowledgeResourceId
+          }))
+        });
+      if(res.Ret != 200) return this.$message.warning('删除失败,请重试');
+      this.knowList = knowList;
+      if(!this.knowList.length){ //清空掉知识资源
+        this.dataList = this.dataList.filter(_=>_.Type != 3);
+        this.$emit('input',this.dataList)
+      }
+      this.setFirstKnow();
+    },
     async deleteKnowledge(item,v){
       let index = this.knowList.findIndex(_=>_.KnowledgeResourceId == item.KnowledgeResourceId && _.ResourceType == item.ResourceType)
       if(index >= 0){

+ 10 - 3
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>
     <!-- 无权限 -->
@@ -31,10 +31,10 @@
     <div class="bottom-tip">
         <div v-if="showSourceFrom" :style="`width: ${getWidth('source')};`">
           <el-tooltip
-            :content="JSON.parse(chartInfo.SourcesFrom).text"
             placement="top"
             v-tooltipHidable
           >
+            <div slot="content" class="tooltip-maxwidth-bi">{{ JSON.parse(chartInfo.SourcesFrom).text }}</div>
             <div
                 class="bottom-overflow"
                 ref="sourceRef"
@@ -57,10 +57,10 @@
         </div>
        <div v-if="showInstruction" :style="`width: ${getWidth('instruction')};`">
         <el-tooltip
-            :content="JSON.parse(chartInfo.Instructions).text"
             placement="top"
             v-tooltipHidable
           >
+          <div slot="content" class="tooltip-maxwidth-bi">{{ JSON.parse(chartInfo.Instructions).text }}</div>
           <div
             class="chart-instruction bottom-overflow"
             v-text="JSON.parse(chartInfo.Instructions).text"
@@ -388,4 +388,11 @@ export default {
     }
   }
 }
+</style>
+<style lang="scss">
+.tooltip-maxwidth-bi{
+    max-width: 500px; 
+    white-space: normal; 
+    word-break: break-word;
+}
 </style>

+ 29 - 4
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
@@ -11,11 +11,21 @@
           @click="changeType(item, index)"
         >
           {{ item.title }}
+          <img
+            v-if="canDelete && choosedType == item.type"
+            src="~@/assets/img/data_m/white_delete_icon.png"
+            alt=""
+            style="width: 20px;height: 20px;margin-left: 4px;cursor: default;"
+            @click.stop="deleteType(item)"
+          />
         </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"
@@ -82,6 +92,9 @@ export default {
   mounted() {},
 
   methods: {
+    deleteType(item){
+      this.$emit('deleteKnowledgeType',item)
+    },
     changeType(item) {
       this.choosedType = item.type;
     },
@@ -126,7 +139,6 @@ export default {
       .type-item {
         font-size: 14px;
         font-weight: 400;
-        line-height: 22px;
         padding: 4px 12px;
         border-top: 1px solid #c8cdd9;
         border-bottom: 1px solid #c8cdd9;
@@ -134,6 +146,8 @@ export default {
         background: #fff;
         color: #666666;
         cursor: pointer;
+        display: flex;
+        align-items: center;
       }
       .type-item:first-of-type {
         border-left: 1px solid #c8cdd9;
@@ -149,6 +163,13 @@ export default {
         color: #fff;
       }
     }
+    .icons{
+      .icon{
+        width: 24px;
+        height: 24px;
+        margin-left: 5px;
+      }
+    }
     .title {
       font-size: 20px;
       font-weight: bold;
@@ -176,6 +197,7 @@ export default {
         cursor: pointer;
         color: #666666;
         margin-right: 20px;
+        white-space: nowrap;
       }
       .item-title {
         cursor: pointer;
@@ -199,5 +221,8 @@ export default {
       }
     }
   }
+  .min-width{
+    min-width: 380px;
+  }
 }
 </style>

+ 15 - 2
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>
     <!-- 无权限 -->
@@ -75,10 +75,10 @@
     </div>
     <div v-if="info && info.SourcesFrom && JSON.parse(info.SourcesFrom) && JSON.parse(info.SourcesFrom).isShow" style="width: 100%;">
       <el-tooltip
-        :content="JSON.parse(info.SourcesFrom).text"
         placement="top"
         v-tooltipHidable
       >
+        <div slot="content" class="tooltip-maxwidth-bi">{{ JSON.parse(info.SourcesFrom).text }}</div>
         <div
             class="bottom-overflow"
             ref="sourceRef"
@@ -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;
@@ -318,4 +324,11 @@ table {
   text-overflow: ellipsis;  
 };
 }
+</style>
+<style lang="scss">
+.tooltip-maxwidth-bi{
+    max-width: 500px; 
+    white-space: normal; 
+    word-break: break-word;
+}
 </style>

+ 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();
     },
 

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

@@ -27,7 +27,7 @@
                 <div v-else class="approve-content" 
                     v-loading="isLoading"
                     element-loading-text="看板加载中...">
-                    <BIBoardContent :value="boardDataList" renderHeight="calc(100vh - 250px)" />
+                    <BIBoardContent ref="boardContent" :knowList.sync="knowledgeList" :value="boardDataList" renderHeight="calc(100vh - 200px)" />
                 </div>
             </div>
             <div class="approve-tool">
@@ -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();
     },
 

+ 4 - 4
src/views/knowledge_manage/components/importMoreFileDia.vue

@@ -2,7 +2,9 @@
   <div>
     <el-dialog :visible.sync="show" :close-on-click-modal="false" :modal-append-to-body="false" @close="cancelHandle"
       custom-class="knowledge-import-dialog" top="10vh" v-dialogDrag title="事件信息" width="1200px">
-      <div class="more-set-btn" @click="setMore">批量设置</div>
+      <div class="more-set-btn">
+        <el-button type="primary" @click="setMore">批量设置</el-button>
+      </div>
       <el-form class="more-set-form" ref="formRef" hide-required-asterisk :model="eventForm" :rules="formRules"
         label-width="0">
         <el-table :data="eventForm.tableData" ref="table" element-loading-text="加载中..." v-loading="tableLoading" border
@@ -312,8 +314,6 @@ export default {
   display: flex;
   justify-content: flex-end;
   padding: 0 40px;
-  margin-bottom: 50px;
-  cursor: pointer;
-  color: #000000;
+  margin-bottom: 24px;
 }
 </style>

+ 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;
       }
     }
   }