@qxs-bns/components 0.0.56 → 0.0.57

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.
@@ -1,2 +1,2 @@
1
- var r="0.0.56";export{r as version};
1
+ var r="0.0.57";export{r as version};
2
2
  //# sourceMappingURL=package.json.mjs.map
@@ -1,2 +1,2 @@
1
- import{defineComponent as e,inject as a,ref as t,computed as r,createElementBlock as o,openBlock as n,createCommentVNode as s,createElementVNode as c}from"vue";import*as i from"echarts";import{getGeoJsonData as l}from"../utils/config.mjs";import{InjectionChartMerge as m}from"../utils/injectionKeys.mjs";import{useCharts as u}from"../utils/useCharts.mjs";const p={class:"data-chart-area-wrap"};var d=e({name:"DataChartArea",__name:"area",props:{chartOptions:{type:null,required:!0},chartData:{type:Object,required:!1,default:()=>({colDesc:[],xGroupByDesc:{colDesc:"",groupByDesc:"",groupByValues:[],xAxis:!1},groupByDesc:[],data:[],modelName:""})}},setup(e){const d=a(m,e=>e,!0);let h="中国";const f=t({features:[],type:"FeatureCollection"}),v=t(null),D=t(null),y=r(()=>{try{const{xGroupByDesc:a,groupByDesc:t,colDesc:r,modelName:o,data:n}=e.chartData,s=[];r.forEach(e=>{n.forEach(a=>{s.push(Number(a[e]))})});const c={title:{text:o},tooltip:{formatter(e){let a=`${e.name}<br/>`;return c.series?.forEach(t=>{t.data?.forEach(r=>{r.name===e.name&&(a+=`${t.name}:${r.value}</br>`)}),a.includes(t.name)||(a+=`${t.name}:-</br>`)}),a}},visualMap:{min:Math.min(...s,0),max:Math.max(...s,0)},series:r?.map(e=>{const r=[],o=t.find(e=>e.colDesc===("中国"===h?"医院所在省":"医院所在市")),s={};n.map(t=>{const r=t[("中国"===h?a?.colDesc||"":o?.colDesc)||""],n=f.value.features?.find(({properties:{name:e}})=>e?.includes(r));return{name:n?.properties?.name||"",value:Number(t[e])}}).forEach(e=>{s[e.name]?s[e.name]=s[e.name]+e.value:s[e.name]=e.value});for(const e in s)r.push({name:e,value:s[e]});return{name:e,type:"map",map:h,data:r}})};return d(c,e.chartOptions)}catch(e){return console.error("Error computing area chart options:",e),{title:{text:"地图加载失败"},series:[]}}});async function g(e="中国"){try{const a=await l({adcode:e});return a&&a.features&&0!==a.features.length?(f.value=a,h=e,void i.registerMap(e,a)):void console.error("Invalid GeoJSON data for:",e)}catch(a){if(console.error("Failed to register map for:",e,a),"中国"!==e)return console.log("Falling back to China map"),g("中国")}}return u({chartDOM:D,chartOptions:y,chartData:r(()=>e.chartData),initAfter:async function(a){v.value=a;try{await g(),a&&!a.isDisposed()&&(a.getZr()?.on("click",e=>{a?.showLoading(),e.target||"中国"===h||g("中国"),a.hideLoading()}),a.on("click",t=>{a?.showLoading();const r=e.chartData.groupByDesc?.some(e=>"医院所在市"===e.colDesc);"中国"===h&&r&&t.name&&g(t.name).then(()=>{a&&!a.isDisposed()&&a.setOption(y.value)}),a?.hideLoading()}))}catch(e){if(console.error("Failed to initialize map:",e),a&&!a.isDisposed())try{await g("中国")}catch(e){console.error("Failed to retry map registration:",e)}}}}),(e,a)=>(n(),o("div",p,[s(' <el-select\n v-if="isShowSelect"\n v-model="adcode"\n class="city-select"\n size="small"\n @change="selectChina"\n >\n <el-option\n v-for="item in selectList"\n :key="item.value"\n :label="item.label"\n :value="item.value"\n />\n </el-select> '),c("div",{ref_key:"dataChartArea",ref:D,class:"data-chart-area"},null,512)]))}});export{d as default};
1
+ import{defineComponent as e,inject as a,ref as t,computed as r,createElementBlock as o,openBlock as n,createCommentVNode as s,createElementVNode as c}from"vue";import*as i from"echarts";import{getGeoJsonData as l}from"../utils/config.mjs";import{InjectionChartMerge as m}from"../utils/injectionKeys.mjs";import{useCharts as u}from"../utils/useCharts.mjs";const p={class:"data-chart-area-wrap"};var d=e({name:"DataChartArea",__name:"area",props:{chartOptions:{type:null,required:!0},chartData:{type:Object,required:!1,default:()=>({colDesc:[],xGroupByDesc:{colDesc:"",groupByDesc:"",groupByValues:[],xAxis:!1},groupByDesc:[],data:[],modelName:""})}},setup(e){const d=a(m,e=>e,!0);let h="中国";const f=t({features:[],type:"FeatureCollection"}),D=t(null),v=t(null),y=r(()=>{try{const{xGroupByDesc:a,groupByDesc:t,colDesc:r,modelName:o,data:n}=e.chartData,s=[];r.forEach(e=>{n.forEach(a=>{s.push(Number(a[e]))})});const c={title:{text:o},tooltip:{formatter(e){let a=`${e.name}<br/>`;return c.series?.forEach(t=>{t.data?.forEach(r=>{r.name===e.name&&(a+=`${t.name}:${r.value}</br>`)}),a.includes(t.name)||(a+=`${t.name}:-</br>`)}),a}},visualMap:{min:Math.min(...s,0),max:Math.max(...s,0),text:["高","低"],realtime:!1,calculable:!0,inRange:{color:["#E8F4FD","#B8D4F7","#7BA4F0","#4A7BE8","#3562e1"]}},series:r?.map(e=>{const r=[],o=t.find(e=>e.colDesc===("中国"===h?"医院所在省":"医院所在市")),s={};n.map(t=>{const r=t[("中国"===h?a?.colDesc||"":o?.colDesc)||""],n=f.value.features?.find(({properties:{name:e}})=>e?.includes(r));return{name:n?.properties?.name||"",value:Number(t[e])}}).forEach(e=>{s[e.name]?s[e.name]=s[e.name]+e.value:s[e.name]=e.value});for(const e in s)r.push({name:e,value:s[e]});return{name:e,type:"map",map:h,data:r}})};return d(c,e.chartOptions)}catch(e){return console.error("Error computing area chart options:",e),{title:{text:"地图加载失败"},series:[]}}});async function g(e="中国"){try{const a=await l({adcode:e});return a&&a.features&&0!==a.features.length?(f.value=a,h=e,void i.registerMap(e,a)):void console.error("Invalid GeoJSON data for:",e)}catch(a){if(console.error("Failed to register map for:",e,a),"中国"!==e)return console.log("Falling back to China map"),g("中国")}}return u({chartDOM:v,chartOptions:y,chartData:r(()=>e.chartData),initAfter:async function(a){D.value=a;try{await g(),a&&!a.isDisposed()&&(a.getZr()?.on("click",e=>{a?.showLoading(),e.target||"中国"===h||g("中国"),a.hideLoading()}),a.on("click",t=>{a?.showLoading();const r=e.chartData.groupByDesc?.some(e=>"医院所在市"===e.colDesc);"中国"===h&&r&&t.name&&g(t.name).then(()=>{a&&!a.isDisposed()&&a.setOption(y.value)}),a?.hideLoading()}))}catch(e){if(console.error("Failed to initialize map:",e),a&&!a.isDisposed())try{await g("中国")}catch(e){console.error("Failed to retry map registration:",e)}}}}),(e,a)=>(n(),o("div",p,[s(' <el-select\n v-if="isShowSelect"\n v-model="adcode"\n class="city-select"\n size="small"\n @change="selectChina"\n >\n <el-option\n v-for="item in selectList"\n :key="item.value"\n :label="item.label"\n :value="item.value"\n />\n </el-select> '),c("div",{ref_key:"dataChartArea",ref:v,class:"data-chart-area"},null,512)]))}});export{d as default};
2
2
  //# sourceMappingURL=area.vue2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"area.vue2.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/area.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ECharts } from 'echarts/types/dist/echarts'\nimport type { EChartsOption, GeoJson, IFormatPublicData } from '../utils/types'\nimport * as echarts from 'echarts'\nimport { getGeoJsonData } from '../utils/config'\nimport { InjectionChartMerge } from '../utils/injectionKeys'\nimport { useCharts } from '../utils/useCharts'\n\ndefineOptions({\n name: 'DataChartArea',\n})\n\nconst {\n chartOptions,\n chartData = {\n colDesc: [],\n xGroupByDesc: {\n colDesc: '',\n groupByDesc: '',\n groupByValues: [],\n xAxis: false,\n },\n groupByDesc: [],\n data: [],\n modelName: '',\n },\n} = defineProps<{\n chartOptions: EChartsOption\n chartData?: IFormatPublicData\n}>()\n\nconst merge = inject(InjectionChartMerge, (v: any) => v, true)\n\nlet adcode = '中国'\nconst currentGeoJson = ref<GeoJson>({\n features: [],\n type: 'FeatureCollection',\n})\nconst myChart = ref<ECharts | null>(null)\nconst dataChartArea = ref(null)\n\nconst areaChartOptions = computed<EChartsOption>(() => {\n try {\n const { xGroupByDesc, groupByDesc, colDesc, modelName, data } = chartData\n const allNums: number[] = []\n colDesc.forEach((item) => {\n data.forEach((dataItem) => {\n allNums.push(Number(dataItem[item]))\n })\n })\n const config = {\n title: {\n text: modelName,\n },\n tooltip: {\n formatter(params: { name: string }) {\n let res = `${params.name}<br/>`\n config.series?.forEach((colDescItem) => {\n colDescItem.data?.forEach((item) => {\n if (item.name === params.name) {\n res += `${colDescItem.name}:${item.value}</br>`\n }\n })\n if (!res.includes(colDescItem.name)) {\n res += `${colDescItem.name}:-</br>`\n }\n })\n return res\n },\n },\n visualMap: {\n min: Math.min(...allNums, 0),\n max: Math.max(...allNums, 0),\n },\n series: colDesc?.map((colDescItem) => {\n const seriesData = []\n const row = groupByDesc.find(item => item.colDesc === (adcode === '中国' ? '医院所在省' : '医院所在市'))\n // 先用省份数据,如果没有再用市级数据\n const arr: {\n [key: string]: number\n } = {}\n data.map((item) => {\n const sourceName = item[(adcode === '中国' ? (xGroupByDesc?.colDesc || '') : row?.colDesc) || '']\n const find = currentGeoJson.value.features?.find(({ properties: { name } }: { properties: { name?: string } }) => name?.includes(sourceName as string))\n return {\n name: find?.properties?.name || '',\n value: Number(item[colDescItem]),\n }\n }).forEach((item) => {\n if (!arr[item.name]) {\n arr[item.name] = item.value\n }\n else {\n arr[item.name] = arr[item.name] + item.value\n }\n })\n for (const key in arr) {\n seriesData.push({\n name: key,\n value: arr[key],\n })\n }\n return {\n name: colDescItem,\n type: 'map',\n map: adcode,\n data: seriesData,\n }\n }),\n }\n\n return merge(config, chartOptions)\n }\n catch (error) {\n console.error('Error computing area chart options:', error)\n return {\n title: { text: '地图加载失败' },\n series: [],\n }\n }\n})\n\nasync function initAfter(mc: ECharts | null) {\n myChart.value = mc\n try {\n await registerMap()\n // 添加判断,确保图表实例存在且未被销毁\n if (mc && !mc.isDisposed()) {\n // charts 监听事件\n mc.getZr()?.on('click', (params: { target: HTMLElement }) => {\n mc?.showLoading()\n if (!params.target && adcode !== '中国') {\n registerMap('中国')\n }\n mc.hideLoading()\n })\n mc.on('click', (params: { name: string }) => {\n mc?.showLoading()\n const flag = chartData.groupByDesc?.some(item => item.colDesc === '医院所在市')\n if (adcode === '中国' && flag && params.name) {\n registerMap(params.name).then(() => {\n if (mc && !mc.isDisposed()) {\n mc.setOption(areaChartOptions.value)\n }\n })\n }\n mc?.hideLoading()\n })\n }\n }\n catch (error) {\n console.error('Failed to initialize map:', error)\n // 如果初始化失败,尝试重新注册地图\n if (mc && !mc.isDisposed()) {\n try {\n await registerMap('中国')\n }\n catch (retryError) {\n console.error('Failed to retry map registration:', retryError)\n }\n }\n }\n}\n\n// function selectChina() {\n// registerMap(adcode)\n// }\nasync function registerMap(keyword = '中国') {\n try {\n const geoJson = await getGeoJsonData({ adcode: keyword })\n if (!geoJson || !geoJson.features || geoJson.features.length === 0) {\n console.error('Invalid GeoJSON data for:', keyword)\n return\n }\n currentGeoJson.value = geoJson\n adcode = keyword\n\n echarts.registerMap(keyword, geoJson as any)\n return\n }\n catch (error) {\n console.error('Failed to register map for:', keyword, error)\n // 如果注册失败,尝试使用默认的中国地图数据\n if (keyword !== '中国') {\n console.log('Falling back to China map')\n return registerMap('中国')\n }\n }\n}\nuseCharts({\n chartDOM: dataChartArea,\n chartOptions: areaChartOptions,\n chartData: computed(() => chartData),\n initAfter\n})\n</script>\n\n<template>\n <div class=\"data-chart-area-wrap\">\n <!-- <el-select\n v-if=\"isShowSelect\"\n v-model=\"adcode\"\n class=\"city-select\"\n size=\"small\"\n @change=\"selectChina\"\n >\n <el-option\n v-for=\"item in selectList\"\n :key=\"item.value\"\n :label=\"item.label\"\n :value=\"item.value\"\n />\n </el-select> -->\n <div\n ref=\"dataChartArea\"\n class=\"data-chart-area\"\n />\n </div>\n</template>\n\n<style scoped lang=\"scss\">\n.data-chart-area-wrap {\n position: relative;\n\n .city-select {\n position: absolute;\n top: 10px;\n right: 100px;\n z-index: 1;\n width: 120px;\n }\n\n .data-chart-area {\n height: 100%;\n }\n}\n</style>\n"],"names":["merge","inject","InjectionChartMerge","v","adcode","currentGeoJson","ref","features","type","myChart","dataChartArea","areaChartOptions","computed","xGroupByDesc","groupByDesc","colDesc","modelName","data","__props","chartData","allNums","forEach","item","dataItem","push","Number","config","title","text","tooltip","formatter","params","res","name","series","colDescItem","value","includes","visualMap","min","Math","max","map","seriesData","row","find","arr","sourceName","properties","key","chartOptions","error","console","async","registerMap","keyword","geoJson","getGeoJsonData","length","echarts","log","useCharts","chartDOM","initAfter","mc","isDisposed","getZr","on","showLoading","target","hideLoading","flag","some","then","setOption","retryError","_openBlock","_createElementBlock","_hoisted_1","_createCommentVNode","_createElementVNode","class"],"mappings":"kpBA+BA,MAAMA,EAAQC,EAAOC,EAAsBC,GAAWA,GAAG,GAEzD,IAAIC,EAAS,KACb,MAAMC,EAAiBC,EAAa,CAClCC,SAAU,GACVC,KAAM,sBAEFC,EAAUH,EAAoB,MAC9BI,EAAgBJ,EAAI,MAEpBK,EAAmBC,EAAwB,KAC/C,IACE,MAAMC,aAAEA,EAAAC,YAAcA,EAAAC,QAAaA,YAASC,EAAAC,KAAWA,GAASC,EAAAC,UAC1DC,EAAoB,GAC1BL,EAAQM,QAASC,IACfL,EAAKI,QAASE,IACZH,EAAQI,KAAKC,OAAOF,EAASD,SAGjC,MAAMI,EAAS,CACbC,MAAO,CACLC,KAAMZ,GAERa,QAAS,CACP,SAAAC,CAAUC,GACR,IAAIC,EAAM,GAAGD,EAAOE,YAWpB,OAVAP,EAAOQ,QAAQb,QAASc,IACtBA,EAAYlB,MAAMI,QAASC,IACrBA,EAAKW,OAASF,EAAOE,OACvBD,GAAO,GAAGG,EAAYF,QAAQX,EAAKc,gBAGlCJ,EAAIK,SAASF,EAAYF,QAC5BD,GAAO,GAAGG,EAAYF,iBAGnBD,CACT,GAEFM,UAAW,CACTC,IAAKC,KAAKD,OAAOnB,EAAS,GAC1BqB,IAAKD,KAAKC,OAAOrB,EAAS,IAE5Bc,OAAQnB,GAAS2B,IAAKP,IACpB,MAAMQ,EAAa,GACbC,EAAM9B,EAAY+B,KAAKvB,GAAQA,EAAKP,WAAwB,OAAXX,EAAkB,QAAU,UAE7E0C,EAEF,CAAA,EACJ7B,EAAK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,GAAG,QAAUpC,IACvBiC,GAAII,cACCrC,EAAOsC,QAAqB,OAAXjE,GACpBkD,EAAY,MAEdU,EAAGM,gBAELN,EAAGG,GAAG,QAAUpC,IACdiC,GAAII,cACJ,MAAMG,EAAOrD,EAAAC,UAAUL,aAAa0D,KAAKlD,GAAyB,UAAjBA,EAAKP,SACvC,OAAXX,GAAmBmE,GAAQxC,EAAOE,MACpCqB,EAAYvB,EAAOE,MAAMwC,KAAK,KACxBT,IAAOA,EAAGC,cACZD,EAAGU,UAAU/D,EAAiByB,SAIpC4B,GAAIM,gBAGV,OACOnB,GAGL,GAFAC,QAAQD,MAAM,4BAA6BA,GAEvCa,IAAOA,EAAGC,aACZ,UACQX,EAAY,KACpB,OACOqB,GACLvB,QAAQD,MAAM,oCAAqCwB,EACrD,CAEJ,CACF,YAoCEC,IAAAC,EAmBM,MAnBNC,EAmBM,CAlBJC,EAAA,6TAcAC,EAGE,MAAA,SAFI,gBAAJ1E,IAAII,EACJuE,MAAM"}
