refactor(图表): 明细表表头未设置分组不显示已设置 (#15326)

This commit is contained in:
wisonic-s
2025-03-12 18:30:39 +08:00
committed by GitHub
parent 2dc2c89981
commit d76d27999e
3 changed files with 6 additions and 2 deletions

View File

@@ -1312,4 +1312,4 @@ declare interface ColumnNode {
children?: Columns
}
declare type Columns = Array<string | ColumnNode>
declare type Columns = Array<ColumnNode>

View File

@@ -74,7 +74,7 @@ const init = () => {
}
if (headerGroupConfig?.columns?.length) {
const allAxis = showColumns.map(item => item.key)
const leafNodes = getLeafNodes(headerGroupConfig.columns as Array<ColumnNode>)
const leafNodes = getLeafNodes(headerGroupConfig.columns)
const leafKeys = leafNodes.map(item => item.key)
if (!isEqual(allAxis, leafKeys)) {
const { columns, meta } = headerGroupConfig

View File

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