cldu 6 روز پیش
والد
کامیت
626813e96a

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


+ 20 - 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"
@@ -198,6 +199,24 @@ export default {
           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){

+ 9 - 2
src/views/BI_manage/components/ChartBox.vue

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

+ 12 - 1
src/views/BI_manage/components/KnowBox.vue

@@ -11,6 +11,13 @@
           @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>
       <div class="icons">
@@ -85,6 +92,9 @@ export default {
   mounted() {},
 
   methods: {
+    deleteType(item){
+      this.$emit('deleteKnowledgeType',item)
+    },
     changeType(item) {
       this.choosedType = item.type;
     },
@@ -129,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;
@@ -137,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;

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

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