1
+ {"version":3,"file":"area.vue2.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/area.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ECharts } from 'echarts/types/dist/echarts'\nimport type { EChartsOption, GeoJson, IFormatPublicData } from '../utils/types'\nimport * as echarts from 'echarts'\nimport { getGeoJsonData } from '../utils/config'\nimport { InjectionChartMerge } from '../utils/injectionKeys'\nimport { useCharts } from '../utils/useCharts'\n\ndefineOptions({\n name: 'DataChartArea',\n})\n\nconst {\n chartOptions,\n chartData = {\n colDesc: [],\n xGroupByDesc: {\n colDesc: '',\n groupByDesc: '',\n groupByValues: [],\n xAxis: false,\n },\n groupByDesc: [],\n data: [],\n modelName: '',\n },\n} = defineProps<{\n chartOptions: EChartsOption\n chartData?: IFormatPublicData\n}>()\n\nconst merge = inject(InjectionChartMerge, (v: any) => v, true)\n\nlet adcode = '中国'\nconst currentGeoJson = ref<GeoJson>({\n features: [],\n type: 'FeatureCollection',\n})\nconst myChart = ref<ECharts | null>(null)\nconst dataChartArea = ref(null)\n\nconst areaChartOptions = computed<EChartsOption>(() => {\n try {\n const { xGroupByDesc, groupByDesc, colDesc, modelName, data } = chartData\n const allNums: number[] = []\n colDesc.forEach((item) => {\n data.forEach((dataItem) => {\n allNums.push(Number(dataItem[item]))\n })\n })\n const config = {\n title: {\n text: modelName,\n },\n tooltip: {\n formatter(params: { name: string }) {\n let res = `${params.name}<br/>`\n config.series?.forEach((colDescItem) => {\n colDescItem.data?.forEach((item) => {\n if (item.name === params.name) {\n res += `${colDescItem.name}:${item.value}</br>`\n }\n })\n if (!res.includes(colDescItem.name)) {\n res += `${colDescItem.name}:-</br>`\n }\n })\n return res\n },\n },\n visualMap: {\n min: Math.min(...allNums, 0),\n max: Math.max(...allNums, 0),\n text: ['高', '低'],\n realtime: false,\n calculable: true,\n inRange: {\n color: ['#E8F4FD', '#B8D4F7', '#7BA4F0', '#4A7BE8', '#3562e1']\n },\n },\n series: colDesc?.map((colDescItem) => {\n const seriesData = []\n const row = groupByDesc.find(item => item.colDesc === (adcode === '中国' ? '医院所在省' : '医院所在市'))\n // 先用省份数据,如果没有再用市级数据\n const arr: {\n [key: string]: number\n } = {}\n data.map((item) => {\n const sourceName = item[(adcode === '中国' ? (xGroupByDesc?.colDesc || '') : row?.colDesc) || '']\n const find = currentGeoJson.value.features?.find(({ properties: { name } }: { properties: { name?: string } }) => name?.includes(sourceName as string))\n return {\n name: find?.properties?.name || '',\n value: Number(item[colDescItem]),\n }\n }).forEach((item) => {\n if (!arr[item.name]) {\n arr[item.name] = item.value\n }\n else {\n arr[item.name] = arr[item.name] + item.value\n }\n })\n for (const key in arr) {\n seriesData.push({\n name: key,\n value: arr[key],\n })\n }\n return {\n name: colDescItem,\n type: 'map',\n map: adcode,\n data: seriesData,\n }\n }),\n }\n\n return merge(config, chartOptions)\n }\n catch (error) {\n console.error('Error computing area chart options:', error)\n return {\n title: { text: '地图加载失败' },\n series: [],\n }\n }\n})\n\nasync function initAfter(mc: ECharts | null) {\n myChart.value = mc\n try {\n await registerMap()\n // 添加判断,确保图表实例存在且未被销毁\n if (mc && !mc.isDisposed()) {\n // charts 监听事件\n mc.getZr()?.on('click', (params: { target: HTMLElement }) => {\n mc?.showLoading()\n if (!params.target && adcode !== '中国') {\n registerMap('中国')\n }\n mc.hideLoading()\n })\n mc.on('click', (params: { name: string }) => {\n mc?.showLoading()\n const flag = chartData.groupByDesc?.some(item => item.colDesc === '医院所在市')\n if (adcode === '中国' && flag && params.name) {\n registerMap(params.name).then(() => {\n if (mc && !mc.isDisposed()) {\n mc.setOption(areaChartOptions.value)\n }\n })\n }\n mc?.hideLoading()\n })\n }\n }\n catch (error) {\n console.error('Failed to initialize map:', error)\n // 如果初始化失败,尝试重新注册地图\n if (mc && !mc.isDisposed()) {\n try {\n await registerMap('中国')\n }\n catch (retryError) {\n console.error('Failed to retry map registration:', retryError)\n }\n }\n }\n}\n\n// function selectChina() {\n// registerMap(adcode)\n// }\nasync function registerMap(keyword = '中国') {\n try {\n const geoJson = await getGeoJsonData({ adcode: keyword })\n if (!geoJson || !geoJson.features || geoJson.features.length === 0) {\n console.error('Invalid GeoJSON data for:', keyword)\n return\n }\n currentGeoJson.value = geoJson\n adcode = keyword\n\n echarts.registerMap(keyword, geoJson as any)\n return\n }\n catch (error) {\n console.error('Failed to register map for:', keyword, error)\n // 如果注册失败,尝试使用默认的中国地图数据\n if (keyword !== '中国') {\n console.log('Falling back to China map')\n return registerMap('中国')\n }\n }\n}\nuseCharts({\n chartDOM: dataChartArea,\n chartOptions: areaChartOptions,\n chartData: computed(() => chartData),\n initAfter\n})\n</script>\n\n<template>\n <div class=\"data-chart-area-wrap\">\n <!-- <el-select\n v-if=\"isShowSelect\"\n v-model=\"adcode\"\n class=\"city-select\"\n size=\"small\"\n @change=\"selectChina\"\n >\n <el-option\n v-for=\"item in selectList\"\n :key=\"item.value\"\n :label=\"item.label\"\n :value=\"item.value\"\n />\n </el-select> -->\n <div\n ref=\"dataChartArea\"\n class=\"data-chart-area\"\n />\n </div>\n</template>\n\n<style scoped lang=\"scss\">\n.data-chart-area-wrap {\n position: relative;\n\n .city-select {\n position: absolute;\n top: 10px;\n right: 100px;\n z-index: 1;\n width: 120px;\n }\n\n .data-chart-area {\n height: 100%;\n }\n}\n</style>\n"],"names":["merge","inject","InjectionChartMerge","v","adcode","currentGeoJson","ref","features","type","myChart","dataChartArea","areaChartOptions","computed","xGroupByDesc","groupByDesc","colDesc","modelName","data","__props","chartData","allNums","forEach","item","dataItem","push","Number","config","title","text","tooltip","formatter","params","res","name","series","colDescItem","value","includes","visualMap","min","Math","max","realtime","calculable","inRange","color","map","seriesData","row","find","arr","sourceName","properties","key","chartOptions","error","console","async","registerMap","keyword","geoJson","getGeoJsonData","length","echarts","log","useCharts","chartDOM","initAfter","mc","isDisposed","getZr","on","showLoading","target","hideLoading","flag","some","then","setOption","retryError","_openBlock","_createElementBlock","_hoisted_1","_createCommentVNode","_createElementVNode","class"],"mappings":"kpBA+BA,MAAMA,EAAQC,EAAOC,EAAsBC,GAAWA,GAAG,GAEzD,IAAIC,EAAS,KACb,MAAMC,EAAiBC,EAAa,CAClCC,SAAU,GACVC,KAAM,sBAEFC,EAAUH,EAAoB,MAC9BI,EAAgBJ,EAAI,MAEpBK,EAAmBC,EAAwB,KAC/C,IACE,MAAMC,aAAEA,EAAAC,YAAcA,EAAAC,QAAaA,YAASC,EAAAC,KAAWA,GAASC,EAAAC,UAC1DC,EAAoB,GAC1BL,EAAQM,QAASC,IACfL,EAAKI,QAASE,IACZH,EAAQI,KAAKC,OAAOF,EAASD,SAGjC,MAAMI,EAAS,CACbC,MAAO,CACLC,KAAMZ,GAERa,QAAS,CACP,SAAAC,CAAUC,GACR,IAAIC,EAAM,GAAGD,EAAOE,YAWpB,OAVAP,EAAOQ,QAAQb,QAASc,IACtBA,EAAYlB,MAAMI,QAASC,IACrBA,EAAKW,OAASF,EAAOE,OACvBD,GAAO,GAAGG,EAAYF,QAAQX,EAAK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AAwC,IAA5BqD,EAAQrD,SAASuD,QAItDzD,EAAe+B,MAAQwB,EACvBxD,EAASuD,OAETI,EAAQL,YAAYC,EAASC,SAN3BJ,QAAQD,MAAM,4BAA6BI,EAQ/C,OACOJ,GAGL,GAFAC,QAAQD,MAAM,8BAA+BI,EAASJ,GAEtC,OAAZI,EAEF,OADAH,QAAQQ,IAAI,6BACLN,EAAY,KAEvB,CACF,QACAO,EAAU,CACRC,SAAUxD,EACV4C,aAAc3C,EACdQ,UAAWP,EAAS,IAAMM,EAAAC,WAC1BgD,UAvEFV,eAAyBW,GACvB3D,EAAQ2B,MAAQgC,EAChB,UACQV,IAEFU,IAAOA,EAAGC,eAEZD,EAAGE,SAASC,GAAG,QAAUxC,IACvBqC,GAAII,cACCzC,EAAO0C,QAAqB,OAAXrE,GACpBsD,EAAY,MAEdU,EAAGM,gBAELN,EAAGG,GAAG,QAAUxC,IACdqC,GAAII,cACJ,MAAMG,EAAOzD,EAAAC,UAAUL,aAAa8D,KAAKtD,GAAyB,UAAjBA,EAAKP,SACvC,OAAXX,GAAmBuE,GAAQ5C,EAAOE,MACpCyB,EAAY3B,EAAOE,MAAM4C,KAAK,KACxBT,IAAOA,EAAGC,cACZD,EAAGU,UAAUnE,EAAiByB,SAIpCgC,GAAIM,gBAGV,OACOnB,GAGL,GAFAC,QAAQD,MAAM,4BAA6BA,GAEvCa,IAAOA,EAAGC,aACZ,UACQX,EAAY,KACpB,OACOqB,GACLvB,QAAQD,MAAM,oCAAqCwB,EACrD,CAEJ,CACF,YAoCEC,IAAAC,EAmBM,MAnBNC,EAmBM,CAlBJC,EAAA,6TAcAC,EAGE,MAAA,SAFI,gBAAJ9E,IAAII,EACJ2E,MAAM"}
@@ -1,2 +1,2 @@
1
- import{merge as e}from"lodash-es";import*as t from"echarts";import{getProvinceCode as o,getChinaMapData as a,isProvinceCode as i,getProvinceMapData as s,getProvinceName as n,fetchMapData as l}from"./mapData.mjs";const r={get:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"showTypeName",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"table";return r.data.find(o=>o[e].toString()===t||o[e]===t)},data:[{showTypeName:"table",label:"表格",coverImg:"table.png",disabled:()=>!1,subTypeList:[],showType:0,baseConfig:{}},{showTypeName:"line",label:"折线图",coverImg:"line-stack.png",showType:1,subTypeList:[{value:"line-simple",icon:"line-smooth",tooltipContent:"折线图"},{value:"area-basic",icon:"chart-line-area",tooltipContent:"折线面积图"}],baseConfig:{tooltip:{confine:!1,trigger:"axis",axisPointer:{type:"line"}},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},legend:{type:"scroll",top:"25px"},grid:{left:"0",bottom:"10px",containLabel:!0},xAxis:{type:"category",boundaryGap:!1},yAxis:{type:"value"},dataZoom:[{type:"inside"}]},disabled:(e,t)=>{const o=t?.length;return!(o>=1&&o<2)}},{showTypeName:"bar",label:"柱状图",coverImg:"bar-tick-align.png",showType:2,baseConfig:{legend:{type:"scroll",top:"25px"},tooltip:{confine:!1,trigger:"axis",axisPointer:{type:"shadow"}},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},grid:{left:"0",bottom:"20px",containLabel:!0},xAxis:{axisLabel:{showMaxLabel:!0},axisTick:{alignWithLabel:!0}},yAxis:{},dataZoom:[{type:"inside"}]},subTypeList:[{value:"bar-simple",icon:"bar-simple",tooltipContent:"垂直条形图"},{value:"bar-y-category",icon:"bar-y-category",tooltipContent:"水平条形图"}],disabled:(e,t)=>{const o=t?.length;return!(o>=1)}},{showTypeName:"pie",label:"饼图",coverImg:"pie-simple.png",showType:4,subTypeList:[{value:"pie-simple",icon:"pie-simple",tooltipContent:"饼图"},{value:"pie-borderRadius",icon:"pie-borderRadius",tooltipContent:"环形图"}],baseConfig:{tooltip:{confine:!0,formatter:"{a}<br>{b}: {c}({d}%)",trigger:"item"},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},legend:{type:"scroll",top:"25px"}},disabled:(e,t)=>{const o=t?.length,a=e?.length;return!(a<=4&&o>0&&o<=1)}},{showTypeName:"area",label:"地图",coverImg:"area.png",showType:5,subTypeList:[],baseConfig:{tooltip:{confine:!0,trigger:"item"},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},visualMap:{text:["高","低"],realtime:!1,calculable:!0,inRange:{color:["lightskyblue","yellow","orangered"]}}},disabled:(e,t)=>{const o=t?.length,a=t?.some(e=>{let{colDesc:t}=e;return t.includes("省")||t.includes("市")});return!(a&&o>0)}},{showTypeName:"funnel",label:"漏斗图",coverImg:"funnel.png",showType:6,subTypeList:[],baseConfig:{tooltip:{confine:!0,trigger:"item",formatter:"{a} <br/>{b} : {c}"},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},legend:{type:"scroll",top:20}},disabled:(e,t)=>{const o=t?.length,a=e?.length;return!(a<=5&&o>0&&o<=1)}},{showTypeName:"card",label:"卡片",coverImg:"card.png",showType:9,subTypeList:[],baseConfig:{},disabled:(e,t)=>{const o=t?.length,a=e?.length;return!(a>0&&o<=1)}},{showTypeName:"radar",label:"雷达图",coverImg:"radar.png",showType:10,subTypeList:[],baseConfig:{legend:{type:"scroll",orient:"vertical",left:"left",top:"25px"},tooltip:{confine:!0,trigger:"item"},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},radar:{center:["50%","55%"]}},disabled:(e,t)=>{const o=t?.length;return 1!==o||1!==e.length}},{showTypeName:"scatter-simple",label:"散点图",coverImg:"",showType:11,subTypeList:[],disabled:()=>!1,baseConfig:{grid:{left:"0",bottom:"10px",containLabel:!0},tooltip:{showDelay:0,axisPointer:{show:!0,type:"cross",lineStyle:{type:"dashed",width:1}}},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},legend:{type:"scroll",top:"25px"},xAxis:{splitLine:{lineStyle:{type:"dashed"}}},yAxis:{splitLine:{lineStyle:{type:"dashed"}}}}}]};function p(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return r.get("showType",e)}function c(t,o){const a={};return t.forEach(t=>{a[t.showTypeName]=e(t.baseConfig,o)}),a}const g=c(r.data,{backgroundColor:"transparent",title:{textStyle:{fontSize:14,lineHeight:16}}}),h=new Map,d=()=>{try{const e=t.getMap("china");if(e&&e.geoJson)return e.geoJson}catch(e){console.warn("Failed to get builtin China map:",e)}return{type:"FeatureCollection",features:[]}};function b(e){let{adcode:t}=e;if("string"!=typeof t||t.match(/^\d{6}$/)||"中国"===t||"100000"===t||(t=o(t)),h.has(t)){const e=h.get(t);if(e)return Promise.resolve(e)}return new Promise(async e=>{try{if("中国"===t||"100000"===t)try{const o=await a();return h.set(t,o),void e(o)}catch(e){console.warn("Failed to fetch China map from DataV, using fallback:",e)}if(i(t))try{const o=await s(n(t));if(o&&o.features&&o.features.length>0)return h.set(t,o),void e(o)}catch(o){console.warn("Failed to fetch province map data with new method, trying old method:",o);try{const o=await l(t);if(o&&o.features&&o.features.length>0)return h.set(t,o),void e(o)}catch(e){console.warn("Failed to fetch province map data with old method:",e)}}const o=d();h.set(t,o),e(o)}catch(o){console.error("All map data sources failed, using simple fallback:",o);const a=d();h.set(t,a),e(a)}})}export{g as defaultChartOption,b as getGeoJsonData,r as iconList,c as setDefaultChartOption,p as showTypeText};
1
+ import{merge as e}from"lodash-es";import*as t from"echarts";import{getProvinceCode as o,isProvinceCode as a}from"./mapData.mjs";const s={get:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"showTypeName",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"table";return s.data.find(o=>o[e].toString()===t||o[e]===t)},data:[{showTypeName:"table",label:"表格",coverImg:"table.png",disabled:()=>!1,subTypeList:[],showType:0,baseConfig:{}},{showTypeName:"line",label:"折线图",coverImg:"line-stack.png",showType:1,subTypeList:[{value:"line-simple",icon:"line-smooth",tooltipContent:"折线图"},{value:"area-basic",icon:"chart-line-area",tooltipContent:"折线面积图"}],baseConfig:{tooltip:{confine:!1,trigger:"axis",axisPointer:{type:"line"}},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},legend:{type:"scroll",top:"25px"},grid:{left:"0",bottom:"10px",containLabel:!0},xAxis:{type:"category",boundaryGap:!1},yAxis:{type:"value"},dataZoom:[{type:"inside"}]},disabled:(e,t)=>{const o=t?.length;return!(o>=1&&o<2)}},{showTypeName:"bar",label:"柱状图",coverImg:"bar-tick-align.png",showType:2,baseConfig:{legend:{type:"scroll",top:"25px"},tooltip:{confine:!1,trigger:"axis",axisPointer:{type:"shadow"}},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},grid:{left:"0",bottom:"20px",containLabel:!0},xAxis:{axisLabel:{showMaxLabel:!0},axisTick:{alignWithLabel:!0}},yAxis:{},dataZoom:[{type:"inside"}]},subTypeList:[{value:"bar-simple",icon:"bar-simple",tooltipContent:"垂直条形图"},{value:"bar-y-category",icon:"bar-y-category",tooltipContent:"水平条形图"}],disabled:(e,t)=>{const o=t?.length;return!(o>=1)}},{showTypeName:"pie",label:"饼图",coverImg:"pie-simple.png",showType:4,subTypeList:[{value:"pie-simple",icon:"pie-simple",tooltipContent:"饼图"},{value:"pie-borderRadius",icon:"pie-borderRadius",tooltipContent:"环形图"}],baseConfig:{tooltip:{confine:!0,formatter:"{a}<br>{b}: {c}({d}%)",trigger:"item"},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},legend:{type:"scroll",top:"25px"}},disabled:(e,t)=>{const o=t?.length,a=e?.length;return!(a<=4&&o>0&&o<=1)}},{showTypeName:"area",label:"地图",coverImg:"area.png",showType:5,subTypeList:[],baseConfig:{tooltip:{confine:!0,trigger:"item"},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},visualMap:{text:["高","低"],realtime:!1,calculable:!0,inRange:{color:["#E8F4FD","#B8D4F7","#7BA4F0","#4A7BE8","#3562e1"]}}},disabled:(e,t)=>{const o=t?.length,a=t?.some(e=>{let{colDesc:t}=e;return t.includes("省")||t.includes("市")});return!(a&&o>0)}},{showTypeName:"funnel",label:"漏斗图",coverImg:"funnel.png",showType:6,subTypeList:[],baseConfig:{tooltip:{confine:!0,trigger:"item",formatter:"{a} <br/>{b} : {c}"},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},legend:{type:"scroll",top:20}},disabled:(e,t)=>{const o=t?.length,a=e?.length;return!(a<=5&&o>0&&o<=1)}},{showTypeName:"card",label:"卡片",coverImg:"card.png",showType:9,subTypeList:[],baseConfig:{},disabled:(e,t)=>{const o=t?.length,a=e?.length;return!(a>0&&o<=1)}},{showTypeName:"radar",label:"雷达图",coverImg:"radar.png",showType:10,subTypeList:[],baseConfig:{legend:{type:"scroll",orient:"vertical",left:"left",top:"25px"},tooltip:{confine:!0,trigger:"item"},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},radar:{center:["50%","55%"]}},disabled:(e,t)=>{const o=t?.length;return 1!==o||1!==e.length}},{showTypeName:"scatter-simple",label:"散点图",coverImg:"",showType:11,subTypeList:[],disabled:()=>!1,baseConfig:{grid:{left:"0",bottom:"10px",containLabel:!0},tooltip:{showDelay:0,axisPointer:{show:!0,type:"cross",lineStyle:{type:"dashed",width:1}}},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},legend:{type:"scroll",top:"25px"},xAxis:{splitLine:{lineStyle:{type:"dashed"}}},yAxis:{splitLine:{lineStyle:{type:"dashed"}}}}}]};function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return s.get("showType",e)}function n(t,o){const a={};return t.forEach(t=>{a[t.showTypeName]=e(t.baseConfig,o)}),a}const l=n(s.data,{backgroundColor:"transparent",title:{textStyle:{fontSize:14,lineHeight:16}}}),r=new Map,p=()=>{try{const e=t.getMap("china");if(e&&e.geoJson)return e.geoJson}catch(e){console.warn("Failed to get builtin China map:",e)}return{type:"FeatureCollection",features:[]}};function c(e){let{adcode:t}=e,s="https://cdnfile.yaomaitong.cn/ksh/lib/geo-data";if("string"!=typeof t||t.match(/^\d{6}$/)||"中国"===t||"100000"===t||(t=o(t)),r.has(t)){const e=r.get(t);if(e)return Promise.resolve(e)}return new Promise(async e=>{try{if("中国"===t||"100000"===t)try{const o=await fetch(`${s}/china.json`);if(o.ok){const a=await o.json();return r.set(t,a),void e(a)}}catch(e){console.warn("Failed to load local China map data:",e)}if(a(t))try{const o=await fetch(`${s}/${t}.json`);if(o.ok){const a=await o.json();if(a&&a.features&&a.features.length>0)return r.set(t,a),void e(a)}}catch(e){console.warn("Failed to load local province map data:",e)}const o=p();r.set(t,o),e(o)}catch(o){console.error("All map data sources failed, using simple fallback:",o);const a=p();r.set(t,a),e(a)}})}export{l as defaultChartOption,c as getGeoJsonData,s as iconList,n as setDefaultChartOption,i as showTypeText};
2
2
  //# sourceMappingURL=config.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/utils/config.ts"],"sourcesContent":["import type { GeoJson, IconRow, IGroupByInfos, ISelectInfos } from './types'\nimport { merge } from 'lodash-es'\nimport * as echarts from 'echarts'\nimport { fetchMapData, getProvinceCode, getProvinceName, isProvinceCode, getProvinceMapData, getChinaMapData } from './mapData'\n\n/**\n * 禁用功能函数\n * 判断当前图表类型是否被禁用\n * 调用时机:渲染页面\n * @param {object} selectInfos 选择信息\n * @param {object} groupByInfos 分组信息\n * @param {Message[]|Message} data 数据\n * @returns Boolean 布尔值\n */\nexport const iconList: {\n data: IconRow[]\n get: (type: keyof IconRow, value: any) => IconRow\n} = {\n get: (type: keyof IconRow = 'showTypeName', value: any = 'table') => {\n return iconList.data.find(item => item[type].toString() === value || item[type] === value)!\n },\n data: [\n {\n showTypeName: 'table',\n label: '表格',\n coverImg: 'table.png',\n disabled: () => false,\n subTypeList: [],\n showType: 0,\n baseConfig: {},\n },\n {\n showTypeName: 'line',\n label: '折线图',\n coverImg: 'line-stack.png',\n showType: 1,\n subTypeList: [\n {\n value: 'line-simple',\n icon: 'line-smooth',\n tooltipContent: '折线图',\n },\n {\n value: 'area-basic',\n icon: 'chart-line-area',\n tooltipContent: '折线面积图',\n },\n ],\n baseConfig: {\n tooltip: {\n confine: false,\n trigger: 'axis',\n axisPointer: {\n type: 'line',\n },\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n },\n },\n legend: {\n type: 'scroll',\n top: '25px',\n },\n grid: {\n left: '0',\n bottom: '10px',\n containLabel: true,\n },\n xAxis: {\n type: 'category',\n boundaryGap: false,\n },\n yAxis: {\n type: 'value',\n },\n dataZoom: [\n {\n type: 'inside',\n },\n ],\n },\n disabled: (_: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n if (groupByInfosLenght >= 1 && groupByInfosLenght < 2) {\n return false\n }\n return true\n },\n },\n {\n showTypeName: 'bar',\n label: '柱状图',\n coverImg: 'bar-tick-align.png',\n showType: 2,\n baseConfig: {\n legend: {\n type: 'scroll',\n top: '25px',\n },\n tooltip: {\n confine: false,\n trigger: 'axis',\n axisPointer: {\n type: 'shadow',\n },\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n // myFull: { // 全屏\n // show: true,\n // title: '全屏',\n // icon: 'path://...',\n // }\n },\n },\n grid: {\n left: '0',\n bottom: '20px',\n containLabel: true,\n },\n xAxis: {\n axisLabel: {\n showMaxLabel: true,\n },\n axisTick: {\n alignWithLabel: true,\n },\n },\n yAxis: {},\n dataZoom: [\n {\n type: 'inside',\n },\n ],\n },\n subTypeList: [\n {\n value: 'bar-simple',\n icon: 'bar-simple',\n tooltipContent: '垂直条形图',\n },\n {\n value: 'bar-y-category',\n icon: 'bar-y-category',\n tooltipContent: '水平条形图',\n },\n ],\n disabled: (_: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n if (groupByInfosLenght >= 1) {\n return false\n }\n return true\n },\n },\n {\n showTypeName: 'pie',\n label: '饼图',\n coverImg: 'pie-simple.png',\n showType: 4,\n subTypeList: [\n {\n value: 'pie-simple',\n icon: 'pie-simple',\n tooltipContent: '饼图',\n },\n {\n value: 'pie-borderRadius',\n icon: 'pie-borderRadius',\n tooltipContent: '环形图',\n },\n ],\n baseConfig: {\n tooltip: {\n confine: true,\n formatter: '{a}<br>{b}: {c}({d}%)',\n trigger: 'item',\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n },\n },\n legend: {\n type: 'scroll',\n top: '25px',\n },\n },\n disabled: (selectInfos: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n const selectInfosLength = selectInfos?.length\n if (selectInfosLength <= 4 && groupByInfosLenght > 0 && groupByInfosLenght <= 1) {\n return false\n }\n return true\n },\n },\n {\n showTypeName: 'area',\n label: '地图',\n coverImg: 'area.png',\n showType: 5,\n subTypeList: [],\n baseConfig: {\n tooltip: {\n confine: true,\n trigger: 'item',\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n },\n },\n visualMap: {\n text: ['高', '低'],\n realtime: false,\n calculable: true,\n inRange: {\n color: ['lightskyblue', 'yellow', 'orangered'],\n },\n },\n },\n disabled: (_: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n const flag = groupByInfos?.some(({ colDesc }) => (colDesc.includes('省') || colDesc.includes('市')))\n if (flag && groupByInfosLenght > 0) {\n return false\n }\n return true\n },\n },\n {\n showTypeName: 'funnel',\n label: '漏斗图',\n coverImg: 'funnel.png',\n showType: 6,\n subTypeList: [],\n baseConfig: {\n tooltip: {\n confine: true,\n trigger: 'item',\n formatter: '{a} <br/>{b} : {c}',\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n },\n },\n legend: {\n type: 'scroll',\n top: 20,\n },\n },\n disabled: (selectInfos: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n const selectInfosLength = selectInfos?.length\n if (selectInfosLength <= 5 && groupByInfosLenght > 0 && groupByInfosLenght <= 1) {\n return false\n }\n return true\n },\n },\n\n // { label: 'scatter', value: 7 },\n {\n showTypeName: 'card',\n label: '卡片',\n coverImg: 'card.png',\n showType: 9,\n subTypeList: [],\n baseConfig: {},\n disabled: (selectInfos: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n const selectInfosLength = selectInfos?.length\n if (selectInfosLength > 0 && groupByInfosLenght <= 1) {\n return false\n }\n return true\n },\n },\n {\n showTypeName: 'radar',\n label: '雷达图',\n coverImg: 'radar.png',\n showType: 10,\n subTypeList: [],\n baseConfig: {\n legend: {\n type: 'scroll',\n orient: 'vertical',\n left: 'left',\n top: '25px',\n },\n tooltip: {\n confine: true,\n trigger: 'item',\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n },\n },\n radar: {\n // shape: 'circle',\n center: ['50%', '55%'],\n },\n },\n disabled: (selectInfos: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n if (groupByInfosLenght === 1 && selectInfos.length === 1) {\n return false\n }\n return true\n },\n },\n {\n showTypeName: 'scatter-simple',\n label: '散点图',\n coverImg: '',\n showType: 11,\n subTypeList: [],\n disabled: () => false,\n baseConfig: {\n grid: {\n left: '0',\n bottom: '10px',\n containLabel: true,\n },\n tooltip: {\n showDelay: 0,\n axisPointer: {\n show: true,\n type: 'cross',\n lineStyle: {\n type: 'dashed',\n width: 1,\n },\n },\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n },\n },\n legend: {\n type: 'scroll',\n top: '25px',\n },\n xAxis: {\n splitLine: {\n lineStyle: {\n type: 'dashed',\n },\n },\n },\n yAxis: {\n splitLine: {\n lineStyle: {\n type: 'dashed',\n },\n },\n },\n },\n },\n ],\n}\n\nexport function showTypeText(showType = 0): IconRow {\n const row = iconList.get('showType', showType)\n return row\n}\n\n// 修改默认配置\nexport function setDefaultChartOption(option: IconRow[], changeConfig: any) {\n const obj: {\n [key in IconRow['showTypeName']]: any\n } = {} as { [key in IconRow['showTypeName']]: any }\n option.forEach((item) => {\n obj[item.showTypeName] = merge(item.baseConfig, changeConfig)\n })\n return obj\n}\nexport const defaultChartOption = setDefaultChartOption(iconList.data, {\n backgroundColor: 'transparent',\n title: {\n textStyle: {\n fontSize: 14,\n lineHeight: 16,\n },\n },\n})\n// 获取地图数据(GeoJson)\n// 添加缓存对象\nconst geoJsonCache = new Map<string, GeoJson>()\n\n // 使用 ECharts 内置的中国地图数据\nconst getBuiltinChinaMap = (): GeoJson => {\n try {\n // 尝试获取 ECharts 内置的中国地图数据\n const chinaMap = echarts.getMap('china')\n if (chinaMap && chinaMap.geoJson) {\n return chinaMap.geoJson as GeoJson\n }\n }\n catch (error) {\n console.warn('Failed to get builtin China map:', error)\n }\n \n // 如果获取失败,返回空的地图数据\n return {\n type: 'FeatureCollection',\n features: [],\n } as GeoJson\n}\nexport function getGeoJsonData(options: any): Promise<GeoJson> {\n let { adcode } = options\n\n // 如果传入的是省份名称,转换为代码\n if (typeof adcode === 'string' && !adcode.match(/^\\d{6}$/) && adcode !== '中国' && adcode !== '100000') {\n adcode = getProvinceCode(adcode)\n }\n\n // 检查缓存中是否存在对应的 GeoJSON 数据\n if (geoJsonCache.has(adcode)) {\n const cachedGeoJson = geoJsonCache.get(adcode)\n if (cachedGeoJson) {\n return Promise.resolve(cachedGeoJson)\n }\n }\n\n // 使用免费的替代方案\n return new Promise(async (resolve) => {\n try {\n // 方案1: 优先使用 DataV 的真实地图数据\n if (adcode === '中国' || adcode === '100000') {\n try {\n const chinaData = await getChinaMapData()\n geoJsonCache.set(adcode, chinaData)\n resolve(chinaData)\n return\n }\n catch (error) {\n console.warn('Failed to fetch China map from DataV, using fallback:', error)\n }\n }\n\n // 方案2: 尝试从免费数据源获取省级地图数据\n if (isProvinceCode(adcode)) {\n try {\n // 尝试使用新的省级地图数据获取函数\n const geoJson = await getProvinceMapData(getProvinceName(adcode))\n if (geoJson && geoJson.features && geoJson.features.length > 0) {\n geoJsonCache.set(adcode, geoJson)\n resolve(geoJson)\n return\n }\n }\n catch (error) {\n console.warn('Failed to fetch province map data with new method, trying old method:', error)\n try {\n const geoJson = await fetchMapData(adcode)\n if (geoJson && geoJson.features && geoJson.features.length > 0) {\n geoJsonCache.set(adcode, geoJson)\n resolve(geoJson)\n return\n }\n }\n catch (secondError) {\n console.warn('Failed to fetch province map data with old method:', secondError)\n }\n }\n }\n\n // 方案3: 使用内置的中国地图数据作为备用\n const builtinMap = getBuiltinChinaMap()\n geoJsonCache.set(adcode, builtinMap)\n resolve(builtinMap)\n }\n catch (error) {\n console.error('All map data sources failed, using simple fallback:', error)\n const builtinMap = getBuiltinChinaMap()\n geoJsonCache.set(adcode, builtinMap)\n resolve(builtinMap)\n }\n })\n}\n"],"names":["iconList","get","type","arguments","length","undefined","value","data","find","item","toString","showTypeName","label","coverImg","disabled","subTypeList","showType","baseConfig","icon","tooltipContent","tooltip","confine","trigger","axisPointer","toolbox","show","showTitle","feature","saveAsImage","legend","top","grid","left","bottom","containLabel","xAxis","boundaryGap","yAxis","dataZoom","_","groupByInfos","groupByInfosLenght","axisLabel","showMaxLabel","axisTick","alignWithLabel","formatter","selectInfos","selectInfosLength","visualMap","text","realtime","calculable","inRange","color","flag","some","_ref","colDesc","includes","orient","radar","center","showDelay","lineStyle","width","splitLine","showTypeText","setDefaultChartOption","option","changeConfig","obj","forEach","merge","defaultChartOption","backgroundColor","title","textStyle","fontSize","lineHeight","geoJsonCache","Map","getBuiltinChinaMap","chinaMap","echarts","getMap","geoJson","error","console","warn","features","getGeoJsonData","options","adcode","match","getProvinceCode","has","cachedGeoJson","Promise","resolve","async","chinaData","getChinaMapData","set","isProvinceCode","getProvinceMapData","getProvinceName","fetchMapData","secondError","builtinMap"],"mappings":"oNAcO,MAAMA,EAGT,CACFC,IAAK,WAAgE,IAA/DC,EAAAC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAsB,eAAgBG,yDAAa,QACvD,OAAON,EAASO,KAAKC,KAAKC,GAAQA,EAAKP,GAAMQ,aAAeJ,GAASG,EAAKP,KAAUI,EACtF,EACAC,KAAM,CACJ,CACEI,aAAc,QACdC,MAAO,KACPC,SAAU,YACVC,SAAUA,KAAM,EAChBC,YAAa,GACbC,SAAU,EACVC,WAAY,CAAA,GAEd,CACEN,aAAc,OACdC,MAAO,MACPC,SAAU,iBACVG,SAAU,EACVD,YAAa,CACX,CACET,MAAO,cACPY,KAAM,cACNC,eAAgB,OAElB,CACEb,MAAO,aACPY,KAAM,kBACNC,eAAgB,UAGpBF,WAAY,CACVG,QAAS,CACPC,SAAS,EACTC,QAAS,OACTC,YAAa,CACXrB,KAAM,SAGVsB,QAAS,CACPC,MAAM,EACNC,WAAW,EACXC,QAAS,CAGPC,YAAa,CAAA,IAGjBC,OAAQ,CACN3B,KAAM,SACN4B,IAAK,QAEPC,KAAM,CACJC,KAAM,IACNC,OAAQ,OACRC,cAAc,GAEhBC,MAAO,CACLjC,KAAM,WACNkC,aAAa,GAEfC,MAAO,CACLnC,KAAM,SAERoC,SAAU,CACR,CACEpC,KAAM,YAIZY,SAAUA,CAACyB,EAAmBC,KAC5B,MAAMC,EAAqBD,GAAcpC,OACzC,QAAIqC,GAAsB,GAAKA,EAAqB,KAMxD,CACE9B,aAAc,MACdC,MAAO,MACPC,SAAU,qBACVG,SAAU,EACVC,WAAY,CACVY,OAAQ,CACN3B,KAAM,SACN4B,IAAK,QAEPV,QAAS,CACPC,SAAS,EACTC,QAAS,OACTC,YAAa,CACXrB,KAAM,WAGVs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XP,GAA8B,WAAXA,EACrB,IACE,MAAMQ,QAAkBC,IAGxB,OAFAtB,EAAauB,IAAIV,EAAQQ,QACzBF,EAAQE,EAEV,OACOd,GACLC,QAAQC,KAAK,wDAAyDF,EACxE,CAIF,GAAIiB,EAAeX,GACjB,IAEE,MAAMP,QAAgBmB,EAAmBC,EAAgBb,IACzD,GAAIP,GAAWA,EAAQI,UAAYJ,EAAQI,SAAStF,OAAS,EAG3D,OAFA4E,EAAauB,IAAIV,EAAQP,QACzBa,EAAQb,EAGZ,OACOC,GACLC,QAAQC,KAAK,wEAAyEF,GACtF,IACE,MAAMD,QAAgBqB,EAAad,GACnC,GAAIP,GAAWA,EAAQI,UAAYJ,EAAQI,SAAStF,OAAS,EAG3D,OAFA4E,EAAauB,IAAIV,EAAQP,QACzBa,EAAQb,EAGZ,OACOsB,GACLpB,QAAQC,KAAK,qDAAsDmB,EACrE,CACF,CAIF,MAAMC,EAAa3B,IACnBF,EAAauB,IAAIV,EAAQgB,GACzBV,EAAQU,EACV,OACOtB,GACLC,QAAQD,MAAM,sDAAuDA,GACrE,MAAMsB,EAAa3B,IACnBF,EAAauB,IAAIV,EAAQgB,GACzBV,EAAQU,EACV,GAEJ"}
