Browse Source

编辑元素默认信息

duy 1 year ago
parent
commit
f938b5cea2

+ 9 - 8
src/views/manager/projectinfo/treeTemplate/template/editDefault.vue

@@ -97,15 +97,16 @@ export default {
         });
         return;
       }
+      //一个字段只能配置一个默认信息
 let isCan=true
-this.setsignaTable.forEach((ele)=>{
-  if(ele.colKey===this.htmlData1.keyname){
-    isCan=false
-    return
-  }else{
-    isCan=true
-  }
-})
+this.setsignaTable.forEach(element => {
+    if (isCan) {
+        // 如果满足条件,执行相应的操作,并将条件修改为 false
+        if (element.colKey===this.htmlData1.keyname) {  // 这里 someConditionMet 是你的条件判断函数
+            isCan = false;
+        }
+    }
+});
 if(isCan){
     const {data: res} = await saveDdefual({
         trIndex: this.htmlData1.tr,