This commit is contained in:
yanran200730
2023-04-26 09:52:41 +08:00
parent fff9891177
commit 30b25e56b8
3 changed files with 30 additions and 8 deletions

View File

@@ -56,7 +56,8 @@ export default {
timer: null,
v: `AiDvMap-${new Date().getTime()}`,
chart: null,
isShowInfo: false
isShowInfo: false,
geoJSON: require('../geoJSon/qxnGeoJSON.json')
}
},
directives: {
@@ -100,9 +101,9 @@ export default {
initChart() {
this.chart = echarts.init(document.querySelector(`.${this.v}`))
this.getData().then(res => {
if (res.code === 0) {
echarts.registerMap('黔西南', res.data)
// this.getData().then(res => {
// if (res.code === 0) {
echarts.registerMap('黔西南', this.geoJSON)
let option = {
geo: [
@@ -275,8 +276,7 @@ export default {
this.chart.on('click', e => {
this.isShowInfo = true
})
}
})
// })
},
convertData(data) {
@@ -299,7 +299,9 @@ export default {
},
getData() {
return http.post(`/app/appdvcpconfig/apiForward?url=${encodeURIComponent(`https://geo.datav.aliyun.com/areas_v3/bound/geojson?code=522300_full`)}`,)
return http.post(`/app/appdvcpconfig/apiForward?url=${encodeURIComponent(`https://geo.datav.aliyun.com/areas_v3/bound/geojson?code=522300_full`)}`, null, {
})
}
}
}