mirror of
https://gitee.com/dromara/go-view.git
synced 2025-04-06 03:58:04 +08:00
!133 解决adcode类型不正确可能导致的问题
Merge pull request !133 from wallellen/master-fetch-dev
This commit is contained in:
parent
00a4c752ed
commit
a626f64e57
@ -59,13 +59,14 @@ const getGeojson = (regionId: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//异步时先注册空的 保证初始化不报错
|
//异步时先注册空的 保证初始化不报错
|
||||||
registerMap(props.chartConfig.option.mapRegion.adcode, { geoJSON: {} as any, specialAreas: {} })
|
registerMap(`${props.chartConfig.option.mapRegion.adcode}`, { geoJSON: {} as any, specialAreas: {} })
|
||||||
|
|
||||||
// 进行更换初始化地图 如果为china 单独处理
|
// 进行更换初始化地图 如果为china 单独处理
|
||||||
const registerMapInitAsync = async () => {
|
const registerMapInitAsync = async () => {
|
||||||
await nextTick()
|
await nextTick()
|
||||||
if (props.chartConfig.option.mapRegion.adcode != 'china') {
|
const adCode = `${props.chartConfig.option.mapRegion.adcode}`;
|
||||||
await getGeojson(props.chartConfig.option.mapRegion.adcode)
|
if (adCode !== 'china') {
|
||||||
|
await getGeojson(adCode)
|
||||||
} else {
|
} else {
|
||||||
await hainanLandsHandle(props.chartConfig.option.mapRegion.showHainanIsLands)
|
await hainanLandsHandle(props.chartConfig.option.mapRegion.showHainanIsLands)
|
||||||
}
|
}
|
||||||
@ -127,7 +128,7 @@ watch(
|
|||||||
|
|
||||||
//监听地图展示区域发生变化
|
//监听地图展示区域发生变化
|
||||||
watch(
|
watch(
|
||||||
() => props.chartConfig.option.mapRegion.adcode,
|
() => `${props.chartConfig.option.mapRegion.adcode}`,
|
||||||
async newData => {
|
async newData => {
|
||||||
try {
|
try {
|
||||||
await getGeojson(newData)
|
await getGeojson(newData)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user