fix: 增加下钻方法返回值

This commit is contained in:
fit2cloud-chenyw 2021-08-16 11:03:13 +08:00
parent 6b1abd07f8
commit 10a4b2cefa
2 changed files with 8 additions and 2 deletions

View File

@ -166,24 +166,28 @@ export default {
this.myEcharts(chart_option)
},
registerDynamicMap(areaCode) {
this.downOrUp = true
if (this.$store.getters.geoMap[areaCode]) {
this.downOrUp = true
const json = this.$store.getters.geoMap[areaCode]
this.$echarts.registerMap('MAP', json)
console.log('开始切换地图:' + areaCode)
return
}
geoJson(areaCode).then(res => {
this.downOrUp = true
this.$echarts.registerMap('MAP', res)
console.log('开始切换地图:' + areaCode)
this.$store.dispatch('map/setGeo', {
key: areaCode,
value: res
})
}).catch(() => {
this.downOrUp = true
})
},
initMapChart(geoJson, chart) {
if (!this.$echarts.getMap('MAP') || !this.downOrUp) {
console.log('开始初始化地图:')
this.$echarts.registerMap('MAP', geoJson)
}
// this.$echarts.getMap('MAP') || this.$echarts.registerMap('MAP', geoJson)

View File

@ -1457,9 +1457,11 @@ export default {
const currentNode = this.findEntityByCode(aCode || this.view.customAttr.areaCode, this.places)
if (currentNode && currentNode.children && currentNode.children.length > 0) {
const nextNode = currentNode.children.find(item => item.name === name)
if (!nextNode || !nextNode.code) return null
// this.view.customAttr.areaCode = nextNode.code
this.currentAcreaNode = nextNode
this.$refs.dynamicChart && this.$refs.dynamicChart.registerDynamicMap && this.$refs.dynamicChart.registerDynamicMap(nextNode.code)
return nextNode
}
},
// areaCode