From d76d27999ea82e1680e1139f16a10c396d90ae5b Mon Sep 17 00:00:00 2001 From: wisonic-s <51065359+wisonic-s@users.noreply.github.com> Date: Wed, 12 Mar 2025 18:30:39 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=9B=BE=E8=A1=A8):=20=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E8=A1=A8=E8=A1=A8=E5=A4=B4=E6=9C=AA=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=88=86=E7=BB=84=E4=B8=8D=E6=98=BE=E7=A4=BA=E5=B7=B2=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=20(#15326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/models/chart/chart-attr.d.ts | 2 +- .../editor-style/components/table/TableHeaderGroupConfig.vue | 2 +- .../editor-style/components/table/TableHeaderSelector.vue | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/core-frontend/src/models/chart/chart-attr.d.ts b/core/core-frontend/src/models/chart/chart-attr.d.ts index a796d99c6f..1aed43cc1f 100644 --- a/core/core-frontend/src/models/chart/chart-attr.d.ts +++ b/core/core-frontend/src/models/chart/chart-attr.d.ts @@ -1312,4 +1312,4 @@ declare interface ColumnNode { children?: Columns } -declare type Columns = Array +declare type Columns = Array diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableHeaderGroupConfig.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableHeaderGroupConfig.vue index 463760610b..f7dd3b1fdd 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableHeaderGroupConfig.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableHeaderGroupConfig.vue @@ -74,7 +74,7 @@ const init = () => { } if (headerGroupConfig?.columns?.length) { const allAxis = showColumns.map(item => item.key) - const leafNodes = getLeafNodes(headerGroupConfig.columns as Array) + const leafNodes = getLeafNodes(headerGroupConfig.columns) const leafKeys = leafNodes.map(item => item.key) if (!isEqual(allAxis, leafKeys)) { const { columns, meta } = headerGroupConfig diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableHeaderSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableHeaderSelector.vue index 46bab59e39..c8d0c4d99e 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableHeaderSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableHeaderSelector.vue @@ -92,6 +92,10 @@ const groupConfigValid = computed(() => { if (!columns?.length) { return false } + const noGroup = columns.every(item => !item.children?.length) + if (noGroup) { + return false + } const xAxis = props.chart.xAxis const showColumns = [] xAxis?.forEach(axis => {