From b16fdef8dc48ca032926a7ab0d2edbccca076973 Mon Sep 17 00:00:00 2001 From: JEECG <445654970@qq.com> Date: Tue, 12 Nov 2024 09:34:18 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90issues/7422=E3=80=91BasicTable?= =?UTF-8?q?=E5=88=97=E8=A1=A8canResize=E5=B1=9E=E6=80=A7=E4=B8=BAtrue?= =?UTF-8?q?=E6=97=B6=E5=90=88=E8=AE=A1=E8=A1=8C=E4=B8=8D=E8=83=BD=E6=A8=AA?= =?UTF-8?q?=E5=90=91=E6=BB=9A=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Table/src/hooks/useTableFooter.ts | 38 ++++++++++++------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/jeecgboot-vue3/src/components/Table/src/hooks/useTableFooter.ts b/jeecgboot-vue3/src/components/Table/src/hooks/useTableFooter.ts index 261998a7..bc19cd2d 100644 --- a/jeecgboot-vue3/src/components/Table/src/hooks/useTableFooter.ts +++ b/jeecgboot-vue3/src/components/Table/src/hooks/useTableFooter.ts @@ -38,24 +38,34 @@ export function useTableFooter( }); function handleSummary() { - const { showSummary } = unref(propsRef); + const { showSummary, canResize } = unref(propsRef); if (!showSummary || unref(getIsEmptyData)) return; - nextTick(() => { const tableEl = unref(tableElRef); if (!tableEl) return; - const bodyDom = tableEl.$el.querySelector('.ant-table-content'); - useEventListener({ - el: bodyDom, - name: 'scroll', - listener: () => { - const footerBodyDom = tableEl.$el.querySelector('.ant-table-footer .ant-table-content') as HTMLDivElement; - if (!footerBodyDom || !bodyDom) return; - footerBodyDom.scrollLeft = bodyDom.scrollLeft; - }, - wait: 0, - options: true, - }); + let bodyDom; + // update-begin--author:liaozhiyang---date:20241111---for:【issues/7422】BasicTable列表canResize属性为true时合计行不能横向滚动 + if (canResize) { + setTimeout(() => { + bodyDom = tableEl.$el.querySelector('.ant-table-body'); + }, 0); + } else { + bodyDom = tableEl.$el.querySelector('.ant-table-content'); + } + setTimeout(() => { + useEventListener({ + el: bodyDom, + name: 'scroll', + listener: () => { + const footerBodyDom = tableEl.$el.querySelector('.ant-table-footer .ant-table-content') as HTMLDivElement; + if (!footerBodyDom || !bodyDom) return; + footerBodyDom.scrollLeft = bodyDom.scrollLeft; + }, + wait: 0, + options: true, + }); + }, 0); + // update-end--author:liaozhiyang---date:20241111---for:【issues/7422】BasicTable列表canResize属性为true时合计行不能横向滚动 }); } return { getFooterProps };