修改云南曲靖项目

This commit is contained in:
guanj
2026-01-08 14:52:01 +08:00
parent 54517c0d5f
commit 6c3037f19b
20 changed files with 47 additions and 36 deletions

View File

@@ -7,7 +7,7 @@
</template>
<script setup lang="ts">
import { onBeforeUnmount, ref, watch, onMounted, defineEmits } from 'vue'
import { onBeforeUnmount, ref, watch, onMounted, } from 'vue'
import * as echarts from 'echarts'
import 'echarts-gl'
import 'echarts-liquidfill'
@@ -19,14 +19,22 @@ const myCharts = ref()
const showCircle = ref(false)
const fetchConfig = async (name: string) => {
const res = await import(`../../assets/map/${name.replace(/市$/, "")}.json`)
return res.default
try {
// 处理城市名称(去掉末尾的"市")并尝试导入对应文件
const res = await import(`../../assets/map/${name.replace(/市$/, '')}.json`)
return res.default
} catch (error) {
const chinaRes = await import(`../../assets/map/中国.json`) // 请确认中国文件的实际命名
return chinaRes.default
}
// const res = await import(`../../assets/map/${name.replace(/市$/, "")}.json`)
// return res.default
// GetEchar(res.default)
}
// fetchConfig()
const emit = defineEmits(['getRegionByRegion', 'eliminate', 'clickMap'])
onMounted(() => { })
onMounted(() => {})
const GetEchar = async (name: string) => {
let chartDom = document.getElementById('chartMap')