From 17afa6d1008c74b7f405c19983687e6e7607c9bd Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Wed, 16 Oct 2024 13:52:30 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=B8=96=E7=95=8C=E5=9C=B0=E5=9B=BE=E6=8F=90=E7=A4=BA=E8=BD=AE?= =?UTF-8?q?=E6=92=AD=E6=95=B0=E6=8D=AE=E7=BC=BA=E5=A4=B1=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20#12679?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/panel/charts/map/tooltip-carousel.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/map/tooltip-carousel.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/map/tooltip-carousel.ts index 598d34f090..656c361480 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/map/tooltip-carousel.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/map/tooltip-carousel.ts @@ -9,9 +9,16 @@ import { deepCopy } from '@/utils/utils' export const configCarouselTooltip = (chart, view, data, scene) => { if (['bubble-map', 'map'].includes(chart.type)) { data = view.source.data.dataArray - ?.filter(i => i.value) + ?.filter(i => i.dimensionList?.length > 0) .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) } return acc