|
@@ -275,17 +275,17 @@ export default {
|
|
|
if (selected) { // 选择
|
|
|
this.selectedRows = [...this.selectedRows, ...changeRows]
|
|
|
} else { // 取消
|
|
|
- const arrId = []
|
|
|
- this.selectedRows.map((item, index) => {
|
|
|
- this.selectedRows.map((subItem, ind) => {
|
|
|
- if (item[this.rowKeyName] == subItem[this.rowKeyName]) {
|
|
|
- arrId.push(index)
|
|
|
- }
|
|
|
- })
|
|
|
+ const arrIds = []
|
|
|
+ changeRows.map((item, index) => {
|
|
|
+ arrIds.push(item[this.rowKeyName])
|
|
|
})
|
|
|
- arrId.map((item, index) => {
|
|
|
- _this.selectedRows = _this.selectedRows.slice(item, item + 1)
|
|
|
+ const arrs = []
|
|
|
+ this.selectedRows.map((item, index) => {
|
|
|
+ if (arrIds.indexOf(item[this.rowKeyName]) == -1) {
|
|
|
+ arrs.push(item)
|
|
|
+ }
|
|
|
})
|
|
|
+ this.selectedRows = arrs
|
|
|
}
|
|
|
this.updateSelect()
|
|
|
},
|