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 {
|
get allChecked(): boolean {
|
||||||
return !!(
|
// 只要selectedRows中包含checkableRows中的全部数据,就认为是全选
|
||||||
self.selectedRows.length ===
|
return (self as ITableStore).checkableRows.every(item =>
|
||||||
(self as ITableStore).checkableRows.length &&
|
self.selectedRows.includes(item)
|
||||||
(self as ITableStore).checkableRows.length
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1246,7 +1245,11 @@ export const TableStore = iRendererStore
|
|||||||
|
|
||||||
function toggleAll() {
|
function toggleAll() {
|
||||||
if (self.allChecked) {
|
if (self.allChecked) {
|
||||||
self.selectedRows.clear();
|
// 需要将不可选的row排除掉
|
||||||
|
// 不可选的 始终保持初始化的状态
|
||||||
|
self.selectedRows.replace(
|
||||||
|
self.selectedRows.filter(row => !row.checkable)
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
self.selectedRows.replace(getSelectedRows());
|
self.selectedRows.replace(getSelectedRows());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user