wsx 9 месяцев назад
Родитель
Сommit
d7d37cb7b4

+ 1 - 4
src/views/system/dataDesensitization/components/RulesDatail.vue

@@ -313,13 +313,10 @@
         });
       },
       openUserPage(row, index) {
-        console.log(row);
+        // 这里有个编辑进来,已有多选,打开窗口带出的优化
         this.index = index;
-        console.log(this.$refs);
         let ref = 'userRef' + index;
-
         this.$refs[ref].blur();
-
         this.$refs.UserPage.open('1', row.userAuthorityList);
 
         // this.userVisible = true;

+ 26 - 13
src/views/system/dataDesensitization/components/UserPage.vue

@@ -171,7 +171,7 @@
         console.log(this.selectionList);
         let ids = this.selectionList.map((item) => item.id);
 
-        let selectIds = [...new Set()];
+        // let selectIds = [...new Set()];
 
         let data = JSON.parse(JSON.stringify(this.selectionList));
         this.$emit('success', { data });
@@ -192,25 +192,38 @@
         this.$refs.table.reload({ pageNum: 1, where: where });
       },
       doneHandler() {
+        console.log(this.initIds);
+
         // console.log('doneHandler');
         // console.log(this.selectIds);
 
         if (this.initIds.length) {
-          this.$nextTick(() => {
-            this.$refs.table.setSelectedRowKeys(this.initIds);
-            this.selectIds = this.selectionList.map((item) => item.id);
-            // console.log(this.initIds);
-            // this.initIds=[]
+          // if()
 
-            // this.initIds = this.initIds.filter(
-            //   (item) => !this.selectIds.includes(item)
-            // );
-            // console.log(this.initIds);
+          this.$refs.table.setSelectedRowKeys(this.initIds);
+          this.selectIds = this.selectionList.map((item) => item.id);
+          console.log(this.selectIds);
 
-            // console.log(this.selectIds);
+          let arr = this.initIds.filter(
+            (item) => !this.selectIds.includes(item)
+          );
 
-            // this.selectIds = [];
-          });
+          this.initIds = arr;
+          console.log(arr);
+          console.log(this.initIds);
+
+          // log
+          // console.log(this.initIds);
+          // this.initIds=[]
+
+          // this.initIds = this.initIds.filter(
+          //   (item) => !this.selectIds.includes(item)
+          // );
+          // console.log(this.initIds);
+
+          // console.log(this.selectIds);
+
+          // this.selectIds = [];
         }
       },
       cancel() {