fix(图表): 修复世界地图提示轮播数据缺失的问题 #12679

This commit is contained in:
jianneng-fit2cloud 2024-10-16 13:52:30 +08:00
parent c4fd3ee095
commit 17afa6d100

View File

@ -9,9 +9,16 @@ import { deepCopy } from '@/utils/utils'
export const configCarouselTooltip = (chart, view, data, scene) => { export const configCarouselTooltip = (chart, view, data, scene) => {
if (['bubble-map', 'map'].includes(chart.type)) { if (['bubble-map', 'map'].includes(chart.type)) {
data = view.source.data.dataArray data = view.source.data.dataArray
?.filter(i => i.value) ?.filter(i => i.dimensionList?.length > 0)
.reduce((acc, current) => { .reduce((acc, current) => {
if (!acc.some(obj => obj.adcode === current.adcode)) { const existingItem = acc.find(obj => {
if (obj.abbrev === 'China') {
return obj.adcode === current.adcode
} else {
return obj.abbrev === current.abbrev
}
})
if (!existingItem) {
acc.push(current) acc.push(current)
} }
return acc return acc