lilei 3 lat temu
rodzic
commit
742a16bb5a
1 zmienionych plików z 4 dodań i 8 usunięć
  1. 4 8
      src/components/Table/index.js

+ 4 - 8
src/components/Table/index.js

@@ -279,15 +279,11 @@ export default {
       } else { //  取消
         const arrId = []
         this.selectedRows.map((item, index) => {
-          this.selectedRows.map((subItem, ind) => {
-            if (item[this.rowKeyName] == subItem[this.rowKeyName]) {
-              arrId.push(index)
-            }
-          })
-        })
-        arrId.map((item, index) => {
-          _this.selectedRows = _this.selectedRows.slice(item, item + 1)
+          if(!changeRows.find(subItem => subItem[this.rowKeyName] == item[this.rowKeyName])){
+            arrId.push(item)
+          }
         })
+        this.selectedRows = arrId
       }
       this.updateSelect()
     },