1
+ {"version":3,"file":"config.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/utils/config.ts"],"sourcesContent":["import type { GeoJson, IconRow, IGroupByInfos, ISelectInfos } from './types'\nimport { merge } from 'lodash-es'\nimport * as echarts from 'echarts'\nimport { getProvinceCode, isProvinceCode } from './mapData'\n\n/**\n * 禁用功能函数\n * 判断当前图表类型是否被禁用\n * 调用时机:渲染页面\n * @param {object} selectInfos 选择信息\n * @param {object} groupByInfos 分组信息\n * @param {Message[]|Message} data 数据\n * @returns Boolean 布尔值\n */\nexport const iconList: {\n data: IconRow[]\n get: (type: keyof IconRow, value: any) => IconRow\n} = {\n get: (type: keyof IconRow = 'showTypeName', value: any = 'table') => {\n return iconList.data.find(item => item[type].toString() === value || item[type] === value)!\n },\n data: [\n {\n showTypeName: 'table',\n label: '表格',\n coverImg: 'table.png',\n disabled: () => false,\n subTypeList: [],\n showType: 0,\n baseConfig: {},\n },\n {\n showTypeName: 'line',\n label: '折线图',\n coverImg: 'line-stack.png',\n showType: 1,\n subTypeList: [\n {\n value: 'line-simple',\n icon: 'line-smooth',\n tooltipContent: '折线图',\n },\n {\n value: 'area-basic',\n icon: 'chart-line-area',\n tooltipContent: '折线面积图',\n },\n ],\n baseConfig: {\n tooltip: {\n confine: false,\n trigger: 'axis',\n axisPointer: {\n type: 'line',\n },\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n },\n },\n legend: {\n type: 'scroll',\n top: '25px',\n },\n grid: {\n left: '0',\n bottom: '10px',\n containLabel: true,\n },\n xAxis: {\n type: 'category',\n boundaryGap: false,\n },\n yAxis: {\n type: 'value',\n },\n dataZoom: [\n {\n type: 'inside',\n },\n ],\n },\n disabled: (_: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n if (groupByInfosLenght >= 1 && groupByInfosLenght < 2) {\n return false\n }\n return true\n },\n },\n {\n showTypeName: 'bar',\n label: '柱状图',\n coverImg: 'bar-tick-align.png',\n showType: 2,\n baseConfig: {\n legend: {\n type: 'scroll',\n top: '25px',\n },\n tooltip: {\n confine: false,\n trigger: 'axis',\n axisPointer: {\n type: 'shadow',\n },\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n // myFull: { // 全屏\n // show: true,\n // title: '全屏',\n // icon: 'path://...',\n // }\n },\n },\n grid: {\n left: '0',\n bottom: '20px',\n containLabel: true,\n },\n xAxis: {\n axisLabel: {\n showMaxLabel: true,\n },\n axisTick: {\n alignWithLabel: true,\n },\n },\n yAxis: {},\n dataZoom: [\n {\n type: 'inside',\n },\n ],\n },\n subTypeList: [\n {\n value: 'bar-simple',\n icon: 'bar-simple',\n tooltipContent: '垂直条形图',\n },\n {\n value: 'bar-y-category',\n icon: 'bar-y-category',\n tooltipContent: '水平条形图',\n },\n ],\n disabled: (_: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n if (groupByInfosLenght >= 1) {\n return false\n }\n return true\n },\n },\n {\n showTypeName: 'pie',\n label: '饼图',\n coverImg: 'pie-simple.png',\n showType: 4,\n subTypeList: [\n {\n value: 'pie-simple',\n icon: 'pie-simple',\n tooltipContent: '饼图',\n },\n {\n value: 'pie-borderRadius',\n icon: 'pie-borderRadius',\n tooltipContent: '环形图',\n },\n ],\n baseConfig: {\n tooltip: {\n confine: true,\n formatter: '{a}<br>{b}: {c}({d}%)',\n trigger: 'item',\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n },\n },\n legend: {\n type: 'scroll',\n top: '25px',\n },\n },\n disabled: (selectInfos: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n const selectInfosLength = selectInfos?.length\n if (selectInfosLength <= 4 && groupByInfosLenght > 0 && groupByInfosLenght <= 1) {\n return false\n }\n return true\n },\n },\n {\n showTypeName: 'area',\n label: '地图',\n coverImg: 'area.png',\n showType: 5,\n subTypeList: [],\n baseConfig: {\n tooltip: {\n confine: true,\n trigger: 'item',\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n },\n },\n visualMap: {\n text: ['高', '低'],\n realtime: false,\n calculable: true,\n inRange: {\n color: ['#E8F4FD', '#B8D4F7', '#7BA4F0', '#4A7BE8', '#3562e1']\n },\n },\n },\n disabled: (_: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n const flag = groupByInfos?.some(({ colDesc }) => (colDesc.includes('省') || colDesc.includes('市')))\n if (flag && groupByInfosLenght > 0) {\n return false\n }\n return true\n },\n },\n {\n showTypeName: 'funnel',\n label: '漏斗图',\n coverImg: 'funnel.png',\n showType: 6,\n subTypeList: [],\n baseConfig: {\n tooltip: {\n confine: true,\n trigger: 'item',\n formatter: '{a} <br/>{b} : {c}',\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n },\n },\n legend: {\n type: 'scroll',\n top: 20,\n },\n },\n disabled: (selectInfos: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n const selectInfosLength = selectInfos?.length\n if (selectInfosLength <= 5 && groupByInfosLenght > 0 && groupByInfosLenght <= 1) {\n return false\n }\n return true\n },\n },\n\n // { label: 'scatter', value: 7 },\n {\n showTypeName: 'card',\n label: '卡片',\n coverImg: 'card.png',\n showType: 9,\n subTypeList: [],\n baseConfig: {},\n disabled: (selectInfos: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n const selectInfosLength = selectInfos?.length\n if (selectInfosLength > 0 && groupByInfosLenght <= 1) {\n return false\n }\n return true\n },\n },\n {\n showTypeName: 'radar',\n label: '雷达图',\n coverImg: 'radar.png',\n showType: 10,\n subTypeList: [],\n baseConfig: {\n legend: {\n type: 'scroll',\n orient: 'vertical',\n left: 'left',\n top: '25px',\n },\n tooltip: {\n confine: true,\n trigger: 'item',\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n },\n },\n radar: {\n // shape: 'circle',\n center: ['50%', '55%'],\n },\n },\n disabled: (selectInfos: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n if (groupByInfosLenght === 1 && selectInfos.length === 1) {\n return false\n }\n return true\n },\n },\n {\n showTypeName: 'scatter-simple',\n label: '散点图',\n coverImg: '',\n showType: 11,\n subTypeList: [],\n disabled: () => false,\n baseConfig: {\n grid: {\n left: '0',\n bottom: '10px',\n containLabel: true,\n },\n tooltip: {\n showDelay: 0,\n axisPointer: {\n show: true,\n type: 'cross',\n lineStyle: {\n type: 'dashed',\n width: 1,\n },\n },\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n },\n },\n legend: {\n type: 'scroll',\n top: '25px',\n },\n xAxis: {\n splitLine: {\n lineStyle: {\n type: 'dashed',\n },\n },\n },\n yAxis: {\n splitLine: {\n lineStyle: {\n type: 'dashed',\n },\n },\n },\n },\n },\n ],\n}\n\nexport function showTypeText(showType = 0): IconRow {\n const row = iconList.get('showType', showType)\n return row\n}\n\n// 修改默认配置\nexport function setDefaultChartOption(option: IconRow[], changeConfig: any) {\n const obj: {\n [key in IconRow['showTypeName']]: any\n } = {} as { [key in IconRow['showTypeName']]: any }\n option.forEach((item) => {\n obj[item.showTypeName] = merge(item.baseConfig, changeConfig)\n })\n return obj\n}\nexport const defaultChartOption = setDefaultChartOption(iconList.data, {\n backgroundColor: 'transparent',\n title: {\n textStyle: {\n fontSize: 14,\n lineHeight: 16,\n },\n },\n})\n// 获取地图数据(GeoJson)\n// 添加缓存对象\nconst geoJsonCache = new Map<string, GeoJson>()\n\n // 使用 ECharts 内置的中国地图数据\nconst getBuiltinChinaMap = (): GeoJson => {\n try {\n // 尝试获取 ECharts 内置的中国地图数据\n const chinaMap = echarts.getMap('china')\n if (chinaMap && chinaMap.geoJson) {\n return chinaMap.geoJson as GeoJson\n }\n }\n catch (error) {\n console.warn('Failed to get builtin China map:', error)\n }\n \n // 如果获取失败,返回空的地图数据\n return {\n type: 'FeatureCollection',\n features: [],\n } as GeoJson\n}\nexport function getGeoJsonData(options: any): Promise<GeoJson> {\n let { adcode } = options\n let baseUrl = 'https://cdnfile.yaomaitong.cn/ksh/lib/geo-data'\n\n // 如果传入的是省份名称,转换为代码\n if (typeof adcode === 'string' && !adcode.match(/^\\d{6}$/) && adcode !== '中国' && adcode !== '100000') {\n adcode = getProvinceCode(adcode)\n }\n\n // 检查缓存中是否存在对应的 GeoJSON 数据\n if (geoJsonCache.has(adcode)) {\n const cachedGeoJson = geoJsonCache.get(adcode)\n if (cachedGeoJson) {\n return Promise.resolve(cachedGeoJson)\n }\n }\n\n // 构建基础 URL\n return new Promise(async (resolve) => {\n try {\n // 方案1: 使用本地地图数据\n if (adcode === '中国' || adcode === '100000') {\n try {\n // 优先尝试本地中国地图数据\n const response = await fetch(`${baseUrl}/china.json`)\n if (response.ok) {\n const chinaData = await response.json()\n geoJsonCache.set(adcode, chinaData)\n resolve(chinaData)\n return\n }\n }\n catch (error) {\n console.warn('Failed to load local China map data:', error)\n }\n }\n\n // 方案2: 使用本地省级地图数据\n if (isProvinceCode(adcode)) {\n try {\n const response = await fetch(`${baseUrl}/${adcode}.json`)\n if (response.ok) {\n const geoJson = await response.json()\n if (geoJson && geoJson.features && geoJson.features.length > 0) {\n geoJsonCache.set(adcode, geoJson)\n resolve(geoJson)\n return\n }\n }\n }\n catch (error) {\n console.warn('Failed to load local province map data:', error)\n }\n }\n\n // 方案3: 使用内置的中国地图数据作为备用\n const builtinMap = getBuiltinChinaMap()\n geoJsonCache.set(adcode, builtinMap)\n resolve(builtinMap)\n }\n catch (error) {\n console.error('All map data sources failed, using simple fallback:', error)\n const builtinMap = getBuiltinChinaMap()\n geoJsonCache.set(adcode, builtinMap)\n resolve(builtinMap)\n }\n })\n}\n"],"names":["iconList","get","type","arguments","length","undefined","value","data","find","item","toString","showTypeName","label","coverImg","disabled","subTypeList","showType","baseConfig","icon","tooltipContent","tooltip","confine","trigger","axisPointer","toolbox","show","showTitle","feature","saveAsImage","legend","top","grid","left","bottom","containLabel","xAxis","boundaryGap","yAxis","dataZoom","_","groupByInfos","groupByInfosLenght","axisLabel","showMaxLabel","axisTick","alignWithLabel","formatter","selectInfos","selectInfosLength","visualMap","text","realtime","calculable","inRange","color","flag","some","_ref","colDesc","includes","orient","radar","center","showDelay","lineStyle","width","splitLine","showTypeText","setDefaultChartOption","option","changeConfig","obj","forEach","merge","defaultChartOption","backgroundColor","title","textStyle","fontSize","lineHeight","geoJsonCache","Map","getBuiltinChinaMap","chinaMap","echarts","getMap","geoJson","error","console","warn","features","getGeoJsonData","options","adcode","baseUrl","match","getProvinceCode","has","cachedGeoJson","Promise","resolve","async","response","fetch","ok","chinaData","json","set","isProvinceCode","builtinMap"],"mappings":"gIAcO,MAAMA,EAGT,CACFC,IAAK,WAAgE,IAA/DC,EAAAC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAsB,eAAgBG,yDAAa,QACvD,OAAON,EAASO,KAAKC,KAAKC,GAAQA,EAAKP,GAAMQ,aAAeJ,GAASG,EAAKP,KAAUI,EACtF,EACAC,KAAM,CACJ,CACEI,aAAc,QACdC,MAAO,KACPC,SAAU,YACVC,SAAUA,KAAM,EAChBC,YAAa,GACbC,SAAU,EACVC,WAAY,CAAA,GAEd,CACEN,aAAc,OACdC,MAAO,MACPC,SAAU,iBACVG,SAAU,EACVD,YAAa,CACX,CACET,MAAO,cACPY,KAAM,cACNC,eAAgB,OAElB,CACEb,MAAO,aACPY,KAAM,kBACNC,eAAgB,UAGpBF,WAAY,CACVG,QAAS,CACPC,SAAS,EACTC,QAAS,OACTC,YAAa,CACXrB,KAAM,SAGVsB,QAAS,CACPC,MAAM,EACNC,WAAW,EACXC,QAAS,CAGPC,YAAa,CAAA,IAGjBC,OAAQ,CACN3B,KAAM,SACN4B,IAAK,QAEPC,KAAM,CACJC,KAAM,IACNC,OAAQ,OACRC,cAAc,GAEhBC,MAAO,CACLjC,KAAM,WACNkC,aAAa,GAEfC,MAAO,CACLnC,KAAM,SAERoC,SAAU,CACR,CACEpC,KAAM,YAIZY,SAAUA,CAACyB,EAAmBC,KAC5B,MAAMC,EAAqBD,GAAcpC,OACzC,QAAIqC,GAAsB,GAAKA,EAAqB,KAMxD,CACE9B,aAAc,MACdC,MAA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AgBH,IAIvBb,EAAaiB,IAAIJ,GAAS,CAC5B,MAAMK,EAAgBlB,EAAa/E,IAAI4F,GACvC,GAAIK,EACF,OAAOC,QAAQC,QAAQF,EAE3B,CAGA,OAAO,IAAIC,QAAQE,UACjB,IAEE,GAAe,OAAXR,GAA8B,WAAXA,EACrB,IAEE,MAAMS,QAAiBC,MAAM,GAAGT,gBAChC,GAAIQ,EAASE,GAAI,CACf,MAAMC,QAAkBH,EAASI,OAGjC,OAFA1B,EAAa2B,IAAId,EAAQY,QACzBL,EAAQK,EAEV,CACF,OACOlB,GACLC,QAAQC,KAAK,uCAAwCF,EACvD,CAIF,GAAIqB,EAAef,GACjB,IACE,MAAMS,QAAiBC,MAAM,GAAGT,KAAWD,UAC3C,GAAIS,EAASE,GAAI,CACf,MAAMlB,QAAgBgB,EAASI,OAC/B,GAAIpB,GAAWA,EAAQI,UAAYJ,EAAQI,SAAStF,OAAS,EAG3D,OAFA4E,EAAa2B,IAAId,EAAQP,QACzBc,EAAQd,EAGZ,CACF,OACOC,GACLC,QAAQC,KAAK,0CAA2CF,EAC1D,CAIF,MAAMsB,EAAa3B,IACnBF,EAAa2B,IAAId,EAAQgB,GACzBT,EAAQS,EACV,OACOtB,GACLC,QAAQD,MAAM,sDAAuDA,GACrE,MAAMsB,EAAa3B,IACnBF,EAAa2B,IAAId,EAAQgB,GACzBT,EAAQS,EACV,GAEJ"}
@@ -1,2 +1,2 @@
1
- const t={PROVINCE:{TIANDITU:()=>"https://api.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=你的天地图token",DATAV:t=>`https://geo.datav.aliyun.com/areas_v3/bound/${t}_full.json`},TIANDITU_ADMIN:{BOUNDARY:t=>`https://api.tianditu.gov.cn/administrative?postStr={"searchWord":"${t}","searchType":"11","needSubInfo":true,"needAll":true,"needPolygon":true,"needPre":true}&type=query&tk=你的天地图token`}};async function e(){try{const t=await fetch("https://geo.datav.aliyun.com/areas_v3/bound/100000_full.json");if(t.ok)return await t.json()}catch(t){console.warn("Failed to fetch China map from DataV:",t)}return{type:"FeatureCollection",features:[{type:"Feature",properties:{name:"中国",adcode:"100000"},geometry:{type:"Polygon",coordinates:[[[73.66,35.42],[78.91,35.42],[81.33,36.08],[85.29,36.08],[88.02,35.42],[90.16,35.42],[92.13,34.76],[94.81,34.76],[97.06,33.44],[99.43,32.78],[101.06,31.46],[102.73,30.14],[104.4,28.82],[106.07,27.5],[107.74,26.18],[109.41,24.86],[111.08,23.54],[112.75,22.22],[114.42,20.9],[116.09,19.58],[117.76,18.26],[119.43,16.94],[121.1,15.62],[122.77,14.3],[124.44,12.98],[126.11,11.66],[127.78,10.34],[129.45,9.02],[131.12,7.7],[132.79,6.38],[134.46,5.06],[135.05,4.4],[135.05,5.06],[135.05,6.38],[135.05,7.7],[135.05,9.02],[135.05,10.34],[135.05,11.66],[135.05,12.98],[135.05,14.3],[135.05,15.62],[135.05,16.94],[135.05,18.26],[135.05,19.58],[135.05,20.9],[135.05,22.22],[135.05,23.54],[135.05,24.86],[135.05,26.18],[135.05,27.5],[135.05,28.82],[135.05,30.14],[135.05,31.46],[135.05,32.78],[135.05,34.1],[135.05,35.42],[134.46,36.08],[133.79,36.74],[133.12,37.4],[132.45,38.06],[131.78,38.72],[131.11,39.38],[130.44,40.04],[129.77,40.7],[129.1,41.36],[128.43,42.02],[127.76,42.68],[127.09,43.34],[126.42,44],[125.75,44.66],[125.08,45.32],[124.41,45.98],[123.74,46.64],[123.07,47.3],[122.4,47.96],[121.73,48.62],[121.06,49.28],[120.39,49.94],[119.72,50.6],[119.05,51.26],[118.38,51.92],[117.71,52.58],[117.04,53.24],[116.37,53.9],[115.7,54.56],[115.03,55.22],[114.36,55.88],[113.69,56.54],[113.02,57.2],[112.35,57.86],[111.68,58.52],[111.01,59.18],[110.34,59.84],[109.67,60.5],[109,61.16],[108.33,61.82],[107.66,62.48],[106.99,63.14],[106.32,63.8],[105.65,64.46],[104.98,65.12],[104.31,65.78],[103.64,66.44],[102.97,67.1],[102.3,67.76],[101.63,68.42],[100.96,69.08],[100.29,69.74],[99.62,70.4],[98.95,71.06],[98.28,71.72],[97.61,72.38],[96.94,73.04],[96.27,73.7],[95.6,74.36],[94.93,75.02],[94.26,75.68],[93.59,76.34],[92.92,77],[92.25,77.66],[91.58,78.32],[90.91,78.98],[90.24,79.64],[89.57,80.3],[88.9,80.96],[88.23,81.62],[87.56,82.28],[86.89,82.94],[86.22,83.6],[85.55,84.26],[84.88,84.92],[84.21,85.58],[83.54,86.24],[82.87,86.9],[82.2,87.56],[81.53,88.22],[80.86,88.88],[80.19,89.54],[79.52,90.2],[78.85,90.86],[78.18,91.52],[77.51,92.18],[76.84,92.84],[76.17,93.5],[75.5,94.16],[74.83,94.82],[74.16,95.48],[73.66,96.14],[73.66,95.48],[73.66,94.82],[73.66,94.16],[73.66,93.5],[73.66,92.84],[73.66,92.18],[73.66,91.52],[73.66,90.86],[73.66,90.2],[73.66,89.54],[73.66,88.88],[73.66,88.22],[73.66,87.56],[73.66,86.9],[73.66,86.24],[73.66,85.58],[73.66,84.92],[73.66,84.26],[73.66,83.6],[73.66,82.94],[73.66,82.28],[73.66,81.62],[73.66,80.96],[73.66,80.3],[73.66,79.64],[73.66,78.98],[73.66,78.32],[73.66,77.66],[73.66,77],[73.66,76.34],[73.66,75.68],[73.66,75.02],[73.66,74.36],[73.66,73.7],[73.66,73.04],[73.66,72.38],[73.66,71.72],[73.66,71.06],[73.66,70.4],[73.66,69.74],[73.66,69.08],[73.66,68.42],[73.66,67.76],[73.66,67.1],[73.66,66.44],[73.66,65.78],[73.66,65.12],[73.66,64.46],[73.66,63.8],[73.66,63.14],[73.66,62.48],[73.66,61.82],[73.66,61.16],[73.66,60.5],[73.66,59.84],[73.66,59.18],[73.66,58.52],[73.66,57.86],[73.66,57.2],[73.66,56.54],[73.66,55.88],[73.66,55.22],[73.66,54.56],[73.66,53.9],[73.66,53.24],[73.66,52.58],[73.66,51.92],[73.66,51.26],[73.66,50.6],[73.66,49.94],[73.66,49.28],[73.66,48.62],[73.66,47.96],[73.66,47.3],[73.66,46.64],[73.66,45.98],[73.66,45.32],[73.66,44.66],[73.66,44],[73.66,43.34],[73.66,42.68],[73.66,42.02],[73.66,41.36],[73.66,40.7],[73.66,40.04],[73.66,39.38],[73.66,38.72],[73.66,38.06],[73.66,37.4],[73.66,36.74],[73.66,36.08],[73.66,35.42]]]}}]}}const o={"北京市":"110000","天津市":"120000","河北省":"130000","山西省":"140000","内蒙古自治区":"150000","辽宁省":"210000","吉林省":"220000","黑龙江省":"230000","上海市":"310000","江苏省":"320000","浙江省":"330000","安徽省":"340000","福建省":"350000","江西省":"360000","山东省":"370000","河南省":"410000","湖北省":"420000","湖南省":"430000","广东省":"440000","广西壮族自治区":"450000","海南省":"460000","重庆市":"500000","四川省":"510000","贵州省":"520000","云南省":"530000","西藏自治区":"540000","陕西省":"610000","甘肃省":"620000","青海省":"630000","宁夏回族自治区":"640000","新疆维吾尔自治区":"650000","台湾省":"710000","香港特别行政区":"810000","澳门特别行政区":"820000"},r=Object.fromEntries(Object.entries(o).map(t=>{let[e,o]=t;return[o,e]}));function a(t){return o[t]||"100000"}function n(t){return r[t]||"中国"}function c(t){return/^\d{6}$/.test(t)&&"100000"!==t}async function s(t){const e=a(t);try{const t=`https://geo.datav.aliyun.com/areas_v3/bound/${e}_full.json`,o=await fetch(t);if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);return await o.json()}catch(e){throw console.error("Failed to fetch province map data for:",t,e),e}}const i={TOKEN:"你的天地图token",BASE_URL:"https://api.tianditu.gov.cn"};async function u(e){try{const o=t.TIANDITU_ADMIN.BOUNDARY(e).replace("你的天地图token",i.TOKEN),r=await fetch(o);if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);return await r.json()}catch(t){throw console.error("Failed to fetch Tianditu boundary data:",t),t}}async function d(e){try{const o=t.PROVINCE.DATAV(e);console.log("Fetching province map data from:",o);const r=await fetch(o);if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);const a=await r.json();return console.log("Successfully fetched province map data for:",e,a),a}catch(t){throw console.error("Failed to fetch map data for adcode:",e,t),t}}export{t as FREE_MAP_SOURCES,o as PROVINCE_CODES,r as PROVINCE_NAMES,i as TIANDITU_CONFIG,d as fetchMapData,u as fetchTiandituBoundary,e as getChinaMapData,a as getProvinceCode,s as getProvinceMapData,n as getProvinceName,c as isProvinceCode};
1
+ const t={"北京市":"110000","天津市":"120000","河北省":"130000","山西省":"140000","内蒙古自治区":"150000","辽宁省":"210000","吉林省":"220000","黑龙江省":"230000","上海市":"310000","江苏省":"320000","浙江省":"330000","安徽省":"340000","福建省":"350000","江西省":"360000","山东省":"370000","河南省":"410000","湖北省":"420000","湖南省":"430000","广东省":"440000","广西壮族自治区":"450000","海南省":"460000","重庆市":"500000","四川省":"510000","贵州省":"520000","云南省":"530000","西藏自治区":"540000","陕西省":"610000","甘肃省":"620000","青海省":"630000","宁夏回族自治区":"640000","新疆维吾尔自治区":"650000","台湾省":"710000","香港特别行政区":"810000","澳门特别行政区":"820000"};function e(e){return t[e]||"100000"}function n(t){return/^\d{6}$/.test(t)&&"100000"!==t}Object.fromEntries(Object.entries(t).map(t=>{let[e,n]=t;return[n,e]}));export{t as PROVINCE_CODES,e as getProvinceCode,n as isProvinceCode};
2
2
  //# sourceMappingURL=mapData.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"mapData.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/utils/mapData.ts"],"sourcesContent":["// 免费的地图数据源\nexport const FREE_MAP_SOURCES = {\n // 省级地图数据源\n PROVINCE: {\n // 使用天地图省级数据\n TIANDITU: () => `https://api.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=你的天地图token`,\n // 使用 DataV 的省级数据\n DATAV: (adcode: string) => `https://geo.datav.aliyun.com/areas_v3/bound/${adcode}_full.json`,\n },\n // 天地图行政区划数据\n TIANDITU_ADMIN: {\n // 获取行政区划边界数据\n BOUNDARY: (adcode: string) => `https://api.tianditu.gov.cn/administrative?postStr={\"searchWord\":\"${adcode}\",\"searchType\":\"11\",\"needSubInfo\":true,\"needAll\":true,\"needPolygon\":true,\"needPre\":true}&type=query&tk=你的天地图token`,\n },\n}\n\n// 中国地图数据 - 使用真实的省级边界数据\nexport const CHINA_MAP_DATA = {\n type: 'FeatureCollection',\n features: [\n // 这里应该包含所有省份的边界数据\n // 由于数据量很大,建议使用外部数据源\n ]\n}\n\n// 获取中国地图数据的函数\nexport async function getChinaMapData(): Promise<any> {\n try {\n // 优先使用 DataV 的中国地图数据\n const response = await fetch('https://geo.datav.aliyun.com/areas_v3/bound/100000_full.json')\n if (response.ok) {\n return await response.json()\n }\n }\n catch (error) {\n console.warn('Failed to fetch China map from DataV:', error)\n }\n\n // 备用方案:使用简化的地图数据\n return {\n type: 'FeatureCollection',\n features: [\n {\n type: 'Feature',\n properties: {\n name: '中国',\n adcode: '100000',\n },\n geometry: {\n type: 'Polygon',\n coordinates: [[\n [73.66, 35.42], [78.91, 35.42], [81.33, 36.08], [85.29, 36.08], \n [88.02, 35.42], [90.16, 35.42], [92.13, 34.76], [94.81, 34.76], \n [97.06, 33.44], [99.43, 32.78], [101.06, 31.46], [102.73, 30.14], \n [104.40, 28.82], [106.07, 27.50], [107.74, 26.18], [109.41, 24.86], \n [111.08, 23.54], [112.75, 22.22], [114.42, 20.90], [116.09, 19.58], \n [117.76, 18.26], [119.43, 16.94], [121.10, 15.62], [122.77, 14.30], \n [124.44, 12.98], [126.11, 11.66], [127.78, 10.34], [129.45, 9.02], \n [131.12, 7.70], [132.79, 6.38], [134.46, 5.06], [135.05, 4.40], \n [135.05, 5.06], [135.05, 6.38], [135.05, 7.70], [135.05, 9.02], \n [135.05, 10.34], [135.05, 11.66], [135.05, 12.98], [135.05, 14.30], \n [135.05, 15.62], [135.05, 16.94], [135.05, 18.26], [135.05, 19.58], \n [135.05, 20.90], [135.05, 22.22], [135.05, 23.54], [135.05, 24.86], \n [135.05, 26.18], [135.05, 27.50], [135.05, 28.82], [135.05, 30.14], \n [135.05, 31.46], [135.05, 32.78], [135.05, 34.10], [135.05, 35.42], \n [134.46, 36.08], [133.79, 36.74], [133.12, 37.40], [132.45, 38.06], \n [131.78, 38.72], [131.11, 39.38], [130.44, 40.04], [129.77, 40.70], \n [129.10, 41.36], [128.43, 42.02], [127.76, 42.68], [127.09, 43.34], \n [126.42, 44.00], [125.75, 44.66], [125.08, 45.32], [124.41, 45.98], \n [123.74, 46.64], [123.07, 47.30], [122.40, 47.96], [121.73, 48.62], \n [121.06, 49.28], [120.39, 49.94], [119.72, 50.60], [119.05, 51.26], \n [118.38, 51.92], [117.71, 52.58], [117.04, 53.24], [116.37, 53.90], \n [115.70, 54.56], [115.03, 55.22], [114.36, 55.88], [113.69, 56.54], \n [113.02, 57.20], [112.35, 57.86], [111.68, 58.52], [111.01, 59.18], \n [110.34, 59.84], [109.67, 60.50], [109.00, 61.16], [108.33, 61.82], \n [107.66, 62.48], [106.99, 63.14], [106.32, 63.80], [105.65, 64.46], \n [104.98, 65.12], [104.31, 65.78], [103.64, 66.44], [102.97, 67.10], \n [102.30, 67.76], [101.63, 68.42], [100.96, 69.08], [100.29, 69.74], \n [99.62, 70.40], [98.95, 71.06], [98.28, 71.72], [97.61, 72.38], \n [96.94, 73.04], [96.27, 73.70], [95.60, 74.36], [94.93, 75.02], \n [94.26, 75.68], [93.59, 76.34], [92.92, 77.00], [92.25, 77.66], \n [91.58, 78.32], [90.91, 78.98], [90.24, 79.64], [89.57, 80.30], \n [88.90, 80.96], [88.23, 81.62], [87.56, 82.28], [86.89, 82.94], \n [86.22, 83.60], [85.55, 84.26], [84.88, 84.92], [84.21, 85.58], \n [83.54, 86.24], [82.87, 86.90], [82.20, 87.56], [81.53, 88.22], \n [80.86, 88.88], [80.19, 89.54], [79.52, 90.20], [78.85, 90.86], \n [78.18, 91.52], [77.51, 92.18], [76.84, 92.84], [76.17, 93.50], \n [75.50, 94.16], [74.83, 94.82], [74.16, 95.48], [73.66, 96.14], \n [73.66, 95.48], [73.66, 94.82], [73.66, 94.16], [73.66, 93.50], \n [73.66, 92.84], [73.66, 92.18], [73.66, 91.52], [73.66, 90.86], \n [73.66, 90.20], [73.66, 89.54], [73.66, 88.88], [73.66, 88.22], \n [73.66, 87.56], [73.66, 86.90], [73.66, 86.24], [73.66, 85.58], \n [73.66, 84.92], [73.66, 84.26], [73.66, 83.60], [73.66, 82.94], \n [73.66, 82.28], [73.66, 81.62], [73.66, 80.96], [73.66, 80.30], \n [73.66, 79.64], [73.66, 78.98], [73.66, 78.32], [73.66, 77.66], \n [73.66, 77.00], [73.66, 76.34], [73.66, 75.68], [73.66, 75.02], \n [73.66, 74.36], [73.66, 73.70], [73.66, 73.04], [73.66, 72.38], \n [73.66, 71.72], [73.66, 71.06], [73.66, 70.40], [73.66, 69.74], \n [73.66, 69.08], [73.66, 68.42], [73.66, 67.76], [73.66, 67.10], \n [73.66, 66.44], [73.66, 65.78], [73.66, 65.12], [73.66, 64.46], \n [73.66, 63.80], [73.66, 63.14], [73.66, 62.48], [73.66, 61.82], \n [73.66, 61.16], [73.66, 60.50], [73.66, 59.84], [73.66, 59.18], \n [73.66, 58.52], [73.66, 57.86], [73.66, 57.20], [73.66, 56.54], \n [73.66, 55.88], [73.66, 55.22], [73.66, 54.56], [73.66, 53.90], \n [73.66, 53.24], [73.66, 52.58], [73.66, 51.92], [73.66, 51.26], \n [73.66, 50.60], [73.66, 49.94], [73.66, 49.28], [73.66, 48.62], \n [73.66, 47.96], [73.66, 47.30], [73.66, 46.64], [73.66, 45.98], \n [73.66, 45.32], [73.66, 44.66], [73.66, 44.00], [73.66, 43.34], \n [73.66, 42.68], [73.66, 42.02], [73.66, 41.36], [73.66, 40.70], \n [73.66, 40.04], [73.66, 39.38], [73.66, 38.72], [73.66, 38.06], \n [73.66, 37.40], [73.66, 36.74], [73.66, 36.08], [73.66, 35.42]\n ]],\n },\n },\n ],\n }\n}\n\n\n\n// 省级行政区代码映射\nexport const PROVINCE_CODES = {\n '北京市': '110000',\n '天津市': '120000',\n '河北省': '130000',\n '山西省': '140000',\n '内蒙古自治区': '150000',\n '辽宁省': '210000',\n '吉林省': '220000',\n '黑龙江省': '230000',\n '上海市': '310000',\n '江苏省': '320000',\n '浙江省': '330000',\n '安徽省': '340000',\n '福建省': '350000',\n '江西省': '360000',\n '山东省': '370000',\n '河南省': '410000',\n '湖北省': '420000',\n '湖南省': '430000',\n '广东省': '440000',\n '广西壮族自治区': '450000',\n '海南省': '460000',\n '重庆市': '500000',\n '四川省': '510000',\n '贵州省': '520000',\n '云南省': '530000',\n '西藏自治区': '540000',\n '陕西省': '610000',\n '甘肃省': '620000',\n '青海省': '630000',\n '宁夏回族自治区': '640000',\n '新疆维吾尔自治区': '650000',\n '台湾省': '710000',\n '香港特别行政区': '810000',\n '澳门特别行政区': '820000',\n}\n\n// 省级名称映射(反向查找)\nexport const PROVINCE_NAMES = Object.fromEntries(\n Object.entries(PROVINCE_CODES).map(([name, code]) => [code, name])\n)\n\n// 获取省级代码\nexport function getProvinceCode(provinceName: string): string {\n return PROVINCE_CODES[provinceName as keyof typeof PROVINCE_CODES] || '100000'\n}\n\n// 获取省级名称\nexport function getProvinceName(provinceCode: string): string {\n return PROVINCE_NAMES[provinceCode] || '中国'\n}\n\n// 判断是否为省级代码\nexport function isProvinceCode(code: string): boolean {\n return /^\\d{6}$/.test(code) && code !== '100000'\n}\n\n// 获取省级地图数据\nexport async function getProvinceMapData(provinceName: string): Promise<any> {\n const provinceCode = getProvinceCode(provinceName)\n \n try {\n const url = `https://geo.datav.aliyun.com/areas_v3/bound/${provinceCode}_full.json`\n \n const response = await fetch(url)\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`)\n }\n \n const data = await response.json()\n return data\n }\n catch (error) {\n console.error('Failed to fetch province map data for:', provinceName, error)\n throw error\n }\n}\n\n// 天地图配置\nexport const TIANDITU_CONFIG = {\n // 天地图 token(需要申请)\n TOKEN: '你的天地图token', // 请替换为您的天地图 token\n // 天地图 API 基础 URL\n BASE_URL: 'https://api.tianditu.gov.cn',\n}\n\n// 获取天地图行政区划数据\nexport async function fetchTiandituBoundary(adcode: string): Promise<any> {\n try {\n const url = FREE_MAP_SOURCES.TIANDITU_ADMIN.BOUNDARY(adcode).replace('你的天地图token', TIANDITU_CONFIG.TOKEN)\n const response = await fetch(url)\n \n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`)\n }\n \n const data = await response.json()\n return data\n }\n catch (error) {\n console.error('Failed to fetch Tianditu boundary data:', error)\n throw error\n }\n}\n\n// 获取地图数据的函数\nexport async function fetchMapData(adcode: string): Promise<any> {\n try {\n // 优先尝试从天地图获取数据\n if (TIANDITU_CONFIG.TOKEN !== '你的天地图token') {\n try {\n const tiandituData = await fetchTiandituBoundary(adcode)\n if (tiandituData && tiandituData.data && tiandituData.data.length > 0) {\n // 转换天地图数据为 GeoJSON 格式\n return convertTiandituToGeoJson(tiandituData)\n }\n }\n catch (error) {\n console.warn('Failed to fetch from Tianditu, trying DataV:', error)\n }\n }\n\n // 备用方案:从 DataV 获取数据\n const url = FREE_MAP_SOURCES.PROVINCE.DATAV(adcode)\n console.log('Fetching province map data from:', url)\n const response = await fetch(url)\n \n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`)\n }\n \n const data = await response.json()\n console.log('Successfully fetched province map data for:', adcode, data)\n return data\n }\n catch (error) {\n console.error('Failed to fetch map data for adcode:', adcode, error)\n throw error\n }\n}\n\n// 转换天地图数据为 GeoJSON 格式\nfunction convertTiandituToGeoJson(tiandituData: any): any {\n const features = tiandituData.data.map((item: any) => ({\n type: 'Feature',\n properties: {\n name: item.name,\n adcode: item.adcode,\n level: item.level,\n },\n geometry: {\n type: 'Polygon',\n coordinates: item.polygon ? [item.polygon] : [],\n },\n }))\n\n return {\n type: 'FeatureCollection',\n features,\n }\n} "],"names":["FREE_MAP_SOURCES","PROVINCE","TIANDITU","DATAV","adcode","TIANDITU_ADMIN","BOUNDARY","async","getChinaMapData","response","fetch","ok","json","error","console","warn","type","features","properties","name","geometry","coordinates","PROVINCE_CODES","PROVINCE_NAMES","Object","fromEntries","entries","map","_ref","code","getProvinceCode","provinceName","getProvinceName","provinceCode","isProvinceCode","test","getProvinceMapData","url","Error","status","TIANDITU_CONFIG","TOKEN","BASE_URL","fetchTiandituBoundary","replace","fetchMapData","log","data"],"mappings":"AACO,MAAMA,EAAmB,CAE9BC,SAAU,CAERC,SAAUA,IAAM,8LAEhBC,MAAQC,GAAmB,+CAA+CA,eAG5EC,eAAgB,CAEdC,SAAWF,GAAmB,qEAAqEA,uHAcvGG,eAAsBC,IACpB,IAEE,MAAMC,QAAiBC,MAAM,gEAC7B,GAAID,EAASE,GACX,aAAaF,EAASG,MAE1B,OACOC,GACLC,QAAQC,KAAK,wCAAyCF,EACxD,CAGA,MAAO,CACLG,KAAM,oBACNC,SAAU,CACR,CACED,KAAM,UACNE,WAAY,CACVC,KAAM,KACNf,OAAQ,UAEVgB,SAAU,CACRJ,KAAM,UACNK,YAAa,CAAC,CACZ,CAAC,MAAO,OAAQ,CAAC,MAAO,OAAQ,CAAC,MAAO,OAAQ,CAAC,MAAO,OACxD,CAAC,MAAO,OAAQ,CAAC,MAAO,OAAQ,CAAC,MAAO,OAAQ,CAAC,MAAO,OACxD,CAAC,MAAO,OAAQ,CAAC,MAAO,OAAQ,CAAC,OAAQ,OAAQ,CAAC,OAAQ,OAC1D,CAAC,MAAQ,OAAQ,CAAC,OAAQ,MAAQ,CAAC,OAAQ,OAAQ,CAAC,OAAQ,OAC5D,CAAC,OAAQ,OAAQ,CAAC,OAAQ,OAAQ,CAAC,OAAQ,MAAQ,CAAC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GO,SAASC,EAAeL,GAC7B,MAAO,UAAUM,KAAKN,IAAkB,WAATA,CACjC,CAGAtB,eAAsB6B,EAAmBL,GACvC,MAAME,EAAeH,EAAgBC,GAErC,IACE,MAAMM,EAAM,+CAA+CJ,cAErDxB,QAAiBC,MAAM2B,GAC7B,IAAK5B,EAASE,GACZ,MAAM,IAAI2B,MAAM,uBAAuB7B,EAAS8B,UAIlD,aADmB9B,EAASG,MAE9B,OACOC,GAEL,MADAC,QAAQD,MAAM,yCAA0CkB,EAAclB,GAChEA,CACR,CACF,CAGO,MAAM2B,EAAkB,CAE7BC,MAAO,aAEPC,SAAU,+BAIZnC,eAAsBoC,EAAsBvC,GAC1C,IACE,MAAMiC,EAAMrC,EAAiBK,eAAeC,SAASF,GAAQwC,QAAQ,aAAcJ,EAAgBC,OAC7FhC,QAAiBC,MAAM2B,GAE7B,IAAK5B,EAASE,GACZ,MAAM,IAAI2B,MAAM,uBAAuB7B,EAAS8B,UAIlD,aADmB9B,EAASG,MAE9B,OACOC,GAEL,MADAC,QAAQD,MAAM,0CAA2CA,GACnDA,CACR,CACF,CAGAN,eAAsBsC,EAAazC,GACjC,IAgBE,MAAMiC,EAAMrC,EAAiBC,SAASE,MAAMC,GAC5CU,QAAQgC,IAAI,mCAAoCT,GAChD,MAAM5B,QAAiBC,MAAM2B,GAE7B,IAAK5B,EAASE,GACZ,MAAM,IAAI2B,MAAM,uBAAuB7B,EAAS8B,UAGlD,MAAMQ,QAAatC,EAASG,OAE5B,OADAE,QAAQgC,IAAI,8CAA+C1C,EAAQ2C,GAC5DA,CACT,OACOlC,GAEL,MADAC,QAAQD,MAAM,uCAAwCT,EAAQS,GACxDA,CACR,CACF"}
