lw-cdp-ui 1.4.5 → 1.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/lwBiChart/map/index.js +6 -10
- package/dist/lw-cdp-ui.esm.js +3 -2
- package/dist/lw-cdp-ui.umd.js +13 -13
- package/package.json +1 -1
- package/dist/components/lwBiChart/map/anhui.json +0 -1
- package/dist/components/lwBiChart/map/aomen.json +0 -1
- package/dist/components/lwBiChart/map/beijing.json +0 -1
- package/dist/components/lwBiChart/map/china-cities.json +0 -1
- package/dist/components/lwBiChart/map/china-contour.json +0 -1
- package/dist/components/lwBiChart/map/china.json +0 -1
- package/dist/components/lwBiChart/map/chongqing.json +0 -1
- package/dist/components/lwBiChart/map/fujian.json +0 -1
- package/dist/components/lwBiChart/map/gansu.json +0 -1
- package/dist/components/lwBiChart/map/guangdong.json +0 -1
- package/dist/components/lwBiChart/map/guangxi.json +0 -1
- package/dist/components/lwBiChart/map/guizhou.json +0 -1
- package/dist/components/lwBiChart/map/hainan.json +0 -1
- package/dist/components/lwBiChart/map/hebei.json +0 -1
- package/dist/components/lwBiChart/map/heilongjiang.json +0 -1
- package/dist/components/lwBiChart/map/henan.json +0 -1
- package/dist/components/lwBiChart/map/hubei.json +0 -1
- package/dist/components/lwBiChart/map/hunan.json +0 -1
- package/dist/components/lwBiChart/map/jiangsu.json +0 -1
- package/dist/components/lwBiChart/map/jiangxi.json +0 -1
- package/dist/components/lwBiChart/map/jilin.json +0 -1
- package/dist/components/lwBiChart/map/liaoning.json +0 -1
- package/dist/components/lwBiChart/map/neimenggu.json +0 -1
- package/dist/components/lwBiChart/map/ningxia.json +0 -1
- package/dist/components/lwBiChart/map/qinghai.json +0 -1
- package/dist/components/lwBiChart/map/shandong.json +0 -1
- package/dist/components/lwBiChart/map/shanghai.json +0 -1
- package/dist/components/lwBiChart/map/shanxi.json +0 -1
- package/dist/components/lwBiChart/map/sichuan.json +0 -1
- package/dist/components/lwBiChart/map/taiwan.json +0 -1
- package/dist/components/lwBiChart/map/tianjin.json +0 -1
- package/dist/components/lwBiChart/map/world.json +0 -1
- package/dist/components/lwBiChart/map/xianggang.json +0 -1
- package/dist/components/lwBiChart/map/xinjiang.json +0 -1
- package/dist/components/lwBiChart/map/xizang.json +0 -1
- package/dist/components/lwBiChart/map/yunnan.json +0 -1
- package/dist/components/lwBiChart/map/zhejiang.json +0 -1
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
* 动态加载地图JSON数据
|
|
3
|
-
* @param {string} area 地区名称,如'china', 'beijing'等
|
|
4
|
-
* @returns {Promise<Object>} 地图数据
|
|
5
|
-
*/
|
|
1
|
+
// 将 JSON 文件放入 项目 /public/map/ 目录
|
|
6
2
|
export async function getMapData(area) {
|
|
7
3
|
try {
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
return
|
|
4
|
+
const url = new URL(`/map/${area}.json`, import.meta.url).href
|
|
5
|
+
const response = await fetch(url)
|
|
6
|
+
return await response.json()
|
|
11
7
|
} catch (error) {
|
|
12
|
-
console.error(
|
|
13
|
-
throw new Error(`无法加载 ${area}
|
|
8
|
+
console.error(`加载失败: ${area}`, error)
|
|
9
|
+
throw new Error(`无法加载 ${area} 数据`)
|
|
14
10
|
}
|
|
15
11
|
}
|
|
16
12
|
|
package/dist/lw-cdp-ui.esm.js
CHANGED
|
@@ -21277,9 +21277,10 @@ function pA(e, t, n, r, a, o) {
|
|
|
21277
21277
|
const Zc = /* @__PURE__ */ ae(fA, [["render", pA], ["__scopeId", "data-v-88abf5da"]]);
|
|
21278
21278
|
async function gA(e) {
|
|
21279
21279
|
try {
|
|
21280
|
-
|
|
21280
|
+
const t = new URL((/* @__PURE__ */ Object.assign({}))[`/map/${e}.json`], import.meta.url).href;
|
|
21281
|
+
return await (await fetch(t)).json();
|
|
21281
21282
|
} catch (t) {
|
|
21282
|
-
throw console.error(
|
|
21283
|
+
throw console.error(`加载失败: ${e}`, t), new Error(`无法加载 ${e} 数据`);
|
|
21283
21284
|
}
|
|
21284
21285
|
}
|
|
21285
21286
|
const mA = {
|