Skip to content

Commit

Permalink
【issues/7422】BasicTable列表canResize属性为true时合计行不能横向滚动
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangdaiscott committed Nov 12, 2024
1 parent b5b6670 commit b16fdef
Showing 1 changed file with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions jeecgboot-vue3/src/components/Table/src/hooks/useTableFooter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down

0 comments on commit b16fdef

Please sign in to comment.