forked from github/dataease
fix: 增加下钻方法返回值
This commit is contained in:
parent
6b1abd07f8
commit
10a4b2cefa
@ -166,24 +166,28 @@ export default {
|
|||||||
this.myEcharts(chart_option)
|
this.myEcharts(chart_option)
|
||||||
},
|
},
|
||||||
registerDynamicMap(areaCode) {
|
registerDynamicMap(areaCode) {
|
||||||
if (this.$store.getters.geoMap[areaCode]) {
|
|
||||||
this.downOrUp = true
|
this.downOrUp = true
|
||||||
|
if (this.$store.getters.geoMap[areaCode]) {
|
||||||
const json = this.$store.getters.geoMap[areaCode]
|
const json = this.$store.getters.geoMap[areaCode]
|
||||||
this.$echarts.registerMap('MAP', json)
|
this.$echarts.registerMap('MAP', json)
|
||||||
|
console.log('开始切换地图:' + areaCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
geoJson(areaCode).then(res => {
|
geoJson(areaCode).then(res => {
|
||||||
this.downOrUp = true
|
|
||||||
this.$echarts.registerMap('MAP', res)
|
this.$echarts.registerMap('MAP', res)
|
||||||
|
console.log('开始切换地图:' + areaCode)
|
||||||
this.$store.dispatch('map/setGeo', {
|
this.$store.dispatch('map/setGeo', {
|
||||||
key: areaCode,
|
key: areaCode,
|
||||||
value: res
|
value: res
|
||||||
})
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
this.downOrUp = true
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
initMapChart(geoJson, chart) {
|
initMapChart(geoJson, chart) {
|
||||||
if (!this.$echarts.getMap('MAP') || !this.downOrUp) {
|
if (!this.$echarts.getMap('MAP') || !this.downOrUp) {
|
||||||
|
console.log('开始初始化地图:')
|
||||||
this.$echarts.registerMap('MAP', geoJson)
|
this.$echarts.registerMap('MAP', geoJson)
|
||||||
}
|
}
|
||||||
// this.$echarts.getMap('MAP') || this.$echarts.registerMap('MAP', geoJson)
|
// this.$echarts.getMap('MAP') || this.$echarts.registerMap('MAP', geoJson)
|
||||||
|
@ -1457,9 +1457,11 @@ export default {
|
|||||||
const currentNode = this.findEntityByCode(aCode || this.view.customAttr.areaCode, this.places)
|
const currentNode = this.findEntityByCode(aCode || this.view.customAttr.areaCode, this.places)
|
||||||
if (currentNode && currentNode.children && currentNode.children.length > 0) {
|
if (currentNode && currentNode.children && currentNode.children.length > 0) {
|
||||||
const nextNode = currentNode.children.find(item => item.name === name)
|
const nextNode = currentNode.children.find(item => item.name === name)
|
||||||
|
if (!nextNode || !nextNode.code) return null
|
||||||
// this.view.customAttr.areaCode = nextNode.code
|
// this.view.customAttr.areaCode = nextNode.code
|
||||||
this.currentAcreaNode = nextNode
|
this.currentAcreaNode = nextNode
|
||||||
this.$refs.dynamicChart && this.$refs.dynamicChart.registerDynamicMap && this.$refs.dynamicChart.registerDynamicMap(nextNode.code)
|
this.$refs.dynamicChart && this.$refs.dynamicChart.registerDynamicMap && this.$refs.dynamicChart.registerDynamicMap(nextNode.code)
|
||||||
|
return nextNode
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 根据地名获取areaCode
|
// 根据地名获取areaCode
|
||||||
|
Loading…
Reference in New Issue
Block a user