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 | 126 | if (String(adcode).startsWith('15') && level === areaEnum.CITY) return |
| 127 | 127 | props.chartConfig.option.mapRegion.adcode = adcode |
| 128 | 128 | saveLevelStr.level = level |
| 129 | - handleDataPoint(adcode) | |
| 130 | 129 | saveHistoryParent.value.push({ |
| 131 | 130 | adcode: item.properties.parent.adcode, |
| 132 | 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 | 243 | const handleDataPoint = (newData: string | number) => { |
| 244 | 244 | if (newData === 'china') { |
| 245 | 245 | //全国则显示所有标点 |
| 246 | - props.chartConfig.option.dataset = dataMaps | |
| 246 | + props.chartConfig.option.series[1].data=dataMaps | |
| 247 | 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 | 290 | try { |
| 291 | 291 | props.chartConfig.option.series.forEach((item: Recordable) => { |
| 292 | 292 | if (item.type === 'map3D') { |
| 293 | + item.adcode = props.chartConfig.option.mapRegion.adcode | |
| 293 | 294 | item.data = newData |
| 294 | 295 | } |
| 295 | 296 | }) |
| ... | ... | @@ -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 | 307 | </script> | ... | ... |