Quellcode durchsuchen

Merge branch 'need-0116'

cxmo vor 9 Monaten
Ursprung
Commit
d2e51b3bf4

+ 6 - 2
src/views/datasheet_manage/customAnalysis/addAnalysisSheet.vue

@@ -34,6 +34,7 @@
         ref="edbWrapRef"
         v-if="$route.path==='/createTaregtBySheet'"
         :list="edbList"
+        :sheetDetailInfo="this.sheetDetailInfo"
         @choose="chooseEdbHandle"
       />
     </div>
@@ -306,7 +307,7 @@ export default {
         }))
 
         this.isLoading = false;
-        this.getTargetList()
+        //this.getTargetList()
       }
     },
 
@@ -410,7 +411,10 @@ export default {
 
       if(!edbInfoId) this.$refs.createTargetRef.initData();
 
-      this.getTargetList()
+      //this.getTargetList()
+      if(this.$refs.edbWrapRef){
+        this.$refs.edbWrapRef.getTargetList('init')
+      }
     },
 
     /* 获取生成指标列表 */

+ 34 - 3
src/views/datasheet_manage/customAnalysis/components/rightSection.vue

@@ -1,6 +1,10 @@
 <template>
   <div class="right-section-wrapper">
     <div class="create-cont">
+        <div class="search-box">
+            <el-input placeholder="请输入指标ID/指标名称" prefix-icon="el-icon-search" clearable
+                v-model="keyWord" @input="getTargetList"/>
+        </div>
       <ul class="edb-list" v-if="edbList.length">
         <li :class="['edb-item',{'selected':selectEdb.EdbInfoId===item.EdbInfoId}]" v-for="(item,index) in edbList" :key="index" @click="chooseEdb(item)">
           <span>{{item.EdbName}}</span>
@@ -17,21 +21,30 @@
   </div>
 </template>
 <script>
+import * as sheetInterface from '@/api/modules/sheetApi.js';
 export default {
   props: {
     list: {
       type: Array
+    },
+    sheetDetailInfo:{
+        type:Object
     }
   },
   watch: {
-    list(nval) {
+    /* list(nval) {
       this.edbList = nval;
+    }, */
+    sheetDetailInfo(newVal){
+        if(newVal&&newVal.ExcelInfoId)
+            this.getTargetList('init')
     }
   },
   data() {
     return {
       edbList:[],
       selectEdb: {},
+      keyWord:''
     }
   },
   mounted(){
@@ -57,7 +70,21 @@ export default {
         classifyId:ClassifyId
       }});
 			window.open(href,'_blank');
-    }
+    },
+    async getTargetList(type) {
+      this.selectEdb={}
+      const res = await sheetInterface.sheetAnalysisInterface.edbListBySheet({
+        ExcelInfoId: this.sheetDetailInfo.ExcelInfoId,
+        Keyword:this.keyWord
+      })
+
+      if(res.Ret !== 200) return
+      
+      this.edbList = res.Data || [];
+      if(type!=='init'&&this.edbList.length){
+        this.chooseEdb(this.edbList[0])
+      }
+    },
   },
 }
 </script>
@@ -73,7 +100,7 @@ export default {
   .create-cont {
     .edb-list {
       padding: 30px;
-      max-height: 640px;
+      max-height: 520px;
       overflow-y: auto;
       .edb-item {
         display: flex;
@@ -106,6 +133,10 @@ export default {
         }
       }
     }
+    .search-box{
+        padding:30px;
+        padding-bottom: 0;
+    }
   }
 }
 </style>