1
+ {"version":3,"file":"mapData.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/utils/mapData.ts"],"sourcesContent":["// 免费的地图数据源\nexport const FREE_MAP_SOURCES = {\n // 省级地图数据源\n PROVINCE: {\n // 使用天地图省级数据\n TIANDITU: () => `https://api.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=你的天地图token`,\n // 使用 DataV 的省级数据\n DATAV: (adcode: string) => `https://geo.datav.aliyun.com/areas_v3/bound/${adcode}_full.json`,\n },\n // 天地图行政区划数据\n TIANDITU_ADMIN: {\n // 获取行政区划边界数据\n BOUNDARY: (adcode: string) => `https://api.tianditu.gov.cn/administrative?postStr={\"searchWord\":\"${adcode}\",\"searchType\":\"11\",\"needSubInfo\":true,\"needAll\":true,\"needPolygon\":true,\"needPre\":true}&type=query&tk=你的天地图token`,\n },\n}\n\n// 中国地图数据 - 使用真实的省级边界数据\nexport const CHINA_MAP_DATA = {\n type: 'FeatureCollection',\n features: [\n // 这里应该包含所有省份的边界数据\n // 由于数据量很大,建议使用外部数据源\n ]\n}\n\n// 获取中国地图数据的函数\nexport async function getChinaMapData(): Promise<any> {\n try {\n // 优先使用 DataV 的中国地图数据\n const response = await fetch('https://geo.datav.aliyun.com/areas_v3/bound/100000_full.json')\n if (response.ok) {\n return await response.json()\n }\n }\n catch (error) {\n console.warn('Failed to fetch China map from DataV:', error)\n }\n\n // 备用方案:使用简化的地图数据\n return {\n type: 'FeatureCollection',\n features: [\n {\n type: 'Feature',\n properties: {\n name: '中国',\n adcode: '100000',\n },\n geometry: {\n type: 'Polygon',\n coordinates: [[\n [73.66, 35.42], [78.91, 35.42], [81.33, 36.08], [85.29, 36.08], \n [88.02, 35.42], [90.16, 35.42], [92.13, 34.76], [94.81, 34.76], \n [97.06, 33.44], [99.43, 32.78], [101.06, 31.46], [102.73, 30.14], \n [104.40, 28.82], [106.07, 27.50], [107.74, 26.18], [109.41, 24.86], \n [111.08, 23.54], [112.75, 22.22], [114.42, 20.90], [116.09, 19.58], \n [117.76, 18.26], [119.43, 16.94], [121.10, 15.62], [122.77, 14.30], \n [124.44, 12.98], [126.11, 11.66], [127.78, 10.34], [129.45, 9.02], \n [131.12, 7.70], [132.79, 6.38], [134.46, 5.06], [135.05, 4.40], \n [135.05, 5.06], [135.05, 6.38], [135.05, 7.70], [135.05, 9.02], \n [135.05, 10.34], [135.05, 11.66], [135.05, 12.98], [135.05, 14.30], \n [135.05, 15.62], [135.05, 16.94], [135.05, 18.26], [135.05, 19.58], \n [135.05, 20.90], [135.05, 22.22], [135.05, 23.54], [135.05, 24.86], \n [135.05, 26.18], [135.05, 27.50], [135.05, 28.82], [135.05, 30.14], \n [135.05, 31.46], [135.05, 32.78], [135.05, 34.10], [135.05, 35.42], \n [134.46, 36.08], [133.79, 36.74], [133.12, 37.40], [132.45, 38.06], \n [131.78, 38.72], [131.11, 39.38], [130.44, 40.04], [129.77, 40.70], \n [129.10, 41.36], [128.43, 42.02], [127.76, 42.68], [127.09, 43.34], \n [126.42, 44.00], [125.75, 44.66], [125.08, 45.32], [124.41, 45.98], \n [123.74, 46.64], [123.07, 47.30], [122.40, 47.96], [121.73, 48.62], \n [121.06, 49.28], [120.39, 49.94], [119.72, 50.60], [119.05, 51.26], \n [118.38, 51.92], [117.71, 52.58], [117.04, 53.24], [116.37, 53.90], \n [115.70, 54.56], [115.03, 55.22], [114.36, 55.88], [113.69, 56.54], \n [113.02, 57.20], [112.35, 57.86], [111.68, 58.52], [111.01, 59.18], \n [110.34, 59.84], [109.67, 60.50], [109.00, 61.16], [108.33, 61.82], \n [107.66, 62.48], [106.99, 63.14], [106.32, 63.80], [105.65, 64.46], \n [104.98, 65.12], [104.31, 65.78], [103.64, 66.44], [102.97, 67.10], \n [102.30, 67.76], [101.63, 68.42], [100.96, 69.08], [100.29, 69.74], \n [99.62, 70.40], [98.95, 71.06], [98.28, 71.72], [97.61, 72.38], \n [96.94, 73.04], [96.27, 73.70], [95.60, 74.36], [94.93, 75.02], \n [94.26, 75.68], [93.59, 76.34], [92.92, 77.00], [92.25, 77.66], \n [91.58, 78.32], [90.91, 78.98], [90.24, 79.64], [89.57, 80.30], \n [88.90, 80.96], [88.23, 81.62], [87.56, 82.28], [86.89, 82.94], \n [86.22, 83.60], [85.55, 84.26], [84.88, 84.92], [84.21, 85.58], \n [83.54, 86.24], [82.87, 86.90], [82.20, 87.56], [81.53, 88.22], \n [80.86, 88.88], [80.19, 89.54], [79.52, 90.20], [78.85, 90.86], \n [78.18, 91.52], [77.51, 92.18], [76.84, 92.84], [76.17, 93.50], \n [75.50, 94.16], [74.83, 94.82], [74.16, 95.48], [73.66, 96.14], \n [73.66, 95.48], [73.66, 94.82], [73.66, 94.16], [73.66, 93.50], \n [73.66, 92.84], [73.66, 92.18], [73.66, 91.52], [73.66, 90.86], \n [73.66, 90.20], [73.66, 89.54], [73.66, 88.88], [73.66, 88.22], \n [73.66, 87.56], [73.66, 86.90], [73.66, 86.24], [73.66, 85.58], \n [73.66, 84.92], [73.66, 84.26], [73.66, 83.60], [73.66, 82.94], \n [73.66, 82.28], [73.66, 81.62], [73.66, 80.96], [73.66, 80.30], \n [73.66, 79.64], [73.66, 78.98], [73.66, 78.32], [73.66, 77.66], \n [73.66, 77.00], [73.66, 76.34], [73.66, 75.68], [73.66, 75.02], \n [73.66, 74.36], [73.66, 73.70], [73.66, 73.04], [73.66, 72.38], \n [73.66, 71.72], [73.66, 71.06], [73.66, 70.40], [73.66, 69.74], \n [73.66, 69.08], [73.66, 68.42], [73.66, 67.76], [73.66, 67.10], \n [73.66, 66.44], [73.66, 65.78], [73.66, 65.12], [73.66, 64.46], \n [73.66, 63.80], [73.66, 63.14], [73.66, 62.48], [73.66, 61.82], \n [73.66, 61.16], [73.66, 60.50], [73.66, 59.84], [73.66, 59.18], \n [73.66, 58.52], [73.66, 57.86], [73.66, 57.20], [73.66, 56.54], \n [73.66, 55.88], [73.66, 55.22], [73.66, 54.56], [73.66, 53.90], \n [73.66, 53.24], [73.66, 52.58], [73.66, 51.92], [73.66, 51.26], \n [73.66, 50.60], [73.66, 49.94], [73.66, 49.28], [73.66, 48.62], \n [73.66, 47.96], [73.66, 47.30], [73.66, 46.64], [73.66, 45.98], \n [73.66, 45.32], [73.66, 44.66], [73.66, 44.00], [73.66, 43.34], \n [73.66, 42.68], [73.66, 42.02], [73.66, 41.36], [73.66, 40.70], \n [73.66, 40.04], [73.66, 39.38], [73.66, 38.72], [73.66, 38.06], \n [73.66, 37.40], [73.66, 36.74], [73.66, 36.08], [73.66, 35.42]\n ]],\n },\n },\n ],\n }\n}\n\n\n\n// 省级行政区代码映射\nexport const PROVINCE_CODES = {\n '北京市': '110000',\n '天津市': '120000',\n '河北省': '130000',\n '山西省': '140000',\n '内蒙古自治区': '150000',\n '辽宁省': '210000',\n '吉林省': '220000',\n '黑龙江省': '230000',\n '上海市': '310000',\n '江苏省': '320000',\n '浙江省': '330000',\n '安徽省': '340000',\n '福建省': '350000',\n '江西省': '360000',\n '山东省': '370000',\n '河南省': '410000',\n '湖北省': '420000',\n '湖南省': '430000',\n '广东省': '440000',\n '广西壮族自治区': '450000',\n '海南省': '460000',\n '重庆市': '500000',\n '四川省': '510000',\n '贵州省': '520000',\n '云南省': '530000',\n '西藏自治区': '540000',\n '陕西省': '610000',\n '甘肃省': '620000',\n '青海省': '630000',\n '宁夏回族自治区': '640000',\n '新疆维吾尔自治区': '650000',\n '台湾省': '710000',\n '香港特别行政区': '810000',\n '澳门特别行政区': '820000',\n}\n\n// 省级名称映射(反向查找)\nexport const PROVINCE_NAMES = Object.fromEntries(\n Object.entries(PROVINCE_CODES).map(([name, code]) => [code, name])\n)\n\n// 获取省级代码\nexport function getProvinceCode(provinceName: string): string {\n return PROVINCE_CODES[provinceName as keyof typeof PROVINCE_CODES] || '100000'\n}\n\n// 获取省级名称\nexport function getProvinceName(provinceCode: string): string {\n return PROVINCE_NAMES[provinceCode] || '中国'\n}\n\n// 判断是否为省级代码\nexport function isProvinceCode(code: string): boolean {\n return /^\\d{6}$/.test(code) && code !== '100000'\n}\n\n// 获取省级地图数据\nexport async function getProvinceMapData(provinceName: string): Promise<any> {\n const provinceCode = getProvinceCode(provinceName)\n \n try {\n const url = `https://geo.datav.aliyun.com/areas_v3/bound/${provinceCode}_full.json`\n \n const response = await fetch(url)\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`)\n }\n \n const data = await response.json()\n return data\n }\n catch (error) {\n console.error('Failed to fetch province map data for:', provinceName, error)\n throw error\n }\n}\n\n// 天地图配置\nexport const TIANDITU_CONFIG = {\n // 天地图 token(需要申请)\n TOKEN: '你的天地图token', // 请替换为您的天地图 token\n // 天地图 API 基础 URL\n BASE_URL: 'https://api.tianditu.gov.cn',\n}\n\n// 获取天地图行政区划数据\nexport async function fetchTiandituBoundary(adcode: string): Promise<any> {\n try {\n const url = FREE_MAP_SOURCES.TIANDITU_ADMIN.BOUNDARY(adcode).replace('你的天地图token', TIANDITU_CONFIG.TOKEN)\n const response = await fetch(url)\n \n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`)\n }\n \n const data = await response.json()\n return data\n }\n catch (error) {\n console.error('Failed to fetch Tianditu boundary data:', error)\n throw error\n }\n}\n\n// 获取地图数据的函数\nexport async function fetchMapData(adcode: string): Promise<any> {\n try {\n // 优先尝试从天地图获取数据\n if (TIANDITU_CONFIG.TOKEN !== '你的天地图token') {\n try {\n const tiandituData = await fetchTiandituBoundary(adcode)\n if (tiandituData && tiandituData.data && tiandituData.data.length > 0) {\n // 转换天地图数据为 GeoJSON 格式\n return convertTiandituToGeoJson(tiandituData)\n }\n }\n catch (error) {\n console.warn('Failed to fetch from Tianditu, trying DataV:', error)\n }\n }\n\n // 备用方案:从 DataV 获取数据\n const url = FREE_MAP_SOURCES.PROVINCE.DATAV(adcode)\n console.log('Fetching province map data from:', url)\n const response = await fetch(url)\n \n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`)\n }\n \n const data = await response.json()\n console.log('Successfully fetched province map data for:', adcode, data)\n return data\n }\n catch (error) {\n console.error('Failed to fetch map data for adcode:', adcode, error)\n throw error\n }\n}\n\n// 转换天地图数据为 GeoJSON 格式\nfunction convertTiandituToGeoJson(tiandituData: any): any {\n const features = tiandituData.data.map((item: any) => ({\n type: 'Feature',\n properties: {\n name: item.name,\n adcode: item.adcode,\n level: item.level,\n },\n geometry: {\n type: 'Polygon',\n coordinates: item.polygon ? [item.polygon] : [],\n },\n }))\n\n return {\n type: 'FeatureCollection',\n features,\n }\n} "],"names":["PROVINCE_CODES","getProvinceCode","provinceName","isProvinceCode","code","test","Object","fromEntries","entries","map","_ref","name"],"mappings":"AAyHO,MAAMA,EAAiB,CAC5B,MAAO,SACP,MAAO,SACP,MAAO,SACP,MAAO,SACP,SAAU,SACV,MAAO,SACP,MAAO,SACP,OAAQ,SACR,MAAO,SACP,MAAO,SACP,MAAO,SACP,MAAO,SACP,MAAO,SACP,MAAO,SACP,MAAO,SACP,MAAO,SACP,MAAO,SACP,MAAO,SACP,MAAO,SACP,UAAW,SACX,MAAO,SACP,MAAO,SACP,MAAO,SACP,MAAO,SACP,MAAO,SACP,QAAS,SACT,MAAO,SACP,MAAO,SACP,MAAO,SACP,UAAW,SACX,WAAY,SACZ,MAAO,SACP,UAAW,SACX,UAAW,UASN,SAASC,EAAgBC,GAC9B,OAAOF,EAAeE,IAAgD,QACxE,CAQO,SAASC,EAAeC,GAC7B,MAAO,UAAUC,KAAKD,IAAkB,WAATA,CACjC,CAjB8BE,OAAOC,YACnCD,OAAOE,QAAQR,GAAgBS,IAAIC,IAAA,IAAEC,EAAMP,GAAIM,EAAA,MAAM,CAACN,EAAMO"}
@@ -1,2 +1,2 @@
1
- "use strict";exports.version="0.0.56";
1
+ "use strict";exports.version="0.0.57";
2
2
  //# sourceMappingURL=package.json.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("echarts"),a=require("../utils/config.cjs"),r=require("../utils/injectionKeys.cjs"),n=require("../utils/useCharts.cjs");function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(a){if("default"!==a){var r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:function(){return e[a]}})}}),t.default=e,Object.freeze(t)}var c=o(t);const s={class:"data-chart-area-wrap"};var i=e.defineComponent({name:"DataChartArea",__name:"area",props:{chartOptions:{type:null,required:!0},chartData:{type:Object,required:!1,default:()=>({colDesc:[],xGroupByDesc:{colDesc:"",groupByDesc:"",groupByValues:[],xAxis:!1},groupByDesc:[],data:[],modelName:""})}},setup(t){const o=e.inject(r.InjectionChartMerge,e=>e,!0);let i="中国";const l=e.ref({features:[],type:"FeatureCollection"}),u=e.ref(null),m=e.ref(null),p=e.computed(()=>{try{const{xGroupByDesc:e,groupByDesc:a,colDesc:r,modelName:n,data:c}=t.chartData,s=[];r.forEach(e=>{c.forEach(t=>{s.push(Number(t[e]))})});const u={title:{text:n},tooltip:{formatter(e){let t=`${e.name}<br/>`;return u.series?.forEach(a=>{a.data?.forEach(r=>{r.name===e.name&&(t+=`${a.name}:${r.value}</br>`)}),t.includes(a.name)||(t+=`${a.name}:-</br>`)}),t}},visualMap:{min:Math.min(...s,0),max:Math.max(...s,0)},series:r?.map(t=>{const r=[],n=a.find(e=>e.colDesc===("中国"===i?"医院所在省":"医院所在市")),o={};c.map(a=>{const r=a[("中国"===i?e?.colDesc||"":n?.colDesc)||""],o=l.value.features?.find(({properties:{name:e}})=>e?.includes(r));return{name:o?.properties?.name||"",value:Number(a[t])}}).forEach(e=>{o[e.name]?o[e.name]=o[e.name]+e.value:o[e.name]=e.value});for(const e in o)r.push({name:e,value:o[e]});return{name:t,type:"map",map:i,data:r}})};return o(u,t.chartOptions)}catch(e){return console.error("Error computing area chart options:",e),{title:{text:"地图加载失败"},series:[]}}});async function d(e="中国"){try{const t=await a.getGeoJsonData({adcode:e});return t&&t.features&&0!==t.features.length?(l.value=t,i=e,void c.registerMap(e,t)):void console.error("Invalid GeoJSON data for:",e)}catch(t){if(console.error("Failed to register map for:",e,t),"中国"!==e)return console.log("Falling back to China map"),d("中国")}}return n.useCharts({chartDOM:m,chartOptions:p,chartData:e.computed(()=>t.chartData),initAfter:async function(e){u.value=e;try{await d(),e&&!e.isDisposed()&&(e.getZr()?.on("click",t=>{e?.showLoading(),t.target||"中国"===i||d("中国"),e.hideLoading()}),e.on("click",a=>{e?.showLoading();const r=t.chartData.groupByDesc?.some(e=>"医院所在市"===e.colDesc);"中国"===i&&r&&a.name&&d(a.name).then(()=>{e&&!e.isDisposed()&&e.setOption(p.value)}),e?.hideLoading()}))}catch(t){if(console.error("Failed to initialize map:",t),e&&!e.isDisposed())try{await d("中国")}catch(e){console.error("Failed to retry map registration:",e)}}}}),(t,a)=>(e.openBlock(),e.createElementBlock("div",s,[e.createCommentVNode(' <el-select\n v-if="isShowSelect"\n v-model="adcode"\n class="city-select"\n size="small"\n @change="selectChina"\n >\n <el-option\n v-for="item in selectList"\n :key="item.value"\n :label="item.label"\n :value="item.value"\n />\n </el-select> '),e.createElementVNode("div",{ref_key:"dataChartArea",ref:m,class:"data-chart-area"},null,512)]))}});exports.default=i;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("echarts"),a=require("../utils/config.cjs"),r=require("../utils/injectionKeys.cjs"),n=require("../utils/useCharts.cjs");function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(a){if("default"!==a){var r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:function(){return e[a]}})}}),t.default=e,Object.freeze(t)}var c=o(t);const s={class:"data-chart-area-wrap"};var i=e.defineComponent({name:"DataChartArea",__name:"area",props:{chartOptions:{type:null,required:!0},chartData:{type:Object,required:!1,default:()=>({colDesc:[],xGroupByDesc:{colDesc:"",groupByDesc:"",groupByValues:[],xAxis:!1},groupByDesc:[],data:[],modelName:""})}},setup(t){const o=e.inject(r.InjectionChartMerge,e=>e,!0);let i="中国";const l=e.ref({features:[],type:"FeatureCollection"}),u=e.ref(null),m=e.ref(null),p=e.computed(()=>{try{const{xGroupByDesc:e,groupByDesc:a,colDesc:r,modelName:n,data:c}=t.chartData,s=[];r.forEach(e=>{c.forEach(t=>{s.push(Number(t[e]))})});const u={title:{text:n},tooltip:{formatter(e){let t=`${e.name}<br/>`;return u.series?.forEach(a=>{a.data?.forEach(r=>{r.name===e.name&&(t+=`${a.name}:${r.value}</br>`)}),t.includes(a.name)||(t+=`${a.name}:-</br>`)}),t}},visualMap:{min:Math.min(...s,0),max:Math.max(...s,0),text:["高","低"],realtime:!1,calculable:!0,inRange:{color:["#E8F4FD","#B8D4F7","#7BA4F0","#4A7BE8","#3562e1"]}},series:r?.map(t=>{const r=[],n=a.find(e=>e.colDesc===("中国"===i?"医院所在省":"医院所在市")),o={};c.map(a=>{const r=a[("中国"===i?e?.colDesc||"":n?.colDesc)||""],o=l.value.features?.find(({properties:{name:e}})=>e?.includes(r));return{name:o?.properties?.name||"",value:Number(a[t])}}).forEach(e=>{o[e.name]?o[e.name]=o[e.name]+e.value:o[e.name]=e.value});for(const e in o)r.push({name:e,value:o[e]});return{name:t,type:"map",map:i,data:r}})};return o(u,t.chartOptions)}catch(e){return console.error("Error computing area chart options:",e),{title:{text:"地图加载失败"},series:[]}}});async function d(e="中国"){try{const t=await a.getGeoJsonData({adcode:e});return t&&t.features&&0!==t.features.length?(l.value=t,i=e,void c.registerMap(e,t)):void console.error("Invalid GeoJSON data for:",e)}catch(t){if(console.error("Failed to register map for:",e,t),"中国"!==e)return console.log("Falling back to China map"),d("中国")}}return n.useCharts({chartDOM:m,chartOptions:p,chartData:e.computed(()=>t.chartData),initAfter:async function(e){u.value=e;try{await d(),e&&!e.isDisposed()&&(e.getZr()?.on("click",t=>{e?.showLoading(),t.target||"中国"===i||d("中国"),e.hideLoading()}),e.on("click",a=>{e?.showLoading();const r=t.chartData.groupByDesc?.some(e=>"医院所在市"===e.colDesc);"中国"===i&&r&&a.name&&d(a.name).then(()=>{e&&!e.isDisposed()&&e.setOption(p.value)}),e?.hideLoading()}))}catch(t){if(console.error("Failed to initialize map:",t),e&&!e.isDisposed())try{await d("中国")}catch(e){console.error("Failed to retry map registration:",e)}}}}),(t,a)=>(e.openBlock(),e.createElementBlock("div",s,[e.createCommentVNode(' <el-select\n v-if="isShowSelect"\n v-model="adcode"\n class="city-select"\n size="small"\n @change="selectChina"\n >\n <el-option\n v-for="item in selectList"\n :key="item.value"\n :label="item.label"\n :value="item.value"\n />\n </el-select> '),e.createElementVNode("div",{ref_key:"dataChartArea",ref:m,class:"data-chart-area"},null,512)]))}});exports.default=i;
