CN-268 feat: panel重构--地图
This commit is contained in:
@@ -166,7 +166,7 @@ export default {
|
||||
...this.entity,
|
||||
...extraParams
|
||||
}
|
||||
const requestUrl = url || chartParams.url
|
||||
const requestUrl = url || (chartParams && chartParams.url)
|
||||
if (requestUrl) {
|
||||
get(replaceUrlPlaceholder(requestUrl, this.queryParams)).then(response => {
|
||||
if (response.code === 200) {
|
||||
@@ -177,11 +177,14 @@ export default {
|
||||
this.noData = true
|
||||
this.errorInfo = response.msg || response.message || 'Unknown'
|
||||
}
|
||||
}).finally(() => {
|
||||
setTimeout(() => {
|
||||
this.loading = false
|
||||
}, 200)
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
} finally {
|
||||
setTimeout(() => {
|
||||
this.loading = false
|
||||
}, 200)
|
||||
|
||||
@@ -308,15 +308,9 @@ export default {
|
||||
]
|
||||
`)*/
|
||||
const tempList = n.map(item => {
|
||||
let params = {}
|
||||
const height = item.h
|
||||
if (item.params) {
|
||||
try {
|
||||
params = JSON.parse(item.params)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
params.showHeader = true
|
||||
item.params.showHeader = true
|
||||
}
|
||||
return {
|
||||
...item,
|
||||
@@ -325,7 +319,7 @@ export default {
|
||||
h: height,
|
||||
x: item.x || 0,
|
||||
y: item.y || 0,
|
||||
params,
|
||||
params: item.params,
|
||||
category: getTypeCategory(item.type) // 类别,是echarts还是map等等
|
||||
}
|
||||
})
|
||||
|
||||
@@ -115,7 +115,9 @@ export default {
|
||||
}
|
||||
},
|
||||
loadAm4ChartMap (polygonSeries, country, chartData) {
|
||||
if (chartData) {
|
||||
this.$emit('showLoading', true)
|
||||
}
|
||||
try {
|
||||
// 清除数据
|
||||
polygonSeries.data.splice(0)
|
||||
@@ -187,10 +189,12 @@ export default {
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
} finally {
|
||||
if (chartData) {
|
||||
setTimeout(() => {
|
||||
this.$emit('showLoading', false)
|
||||
}, 200)
|
||||
}
|
||||
}
|
||||
},
|
||||
loadLeafletMap () {
|
||||
this.$emit('showLoading', true)
|
||||
@@ -250,8 +254,13 @@ export default {
|
||||
return { key, labelText }
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
watch: {
|
||||
chartData: {
|
||||
deep: true,
|
||||
handler (n) {
|
||||
this.initMap(`chart${this.chartInfo.id}`)
|
||||
}
|
||||
}
|
||||
},
|
||||
setup (props) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user