ソースを参照

归档树回显更改

duy 2 年 前
コミット
8a97bf0584
1 ファイル変更24 行追加16 行削除
  1. 24 16
      src/views/manager/projectinfo/archivetreeRule.vue

+ 24 - 16
src/views/manager/projectinfo/archivetreeRule.vue

@@ -1561,29 +1561,37 @@ export default {
         nodeType: 2,
       })
       this.pushfileTap = true
-      await this.saixuan(this.dialogData)
-      console.log(this.checkXuan);
+      // await this.saixuan(this.dialogData)
+      await this.saixuan(this.dialogData[0].selectAllNodes)
       this.$refs.trees.setCheckedKeys(this.checkXuan);
     },
-    // 赛选
     saixuan (da) {//赛选
       if (da.length > 0) {
-        let tag = true
-        da.forEach(val => {
-          if (val.isDisplayTree == 1 && val.hasChildren) {
-            let ks = this.saixuan(val.children)
-            if (ks) {
-              this.checkXuan.push(val.id)
-            }
-          } else if (val.isDisplayTree == 1 && !val.hasChildren) {
-            this.checkXuan.push(val.id)
-          } else {
-            tag = false
-          }
+        da.forEach(val=>{
+          this.checkXuan.push(val)
         })
-        return tag
       }
+       
     },
+    // 赛选
+    // saixuan (da) {//赛选
+    //   if (da.length > 0) {
+    //     let tag = true
+    //     da.forEach(val => {
+    //       if (val.isDisplayTree == 1 && val.hasChildren) {
+    //         let ks = this.saixuan(val.children)
+    //         if (ks) {
+    //           this.checkXuan.push(val.id)
+    //         }
+    //       } else if (val.isDisplayTree == 1 && !val.hasChildren) {
+    //         this.checkXuan.push(val.id)
+    //       } else {
+    //         tag = false
+    //       }
+    //     })
+    //     return tag
+    //   }
+    // },
     pushFileClose () {//弹框关闭事件
       this.checkXuan = []
     },