2
2
  //# sourceMappingURL=area.vue2.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"area.vue2.cjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/area.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ECharts } from 'echarts/types/dist/echarts'\nimport type { EChartsOption, GeoJson, IFormatPublicData } from '../utils/types'\nimport * as echarts from 'echarts'\nimport { getGeoJsonData } from '../utils/config'\nimport { InjectionChartMerge } from '../utils/injectionKeys'\nimport { useCharts } from '../utils/useCharts'\n\ndefineOptions({\n name: 'DataChartArea',\n})\n\nconst {\n chartOptions,\n chartData = {\n colDesc: [],\n xGroupByDesc: {\n colDesc: '',\n groupByDesc: '',\n groupByValues: [],\n xAxis: false,\n },\n groupByDesc: [],\n data: [],\n modelName: '',\n },\n} = defineProps<{\n chartOptions: EChartsOption\n chartData?: IFormatPublicData\n}>()\n\nconst merge = inject(InjectionChartMerge, (v: any) => v, true)\n\nlet adcode = '中国'\nconst currentGeoJson = ref<GeoJson>({\n features: [],\n type: 'FeatureCollection',\n})\nconst myChart = ref<ECharts | null>(null)\nconst dataChartArea = ref(null)\n\nconst areaChartOptions = computed<EChartsOption>(() => {\n try {\n const { xGroupByDesc, groupByDesc, colDesc, modelName, data } = chartData\n const allNums: number[] = []\n colDesc.forEach((item) => {\n data.forEach((dataItem) => {\n allNums.push(Number(dataItem[item]))\n })\n })\n const config = {\n title: {\n text: modelName,\n },\n tooltip: {\n formatter(params: { name: string }) {\n let res = `${params.name}<br/>`\n config.series?.forEach((colDescItem) => {\n colDescItem.data?.forEach((item) => {\n if (item.name === params.name) {\n res += `${colDescItem.name}:${item.value}</br>`\n }\n })\n if (!res.includes(colDescItem.name)) {\n res += `${colDescItem.name}:-</br>`\n }\n })\n return res\n },\n },\n visualMap: {\n min: Math.min(...allNums, 0),\n max: Math.max(...allNums, 0),\n },\n series: colDesc?.map((colDescItem) => {\n const seriesData = []\n const row = groupByDesc.find(item => item.colDesc === (adcode === '中国' ? '医院所在省' : '医院所在市'))\n // 先用省份数据,如果没有再用市级数据\n const arr: {\n [key: string]: number\n } = {}\n data.map((item) => {\n const sourceName = item[(adcode === '中国' ? (xGroupByDesc?.colDesc || '') : row?.colDesc) || '']\n const find = currentGeoJson.value.features?.find(({ properties: { name } }: { properties: { name?: string } }) => name?.includes(sourceName as string))\n return {\n name: find?.properties?.name || '',\n value: Number(item[colDescItem]),\n }\n }).forEach((item) => {\n if (!arr[item.name]) {\n arr[item.name] = item.value\n }\n else {\n arr[item.name] = arr[item.name] + item.value\n }\n })\n for (const key in arr) {\n seriesData.push({\n name: key,\n value: arr[key],\n })\n }\n return {\n name: colDescItem,\n type: 'map',\n map: adcode,\n data: seriesData,\n }\n }),\n }\n\n return merge(config, chartOptions)\n }\n catch (error) {\n console.error('Error computing area chart options:', error)\n return {\n title: { text: '地图加载失败' },\n series: [],\n }\n }\n})\n\nasync function initAfter(mc: ECharts | null) {\n myChart.value = mc\n try {\n await registerMap()\n // 添加判断,确保图表实例存在且未被销毁\n if (mc && !mc.isDisposed()) {\n // charts 监听事件\n mc.getZr()?.on('click', (params: { target: HTMLElement }) => {\n mc?.showLoading()\n if (!params.target && adcode !== '中国') {\n registerMap('中国')\n }\n mc.hideLoading()\n })\n mc.on('click', (params: { name: string }) => {\n mc?.showLoading()\n const flag = chartData.groupByDesc?.some(item => item.colDesc === '医院所在市')\n if (adcode === '中国' && flag && params.name) {\n registerMap(params.name).then(() => {\n if (mc && !mc.isDisposed()) {\n mc.setOption(areaChartOptions.value)\n }\n })\n }\n mc?.hideLoading()\n })\n }\n }\n catch (error) {\n console.error('Failed to initialize map:', error)\n // 如果初始化失败,尝试重新注册地图\n if (mc && !mc.isDisposed()) {\n try {\n await registerMap('中国')\n }\n catch (retryError) {\n console.error('Failed to retry map registration:', retryError)\n }\n }\n }\n}\n\n// function selectChina() {\n// registerMap(adcode)\n// }\nasync function registerMap(keyword = '中国') {\n try {\n const geoJson = await getGeoJsonData({ adcode: keyword })\n if (!geoJson || !geoJson.features || geoJson.features.length === 0) {\n console.error('Invalid GeoJSON data for:', keyword)\n return\n }\n currentGeoJson.value = geoJson\n adcode = keyword\n\n echarts.registerMap(keyword, geoJson as any)\n return\n }\n catch (error) {\n console.error('Failed to register map for:', keyword, error)\n // 如果注册失败,尝试使用默认的中国地图数据\n if (keyword !== '中国') {\n console.log('Falling back to China map')\n return registerMap('中国')\n }\n }\n}\nuseCharts({\n chartDOM: dataChartArea,\n chartOptions: areaChartOptions,\n chartData: computed(() => chartData),\n initAfter\n})\n</script>\n\n<template>\n <div class=\"data-chart-area-wrap\">\n <!-- <el-select\n v-if=\"isShowSelect\"\n v-model=\"adcode\"\n class=\"city-select\"\n size=\"small\"\n @change=\"selectChina\"\n >\n <el-option\n v-for=\"item in selectList\"\n :key=\"item.value\"\n :label=\"item.label\"\n :value=\"item.value\"\n />\n </el-select> -->\n <div\n ref=\"dataChartArea\"\n class=\"data-chart-area\"\n />\n </div>\n</template>\n\n<style scoped lang=\"scss\">\n.data-chart-area-wrap {\n position: relative;\n\n .city-select {\n position: absolute;\n top: 10px;\n right: 100px;\n z-index: 1;\n width: 120px;\n }\n\n .data-chart-area {\n height: 100%;\n }\n}\n</style>\n"],"names":["merge","inject","InjectionChartMerge","v","adcode","currentGeoJson","ref","features","type","myChart","dataChartArea","areaChartOptions","computed","xGroupByDesc","groupByDesc","colDesc","modelName","data","__props","chartData","allNums","forEach","item","dataItem","push","Number","config","title","text","tooltip","formatter","params","res","name","series","colDescItem","value","includes","visualMap","min","Math","max","map","seriesData","row","find","arr","sourceName","properties","key","chartOptions","error","console","async","registerMap","keyword","geoJson","getGeoJsonData","length","echarts","log","useCharts","chartDOM","initAfter","mc","isDisposed","getZr","on","showLoading","target","hideLoading","flag","some","then","setOption","retryError","_openBlock","_createElementBlock","_hoisted_1","_createCommentVNode","_createElementVNode","class"],"mappings":"syBA+BA,MAAMA,EAAQC,EAAAA,OAAOC,EAAAA,oBAAsBC,GAAWA,GAAG,GAEzD,IAAIC,EAAS,KACb,MAAMC,EAAiBC,EAAAA,IAAa,CAClCC,SAAU,GACVC,KAAM,sBAEFC,EAAUH,EAAAA,IAAoB,MAC9BI,EAAgBJ,EAAAA,IAAI,MAEpBK,EAAmBC,EAAAA,SAAwB,KAC/C,IACE,MAAMC,aAAEA,EAAAC,YAAcA,EAAAC,QAAaA,YAASC,EAAAC,KAAWA,GAASC,EAAAC,UAC1DC,EAAoB,GAC1BL,EAAQM,QAASC,IACfL,EAAKI,QAASE,IACZH,EAAQI,KAAKC,OAAOF,EAASD,SAGjC,MAAMI,EAAS,CACbC,MAAO,CACLC,KAAMZ,GAERa,QAAS,CACP,SAAAC,CAAUC,GACR,IAAIC,EAAM,GAAGD,EAAOE,YAWpB,OAVAP,EAAOQ,QAAQb,QAASc,IACtBA,EAAYlB,MAAMI,QAASC,IACrBA,EAAKW,OAASF,EAAOE,OACvBD,GAAO,GAAGG,EAAYF,QAAQX,EAAKc,gBAGlCJ,EAAIK,SAASF,EAAYF,QAC5BD,GAAO,GAAGG,EAAYF,iBAGnBD,CACT,GAEFM,UAAW,CACTC,IAAKC,KAAKD,OAAOnB,EAAS,GAC1BqB,IAAKD,KAAKC,OAAOrB,EAAS,IAE5Bc,OAAQnB,GAAS2B,IAAKP,IACpB,MAAMQ,EAAa,GACbC,EAAM9B,EAAY+B,KAAKvB,GAAQA,EAAKP,WAAwB,OAAXX,EAAkB,QAAU,UAE7E0C,EAEF,CAAA,EACJ7B,E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AEZD,EAAGE,SAASC,GAAG,QAAUpC,IACvBiC,GAAII,cACCrC,EAAOsC,QAAqB,OAAXjE,GACpBkD,EAAY,MAEdU,EAAGM,gBAELN,EAAGG,GAAG,QAAUpC,IACdiC,GAAII,cACJ,MAAMG,EAAOrD,EAAAC,UAAUL,aAAa0D,KAAKlD,GAAyB,UAAjBA,EAAKP,SACvC,OAAXX,GAAmBmE,GAAQxC,EAAOE,MACpCqB,EAAYvB,EAAOE,MAAMwC,KAAK,KACxBT,IAAOA,EAAGC,cACZD,EAAGU,UAAU/D,EAAiByB,SAIpC4B,GAAIM,gBAGV,OACOnB,GAGL,GAFAC,QAAQD,MAAM,4BAA6BA,GAEvCa,IAAOA,EAAGC,aACZ,UACQX,EAAY,KACpB,OACOqB,GACLvB,QAAQD,MAAM,oCAAqCwB,EACrD,CAEJ,CACF,YAoCEC,cAAAC,qBAmBM,MAnBNC,EAmBM,CAlBJC,EAAAA,mBAAA,6TAcAC,EAAAA,mBAGE,MAAA,SAFI,gBAAJ1E,IAAII,EACJuE,MAAM"}
