mirror of
https://github.com/dataease/dataease.git
synced 2026-06-16 20:42:07 +08:00
fix(图表): 修复对称条形图联动无法正常显示的问题,以及特殊处理图表联动字段能够选择指标的问题
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user