duy 1 tháng trước cách đây
mục cha
commit
9de41b6992
2 tập tin đã thay đổi với 35 bổ sung24 xóa
  1. 24 16
      src/views/codeRule/ConditionsSet.vue
  2. 11 8
      src/views/manager/projectinfo/tree.vue

+ 24 - 16
src/views/codeRule/ConditionsSet.vue

@@ -367,24 +367,32 @@ export default {
       saveCondition() {
         console.log(this.paramList,'this.paramList');
         
-      let resArr = this.paramList.map(item => {
-        // 收集所有 codeValue 的 value,不需要额外的数组包装
-        const rightIds = item.codeList.reduce((acc, codeItem) => {
-          // codeItem.codeValue[0].value 是一个数组,直接展开到 acc 中
-          return [...acc, ...codeItem.codeValue[0].value];
-        }, []);
+        this.paramList.map(item => {
+          return{
+            id: item.id,
+            standardInfos:item.codeList.map(codeItem => {
+          })
 
-        return {
-          leftId: item.id, // leftId 保持数组形式
-          rightIds // rightIds 是展开后的一维数组
-        };
-      });
+          }
+      })
+      // let resArr = this.paramList.map(item => {
+      //   // 收集所有 codeValue 的 value,不需要额外的数组包装
+      //   const rightIds = item.codeList.reduce((acc, codeItem) => {
+      //     // codeItem.codeValue[0].value 是一个数组,直接展开到 acc 中
+      //     return [...acc, ...codeItem.codeValue[0].value];
+      //   }, []);
 
-        // 调用保存接口
-        if (resArr.length === 0) {
-          this.$message.warning('请先设置关联关系');
-          return;
-        }
+      //   return {
+      //     leftId: item.id, // leftId 保持数组形式
+      //     rightIds // rightIds 是展开后的一维数组
+      //   };
+      // });
+
+      //   // 调用保存接口
+      //   if (resArr.length === 0) {
+      //     this.$message.warning('请先设置关联关系');
+      //     return;
+      //   }
         console.log(resArr,'resArr');
         
         saveConditionSet(resArr).then((res) => {

+ 11 - 8
src/views/manager/projectinfo/tree.vue

@@ -2109,6 +2109,7 @@
                   style="width: 100%"
                   max-height="300"
                   @selection-change="handleSelectionChange1"
+                  
                   >
                   <el-table-column
                     type="selection"
@@ -5189,6 +5190,7 @@ export default {
                     this.$message.success(res.data.msg)
                     this.syncTableDialog=false
                     this.$refs.proTable1.clearSelection()
+                    this.updateNodeTable()
                    
                     }else{
                       this.$message.error(res.data.msg)
@@ -5208,16 +5210,17 @@ export default {
      
     },
     handleSelectionChange1(val) {
-      let arr = []
-      if(val.length>0){
-        for (let index = 0; index < val.length; index++) {
-          let i = val[index];
-         arr.push(i.pkeyId)
-        }
-        this.formIds=arr.join(',')
+        if (val.length > 1) {
+          // 如果选择了多个,只保留最后一个
+          this.$nextTick(() => {
+            this.$refs.proTable1.clearSelection();
+            this.$refs.proTable1.toggleRowSelection(val.pop());
+          });
+          this.formIds=val[0].pkeyId
 
-        // this.syncForm.formIds=arr.join(',')
       }
+       
+  
     },
    async refreshData(){
     this.refreshLoading=true