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 => {