From df17b4b6f1abbde5cdde22b008b3352156dd7d8e Mon Sep 17 00:00:00 2001 From: zhangdaiscott Date: Sat, 4 Nov 2023 17:39:04 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90issues/638=E3=80=91=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E5=90=88=E8=AE=A1=EF=BC=8C=E5=88=97=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E6=88=96=E5=B1=95=E7=A4=BA=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=90=88=E8=AE=A1=E6=A0=8F=E4=BC=9A=E9=94=99=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Table/src/components/TableFooter.vue | 5 ++++- src/components/Table/src/hooks/useColumns.ts | 3 --- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Table/src/components/TableFooter.vue b/src/components/Table/src/components/TableFooter.vue index 5d23ef9..c2b08c9 100644 --- a/src/components/Table/src/components/TableFooter.vue +++ b/src/components/Table/src/components/TableFooter.vue @@ -67,7 +67,10 @@ const getColumns = computed(() => { const dataSource = unref(getDataSource); - const columns: BasicColumn[] = cloneDeep(table.getColumns()); + let columns: BasicColumn[] = cloneDeep(table.getColumns()); + // update-begin--author:liaozhiyang---date:220230804---for:【issues/638】表格合计,列自定义隐藏或展示时,合计栏会错位 + columns = columns.filter((item) => !item.defaultHidden); + // update-begin--author:liaozhiyang---date:220230804---for:【issues/638】表格合计,列自定义隐藏或展示时,合计栏会错位 const index = columns.findIndex((item) => item.flag === INDEX_COLUMN_FLAG); const hasRowSummary = dataSource.some((item) => Reflect.has(item, SUMMARY_ROW_KEY)); const hasIndexSummary = dataSource.some((item) => Reflect.has(item, SUMMARY_INDEX_KEY)); diff --git a/src/components/Table/src/hooks/useColumns.ts b/src/components/Table/src/hooks/useColumns.ts index 5fb856e..5ca08e6 100644 --- a/src/components/Table/src/hooks/useColumns.ts +++ b/src/components/Table/src/hooks/useColumns.ts @@ -277,9 +277,6 @@ export function useColumns( columns = columns.filter((item) => item.key !== CUS_SEL_COLUMN_KEY); // update-enb--author:sunjianlei---date:220230630---for:【QQYUN-5571】自封装选择列,解决数据行选择卡顿问题 - // update-begin--author:liaozhiyang---date:220230804---for:【issues/638】表格合计,列自定义隐藏或展示时,合计栏会错位 - columns = columns.filter((item) => !item.defaultHidden); - // update-begin--author:liaozhiyang---date:220230804---for:【issues/638】表格合计,列自定义隐藏或展示时,合计栏会错位 if (sort) { columns = sortFixedColumn(columns); }