1
+ {"version":3,"file":"area.vue2.cjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/area.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ECharts } from 'echarts/types/dist/echarts'\nimport type { EChartsOption, GeoJson, IFormatPublicData } from '../utils/types'\nimport * as echarts from 'echarts'\nimport { getGeoJsonData } from '../utils/config'\nimport { InjectionChartMerge } from '../utils/injectionKeys'\nimport { useCharts } from '../utils/useCharts'\n\ndefineOptions({\n name: 'DataChartArea',\n})\n\nconst {\n chartOptions,\n chartData = {\n colDesc: [],\n xGroupByDesc: {\n colDesc: '',\n groupByDesc: '',\n groupByValues: [],\n xAxis: false,\n },\n groupByDesc: [],\n data: [],\n modelName: '',\n },\n} = defineProps<{\n chartOptions: EChartsOption\n chartData?: IFormatPublicData\n}>()\n\nconst merge = inject(InjectionChartMerge, (v: any) => v, true)\n\nlet adcode = '中国'\nconst currentGeoJson = ref<GeoJson>({\n features: [],\n type: 'FeatureCollection',\n})\nconst myChart = ref<ECharts | null>(null)\nconst dataChartArea = ref(null)\n\nconst areaChartOptions = computed<EChartsOption>(() => {\n try {\n const { xGroupByDesc, groupByDesc, colDesc, modelName, data } = chartData\n const allNums: number[] = []\n colDesc.forEach((item) => {\n data.forEach((dataItem) => {\n allNums.push(Number(dataItem[item]))\n })\n })\n const config = {\n title: {\n text: modelName,\n },\n tooltip: {\n formatter(params: { name: string }) {\n let res = `${params.name}<br/>`\n config.series?.forEach((colDescItem) => {\n colDescItem.data?.forEach((item) => {\n if (item.name === params.name) {\n res += `${colDescItem.name}:${item.value}</br>`\n }\n })\n if (!res.includes(colDescItem.name)) {\n res += `${colDescItem.name}:-</br>`\n }\n })\n return res\n },\n },\n visualMap: {\n min: Math.min(...allNums, 0),\n max: Math.max(...allNums, 0),\n text: ['高', '低'],\n realtime: false,\n calculable: true,\n inRange: {\n color: ['#E8F4FD', '#B8D4F7', '#7BA4F0', '#4A7BE8', '#3562e1']\n },\n },\n series: colDesc?.map((colDescItem) => {\n const seriesData = []\n const row = groupByDesc.find(item => item.colDesc === (adcode === '中国' ? '医院所在省' : '医院所在市'))\n // 先用省份数据,如果没有再用市级数据\n const arr: {\n [key: string]: number\n } = {}\n data.map((item) => {\n const sourceName = item[(adcode === '中国' ? (xGroupByDesc?.colDesc || '') : row?.colDesc) || '']\n const find = currentGeoJson.value.features?.find(({ properties: { name } }: { properties: { name?: string } }) => name?.includes(sourceName as string))\n return {\n name: find?.properties?.name || '',\n value: Number(item[colDescItem]),\n }\n }).forEach((item) => {\n if (!arr[item.name]) {\n arr[item.name] = item.value\n }\n else {\n arr[item.name] = arr[item.name] + item.value\n }\n })\n for (const key in arr) {\n seriesData.push({\n name: key,\n value: arr[key],\n })\n }\n return {\n name: colDescItem,\n type: 'map',\n map: adcode,\n data: seriesData,\n }\n }),\n }\n\n return merge(config, chartOptions)\n }\n catch (error) {\n console.error('Error computing area chart options:', error)\n return {\n title: { text: '地图加载失败' },\n series: [],\n }\n }\n})\n\nasync function initAfter(mc: ECharts | null) {\n myChart.value = mc\n try {\n await registerMap()\n // 添加判断,确保图表实例存在且未被销毁\n if (mc && !mc.isDisposed()) {\n // charts 监听事件\n mc.getZr()?.on('click', (params: { target: HTMLElement }) => {\n mc?.showLoading()\n if (!params.target && adcode !== '中国') {\n registerMap('中国')\n }\n mc.hideLoading()\n })\n mc.on('click', (params: { name: string }) => {\n mc?.showLoading()\n const flag = chartData.groupByDesc?.some(item => item.colDesc === '医院所在市')\n if (adcode === '中国' && flag && params.name) {\n registerMap(params.name).then(() => {\n if (mc && !mc.isDisposed()) {\n mc.setOption(areaChartOptions.value)\n }\n })\n }\n mc?.hideLoading()\n })\n }\n }\n catch (error) {\n console.error('Failed to initialize map:', error)\n // 如果初始化失败,尝试重新注册地图\n if (mc && !mc.isDisposed()) {\n try {\n await registerMap('中国')\n }\n catch (retryError) {\n console.error('Failed to retry map registration:', retryError)\n }\n }\n }\n}\n\n// function selectChina() {\n// registerMap(adcode)\n// }\nasync function registerMap(keyword = '中国') {\n try {\n const geoJson = await getGeoJsonData({ adcode: keyword })\n if (!geoJson || !geoJson.features || geoJson.features.length === 0) {\n console.error('Invalid GeoJSON data for:', keyword)\n return\n }\n currentGeoJson.value = geoJson\n adcode = keyword\n\n echarts.registerMap(keyword, geoJson as any)\n return\n }\n catch (error) {\n console.error('Failed to register map for:', keyword, error)\n // 如果注册失败,尝试使用默认的中国地图数据\n if (keyword !== '中国') {\n console.log('Falling back to China map')\n return registerMap('中国')\n }\n }\n}\nuseCharts({\n chartDOM: dataChartArea,\n chartOptions: areaChartOptions,\n chartData: computed(() => chartData),\n initAfter\n})\n</script>\n\n<template>\n <div class=\"data-chart-area-wrap\">\n <!-- <el-select\n v-if=\"isShowSelect\"\n v-model=\"adcode\"\n class=\"city-select\"\n size=\"small\"\n @change=\"selectChina\"\n >\n <el-option\n v-for=\"item in selectList\"\n :key=\"item.value\"\n :label=\"item.label\"\n :value=\"item.value\"\n />\n </el-select> -->\n <div\n ref=\"dataChartArea\"\n class=\"data-chart-area\"\n />\n </div>\n</template>\n\n<style scoped lang=\"scss\">\n.data-chart-area-wrap {\n position: relative;\n\n .city-select {\n position: absolute;\n top: 10px;\n right: 100px;\n z-index: 1;\n width: 120px;\n }\n\n .data-chart-area {\n height: 100%;\n }\n}\n</style>\n"],"names":["merge","inject","InjectionChartMerge","v","adcode","currentGeoJson","ref","features","type","myChart","dataChartArea","areaChartOptions","computed","xGroupByDesc","groupByDesc","colDesc","modelName","data","__props","chartData","allNums","forEach","item","dataItem","push","Number","config","title","text","tooltip","formatter","params","res","name","series","colDescItem","value","includes","visualMap","min","Math","max","realtime","calculable","inRange","color","map","seriesData","row","find","arr","sourceName","properties","key","chartOptions","error","console","async","registerMap","keyword","geoJson","getGeoJsonData","length","echarts","log","useCharts","chartDOM","initAfter","mc","isDisposed","getZr","on","showLoading","target","hideLoading","flag","some","then","setOption","retryError","_openBlock","_createElementBlock","_hoisted_1","_createCommentVNode","_createElementVNode","class"],"mappings":"syBA+BA,MAAMA,EAAQC,EAAAA,OAAOC,EAAAA,oBAAsBC,GAAWA,GAAG,GAEzD,IAAIC,EAAS,KACb,MAAMC,EAAiBC,EAAAA,IAAa,CAClCC,SAAU,GACVC,KAAM,sBAEFC,EAAUH,EAAAA,IAAoB,MAC9BI,EAAgBJ,EAAAA,IAAI,MAEpBK,EAAmBC,EAAAA,SAAwB,KAC/C,IACE,MAAMC,aAAEA,EAAAC,YAAcA,EAAAC,QAAaA,YAASC,EAAAC,KAAWA,GAASC,EAAAC,UAC1DC,EAAoB,GAC1BL,EAAQM,QAASC,IACfL,EAAKI,QAASE,IACZH,EAAQI,KAAKC,OAAOF,EAASD,SAGjC,MAAMI,EAAS,CACbC,MAAO,CACLC,KAAMZ,GAERa,QAAS,CACP,SAAAC,CAAUC,GACR,IAAIC,EAAM,GAAGD,EAAOE,YAWpB,OAVAP,EAAOQ,QAAQb,QAASc,IACtBA,EAAYlB,M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./mapData.cjs");function a(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(o){if("default"!==o){var a=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,a.get?a:{enumerable:!0,get:function(){return e[o]}})}}),t.default=e,Object.freeze(t)}var i=a(t);const n={get:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"showTypeName",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"table";return n.data.find(o=>o[e].toString()===t||o[e]===t)},data:[{showTypeName:"table",label:"表格",coverImg:"table.png",disabled:()=>!1,subTypeList:[],showType:0,baseConfig:{}},{showTypeName:"line",label:"折线图",coverImg:"line-stack.png",showType:1,subTypeList:[{value:"line-simple",icon:"line-smooth",tooltipContent:"折线图"},{value:"area-basic",icon:"chart-line-area",tooltipContent:"折线面积图"}],baseConfig:{tooltip:{confine:!1,trigger:"axis",axisPointer:{type:"line"}},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},legend:{type:"scroll",top:"25px"},grid:{left:"0",bottom:"10px",containLabel:!0},xAxis:{type:"category",boundaryGap:!1},yAxis:{type:"value"},dataZoom:[{type:"inside"}]},disabled:(e,t)=>{const o=t?.length;return!(o>=1&&o<2)}},{showTypeName:"bar",label:"柱状图",coverImg:"bar-tick-align.png",showType:2,baseConfig:{legend:{type:"scroll",top:"25px"},tooltip:{confine:!1,trigger:"axis",axisPointer:{type:"shadow"}},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},grid:{left:"0",bottom:"20px",containLabel:!0},xAxis:{axisLabel:{showMaxLabel:!0},axisTick:{alignWithLabel:!0}},yAxis:{},dataZoom:[{type:"inside"}]},subTypeList:[{value:"bar-simple",icon:"bar-simple",tooltipContent:"垂直条形图"},{value:"bar-y-category",icon:"bar-y-category",tooltipContent:"水平条形图"}],disabled:(e,t)=>{const o=t?.length;return!(o>=1)}},{showTypeName:"pie",label:"饼图",coverImg:"pie-simple.png",showType:4,subTypeList:[{value:"pie-simple",icon:"pie-simple",tooltipContent:"饼图"},{value:"pie-borderRadius",icon:"pie-borderRadius",tooltipContent:"环形图"}],baseConfig:{tooltip:{confine:!0,formatter:"{a}<br>{b}: {c}({d}%)",trigger:"item"},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},legend:{type:"scroll",top:"25px"}},disabled:(e,t)=>{const o=t?.length,a=e?.length;return!(a<=4&&o>0&&o<=1)}},{showTypeName:"area",label:"地图",coverImg:"area.png",showType:5,subTypeList:[],baseConfig:{tooltip:{confine:!0,trigger:"item"},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},visualMap:{text:["高","低"],realtime:!1,calculable:!0,inRange:{color:["lightskyblue","yellow","orangered"]}}},disabled:(e,t)=>{const o=t?.length,a=t?.some(e=>{let{colDesc:t}=e;return t.includes("省")||t.includes("市")});return!(a&&o>0)}},{showTypeName:"funnel",label:"漏斗图",coverImg:"funnel.png",showType:6,subTypeList:[],baseConfig:{tooltip:{confine:!0,trigger:"item",formatter:"{a} <br/>{b} : {c}"},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},legend:{type:"scroll",top:20}},disabled:(e,t)=>{const o=t?.length,a=e?.length;return!(a<=5&&o>0&&o<=1)}},{showTypeName:"card",label:"卡片",coverImg:"card.png",showType:9,subTypeList:[],baseConfig:{},disabled:(e,t)=>{const o=t?.length,a=e?.length;return!(a>0&&o<=1)}},{showTypeName:"radar",label:"雷达图",coverImg:"radar.png",showType:10,subTypeList:[],baseConfig:{legend:{type:"scroll",orient:"vertical",left:"left",top:"25px"},tooltip:{confine:!0,trigger:"item"},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},radar:{center:["50%","55%"]}},disabled:(e,t)=>{const o=t?.length;return 1!==o||1!==e.length}},{showTypeName:"scatter-simple",label:"散点图",coverImg:"",showType:11,subTypeList:[],disabled:()=>!1,baseConfig:{grid:{left:"0",bottom:"10px",containLabel:!0},tooltip:{showDelay:0,axisPointer:{show:!0,type:"cross",lineStyle:{type:"dashed",width:1}}},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},legend:{type:"scroll",top:"25px"},xAxis:{splitLine:{lineStyle:{type:"dashed"}}},yAxis:{splitLine:{lineStyle:{type:"dashed"}}}}}]};function s(t,o){const a={};return t.forEach(t=>{a[t.showTypeName]=e.merge(t.baseConfig,o)}),a}const r=s(n.data,{backgroundColor:"transparent",title:{textStyle:{fontSize:14,lineHeight:16}}}),l=new Map,p=()=>{try{const e=i.getMap("china");if(e&&e.geoJson)return e.geoJson}catch(e){console.warn("Failed to get builtin China map:",e)}return{type:"FeatureCollection",features:[]}};exports.defaultChartOption=r,exports.getGeoJsonData=function(e){let{adcode:t}=e;if("string"!=typeof t||t.match(/^\d{6}$/)||"中国"===t||"100000"===t||(t=o.getProvinceCode(t)),l.has(t)){const e=l.get(t);if(e)return Promise.resolve(e)}return new Promise(async e=>{try{if("中国"===t||"100000"===t)try{const a=await o.getChinaMapData();return l.set(t,a),void e(a)}catch(e){console.warn("Failed to fetch China map from DataV, using fallback:",e)}if(o.isProvinceCode(t))try{const a=await o.getProvinceMapData(o.getProvinceName(t));if(a&&a.features&&a.features.length>0)return l.set(t,a),void e(a)}catch(a){console.warn("Failed to fetch province map data with new method, trying old method:",a);try{const a=await o.fetchMapData(t);if(a&&a.features&&a.features.length>0)return l.set(t,a),void e(a)}catch(e){console.warn("Failed to fetch province map data with old method:",e)}}const a=p();l.set(t,a),e(a)}catch(o){console.error("All map data sources failed, using simple fallback:",o);const a=p();l.set(t,a),e(a)}})},exports.iconList=n,exports.setDefaultChartOption=s,exports.showTypeText=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return n.get("showType",e)};
1
+ "use strict";var e=require("lodash-es"),t=require("echarts"),o=require("./mapData.cjs");function a(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(o){if("default"!==o){var a=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,a.get?a:{enumerable:!0,get:function(){return e[o]}})}}),t.default=e,Object.freeze(t)}var i=a(t);const s={get:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"showTypeName",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"table";return s.data.find(o=>o[e].toString()===t||o[e]===t)},data:[{showTypeName:"table",label:"表格",coverImg:"table.png",disabled:()=>!1,subTypeList:[],showType:0,baseConfig:{}},{showTypeName:"line",label:"折线图",coverImg:"line-stack.png",showType:1,subTypeList:[{value:"line-simple",icon:"line-smooth",tooltipContent:"折线图"},{value:"area-basic",icon:"chart-line-area",tooltipContent:"折线面积图"}],baseConfig:{tooltip:{confine:!1,trigger:"axis",axisPointer:{type:"line"}},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},legend:{type:"scroll",top:"25px"},grid:{left:"0",bottom:"10px",containLabel:!0},xAxis:{type:"category",boundaryGap:!1},yAxis:{type:"value"},dataZoom:[{type:"inside"}]},disabled:(e,t)=>{const o=t?.length;return!(o>=1&&o<2)}},{showTypeName:"bar",label:"柱状图",coverImg:"bar-tick-align.png",showType:2,baseConfig:{legend:{type:"scroll",top:"25px"},tooltip:{confine:!1,trigger:"axis",axisPointer:{type:"shadow"}},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},grid:{left:"0",bottom:"20px",containLabel:!0},xAxis:{axisLabel:{showMaxLabel:!0},axisTick:{alignWithLabel:!0}},yAxis:{},dataZoom:[{type:"inside"}]},subTypeList:[{value:"bar-simple",icon:"bar-simple",tooltipContent:"垂直条形图"},{value:"bar-y-category",icon:"bar-y-category",tooltipContent:"水平条形图"}],disabled:(e,t)=>{const o=t?.length;return!(o>=1)}},{showTypeName:"pie",label:"饼图",coverImg:"pie-simple.png",showType:4,subTypeList:[{value:"pie-simple",icon:"pie-simple",tooltipContent:"饼图"},{value:"pie-borderRadius",icon:"pie-borderRadius",tooltipContent:"环形图"}],baseConfig:{tooltip:{confine:!0,formatter:"{a}<br>{b}: {c}({d}%)",trigger:"item"},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},legend:{type:"scroll",top:"25px"}},disabled:(e,t)=>{const o=t?.length,a=e?.length;return!(a<=4&&o>0&&o<=1)}},{showTypeName:"area",label:"地图",coverImg:"area.png",showType:5,subTypeList:[],baseConfig:{tooltip:{confine:!0,trigger:"item"},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},visualMap:{text:["高","低"],realtime:!1,calculable:!0,inRange:{color:["#E8F4FD","#B8D4F7","#7BA4F0","#4A7BE8","#3562e1"]}}},disabled:(e,t)=>{const o=t?.length,a=t?.some(e=>{let{colDesc:t}=e;return t.includes("省")||t.includes("市")});return!(a&&o>0)}},{showTypeName:"funnel",label:"漏斗图",coverImg:"funnel.png",showType:6,subTypeList:[],baseConfig:{tooltip:{confine:!0,trigger:"item",formatter:"{a} <br/>{b} : {c}"},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},legend:{type:"scroll",top:20}},disabled:(e,t)=>{const o=t?.length,a=e?.length;return!(a<=5&&o>0&&o<=1)}},{showTypeName:"card",label:"卡片",coverImg:"card.png",showType:9,subTypeList:[],baseConfig:{},disabled:(e,t)=>{const o=t?.length,a=e?.length;return!(a>0&&o<=1)}},{showTypeName:"radar",label:"雷达图",coverImg:"radar.png",showType:10,subTypeList:[],baseConfig:{legend:{type:"scroll",orient:"vertical",left:"left",top:"25px"},tooltip:{confine:!0,trigger:"item"},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},radar:{center:["50%","55%"]}},disabled:(e,t)=>{const o=t?.length;return 1!==o||1!==e.length}},{showTypeName:"scatter-simple",label:"散点图",coverImg:"",showType:11,subTypeList:[],disabled:()=>!1,baseConfig:{grid:{left:"0",bottom:"10px",containLabel:!0},tooltip:{showDelay:0,axisPointer:{show:!0,type:"cross",lineStyle:{type:"dashed",width:1}}},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},legend:{type:"scroll",top:"25px"},xAxis:{splitLine:{lineStyle:{type:"dashed"}}},yAxis:{splitLine:{lineStyle:{type:"dashed"}}}}}]};function n(t,o){const a={};return t.forEach(t=>{a[t.showTypeName]=e.merge(t.baseConfig,o)}),a}const l=n(s.data,{backgroundColor:"transparent",title:{textStyle:{fontSize:14,lineHeight:16}}}),r=new Map,p=()=>{try{const e=i.getMap("china");if(e&&e.geoJson)return e.geoJson}catch(e){console.warn("Failed to get builtin China map:",e)}return{type:"FeatureCollection",features:[]}};exports.defaultChartOption=l,exports.getGeoJsonData=function(e){let{adcode:t}=e,a="https://cdnfile.yaomaitong.cn/ksh/lib/geo-data";if("string"!=typeof t||t.match(/^\d{6}$/)||"中国"===t||"100000"===t||(t=o.getProvinceCode(t)),r.has(t)){const e=r.get(t);if(e)return Promise.resolve(e)}return new Promise(async e=>{try{if("中国"===t||"100000"===t)try{const o=await fetch(`${a}/china.json`);if(o.ok){const a=await o.json();return r.set(t,a),void e(a)}}catch(e){console.warn("Failed to load local China map data:",e)}if(o.isProvinceCode(t))try{const o=await fetch(`${a}/${t}.json`);if(o.ok){const a=await o.json();if(a&&a.features&&a.features.length>0)return r.set(t,a),void e(a)}}catch(e){console.warn("Failed to load local province map data:",e)}const i=p();r.set(t,i),e(i)}catch(o){console.error("All map data sources failed, using simple fallback:",o);const a=p();r.set(t,a),e(a)}})},exports.iconList=s,exports.setDefaultChartOption=n,exports.showTypeText=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return s.get("showType",e)};
2
2
  //# sourceMappingURL=config.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.cjs","sources":["../../../../../../../packages/components/src/data-chart/src/utils/config.ts"],"sourcesContent":["import type { GeoJson, IconRow, IGroupByInfos, ISelectInfos } from './types'\nimport { merge } from 'lodash-es'\nimport * as echarts from 'echarts'\nimport { fetchMapData, getProvinceCode, getProvinceName, isProvinceCode, getProvinceMapData, getChinaMapData } from './mapData'\n\n/**\n * 禁用功能函数\n * 判断当前图表类型是否被禁用\n * 调用时机:渲染页面\n * @param {object} selectInfos 选择信息\n * @param {object} groupByInfos 分组信息\n * @param {Message[]|Message} data 数据\n * @returns Boolean 布尔值\n */\nexport const iconList: {\n data: IconRow[]\n get: (type: keyof IconRow, value: any) => IconRow\n} = {\n get: (type: keyof IconRow = 'showTypeName', value: any = 'table') => {\n return iconList.data.find(item => item[type].toString() === value || item[type] === value)!\n },\n data: [\n {\n showTypeName: 'table',\n label: '表格',\n coverImg: 'table.png',\n disabled: () => false,\n subTypeList: [],\n showType: 0,\n baseConfig: {},\n },\n {\n showTypeName: 'line',\n label: '折线图',\n coverImg: 'line-stack.png',\n showType: 1,\n subTypeList: [\n {\n value: 'line-simple',\n icon: 'line-smooth',\n tooltipContent: '折线图',\n },\n {\n value: 'area-basic',\n icon: 'chart-line-area',\n tooltipContent: '折线面积图',\n },\n ],\n baseConfig: {\n tooltip: {\n confine: false,\n trigger: 'axis',\n axisPointer: {\n type: 'line',\n },\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n },\n },\n legend: {\n type: 'scroll',\n top: '25px',\n },\n grid: {\n left: '0',\n bottom: '10px',\n containLabel: true,\n },\n xAxis: {\n type: 'category',\n boundaryGap: false,\n },\n yAxis: {\n type: 'value',\n },\n dataZoom: [\n {\n type: 'inside',\n },\n ],\n },\n disabled: (_: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n if (groupByInfosLenght >= 1 && groupByInfosLenght < 2) {\n return false\n }\n return true\n },\n },\n {\n showTypeName: 'bar',\n label: '柱状图',\n coverImg: 'bar-tick-align.png',\n showType: 2,\n baseConfig: {\n legend: {\n type: 'scroll',\n top: '25px',\n },\n tooltip: {\n confine: false,\n trigger: 'axis',\n axisPointer: {\n type: 'shadow',\n },\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n // myFull: { // 全屏\n // show: true,\n // title: '全屏',\n // icon: 'path://...',\n // }\n },\n },\n grid: {\n left: '0',\n bottom: '20px',\n containLabel: true,\n },\n xAxis: {\n axisLabel: {\n showMaxLabel: true,\n },\n axisTick: {\n alignWithLabel: true,\n },\n },\n yAxis: {},\n dataZoom: [\n {\n type: 'inside',\n },\n ],\n },\n subTypeList: [\n {\n value: 'bar-simple',\n icon: 'bar-simple',\n tooltipContent: '垂直条形图',\n },\n {\n value: 'bar-y-category',\n icon: 'bar-y-category',\n tooltipContent: '水平条形图',\n },\n ],\n disabled: (_: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n if (groupByInfosLenght >= 1) {\n return false\n }\n return true\n },\n },\n {\n showTypeName: 'pie',\n label: '饼图',\n coverImg: 'pie-simple.png',\n showType: 4,\n subTypeList: [\n {\n value: 'pie-simple',\n icon: 'pie-simple',\n tooltipContent: '饼图',\n },\n {\n value: 'pie-borderRadius',\n icon: 'pie-borderRadius',\n tooltipContent: '环形图',\n },\n ],\n baseConfig: {\n tooltip: {\n confine: true,\n formatter: '{a}<br>{b}: {c}({d}%)',\n trigger: 'item',\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n },\n },\n legend: {\n type: 'scroll',\n top: '25px',\n },\n },\n disabled: (selectInfos: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n const selectInfosLength = selectInfos?.length\n if (selectInfosLength <= 4 && groupByInfosLenght > 0 && groupByInfosLenght <= 1) {\n return false\n }\n return true\n },\n },\n {\n showTypeName: 'area',\n label: '地图',\n coverImg: 'area.png',\n showType: 5,\n subTypeList: [],\n baseConfig: {\n tooltip: {\n confine: true,\n trigger: 'item',\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n },\n },\n visualMap: {\n text: ['高', '低'],\n realtime: false,\n calculable: true,\n inRange: {\n color: ['lightskyblue', 'yellow', 'orangered'],\n },\n },\n },\n disabled: (_: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n const flag = groupByInfos?.some(({ colDesc }) => (colDesc.includes('省') || colDesc.includes('市')))\n if (flag && groupByInfosLenght > 0) {\n return false\n }\n return true\n },\n },\n {\n showTypeName: 'funnel',\n label: '漏斗图',\n coverImg: 'funnel.png',\n showType: 6,\n subTypeList: [],\n baseConfig: {\n tooltip: {\n confine: true,\n trigger: 'item',\n formatter: '{a} <br/>{b} : {c}',\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n },\n },\n legend: {\n type: 'scroll',\n top: 20,\n },\n },\n disabled: (selectInfos: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n const selectInfosLength = selectInfos?.length\n if (selectInfosLength <= 5 && groupByInfosLenght > 0 && groupByInfosLenght <= 1) {\n return false\n }\n return true\n },\n },\n\n // { label: 'scatter', value: 7 },\n {\n showTypeName: 'card',\n label: '卡片',\n coverImg: 'card.png',\n showType: 9,\n subTypeList: [],\n baseConfig: {},\n disabled: (selectInfos: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n const selectInfosLength = selectInfos?.length\n if (selectInfosLength > 0 && groupByInfosLenght <= 1) {\n return false\n }\n return true\n },\n },\n {\n showTypeName: 'radar',\n label: '雷达图',\n coverImg: 'radar.png',\n showType: 10,\n subTypeList: [],\n baseConfig: {\n legend: {\n type: 'scroll',\n orient: 'vertical',\n left: 'left',\n top: '25px',\n },\n tooltip: {\n confine: true,\n trigger: 'item',\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n },\n },\n radar: {\n // shape: 'circle',\n center: ['50%', '55%'],\n },\n },\n disabled: (selectInfos: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n if (groupByInfosLenght === 1 && selectInfos.length === 1) {\n return false\n }\n return true\n },\n },\n {\n showTypeName: 'scatter-simple',\n label: '散点图',\n coverImg: '',\n showType: 11,\n subTypeList: [],\n disabled: () => false,\n baseConfig: {\n grid: {\n left: '0',\n bottom: '10px',\n containLabel: true,\n },\n tooltip: {\n showDelay: 0,\n axisPointer: {\n show: true,\n type: 'cross',\n lineStyle: {\n type: 'dashed',\n width: 1,\n },\n },\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n },\n },\n legend: {\n type: 'scroll',\n top: '25px',\n },\n xAxis: {\n splitLine: {\n lineStyle: {\n type: 'dashed',\n },\n },\n },\n yAxis: {\n splitLine: {\n lineStyle: {\n type: 'dashed',\n },\n },\n },\n },\n },\n ],\n}\n\nexport function showTypeText(showType = 0): IconRow {\n const row = iconList.get('showType', showType)\n return row\n}\n\n// 修改默认配置\nexport function setDefaultChartOption(option: IconRow[], changeConfig: any) {\n const obj: {\n [key in IconRow['showTypeName']]: any\n } = {} as { [key in IconRow['showTypeName']]: any }\n option.forEach((item) => {\n obj[item.showTypeName] = merge(item.baseConfig, changeConfig)\n })\n return obj\n}\nexport const defaultChartOption = setDefaultChartOption(iconList.data, {\n backgroundColor: 'transparent',\n title: {\n textStyle: {\n fontSize: 14,\n lineHeight: 16,\n },\n },\n})\n// 获取地图数据(GeoJson)\n// 添加缓存对象\nconst geoJsonCache = new Map<string, GeoJson>()\n\n // 使用 ECharts 内置的中国地图数据\nconst getBuiltinChinaMap = (): GeoJson => {\n try {\n // 尝试获取 ECharts 内置的中国地图数据\n const chinaMap = echarts.getMap('china')\n if (chinaMap && chinaMap.geoJson) {\n return chinaMap.geoJson as GeoJson\n }\n }\n catch (error) {\n console.warn('Failed to get builtin China map:', error)\n }\n \n // 如果获取失败,返回空的地图数据\n return {\n type: 'FeatureCollection',\n features: [],\n } as GeoJson\n}\nexport function getGeoJsonData(options: any): Promise<GeoJson> {\n let { adcode } = options\n\n // 如果传入的是省份名称,转换为代码\n if (typeof adcode === 'string' && !adcode.match(/^\\d{6}$/) && adcode !== '中国' && adcode !== '100000') {\n adcode = getProvinceCode(adcode)\n }\n\n // 检查缓存中是否存在对应的 GeoJSON 数据\n if (geoJsonCache.has(adcode)) {\n const cachedGeoJson = geoJsonCache.get(adcode)\n if (cachedGeoJson) {\n return Promise.resolve(cachedGeoJson)\n }\n }\n\n // 使用免费的替代方案\n return new Promise(async (resolve) => {\n try {\n // 方案1: 优先使用 DataV 的真实地图数据\n if (adcode === '中国' || adcode === '100000') {\n try {\n const chinaData = await getChinaMapData()\n geoJsonCache.set(adcode, chinaData)\n resolve(chinaData)\n return\n }\n catch (error) {\n console.warn('Failed to fetch China map from DataV, using fallback:', error)\n }\n }\n\n // 方案2: 尝试从免费数据源获取省级地图数据\n if (isProvinceCode(adcode)) {\n try {\n // 尝试使用新的省级地图数据获取函数\n const geoJson = await getProvinceMapData(getProvinceName(adcode))\n if (geoJson && geoJson.features && geoJson.features.length > 0) {\n geoJsonCache.set(adcode, geoJson)\n resolve(geoJson)\n return\n }\n }\n catch (error) {\n console.warn('Failed to fetch province map data with new method, trying old method:', error)\n try {\n const geoJson = await fetchMapData(adcode)\n if (geoJson && geoJson.features && geoJson.features.length > 0) {\n geoJsonCache.set(adcode, geoJson)\n resolve(geoJson)\n return\n }\n }\n catch (secondError) {\n console.warn('Failed to fetch province map data with old method:', secondError)\n }\n }\n }\n\n // 方案3: 使用内置的中国地图数据作为备用\n const builtinMap = getBuiltinChinaMap()\n geoJsonCache.set(adcode, builtinMap)\n resolve(builtinMap)\n }\n catch (error) {\n console.error('All map data sources failed, using simple fallback:', error)\n const builtinMap = getBuiltinChinaMap()\n geoJsonCache.set(adcode, builtinMap)\n resolve(builtinMap)\n }\n })\n}\n"],"names":["iconList","get","type","arguments","length","undefined","value","data","find","item","toString","showTypeName","label","coverImg","disabled","subTypeList","showType","baseConfig","icon","tooltipContent","tooltip","confine","trigger","axisPointer","toolbox","show","showTitle","feature","saveAsImage","legend","top","grid","left","bottom","containLabel","xAxis","boundaryGap","yAxis","dataZoom","_","groupByInfos","groupByInfosLenght","axisLabel","showMaxLabel","axisTick","alignWithLabel","formatter","selectInfos","selectInfosLength","visualMap","text","realtime","calculable","inRange","color","flag","some","_ref","colDesc","includes","orient","radar","center","showDelay","lineStyle","width","splitLine","setDefaultChartOption","option","changeConfig","obj","forEach","merge","defaultChartOption","backgroundColor","title","textStyle","fontSize","lineHeight","geoJsonCache","Map","getBuiltinChinaMap","chinaMap","echarts","getMap","geoJson","error","console","warn","features","options","adcode","match","getProvinceCode","has","cachedGeoJson","Promise","resolve","async","chinaData","getChinaMapData","set","isProvinceCode","getProvinceMapData","getProvinceName","fetchMapData","secondError","builtinMap"],"mappings":"oWAcO,MAAMA,EAGT,CACFC,IAAK,WAAgE,IAA/DC,EAAAC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAsB,eAAgBG,yDAAa,QACvD,OAAON,EAASO,KAAKC,KAAKC,GAAQA,EAAKP,GAAMQ,aAAeJ,GAASG,EAAKP,KAAUI,EACtF,EACAC,KAAM,CACJ,CACEI,aAAc,QACdC,MAAO,KACPC,SAAU,YACVC,SAAUA,KAAM,EAChBC,YAAa,GACbC,SAAU,EACVC,WAAY,CAAA,GAEd,CACEN,aAAc,OACdC,MAAO,MACPC,SAAU,iBACVG,SAAU,EACVD,YAAa,CACX,CACET,MAAO,cACPY,KAAM,cACNC,eAAgB,OAElB,CACEb,MAAO,aACPY,KAAM,kBACNC,eAAgB,UAGpBF,WAAY,CACVG,QAAS,CACPC,SAAS,EACTC,QAAS,OACTC,YAAa,CACXrB,KAAM,SAGVsB,QAAS,CACPC,MAAM,EACNC,WAAW,EACXC,QAAS,CAGPC,YAAa,CAAA,IAGjBC,OAAQ,CACN3B,KAAM,SACN4B,IAAK,QAE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.cjs","sources":["../../../../../../../packages/components/src/data-chart/src/utils/config.ts"],"sourcesContent":["import type { GeoJson, IconRow, IGroupByInfos, ISelectInfos } from './types'\nimport { merge } from 'lodash-es'\nimport * as echarts from 'echarts'\nimport { getProvinceCode, isProvinceCode } from './mapData'\n\n/**\n * 禁用功能函数\n * 判断当前图表类型是否被禁用\n * 调用时机:渲染页面\n * @param {object} selectInfos 选择信息\n * @param {object} groupByInfos 分组信息\n * @param {Message[]|Message} data 数据\n * @returns Boolean 布尔值\n */\nexport const iconList: {\n data: IconRow[]\n get: (type: keyof IconRow, value: any) => IconRow\n} = {\n get: (type: keyof IconRow = 'showTypeName', value: any = 'table') => {\n return iconList.data.find(item => item[type].toString() === value || item[type] === value)!\n },\n data: [\n {\n showTypeName: 'table',\n label: '表格',\n coverImg: 'table.png',\n disabled: () => false,\n subTypeList: [],\n showType: 0,\n baseConfig: {},\n },\n {\n showTypeName: 'line',\n label: '折线图',\n coverImg: 'line-stack.png',\n showType: 1,\n subTypeList: [\n {\n value: 'line-simple',\n icon: 'line-smooth',\n tooltipContent: '折线图',\n },\n {\n value: 'area-basic',\n icon: 'chart-line-area',\n tooltipContent: '折线面积图',\n },\n ],\n baseConfig: {\n tooltip: {\n confine: false,\n trigger: 'axis',\n axisPointer: {\n type: 'line',\n },\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n },\n },\n legend: {\n type: 'scroll',\n top: '25px',\n },\n grid: {\n left: '0',\n bottom: '10px',\n containLabel: true,\n },\n xAxis: {\n type: 'category',\n boundaryGap: false,\n },\n yAxis: {\n type: 'value',\n },\n dataZoom: [\n {\n type: 'inside',\n },\n ],\n },\n disabled: (_: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n if (groupByInfosLenght >= 1 && groupByInfosLenght < 2) {\n return false\n }\n return true\n },\n },\n {\n showTypeName: 'bar',\n label: '柱状图',\n coverImg: 'bar-tick-align.png',\n showType: 2,\n baseConfig: {\n legend: {\n type: 'scroll',\n top: '25px',\n },\n tooltip: {\n confine: false,\n trigger: 'axis',\n axisPointer: {\n type: 'shadow',\n },\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n // myFull: { // 全屏\n // show: true,\n // title: '全屏',\n // icon: 'path://...',\n // }\n },\n },\n grid: {\n left: '0',\n bottom: '20px',\n containLabel: true,\n },\n xAxis: {\n axisLabel: {\n showMaxLabel: true,\n },\n axisTick: {\n alignWithLabel: true,\n },\n },\n yAxis: {},\n dataZoom: [\n {\n type: 'inside',\n },\n ],\n },\n subTypeList: [\n {\n value: 'bar-simple',\n icon: 'bar-simple',\n tooltipContent: '垂直条形图',\n },\n {\n value: 'bar-y-category',\n icon: 'bar-y-category',\n tooltipContent: '水平条形图',\n },\n ],\n disabled: (_: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n if (groupByInfosLenght >= 1) {\n return false\n }\n return true\n },\n },\n {\n showTypeName: 'pie',\n label: '饼图',\n coverImg: 'pie-simple.png',\n showType: 4,\n subTypeList: [\n {\n value: 'pie-simple',\n icon: 'pie-simple',\n tooltipContent: '饼图',\n },\n {\n value: 'pie-borderRadius',\n icon: 'pie-borderRadius',\n tooltipContent: '环形图',\n },\n ],\n baseConfig: {\n tooltip: {\n confine: true,\n formatter: '{a}<br>{b}: {c}({d}%)',\n trigger: 'item',\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n },\n },\n legend: {\n type: 'scroll',\n top: '25px',\n },\n },\n disabled: (selectInfos: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n const selectInfosLength = selectInfos?.length\n if (selectInfosLength <= 4 && groupByInfosLenght > 0 && groupByInfosLenght <= 1) {\n return false\n }\n return true\n },\n },\n {\n showTypeName: 'area',\n label: '地图',\n coverImg: 'area.png',\n showType: 5,\n subTypeList: [],\n baseConfig: {\n tooltip: {\n confine: true,\n trigger: 'item',\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n },\n },\n visualMap: {\n text: ['高', '低'],\n realtime: false,\n calculable: true,\n inRange: {\n color: ['#E8F4FD', '#B8D4F7', '#7BA4F0', '#4A7BE8', '#3562e1']\n },\n },\n },\n disabled: (_: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n const flag = groupByInfos?.some(({ colDesc }) => (colDesc.includes('省') || colDesc.includes('市')))\n if (flag && groupByInfosLenght > 0) {\n return false\n }\n return true\n },\n },\n {\n showTypeName: 'funnel',\n label: '漏斗图',\n coverImg: 'funnel.png',\n showType: 6,\n subTypeList: [],\n baseConfig: {\n tooltip: {\n confine: true,\n trigger: 'item',\n formatter: '{a} <br/>{b} : {c}',\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n },\n },\n legend: {\n type: 'scroll',\n top: 20,\n },\n },\n disabled: (selectInfos: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n const selectInfosLength = selectInfos?.length\n if (selectInfosLength <= 5 && groupByInfosLenght > 0 && groupByInfosLenght <= 1) {\n return false\n }\n return true\n },\n },\n\n // { label: 'scatter', value: 7 },\n {\n showTypeName: 'card',\n label: '卡片',\n coverImg: 'card.png',\n showType: 9,\n subTypeList: [],\n baseConfig: {},\n disabled: (selectInfos: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n const selectInfosLength = selectInfos?.length\n if (selectInfosLength > 0 && groupByInfosLenght <= 1) {\n return false\n }\n return true\n },\n },\n {\n showTypeName: 'radar',\n label: '雷达图',\n coverImg: 'radar.png',\n showType: 10,\n subTypeList: [],\n baseConfig: {\n legend: {\n type: 'scroll',\n orient: 'vertical',\n left: 'left',\n top: '25px',\n },\n tooltip: {\n confine: true,\n trigger: 'item',\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n },\n },\n radar: {\n // shape: 'circle',\n center: ['50%', '55%'],\n },\n },\n disabled: (selectInfos: ISelectInfos[], groupByInfos: IGroupByInfos[]) => {\n const groupByInfosLenght = groupByInfos?.length\n if (groupByInfosLenght === 1 && selectInfos.length === 1) {\n return false\n }\n return true\n },\n },\n {\n showTypeName: 'scatter-simple',\n label: '散点图',\n coverImg: '',\n showType: 11,\n subTypeList: [],\n disabled: () => false,\n baseConfig: {\n grid: {\n left: '0',\n bottom: '10px',\n containLabel: true,\n },\n tooltip: {\n showDelay: 0,\n axisPointer: {\n show: true,\n type: 'cross',\n lineStyle: {\n type: 'dashed',\n width: 1,\n },\n },\n },\n toolbox: {\n show: false,\n showTitle: false,\n feature: {\n // dataView: { readOnly: true },\n // restore: {},\n saveAsImage: {},\n },\n },\n legend: {\n type: 'scroll',\n top: '25px',\n },\n xAxis: {\n splitLine: {\n lineStyle: {\n type: 'dashed',\n },\n },\n },\n yAxis: {\n splitLine: {\n lineStyle: {\n type: 'dashed',\n },\n },\n },\n },\n },\n ],\n}\n\nexport function showTypeText(showType = 0): IconRow {\n const row = iconList.get('showType', showType)\n return row\n}\n\n// 修改默认配置\nexport function setDefaultChartOption(option: IconRow[], changeConfig: any) {\n const obj: {\n [key in IconRow['showTypeName']]: any\n } = {} as { [key in IconRow['showTypeName']]: any }\n option.forEach((item) => {\n obj[item.showTypeName] = merge(item.baseConfig, changeConfig)\n })\n return obj\n}\nexport const defaultChartOption = setDefaultChartOption(iconList.data, {\n backgroundColor: 'transparent',\n title: {\n textStyle: {\n fontSize: 14,\n lineHeight: 16,\n },\n },\n})\n// 获取地图数据(GeoJson)\n// 添加缓存对象\nconst geoJsonCache = new Map<string, GeoJson>()\n\n // 使用 ECharts 内置的中国地图数据\nconst getBuiltinChinaMap = (): GeoJson => {\n try {\n // 尝试获取 ECharts 内置的中国地图数据\n const chinaMap = echarts.getMap('china')\n if (chinaMap && chinaMap.geoJson) {\n return chinaMap.geoJson as GeoJson\n }\n }\n catch (error) {\n console.warn('Failed to get builtin China map:', error)\n }\n \n // 如果获取失败,返回空的地图数据\n return {\n type: 'FeatureCollection',\n features: [],\n } as GeoJson\n}\nexport function getGeoJsonData(options: any): Promise<GeoJson> {\n let { adcode } = options\n let baseUrl = 'https://cdnfile.yaomaitong.cn/ksh/lib/geo-data'\n\n // 如果传入的是省份名称,转换为代码\n if (typeof adcode === 'string' && !adcode.match(/^\\d{6}$/) && adcode !== '中国' && adcode !== '100000') {\n adcode = getProvinceCode(adcode)\n }\n\n // 检查缓存中是否存在对应的 GeoJSON 数据\n if (geoJsonCache.has(adcode)) {\n const cachedGeoJson = geoJsonCache.get(adcode)\n if (cachedGeoJson) {\n return Promise.resolve(cachedGeoJson)\n }\n }\n\n // 构建基础 URL\n return new Promise(async (resolve) => {\n try {\n // 方案1: 使用本地地图数据\n if (adcode === '中国' || adcode === '100000') {\n try {\n // 优先尝试本地中国地图数据\n const response = await fetch(`${baseUrl}/china.json`)\n if (response.ok) {\n const chinaData = await response.json()\n geoJsonCache.set(adcode, chinaData)\n resolve(chinaData)\n return\n }\n }\n catch (error) {\n console.warn('Failed to load local China map data:', error)\n }\n }\n\n // 方案2: 使用本地省级地图数据\n if (isProvinceCode(adcode)) {\n try {\n const response = await fetch(`${baseUrl}/${adcode}.json`)\n if (response.ok) {\n const geoJson = await response.json()\n if (geoJson && geoJson.features && geoJson.features.length > 0) {\n geoJsonCache.set(adcode, geoJson)\n resolve(geoJson)\n return\n }\n }\n }\n catch (error) {\n console.warn('Failed to load local province map data:', error)\n }\n }\n\n // 方案3: 使用内置的中国地图数据作为备用\n const builtinMap = getBuiltinChinaMap()\n geoJsonCache.set(adcode, builtinMap)\n resolve(builtinMap)\n }\n catch (error) {\n console.error('All map data sources failed, using simple fallback:', error)\n const builtinMap = getBuiltinChinaMap()\n geoJsonCache.set(adcode, builtinMap)\n resolve(builtinMap)\n }\n })\n}\n"],"names":["iconList","get","type","arguments","length","undefined","value","data","find","item","toString","showTypeName","label","coverImg","disabled","subTypeList","showType","baseConfig","icon","tooltipContent","tooltip","confine","trigger","axisPointer","toolbox","show","showTitle","feature","saveAsImage","legend","top","grid","left","bottom","containLabel","xAxis","boundaryGap","yAxis","dataZoom","_","groupByInfos","groupByInfosLenght","axisLabel","showMaxLabel","axisTick","alignWithLabel","formatter","selectInfos","selectInfosLength","visualMap","text","realtime","calculable","inRange","color","flag","some","_ref","colDesc","includes","orient","radar","center","showDelay","lineStyle","width","splitLine","setDefaultChartOption","option","changeConfig","obj","forEach","merge","defaultChartOption","backgroundColor","title","textStyle","fontSize","lineHeight","geoJsonCache","Map","getBuiltinChinaMap","chinaMap","echarts","getMap","geoJson","error","console","warn","features","options","adcode","baseUrl","match","getProvinceCode","has","cachedGeoJson","Promise","resolve","async","response","fetch","ok","chinaData","json","set","isProvinceCode","builtinMap"],"mappings":"oWAcO,MAAMA,EAGT,CACFC,IAAK,WAAgE,IAA/DC,EAAAC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAsB,eAAgBG,yDAAa,QACvD,OAAON,EAASO,KAAKC,KAAKC,GAAQA,EAAKP,GAAMQ,aAAeJ,GAASG,EAAKP,KAAUI,EACtF,EACAC,KAAM,CACJ,CACEI,aAAc,QACdC,MAAO,KACPC,SAAU,YACVC,SAAUA,KAAM,EAChBC,YAAa,GACbC,SAAU,EACVC,WAAY,CAAA,GAEd,CACEN,aAAc,OACdC,MAAO,MACPC,SAAU,iBACVG,SAAU,EACVD,YAAa,CACX,CACET,MAAO,cACPY,KAAM,cACNC,eAAgB,OAElB,CACEb,MAAO,aACPY,KAAM,kBACNC,eAAgB,UAGpBF,WAAY,CACVG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