feat: 调整地图

This commit is contained in:
huanghao1412 2024-07-08 16:51:25 +08:00
parent a041c6cd20
commit e6a18a6405

View File

@ -189,22 +189,22 @@ const registerMapInitAsync = async () => {
registerMapInitAsync() registerMapInitAsync()
const handleClickMap = (e: any) => { const handleClickMap = (e: any) => {
let obj = JSON.parse(customData.value.dataMap) let obj = dataMap.value as any
if(obj && JSON.stringify(obj) !== '{}') { if(obj && JSON.stringify(obj) !== '{}') {
let path = obj[e.name].skipPath let path = obj[e.name]?.skipPath
if(path) openWeb(path) if(path) openWeb(path)
} }
} }
// onMounted(() => { onMounted(() => {
// if(vChartRef.value) { if(vChartRef.value) {
// vChartRef.value.chart.on('click', 'series.map', handleClickMap) vChartRef.value.chart.on('click', 'series.map', handleClickMap)
// } }
// }) })
//
// onUnmounted(() => { onUnmounted(() => {
// if(vChartRef.value) vChartRef.value.chart.off('click', 'series.map', handleClickMap) if(vChartRef.value) vChartRef.value.chart.off('click', 'series.map', handleClickMap)
// }) })
const openWeb = (url: string) => { const openWeb = (url: string) => {
postMessageToParent({ postMessageToParent({