From acd4f16ec911aa9f3756546a2ccb38641e359c3c Mon Sep 17 00:00:00 2001 From: jiangkai Date: Thu, 31 Jul 2025 12:21:01 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9C=B0=E5=9B=BE):=20=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BC=96=E8=BE=91=E5=9B=9E=E6=98=BE=E9=94=99?= =?UTF-8?q?=E8=AF=AF=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Charts/Maps/MapBase/index.vue | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/packages/components/Charts/Maps/MapBase/index.vue b/src/packages/components/Charts/Maps/MapBase/index.vue index 30473bf8..035fc776 100644 --- a/src/packages/components/Charts/Maps/MapBase/index.vue +++ b/src/packages/components/Charts/Maps/MapBase/index.vue @@ -116,19 +116,31 @@ const vEchartsSetOption = () => { // 更新数据处理 const dataSetHandle = async (dataset: any) => { props.chartConfig.option.series.forEach((item: any) => { - if (item.type === 'effectScatter' && dataset.point) item.data = dataset.point - else if (item.type === 'lines' && dataset.line) { - item.data = dataset.line.map((it: any) => { - return { - ...it, - lineStyle: { - color: props.chartConfig.option.series[2].lineStyle.normal.color + if (item.type === 'effectScatter') { + item.data = dataset.point || [] + } else if (item.type === 'lines') { + if (dataset.line) { + item.data = dataset.line.map((it: any) => { + return { + ...it, + lineStyle: { + color: props.chartConfig.option.series[2].lineStyle.normal.color + } } - } - }) - } else if (item.type === 'map' && dataset.map) item.data = dataset.map + }) + } else { + item.data = [] + } + } else if (item.type === 'map') { + item.data = dataset.map || [] + } }) - if (dataset.pieces) props.chartConfig.option.visualMap.pieces = dataset.pieces + if (dataset.pieces){ + props.chartConfig.option.visualMap.show = true + props.chartConfig.option.visualMap.pieces = dataset.pieces + }else { + props.chartConfig.option.visualMap.show = false + } isPreview() && vEchartsSetOption() }