From 4d3f6878d3279f7f95426695f76c220ff540dce6 Mon Sep 17 00:00:00 2001 From: "xinxin.wu" Date: Thu, 20 Jun 2024 15:56:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=A8=E9=80=89=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E5=BD=93=E5=89=8D=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/pure/ms-table/useTable.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/pure/ms-table/useTable.ts b/frontend/src/components/pure/ms-table/useTable.ts index 965d4c6b0b..51509b7412 100644 --- a/frontend/src/components/pure/ms-table/useTable.ts +++ b/frontend/src/components/pure/ms-table/useTable.ts @@ -453,13 +453,17 @@ export default function useTableProps( // 表格SelectAll change selectAllChange: (v: SelectAllEnum, onlyCurrent: boolean) => { - const { data, rowKey } = propsRes.value; + const { data, rowKey, selectorStatus } = propsRes.value; if (v === SelectAllEnum.NONE) { // 清空选中项 resetSelector(false); } else if (v === SelectAllEnum.CURRENT) { - // 先清空选中项选,当再选中当前页面所有数据, - propsRes.value.selectedKeys.clear(); + // 如果是全选先清空选中项选和排除项,再选中当前页面所有数据, + if (selectorStatus === SelectAllEnum.ALL) { + propsRes.value.selectedKeys.clear(); + propsRes.value.excludeKeys.clear(); + } + collectIds(data as MsTableDataItem[], rowKey); } else if (v === SelectAllEnum.ALL) { // 全选所有页的时候先清空排除项,再选中所有数据