fix(图表): 修复对称条形图联动无法正常显示的问题,以及特殊处理图表联动字段能够选择指标的问题

This commit is contained in:
jianneng-fit2cloud
2026-06-16 18:29:52 +08:00
parent dcbc0d09b2
commit d421a1fa3b

View File

@@ -354,22 +354,35 @@ const toggleSameDs = ref(true)
const toggleDiffDs = ref(true)
const LINKAGE_FIELD_PROPS = [
'xAxis',
'xAxisExt',
'extStack',
const LINKAGE_DIMENSION_FIELD_PROPS = ['xAxis', 'xAxisExt', 'extStack', 'drillFields']
const MULTI_SCATTER_LINKAGE_FIELD_PROPS = [
'extColor',
'xAxis',
'yAxis',
'yAxisExt',
'extBubble',
'yAxisExt',
'extLabel',
'extTooltip',
'drillFields'
'extTooltip'
]
const getLinkageFieldProps = chart => {
if (chart?.type === 'multi-scatter') {
return MULTI_SCATTER_LINKAGE_FIELD_PROPS
}
const props = [...LINKAGE_DIMENSION_FIELD_PROPS]
if (chart?.type?.includes('chart-mix')) {
props.push('extBubble')
}
if (['table-normal', 'indicator'].includes(chart?.type)) {
props.push('yAxis')
}
return props
}
const getDraggedFieldIds = chart => {
const ids = new Set<string>()
LINKAGE_FIELD_PROPS.forEach(prop => {
getLinkageFieldProps(chart).forEach(prop => {
const fields = chart?.[prop]
if (!Array.isArray(fields)) {
return