From 560a251a48fa68e873df6f9ad86eebecbcc4e7b9 Mon Sep 17 00:00:00 2001 From: teukkk Date: Fri, 13 Sep 2024 15:20:15 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=A2=9E=E5=8A=A0=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/pure/ms-table/select-all.vue | 3 ++- frontend/src/components/pure/ms-table/useTable.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/pure/ms-table/select-all.vue b/frontend/src/components/pure/ms-table/select-all.vue index 48973c6888..cec35b09df 100644 --- a/frontend/src/components/pure/ms-table/select-all.vue +++ b/frontend/src/components/pure/ms-table/select-all.vue @@ -141,6 +141,7 @@ if (item.children && item.children.length > 0 && !props.rowSelectionDisabledConfig?.disabledChildren) { return hasUnselectedChildren(item.children, selectedKeys, rowKey); } + // 有数据没有勾选上,且该数据没有被禁用 return ( !selectedKeys.has(item[rowKey]) && !(props?.rowSelectionDisabledConfig?.disabledKey && item[props?.rowSelectionDisabledConfig?.disabledKey]) @@ -150,7 +151,7 @@ const handleCheckChange = () => { if (hasUnselectedChildren(props.currentData, props.selectedKeys, props.rowKey)) { - // 当前页有数据没有勾选上,此时点击全选按钮代表全部选中 + // 当前页有数据没有勾选上,且该数据没有被禁用,此时点击全选按钮代表全部选中 handleSelect(SelectAllEnum.CURRENT, false); } else { // 否则是当前页全部数据已勾选,此时点击全选按钮代表取消当前页面数据勾选 diff --git a/frontend/src/components/pure/ms-table/useTable.ts b/frontend/src/components/pure/ms-table/useTable.ts index d7b9878bc4..ce9544d05d 100644 --- a/frontend/src/components/pure/ms-table/useTable.ts +++ b/frontend/src/components/pure/ms-table/useTable.ts @@ -365,6 +365,7 @@ export default function useTableProps( }; const collectIds = (data: MsTableDataItem[], rowKey: string) => { data.forEach((item: MsTableDataItem) => { + // 有数据没有勾选上,且该数据没有被禁用 if ( item[rowKey] && !propsRes.value.selectedKeys.has(item[rowKey]) &&