Browse Source

调整表单修改

duy 1 year ago
parent
commit
632ea4bb33

+ 14 - 3
src/views/manager/projectinfo/treeTemplate/dynamicExcel.vue

@@ -28,6 +28,7 @@
             @cop='domss'
             :htmlData="htmlData"
             :checkList="checkList"
+            :checkNameList="checkNameList"
             @change="change"
           />
         </span>
@@ -82,7 +83,8 @@ export default {
         }
         ]
       },
-      checkList:[]
+      checkList:[],
+      checkNameList:[],
     }
   },
   mounted () {
@@ -96,6 +98,7 @@ export default {
   methods: {
     change(){
       this.checkList=[]
+      this.checkNameList=[]
     },
     GoBack () {//返回上一级
       this.$emit('remove')
@@ -196,7 +199,7 @@ export default {
     },
 
     getInformation (name, tr, td) {//鼠标点击事件
-      //console.log(event)
+      console.log(name,'name')
       let tdEle = null;
       //获取TD元素
       if(event.target.nodeName == "TD"){
@@ -214,13 +217,14 @@ export default {
         tr,
         td
       },moreObj)
+    
     },
 
     //excel父节点点击检测
     parentClick(e){
       let target = e.target;
       const{metaKey,ctrlKey}=e
-      //console.log(target)
+      console.log(target,'target')
       let bgs = document.querySelectorAll("#parent .oldlace-bg")
       //console.log(bgs)
       for (let i = 0; i < bgs.length; i++) {
@@ -246,6 +250,7 @@ export default {
           target.classList.add("oldlace-bg");
           if(metaKey||ctrlKey){
             target.classList.add("select-td");
+            this.checkNameList.push(this.htmlData)
             this.checkList.push({
               tr:target.getAttribute('trindex')||target1.getAttribute('trindex'),
               td:target.getAttribute('tdindex')||target1.getAttribute('tdindex'),
@@ -257,6 +262,12 @@ export default {
                 this.checkList.splice(index,1)
               }
             })
+            this.checkNameList.forEach((ele,index)=>{
+              if(this.htmlData.tr===ele.tr){
+                this.checkNameList.splice(index,1)
+              }
+            })
+          
           }
         }
       }

+ 17 - 2
src/views/manager/projectinfo/treeTemplate/template/setInputTPT.vue

@@ -170,7 +170,7 @@
 import { dictionary, saveInput, getColByTabId } from "@/api/manager/AdjustForm";
 import { getExcelHtml } from '@/api/exctab/excelmodel'
 export default {
-  props: ['pkeyId', 'htmlData','checkList'],
+  props: ['pkeyId', 'htmlData','checkList','checkNameList'],
   computed: {
     myHtmlData: function () {
       return this.htmlData;
@@ -178,6 +178,9 @@ export default {
     myCheckList: function () {
       return this.checkList;
     },
+    myCheckNameList: function () {
+      return this.checkNameList;
+    },
   },
   watch: {
     myHtmlData: function (newV) {
@@ -238,6 +241,15 @@ export default {
       this.setInputTable.splice(key, 1)
     },
     saveType() {//保存设置按钮
+    let iCan=this.checkNameList.some(e => e.name === "警告")
+      if(iCan||this.htmlData.name==='警告'){
+        this.$message({
+          type: "warning",
+          message: "当前选中的元素未进行匹配,不能设置输入框格式"
+        });
+        
+        return;
+      }
       if (this.htmlData.tr === ''&&this.checkList.length==0 || this.htmlData.td === ''&&this.checkList.length==0) {
         this.$message({
           type: "warning",
@@ -245,7 +257,7 @@ export default {
         });
         return;
       }
-
+     
       this.disabled = true
       if (this.from.type) {
         let ks = false
@@ -399,6 +411,7 @@ export default {
           message: "请选择文本格式"
         });
       }
+   
     },
     async dictionary() {//获取文本类型接口
       const { data: res } = await dictionary()
@@ -418,6 +431,8 @@ export default {
       this.yearSort=[]
       this.TimeSort=[]
       this.checkList=[]
+      this.checkNameList=[]
+
       this.$emit('change')
       if (res.code == 200) {
         this.setInputTable = []