Commit d18fe193e3029df5002c4f22271cfab07619e92b
1 parent
0e74ac0d
feat(src/packages/): 修改3d地图点击下钻,不是此区域,标点还存在问题
Showing
1 changed file
with
6 additions
and
4 deletions
@@ -126,11 +126,11 @@ const handleMap3DClick = async (params: Recordable) => { | @@ -126,11 +126,11 @@ const handleMap3DClick = async (params: Recordable) => { | ||
126 | if (String(adcode).startsWith('15') && level === areaEnum.CITY) return | 126 | if (String(adcode).startsWith('15') && level === areaEnum.CITY) return |
127 | props.chartConfig.option.mapRegion.adcode = adcode | 127 | props.chartConfig.option.mapRegion.adcode = adcode |
128 | saveLevelStr.level = level | 128 | saveLevelStr.level = level |
129 | - handleDataPoint(adcode) | ||
130 | saveHistoryParent.value.push({ | 129 | saveHistoryParent.value.push({ |
131 | adcode: item.properties.parent.adcode, | 130 | adcode: item.properties.parent.adcode, |
132 | level: (regionMapParentArea as Recordable)[level] | 131 | level: (regionMapParentArea as Recordable)[level] |
133 | }) | 132 | }) |
133 | + handleDataPoint(adcode) | ||
134 | } | 134 | } |
135 | }) | 135 | }) |
136 | } | 136 | } |
@@ -243,10 +243,10 @@ const handleSetOption = (instance: any, option: Recordable) => { | @@ -243,10 +243,10 @@ const handleSetOption = (instance: any, option: Recordable) => { | ||
243 | const handleDataPoint = (newData: string | number) => { | 243 | const handleDataPoint = (newData: string | number) => { |
244 | if (newData === 'china') { | 244 | if (newData === 'china') { |
245 | //全国则显示所有标点 | 245 | //全国则显示所有标点 |
246 | - props.chartConfig.option.dataset = dataMaps | 246 | + props.chartConfig.option.series[1].data=dataMaps |
247 | } else { | 247 | } else { |
248 | //显示对应区域标点 | 248 | //显示对应区域标点 |
249 | - props.chartConfig.option.dataset = dataMaps.filter((item: dataPointI) => item.adcode === newData) | 249 | + props.chartConfig.option.series[1].data = dataMaps.filter((item: dataPointI) => item.adcode === newData) |
250 | } | 250 | } |
251 | } | 251 | } |
252 | 252 | ||
@@ -290,6 +290,7 @@ watch( | @@ -290,6 +290,7 @@ watch( | ||
290 | try { | 290 | try { |
291 | props.chartConfig.option.series.forEach((item: Recordable) => { | 291 | props.chartConfig.option.series.forEach((item: Recordable) => { |
292 | if (item.type === 'map3D') { | 292 | if (item.type === 'map3D') { |
293 | + item.adcode = props.chartConfig.option.mapRegion.adcode | ||
293 | item.data = newData | 294 | item.data = newData |
294 | } | 295 | } |
295 | }) | 296 | }) |
@@ -299,7 +300,8 @@ watch( | @@ -299,7 +300,8 @@ watch( | ||
299 | } | 300 | } |
300 | }, | 301 | }, |
301 | { | 302 | { |
302 | - deep: true | 303 | + deep: true, |
304 | + immediate: true | ||
303 | } | 305 | } |
304 | ) | 306 | ) |
305 | </script> | 307 | </script> |