fix(图表): 修复从支持下钻的图表,下钻后切换图表到不支持下钻的图表时,下钻路径以及下钻字段不清空的问题

This commit is contained in:
jianneng-fit2cloud
2026-04-14 15:08:32 +08:00
committed by jianneng-fit2cloud
parent c17905a0db
commit e1ecdbd20a
2 changed files with 7 additions and 5 deletions

View File

@@ -1064,11 +1064,7 @@ const onTypeChange = (render, type) => {
emitter.emit('removeAxis', { axisType: 'yAxis', axis, editType: 'remove' })
}
}
if (
view.value.type === 'liquid' ||
view.value.type === 'gauge' ||
view.value.type === 'indicator'
) {
if (['liquid', 'gauge', 'indicator', 'multi-scatter', 't-heatmap'].includes(view.value.type)) {
removeItems('drillFields')
}
if (!['line', 'area', 'bar', 'bar-group'].includes(view.value.type)) {

View File

@@ -873,6 +873,12 @@ onMounted(() => {
chart.container =
'container-' + showPosition.value + '-' + view.value.id + '-' + suffixId.value
clearExtremum(chart)
// 切换到不支持下钻的图表类型时,清除下钻状态
const chartView = chartViewManager.getChartView(view.value.render, view.value.type)
if (chartView && !chartView.axis.includes('drill')) {
state.drillClickDimensionList = []
state.drillFilters = []
}
}
})
if (showPosition.value === 'viewDialog') {