CN-1317 fix: 地图有时点击一次无法下钻,页面报错 “No detailed map yet”

This commit is contained in:
刘洪洪
2023-09-19 11:40:55 +08:00
parent f28c87dbd3
commit fc1aae3d2a

View File

@@ -348,7 +348,7 @@ export default {
return imageSeries return imageSeries
}, },
async drill (countryId) { async drill (countryId, num) {
if (countryId) { if (countryId) {
const targetMapObject = this.polygonSeries.getPolygonById(countryId) const targetMapObject = this.polygonSeries.getPolygonById(countryId)
targetMapObject.series.chart.zoomToMapObject(targetMapObject) targetMapObject.series.chart.zoomToMapObject(targetMapObject)
@@ -369,9 +369,13 @@ export default {
await this.$nextTick(() => { await this.$nextTick(() => {
this.loadAm4ChartMap(this.countrySeries, this.countryImageSeries) this.loadAm4ChartMap(this.countrySeries, this.countryImageSeries)
}) })
} else if (num < 2) {
// 多次测试最多2次查询不到数据
await this.drill(countryId, 0)
} else { } else {
this.$message.warning(this.$t('tip.noDetailMap')) this.$message.warning(this.$t('tip.noDetailMap'))
} }
num++
} }
} }
}, },