Jelajahi Sumber

未进行匹配元素

duy 2 tahun lalu
induk
melakukan
67c593cc3a

+ 9 - 0
src/api/exctab/editelement.js

@@ -59,4 +59,13 @@ export const tableType = () => {
       method: 'get',
     })
   }
+
+//提取未匹配的元素字段
+export const getUnMatchField = (params) => {
+    return request({
+      url: '/api/blade-manager/exceltab/getUnMatchField',
+      method: 'get',
+      params
+    })
+  }
   

+ 31 - 9
src/views/manager/projectinfo/editElement/editElement.vue

@@ -104,12 +104,12 @@
                 @click="saveReplace()"
               >保存</el-button>
             </div> -->
-            <div class="martop20 replace_box" v-if="false">
+            <div class="martop20 replace_box" v-if="true">
               <div style="width: 100%;height: 100%;overflow-y: auto;">
                   <el-row class="mb-4 ">
-                    <el-col v-for="item in unMatchItems" :span="item.name.length>6?12:8">
-                      <el-button type="warning" plain>{{ item.name }}</el-button>
-                    </el-col>
+                    <div  style="width: 100%;">
+                      <el-button type="warning" plain v-for="item in unMatchItems"  @click="unMatchClick(item)" style="margin-bottom: 10px ;" size="small">{{ item.eName }}</el-button>
+                    </div>
                 </el-row>
               </div>
             </div>
@@ -262,7 +262,7 @@ import FormulaEdit from '@/views/formula/edit.vue'
 import FormulaEditone from '@/views/formula/edit1.vue'
 
 import { getExcelHtml } from '@/api/exctab/excelmodel'
-import { getElementInfoByTabId, submit, dictionarydataType, submitBatch } from '@/api/exctab/editelement'
+import { getElementInfoByTabId, submit, dictionarydataType, submitBatch,getUnMatchField } from '@/api/exctab/editelement'
 import Vue from 'vue'
 
 export default {
@@ -364,8 +364,9 @@ export default {
        formulaCompVisible1:false,//公式弹框全局公式
       eleid:'',//当前元素
       unMatchItems:[
-       
-      ]
+
+      ],
+     
     }
   },
   mounted () {
@@ -375,9 +376,27 @@ export default {
   },
   created () {
     this.getElementInfoByTabId()
+    this.getUnMatchFieldData()
     this.AddNewElementField = '替换元素'
   },
   methods: {
+    //获取未匹配的元素字段
+    getUnMatchFieldData(){
+      getUnMatchField({
+        pkeyId:this.pkeyId,
+        tabId:this.initTableId
+      }).then((res)=>{
+        console.log(res,'res');
+        this.unMatchItems=res.data.data
+      })
+    },
+    //选择未匹配的字段
+    unMatchClick(item){
+      console.log(item,'item');
+      this.value=item.id
+      this.names=item.eName
+    
+    },
     takuangchangge (value) {//切换事件
       if (value[value.length - 1] == '替换元素') {
         this.AddNewElementField = '替换元素'
@@ -681,6 +700,7 @@ export default {
           localStorage.setItem('editElement', res.data)
           this.getElementInfoByTabId()
           this.copss()
+          this.getUnMatchFieldData()
         }
       }
     },
@@ -840,6 +860,7 @@ export default {
       }
       return targetParent;
     },
+ 
 
   },
   watch: {
@@ -938,9 +959,10 @@ export default {
   }
 }
 .replace_box{
+  margin-top: 40px;
   border: 1px gray dashed;
   width: 95%;
-  height: 500px;
+  height: calc(100vh - 560px);
   position: relative;
   padding-top: 20px;
   padding-left: 20px;
@@ -949,7 +971,7 @@ export default {
  
 }
 .replace_box::after {
-				content: '未进行匹配的字段';
+				content: '未进行匹配的元素字段';
 				position: absolute;
 				right: 34%;
 				top: -15px;