From c3b2d18a067067f9443124e2462b8ffcdc7614bd Mon Sep 17 00:00:00 2001 From: RubyLiu Date: Fri, 10 Nov 2023 14:43:28 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=B8=8D=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E9=80=BB=E8=BE=91=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/pure/ms-table/useTable.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/pure/ms-table/useTable.ts b/frontend/src/components/pure/ms-table/useTable.ts index cb4ffe4a52..cee13ce47e 100644 --- a/frontend/src/components/pure/ms-table/useTable.ts +++ b/frontend/src/components/pure/ms-table/useTable.ts @@ -381,13 +381,17 @@ export default function useTableProps( watchEffect(() => { const { heightUsed, showPagination, selectedKeys, msPagination } = propsRes.value; - const { pageSize, total } = msPagination as Pagination; - /* - * 是否有底部操作栏 包括 批量操作 和 分页器 - * 1. 有分页器,且总条数大于每页条数 - * 2. 有选中项 - */ - const hasFooterAction = (showPagination && total > pageSize) || selectedKeys.size > 0; + let hasFooterAction = false; + if (showPagination) { + const { pageSize, total } = msPagination as Pagination; + /* + * 是否有底部操作栏 包括 批量操作 和 分页器 + * 1. 有分页器,且总条数大于每页条数 + * 2. 有选中项 + */ + hasFooterAction = total > pageSize || selectedKeys.size > 0; + } + const currentY = appStore.innerHeight - (heightUsed || defaultHeightUsed) + (hasFooterAction ? 0 : footerActionWrapHeight); propsRes.value.showFooterActionWrap = hasFooterAction;