mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
fix:picker全选排除已禁用的行 (#7736)
Co-authored-by: wanglinfang <wanglinfang@baidu.com>
This commit is contained in:
parent
2719df138d
commit
c8ad83ec03
@ -653,10 +653,9 @@ export const TableStore = iRendererStore
|
||||
},
|
||||
|
||||
get allChecked(): boolean {
|
||||
return !!(
|
||||
self.selectedRows.length ===
|
||||
(self as ITableStore).checkableRows.length &&
|
||||
(self as ITableStore).checkableRows.length
|
||||
// 只要selectedRows中包含checkableRows中的全部数据,就认为是全选
|
||||
return (self as ITableStore).checkableRows.every(item =>
|
||||
self.selectedRows.includes(item)
|
||||
);
|
||||
},
|
||||
|
||||
@ -1246,7 +1245,11 @@ export const TableStore = iRendererStore
|
||||
|
||||
function toggleAll() {
|
||||
if (self.allChecked) {
|
||||
self.selectedRows.clear();
|
||||
// 需要将不可选的row排除掉
|
||||
// 不可选的 始终保持初始化的状态
|
||||
self.selectedRows.replace(
|
||||
self.selectedRows.filter(row => !row.checkable)
|
||||
);
|
||||
} else {
|
||||
self.selectedRows.replace(getSelectedRows());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user