|
|
|
@ -5053,22 +5053,22 @@ |
|
|
|
handleSelectionChange(val) { |
|
|
|
// val 只包含当前数据源中被选中的行 |
|
|
|
// 需要合并历史选择(selectionDelegateAccess)中不在当前数据源的人员 |
|
|
|
|
|
|
|
|
|
|
|
// 当前数据源中的所有人员编码 |
|
|
|
let currentDataKeys = this.baseDelegateAccessList.map(item => item.delegateAccess); |
|
|
|
|
|
|
|
|
|
|
|
// 保留历史选择中不在当前数据源的人员(这些人员用户无法在当前对话框中取消选择) |
|
|
|
let historyNotInCurrent = this.selectionDelegateAccess.filter(item => |
|
|
|
let historyNotInCurrent = this.selectionDelegateAccess.filter(item => |
|
|
|
!currentDataKeys.includes(item.delegateAccess) |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// 合并:历史人员(不在当前数据源)+ 当前选中的人员 |
|
|
|
let merged = [...historyNotInCurrent, ...val]; |
|
|
|
|
|
|
|
|
|
|
|
// 去重(虽然理论上不会重复) |
|
|
|
let map = new Map(); |
|
|
|
merged.forEach(item => map.set(item.delegateAccess, item)); |
|
|
|
|
|
|
|
|
|
|
|
this.selectionDelegateAccess2 = Array.from(map.values()); |
|
|
|
}, |
|
|
|
|
|
|
|
|