fix(测试跟踪): 修复取消记住跨页选择的记录前一页的数据不能删除问题

--bug=1021992 --user=郭雨琦
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001021992
This commit is contained in:
guoyuqi 2023-01-16 14:12:29 +08:00 committed by fit2-zhao
parent 837e1f3841
commit 22f7f58e30
2 changed files with 12 additions and 6 deletions

View File

@ -434,7 +434,13 @@ export default {
}); });
}, },
handleSelect(selection, row) { handleSelect(selection, row) {
_handleSelect(this, selection, row, this.selectRows); let selectRowMap = new Map();
for (let selectRow of this.selectRows) {
selectRowMap.set(selectRow.id, selectRow);
}
_handleSelect(this, selection, row, selectRowMap);
let selectRow = Array.from(selectRowMap.values());
this.selectRows = new Set(selectRow);
setUnSelectIds(this.data, this.condition, this.selectRows); setUnSelectIds(this.data, this.condition, this.selectRows);
this.selectDataCounts = getSelectDataCounts( this.selectDataCounts = getSelectDataCounts(
this.condition, this.condition,

View File

@ -37,16 +37,16 @@ export function _handleSelectAll(component, selection, tableData, selectRows, co
} }
} }
export function _handleSelect(component, selection, row, selectRows) { export function _handleSelect(component, selection, row, selectRowMap) {
row.hashTree = []; row.hashTree = [];
if (selectRows.has(row)) { if (selectRowMap.has(row.id)) {
component.$set(row, "showMore", false); component.$set(row, "showMore", false);
selectRows.delete(row); selectRowMap.delete(row.id);
} else { } else {
component.$set(row, "showMore", true); component.$set(row, "showMore", true);
selectRows.add(row); selectRowMap.set(row.id, row);
} }
let arr = Array.from(selectRows); let arr = Array.from(selectRowMap.values());
arr.forEach(row => { arr.forEach(row => {
component.$set(row, "showMore", true); component.$set(row, "showMore", true);
}); });