mirror of
https://github.com/dataease/dataease.git
synced 2026-05-15 13:32:18 +08:00
fix(图表): 修复双轴图联动前端报错的问题
This commit is contained in:
committed by
xuwei-fit2cloud
parent
7ce55aaf74
commit
6c333cecd2
@@ -187,16 +187,32 @@ const linkageActive = () => {
|
||||
})
|
||||
}
|
||||
const checkSelected = param => {
|
||||
// 当前图表是双轴图时
|
||||
const chartMixFieldIds = []
|
||||
if (view.value.type.includes('chart-mix')) {
|
||||
chartData.value?.left?.fields?.forEach(field => {
|
||||
if (!chartMixFieldIds.includes(field.id)) {
|
||||
chartMixFieldIds.push(field.id)
|
||||
}
|
||||
})
|
||||
chartData.value?.right?.fields?.forEach(field => {
|
||||
if (!chartMixFieldIds.includes(field.id)) {
|
||||
chartMixFieldIds.push(field.id)
|
||||
}
|
||||
})
|
||||
}
|
||||
// 获取当前视图的所有联动字段ID
|
||||
const mappingFieldIds = Array.from(
|
||||
new Set(
|
||||
chartData.value?.fields
|
||||
.map(item => item.id)
|
||||
.filter(id =>
|
||||
Object.keys(nowPanelTrackInfo.value).some(
|
||||
key => key.startsWith(view.value.id) && key.split('#')[1] === id
|
||||
)
|
||||
)
|
||||
chartMixFieldIds.length
|
||||
? chartMixFieldIds
|
||||
: chartData.value?.fields
|
||||
.map(item => item.id)
|
||||
.filter(id =>
|
||||
Object.keys(nowPanelTrackInfo.value).some(
|
||||
key => key.startsWith(view.value.id) && key.split('#')[1] === id
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
// 维度字段匹配
|
||||
|
||||
Reference in New Issue
Block a user