@qxs-bns/components 0.0.55 → 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.
Files changed (193) hide show
  1. package/es/index.mjs +1 -1
  2. package/es/index.mjs.map +1 -1
  3. package/es/node_modules/.pnpm/@iconify_vue@5.0.0_vue@3.5.18_typescript@5.8.3_/node_modules/@iconify/vue/dist/iconify.mjs +2 -0
  4. package/es/node_modules/.pnpm/{@iconify_vue@5.0.0_vue@3.5.13_typescript@5.8.2_ → @iconify_vue@5.0.0_vue@3.5.18_typescript@5.8.3_}/node_modules/@iconify/vue/dist/iconify.mjs.map +1 -1
  5. package/es/package.json.mjs +1 -1
  6. package/es/src/components.mjs +1 -1
  7. package/es/src/data-chart/src/analyze.mjs +1 -1
  8. package/es/src/data-chart/src/analyze.mjs.map +1 -1
  9. package/es/src/data-chart/src/components/area.vue2.mjs +1 -1
  10. package/es/src/data-chart/src/components/area.vue2.mjs.map +1 -1
  11. package/es/src/data-chart/src/components/bar.vue.mjs +1 -1
  12. package/es/src/data-chart/src/components/bar.vue.mjs.map +1 -1
  13. package/es/src/data-chart/src/components/card.vue2.mjs +1 -1
  14. package/es/src/data-chart/src/components/card.vue2.mjs.map +1 -1
  15. package/es/src/data-chart/src/components/data-chart-card-bg-left.svg.mjs.map +1 -1
  16. package/es/src/data-chart/src/components/data-chart-card-bg-right.svg.mjs.map +1 -1
  17. package/es/src/data-chart/src/components/empty.svg.mjs.map +1 -1
  18. package/es/src/data-chart/src/components/empty.vue.mjs.map +1 -1
  19. package/es/src/data-chart/src/components/funnel.vue.mjs +1 -1
  20. package/es/src/data-chart/src/components/funnel.vue.mjs.map +1 -1
  21. package/es/src/data-chart/src/components/line.vue2.mjs +1 -1
  22. package/es/src/data-chart/src/components/line.vue2.mjs.map +1 -1
  23. package/es/src/data-chart/src/components/pie.vue.mjs +1 -1
  24. package/es/src/data-chart/src/components/pie.vue.mjs.map +1 -1
  25. package/es/src/data-chart/src/components/radar.vue.mjs +1 -1
  26. package/es/src/data-chart/src/components/radar.vue.mjs.map +1 -1
  27. package/es/src/data-chart/src/components/scatter-simple.vue.mjs +1 -1
  28. package/es/src/data-chart/src/components/scatter-simple.vue.mjs.map +1 -1
  29. package/es/src/data-chart/src/components/scatter.vue.mjs +1 -1
  30. package/es/src/data-chart/src/components/scatter.vue.mjs.map +1 -1
  31. package/es/src/data-chart/src/components/table.vue.mjs +1 -1
  32. package/es/src/data-chart/src/components/table.vue.mjs.map +1 -1
  33. package/es/src/data-chart/src/data-chart.vue.mjs +1 -1
  34. package/es/src/data-chart/src/data-chart.vue.mjs.map +1 -1
  35. package/es/src/data-chart/src/utils/config.mjs +1 -1
  36. package/es/src/data-chart/src/utils/config.mjs.map +1 -1
  37. package/es/src/data-chart/src/utils/mapData.mjs +2 -0
  38. package/es/src/data-chart/src/utils/mapData.mjs.map +1 -0
  39. package/es/src/data-chart/src/utils/safe-eval.mjs.map +1 -1
  40. package/es/src/data-chart/src/utils/useCharts.mjs +1 -1
  41. package/es/src/data-chart/src/utils/useCharts.mjs.map +1 -1
  42. package/es/src/defaults.mjs.map +1 -1
  43. package/es/src/file-upload/src/file-upload.vue.mjs +1 -1
  44. package/es/src/file-upload/src/file-upload.vue.mjs.map +1 -1
  45. package/es/src/fixed-action-bar/src/fixed-action-bar.vue.mjs +1 -1
  46. package/es/src/fixed-action-bar/src/fixed-action-bar.vue.mjs.map +1 -1
  47. package/es/src/icon/index.mjs +1 -1
  48. package/es/src/icon/index.mjs.map +1 -1
  49. package/es/src/icon/src/icon.vue.mjs +1 -1
  50. package/es/src/icon/src/icon.vue.mjs.map +1 -1
  51. package/es/src/image-upload/src/image-upload.vue.mjs +1 -1
  52. package/es/src/image-upload/src/image-upload.vue.mjs.map +1 -1
  53. package/es/src/make-installer.mjs.map +1 -1
  54. package/es/src/photo-crop-tool/src/composables.mjs +1 -1
  55. package/es/src/photo-crop-tool/src/composables.mjs.map +1 -1
  56. package/es/src/photo-crop-tool/src/photo-crop-tool.vue.mjs +1 -1
  57. package/es/src/photo-crop-tool/src/photo-crop-tool.vue.mjs.map +1 -1
  58. package/es/src/subject-action/src/subject-action.vue.mjs +1 -1
  59. package/es/src/subject-action/src/subject-action.vue.mjs.map +1 -1
  60. package/es/src/subject-layout/src/subject-layout.vue.mjs.map +1 -1
  61. package/es/src/subject-list/src/components/SubjectPageEnd.vue.mjs +1 -1
  62. package/es/src/subject-list/src/components/SubjectPageEnd.vue.mjs.map +1 -1
  63. package/es/src/subject-list/src/components/SubjectRichText.vue.mjs +1 -1
  64. package/es/src/subject-list/src/components/SubjectRichText.vue.mjs.map +1 -1
  65. package/es/src/subject-list/src/components/subject-blank-fill.vue.mjs +1 -1
  66. package/es/src/subject-list/src/components/subject-blank-fill.vue.mjs.map +1 -1
  67. package/es/src/subject-list/src/components/subject-scale.vue.mjs +1 -1
  68. package/es/src/subject-list/src/components/subject-scale.vue.mjs.map +1 -1
  69. package/es/src/subject-list/src/components/subject-single.vue.mjs +1 -1
  70. package/es/src/subject-list/src/components/subject-single.vue.mjs.map +1 -1
  71. package/es/src/subject-list/src/components/subject-text-fill.vue.mjs +1 -1
  72. package/es/src/subject-list/src/components/subject-text-fill.vue.mjs.map +1 -1
  73. package/es/src/subject-list/src/subject-list.vue.mjs +1 -1
  74. package/es/src/subject-list/src/subject-list.vue.mjs.map +1 -1
  75. package/es/src/subject-type/src/subject-type.vue.mjs +1 -1
  76. package/es/src/subject-type/src/subject-type.vue.mjs.map +1 -1
  77. package/es/src/tiny-mce-editor/src/tiny-mce-editor.vue.mjs +1 -1
  78. package/es/src/tiny-mce-editor/src/tiny-mce-editor.vue.mjs.map +1 -1
  79. package/es/src/withInstall.mjs.map +1 -1
  80. package/lib/index.cjs +1 -1
  81. package/lib/index.cjs.map +1 -1
  82. package/lib/node_modules/.pnpm/@iconify_vue@5.0.0_vue@3.5.18_typescript@5.8.3_/node_modules/@iconify/vue/dist/iconify.cjs +2 -0
  83. package/lib/node_modules/.pnpm/{@iconify_vue@5.0.0_vue@3.5.13_typescript@5.8.2_ → @iconify_vue@5.0.0_vue@3.5.18_typescript@5.8.3_}/node_modules/@iconify/vue/dist/iconify.cjs.map +1 -1
  84. package/lib/package.json.cjs +1 -1
  85. package/lib/src/components.cjs +1 -1
  86. package/lib/src/data-chart/index.cjs.map +1 -1
  87. package/lib/src/data-chart/src/analyze.cjs +1 -1
  88. package/lib/src/data-chart/src/analyze.cjs.map +1 -1
  89. package/lib/src/data-chart/src/components/area.vue2.cjs +1 -1
  90. package/lib/src/data-chart/src/components/area.vue2.cjs.map +1 -1
  91. package/lib/src/data-chart/src/components/bar.vue.cjs +1 -1
  92. package/lib/src/data-chart/src/components/bar.vue.cjs.map +1 -1
  93. package/lib/src/data-chart/src/components/card.vue2.cjs +1 -1
  94. package/lib/src/data-chart/src/components/card.vue2.cjs.map +1 -1
  95. package/lib/src/data-chart/src/components/empty.vue.cjs.map +1 -1
  96. package/lib/src/data-chart/src/components/funnel.vue.cjs +1 -1
  97. package/lib/src/data-chart/src/components/funnel.vue.cjs.map +1 -1
  98. package/lib/src/data-chart/src/components/line.vue2.cjs +1 -1
  99. package/lib/src/data-chart/src/components/line.vue2.cjs.map +1 -1
  100. package/lib/src/data-chart/src/components/pie.vue.cjs +1 -1
  101. package/lib/src/data-chart/src/components/pie.vue.cjs.map +1 -1
  102. package/lib/src/data-chart/src/components/radar.vue.cjs +1 -1
  103. package/lib/src/data-chart/src/components/radar.vue.cjs.map +1 -1
  104. package/lib/src/data-chart/src/components/scatter-simple.vue.cjs +1 -1
  105. package/lib/src/data-chart/src/components/scatter-simple.vue.cjs.map +1 -1
  106. package/lib/src/data-chart/src/components/scatter.vue.cjs +1 -1
  107. package/lib/src/data-chart/src/components/scatter.vue.cjs.map +1 -1
  108. package/lib/src/data-chart/src/components/table.vue.cjs +1 -1
  109. package/lib/src/data-chart/src/components/table.vue.cjs.map +1 -1
  110. package/lib/src/data-chart/src/data-chart.vue.cjs +1 -1
  111. package/lib/src/data-chart/src/data-chart.vue.cjs.map +1 -1
  112. package/lib/src/data-chart/src/utils/config.cjs +1 -1
  113. package/lib/src/data-chart/src/utils/config.cjs.map +1 -1
  114. package/lib/src/data-chart/src/utils/mapData.cjs +2 -0
  115. package/lib/src/data-chart/src/utils/mapData.cjs.map +1 -0
  116. package/lib/src/data-chart/src/utils/safe-eval.cjs.map +1 -1
  117. package/lib/src/data-chart/src/utils/useCharts.cjs +1 -1
  118. package/lib/src/data-chart/src/utils/useCharts.cjs.map +1 -1
  119. package/lib/src/defaults.cjs.map +1 -1
  120. package/lib/src/file-upload/index.cjs.map +1 -1
  121. package/lib/src/file-upload/src/file-upload.vue.cjs +1 -1
  122. package/lib/src/file-upload/src/file-upload.vue.cjs.map +1 -1
  123. package/lib/src/fixed-action-bar/index.cjs.map +1 -1
  124. package/lib/src/fixed-action-bar/src/fixed-action-bar.vue.cjs +1 -1
  125. package/lib/src/fixed-action-bar/src/fixed-action-bar.vue.cjs.map +1 -1
  126. package/lib/src/icon/index.cjs +1 -1
  127. package/lib/src/icon/index.cjs.map +1 -1
  128. package/lib/src/icon/src/icon.vue.cjs +1 -1
  129. package/lib/src/icon/src/icon.vue.cjs.map +1 -1
  130. package/lib/src/image-upload/index.cjs.map +1 -1
  131. package/lib/src/image-upload/src/image-upload.vue.cjs +1 -1
  132. package/lib/src/image-upload/src/image-upload.vue.cjs.map +1 -1
  133. package/lib/src/make-installer.cjs.map +1 -1
  134. package/lib/src/photo-crop-tool/index.cjs.map +1 -1
  135. package/lib/src/photo-crop-tool/src/composables.cjs +1 -1
  136. package/lib/src/photo-crop-tool/src/composables.cjs.map +1 -1
  137. package/lib/src/photo-crop-tool/src/photo-crop-tool.vue.cjs +1 -1
  138. package/lib/src/photo-crop-tool/src/photo-crop-tool.vue.cjs.map +1 -1
  139. package/lib/src/subject-action/index.cjs.map +1 -1
  140. package/lib/src/subject-action/src/subject-action.vue.cjs +1 -1
  141. package/lib/src/subject-action/src/subject-action.vue.cjs.map +1 -1
  142. package/lib/src/subject-layout/index.cjs.map +1 -1
  143. package/lib/src/subject-layout/src/subject-layout.vue.cjs.map +1 -1
  144. package/lib/src/subject-list/index.cjs.map +1 -1
  145. package/lib/src/subject-list/src/components/SubjectPageEnd.vue.cjs +1 -1
  146. package/lib/src/subject-list/src/components/SubjectPageEnd.vue.cjs.map +1 -1
  147. package/lib/src/subject-list/src/components/SubjectRichText.vue.cjs +1 -1
  148. package/lib/src/subject-list/src/components/SubjectRichText.vue.cjs.map +1 -1
  149. package/lib/src/subject-list/src/components/subject-blank-fill.vue.cjs +1 -1
  150. package/lib/src/subject-list/src/components/subject-blank-fill.vue.cjs.map +1 -1
  151. package/lib/src/subject-list/src/components/subject-scale.vue.cjs +1 -1
  152. package/lib/src/subject-list/src/components/subject-scale.vue.cjs.map +1 -1
  153. package/lib/src/subject-list/src/components/subject-single.vue.cjs +1 -1
  154. package/lib/src/subject-list/src/components/subject-single.vue.cjs.map +1 -1
  155. package/lib/src/subject-list/src/components/subject-text-fill.vue.cjs +1 -1
  156. package/lib/src/subject-list/src/components/subject-text-fill.vue.cjs.map +1 -1
  157. package/lib/src/subject-list/src/subject-list.vue.cjs +1 -1
  158. package/lib/src/subject-list/src/subject-list.vue.cjs.map +1 -1
  159. package/lib/src/subject-type/index.cjs.map +1 -1
  160. package/lib/src/subject-type/src/subject-type.vue.cjs +1 -1
  161. package/lib/src/subject-type/src/subject-type.vue.cjs.map +1 -1
  162. package/lib/src/tiny-mce-editor/index.cjs.map +1 -1
  163. package/lib/src/tiny-mce-editor/src/tiny-mce-editor.vue.cjs +1 -1
  164. package/lib/src/tiny-mce-editor/src/tiny-mce-editor.vue.cjs.map +1 -1
  165. package/lib/src/withInstall.cjs.map +1 -1
  166. package/package.json +3 -2
  167. package/types/src/components.d.ts +1 -1
  168. package/types/src/components.d.ts.map +1 -1
  169. package/types/src/data-chart/src/components/area.vue.d.ts.map +1 -1
  170. package/types/src/data-chart/src/utils/config.d.ts.map +1 -1
  171. package/types/src/data-chart/src/utils/mapData.d.ts +64 -0
  172. package/types/src/data-chart/src/utils/mapData.d.ts.map +1 -0
  173. package/types/src/data-chart/src/utils/types.d.ts +4 -0
  174. package/types/src/data-chart/src/utils/types.d.ts.map +1 -1
  175. package/types/src/data-chart/src/utils/useCharts.d.ts +3 -4
  176. package/types/src/data-chart/src/utils/useCharts.d.ts.map +1 -1
  177. package/types/src/fixed-action-bar/index.d.ts +1 -1
  178. package/types/src/fixed-action-bar/src/fixed-action-bar.vue.d.ts +1 -1
  179. package/types/src/fixed-action-bar/src/fixed-action-bar.vue.d.ts.map +1 -1
  180. package/types/src/icon/index.d.ts +3 -3
  181. package/types/src/icon/index.d.ts.map +1 -1
  182. package/types/src/image-upload/index.d.ts +3 -2
  183. package/types/src/image-upload/index.d.ts.map +1 -1
  184. package/types/src/image-upload/src/image-upload.vue.d.ts +2 -80
  185. package/types/src/image-upload/src/image-upload.vue.d.ts.map +1 -1
  186. package/types/src/subject-layout/index.d.ts +5 -3
  187. package/types/src/subject-layout/index.d.ts.map +1 -1
  188. package/types/src/subject-layout/src/subject-layout.vue.d.ts +2 -24
  189. package/types/src/subject-layout/src/subject-layout.vue.d.ts.map +1 -1
  190. package/types/src/tiny-mce-editor/index.d.ts.map +1 -1
  191. package/types/tsconfig.tsbuildinfo +1 -1
  192. package/es/node_modules/.pnpm/@iconify_vue@5.0.0_vue@3.5.13_typescript@5.8.2_/node_modules/@iconify/vue/dist/iconify.mjs +0 -2
  193. package/lib/node_modules/.pnpm/@iconify_vue@5.0.0_vue@3.5.13_typescript@5.8.2_/node_modules/@iconify/vue/dist/iconify.cjs +0 -2
@@ -1,2 +1,2 @@
1
- import{defineComponent as t,ref as e,inject as a,computed as r,createElementBlock as s,openBlock as c}from"vue";import{InjectionChartMerge as m}from"../utils/injectionKeys.mjs";import{useCharts as i}from"../utils/useCharts.mjs";var l=t({name:"DataChartScatterSimple",__name:"scatter-simple",props:{chartData:{type:Object,required:!0},chartOptions:{type:null,required:!0}},setup(t){const l=e(),o=a(m,(t=>t),!0),p=r((()=>{const{colDesc:e,xGroupByDesc:a,modelName:r,data:s}=t.chartData,c={title:{text:r},tooltip:{formatter:t=>t.value.length>1?`${t.seriesName} :<br/>${t.value[0]} ${t.value[1]} `:`${t.seriesName} :<br/>${t.name} : ${t.value} `},series:e.map((t=>({symbolSize:20,name:t,data:s.map((e=>[e[t],e[a?.colDesc||""]])),type:"scatter"})))};return o(c,t.chartOptions)}));return i({chartDOM:l,chartOptions:p,chartData:r((()=>t.chartData))}),(t,e)=>(c(),s("div",{ref_key:"dataChartScatterSimple",ref:l,class:"data-chart-scatter-simple"},null,512))}});export{l as default};
1
+ import{defineComponent as t,ref as e,inject as a,computed as r,createElementBlock as s,openBlock as c}from"vue";import{InjectionChartMerge as m}from"../utils/injectionKeys.mjs";import{useCharts as i}from"../utils/useCharts.mjs";var l=t({name:"DataChartScatterSimple",__name:"scatter-simple",props:{chartData:{type:Object,required:!0},chartOptions:{type:null,required:!0}},setup(t){const l=e(),o=a(m,t=>t,!0),p=r(()=>{const{colDesc:e,xGroupByDesc:a,modelName:r,data:s}=t.chartData,c={title:{text:r},tooltip:{formatter:t=>t.value.length>1?`${t.seriesName} :<br/>${t.value[0]} ${t.value[1]} `:`${t.seriesName} :<br/>${t.name} : ${t.value} `},series:e.map(t=>({symbolSize:20,name:t,data:s.map(e=>[e[t],e[a?.colDesc||""]]),type:"scatter"}))};return o(c,t.chartOptions)});return i({chartDOM:l,chartOptions:p,chartData:r(()=>t.chartData)}),(t,e)=>(c(),s("div",{ref_key:"dataChartScatterSimple",ref:l,class:"data-chart-scatter-simple"},null,512))}});export{l as default};
2
2
  //# sourceMappingURL=scatter-simple.vue.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"scatter-simple.vue.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/scatter-simple.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { EChartsOption, IFormatPublicData } from '../utils/types'\nimport { InjectionChartMerge } from '../utils/injectionKeys'\nimport { useCharts } from '../utils/useCharts'\n\ndefineOptions({\n name: 'DataChartScatterSimple',\n})\nconst {\n chartData,\n chartOptions,\n} = defineProps<{\n chartData: IFormatPublicData\n chartOptions: EChartsOption\n}>()\nconst dataChartScatterSimple = ref()\nconst merge = inject(InjectionChartMerge, (v: any) => v, true)\n\nconst scatterChartOptions = computed<EChartsOption>(() => {\n const { colDesc, xGroupByDesc, modelName, data } = chartData\n const config = {\n title: {\n text: modelName,\n },\n tooltip: {\n formatter(params: { value: string, seriesName: string, name: string }) {\n if (params.value.length > 1) {\n return (\n `${params.seriesName\n } :<br/>${params.value[0]\n } ${params.value[1]\n } `\n )\n }\n else {\n return (\n `${params.seriesName\n } :<br/>${params.name\n } : ${params.value\n } `\n )\n }\n },\n },\n series: colDesc.map((colDescItem) => {\n return {\n symbolSize: 20,\n name: colDescItem,\n data: data.map((dataItem) => {\n return [dataItem[colDescItem], dataItem[xGroupByDesc?.colDesc || '']]\n }),\n type: 'scatter',\n }\n }),\n }\n return merge(config, chartOptions)\n})\nuseCharts({ chartDOM: dataChartScatterSimple, chartOptions: scatterChartOptions, chartData: computed(() => chartData) })\n</script>\n\n<template>\n <div\n ref=\"dataChartScatterSimple\"\n class=\"data-chart-scatter-simple\"\n />\n</template>\n"],"names":["dataChartScatterSimple","ref","merge","inject","InjectionChartMerge","v","scatterChartOptions","computed","colDesc","xGroupByDesc","modelName","data","__props","chartData","config","title","text","tooltip","formatter","params","value","length","seriesName","name","series","map","colDescItem","symbolSize","dataItem","type","chartOptions","useCharts","chartDOM"],"mappings":"6XAeA,MAAMA,EAAyBC,IACzBC,EAAQC,EAAOC,GAAsBC,GAAWA,IAAG,GAEnDC,EAAsBC,GAAwB,KAClD,MAAMC,QAAEA,EAASC,aAAAA,EAAAC,UAAcA,EAAWC,KAAAA,GAASC,EAAAC,UAC7CC,EAAS,CACbC,MAAO,CACLC,KAAMN,GAERO,QAAS,CACPC,UAAUC,GACJA,EAAOC,MAAMC,OAAS,EAEtB,GAAGF,EAAOG,oBACAH,EAAOC,MAAM,MACnBD,EAAOC,MAAM,MAMjB,GAAGD,EAAOG,oBACAH,EAAOI,UACXJ,EAAOC,UAMrBI,OAAQhB,EAAQiB,KAAKC,IACZ,CACLC,WAAY,GACZJ,KAAMG,EACNf,KAAMA,EAAKc,KAAKG,GACP,CAACA,EAASF,GAAcE,EAASnB,GAAcD,SAAW,OAEnEqB,KAAM,eAIL,OAAA3B,EAAMY,EAAQF,EAAYkB,aAAA,WAEzBC,EAAA,CAAEC,SAAUhC,EAAwB8B,aAAcxB,EAAqBO,UAAWN,GAAS,IAAMK,EAAAC"}
1
+ {"version":3,"file":"scatter-simple.vue.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/scatter-simple.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { EChartsOption, IFormatPublicData } from '../utils/types'\nimport { InjectionChartMerge } from '../utils/injectionKeys'\nimport { useCharts } from '../utils/useCharts'\n\ndefineOptions({\n name: 'DataChartScatterSimple',\n})\nconst {\n chartData,\n chartOptions,\n} = defineProps<{\n chartData: IFormatPublicData\n chartOptions: EChartsOption\n}>()\nconst dataChartScatterSimple = ref()\nconst merge = inject(InjectionChartMerge, (v: any) => v, true)\n\nconst scatterChartOptions = computed<EChartsOption>(() => {\n const { colDesc, xGroupByDesc, modelName, data } = chartData\n const config = {\n title: {\n text: modelName,\n },\n tooltip: {\n formatter(params: { value: string, seriesName: string, name: string }) {\n if (params.value.length > 1) {\n return (\n `${params.seriesName\n } :<br/>${params.value[0]\n } ${params.value[1]\n } `\n )\n }\n else {\n return (\n `${params.seriesName\n } :<br/>${params.name\n } : ${params.value\n } `\n )\n }\n },\n },\n series: colDesc.map((colDescItem) => {\n return {\n symbolSize: 20,\n name: colDescItem,\n data: data.map((dataItem) => {\n return [dataItem[colDescItem], dataItem[xGroupByDesc?.colDesc || '']]\n }),\n type: 'scatter',\n }\n }),\n }\n return merge(config, chartOptions)\n})\nuseCharts({ chartDOM: dataChartScatterSimple, chartOptions: scatterChartOptions, chartData: computed(() => chartData) })\n</script>\n\n<template>\n <div\n ref=\"dataChartScatterSimple\"\n class=\"data-chart-scatter-simple\"\n />\n</template>\n"],"names":["dataChartScatterSimple","ref","merge","inject","InjectionChartMerge","v","scatterChartOptions","computed","colDesc","xGroupByDesc","modelName","data","__props","chartData","config","title","text","tooltip","formatter","params","value","length","seriesName","name","series","map","colDescItem","symbolSize","dataItem","type","chartOptions","useCharts","chartDOM","_createElementBlock","class"],"mappings":"6XAeA,MAAMA,EAAyBC,IACzBC,EAAQC,EAAOC,EAAsBC,GAAWA,GAAG,GAEnDC,EAAsBC,EAAwB,KAClD,MAAMC,QAAEA,EAAAC,aAASA,EAAAC,UAAcA,EAAAC,KAAWA,GAASC,EAAAC,UAC7CC,EAAS,CACbC,MAAO,CACLC,KAAMN,GAERO,QAAS,CACPC,UAAUC,GACJA,EAAOC,MAAMC,OAAS,EAEtB,GAAGF,EAAOG,oBACAH,EAAOC,MAAM,MACnBD,EAAOC,MAAM,MAMjB,GAAGD,EAAOG,oBACAH,EAAOI,UACXJ,EAAOC,UAMrBI,OAAQhB,EAAQiB,IAAKC,IACZ,CACLC,WAAY,GACZJ,KAAMG,EACNf,KAAMA,EAAKc,IAAKG,GACP,CAACA,EAASF,GAAcE,EAASnB,GAAcD,SAAW,MAEnEqB,KAAM,cAIZ,OAAO3B,EAAMY,EAAQF,EAAAkB,uBAEvBC,EAAU,CAAEC,SAAUhC,EAAwB8B,aAAcxB,EAAqBO,UAAWN,EAAS,IAAMK,EAAAC,yBAIzGoB,EAGE,MAAA,SAFI,yBAAJhC,IAAID,EACJkC,MAAM"}
@@ -1,2 +1,2 @@
1
- import{defineComponent as t,ref as a,inject as r,computed as e,createElementBlock as s,openBlock as c}from"vue";import{InjectionChartMerge as i}from"../utils/injectionKeys.mjs";import{useCharts as o}from"../utils/useCharts.mjs";var p=t({name:"DataChartScatter",__name:"scatter",props:{chartData:{type:Object,required:!0},chartOptions:{type:null,required:!0}},setup(t){const p=a(),h=r(i,(t=>t),!0),m=e((()=>h({xAxis:{},yAxis:{},series:[{symbolSize:20,data:[[10,8.04],[8.07,6.95],[13,7.58],[9.05,8.81],[11,8.33],[14,7.66],[13.4,6.81],[10,6.33],[14,8.96],[12.5,6.82],[9.15,7.2],[11.5,7.2],[3.03,4.23],[12.2,7.83],[2.02,4.47],[1.05,3.33],[4.05,4.96],[6.03,7.24],[12,6.26],[12,8.84],[7.08,5.82],[5.02,5.68]],type:"scatter"}]},t.chartOptions)));return o({chartDOM:p,chartOptions:m,chartData:e((()=>t.chartData))}),(t,a)=>(c(),s("div",{ref_key:"dataChartScatter",ref:p,class:"data-chart-scatter"},null,512))}});export{p as default};
1
+ import{defineComponent as t,ref as a,inject as r,computed as e,createElementBlock as s,openBlock as c}from"vue";import{InjectionChartMerge as i}from"../utils/injectionKeys.mjs";import{useCharts as o}from"../utils/useCharts.mjs";var p=t({name:"DataChartScatter",__name:"scatter",props:{chartData:{type:Object,required:!0},chartOptions:{type:null,required:!0}},setup(t){const p=a(),h=r(i,t=>t,!0),m=e(()=>h({xAxis:{},yAxis:{},series:[{symbolSize:20,data:[[10,8.04],[8.07,6.95],[13,7.58],[9.05,8.81],[11,8.33],[14,7.66],[13.4,6.81],[10,6.33],[14,8.96],[12.5,6.82],[9.15,7.2],[11.5,7.2],[3.03,4.23],[12.2,7.83],[2.02,4.47],[1.05,3.33],[4.05,4.96],[6.03,7.24],[12,6.26],[12,8.84],[7.08,5.82],[5.02,5.68]],type:"scatter"}]},t.chartOptions));return o({chartDOM:p,chartOptions:m,chartData:e(()=>t.chartData)}),(t,a)=>(c(),s("div",{ref_key:"dataChartScatter",ref:p,class:"data-chart-scatter"},null,512))}});export{p as default};
2
2
  //# sourceMappingURL=scatter.vue.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"scatter.vue.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/scatter.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { EChartsOption, IFormatPublicData } from '../utils/types'\nimport { InjectionChartMerge } from '../utils/injectionKeys'\nimport { useCharts } from '../utils/useCharts'\n\ndefineOptions({\n name: 'DataChartScatter',\n})\n\nconst {\n chartData,\n chartOptions,\n} = defineProps<{\n chartData: IFormatPublicData\n chartOptions: EChartsOption\n}>()\n\nconst dataChartScatter = ref()\nconst merge = inject(InjectionChartMerge, (v: any) => v, true)\n\nconst scatterChartOptions = computed<EChartsOption>(() => {\n const config = {\n xAxis: {},\n yAxis: {},\n series: [\n {\n symbolSize: 20,\n data: [\n [10.0, 8.04],\n [8.07, 6.95],\n [13.0, 7.58],\n [9.05, 8.81],\n [11.0, 8.33],\n [14.0, 7.66],\n [13.4, 6.81],\n [10.0, 6.33],\n [14.0, 8.96],\n [12.5, 6.82],\n [9.15, 7.2],\n [11.5, 7.2],\n [3.03, 4.23],\n [12.2, 7.83],\n [2.02, 4.47],\n [1.05, 3.33],\n [4.05, 4.96],\n [6.03, 7.24],\n [12.0, 6.26],\n [12.0, 8.84],\n [7.08, 5.82],\n [5.02, 5.68],\n ],\n type: 'scatter',\n },\n ],\n }\n\n return merge(config, chartOptions)\n})\nuseCharts({ chartDOM: dataChartScatter, chartOptions: scatterChartOptions, chartData: computed(() => chartData) })\n</script>\n\n<template>\n <div\n ref=\"dataChartScatter\"\n class=\"data-chart-scatter\"\n />\n</template>\n"],"names":["dataChartScatter","ref","merge","inject","InjectionChartMerge","v","scatterChartOptions","computed","xAxis","yAxis","series","symbolSize","data","type","__props","chartOptions","useCharts","chartDOM","chartData"],"mappings":"gXAiBA,MAAMA,EAAmBC,IACnBC,EAAQC,EAAOC,GAAsBC,GAAWA,IAAG,GAEnDC,EAAsBC,GAAwB,IAoC3CL,EAnCQ,CACbM,MAAO,CAAC,EACRC,MAAO,CAAC,EACRC,OAAQ,CACN,CACEC,WAAY,GACZC,KAAM,CACJ,CAAC,GAAM,MACP,CAAC,KAAM,MACP,CAAC,GAAM,MACP,CAAC,KAAM,MACP,CAAC,GAAM,MACP,CAAC,GAAM,MACP,CAAC,KAAM,MACP,CAAC,GAAM,MACP,CAAC,GAAM,MACP,CAAC,KAAM,MACP,CAAC,KAAM,KACP,CAAC,KAAM,KACP,CAAC,KAAM,MACP,CAAC,KAAM,MACP,CAAC,KAAM,MACP,CAAC,KAAM,MACP,CAAC,KAAM,MACP,CAAC,KAAM,MACP,CAAC,GAAM,MACP,CAAC,GAAM,MACP,CAAC,KAAM,MACP,CAAC,KAAM,OAETC,KAAM,aAKSC,EAAYC,uBAEzBC,EAAA,CAAEC,SAAUjB,EAAkBe,aAAcT,EAAqBY,UAAWX,GAAS,IAAMO,EAAAI"}
1
+ {"version":3,"file":"scatter.vue.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/scatter.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { EChartsOption, IFormatPublicData } from '../utils/types'\nimport { InjectionChartMerge } from '../utils/injectionKeys'\nimport { useCharts } from '../utils/useCharts'\n\ndefineOptions({\n name: 'DataChartScatter',\n})\n\nconst {\n chartData,\n chartOptions,\n} = defineProps<{\n chartData: IFormatPublicData\n chartOptions: EChartsOption\n}>()\n\nconst dataChartScatter = ref()\nconst merge = inject(InjectionChartMerge, (v: any) => v, true)\n\nconst scatterChartOptions = computed<EChartsOption>(() => {\n const config = {\n xAxis: {},\n yAxis: {},\n series: [\n {\n symbolSize: 20,\n data: [\n [10.0, 8.04],\n [8.07, 6.95],\n [13.0, 7.58],\n [9.05, 8.81],\n [11.0, 8.33],\n [14.0, 7.66],\n [13.4, 6.81],\n [10.0, 6.33],\n [14.0, 8.96],\n [12.5, 6.82],\n [9.15, 7.2],\n [11.5, 7.2],\n [3.03, 4.23],\n [12.2, 7.83],\n [2.02, 4.47],\n [1.05, 3.33],\n [4.05, 4.96],\n [6.03, 7.24],\n [12.0, 6.26],\n [12.0, 8.84],\n [7.08, 5.82],\n [5.02, 5.68],\n ],\n type: 'scatter',\n },\n ],\n }\n\n return merge(config, chartOptions)\n})\nuseCharts({ chartDOM: dataChartScatter, chartOptions: scatterChartOptions, chartData: computed(() => chartData) })\n</script>\n\n<template>\n <div\n ref=\"dataChartScatter\"\n class=\"data-chart-scatter\"\n />\n</template>\n"],"names":["dataChartScatter","ref","merge","inject","InjectionChartMerge","v","scatterChartOptions","computed","xAxis","yAxis","series","symbolSize","data","type","__props","chartOptions","useCharts","chartDOM","chartData","_createElementBlock","class"],"mappings":"gXAiBA,MAAMA,EAAmBC,IACnBC,EAAQC,EAAOC,EAAsBC,GAAWA,GAAG,GAEnDC,EAAsBC,EAAwB,IAoC3CL,EAnCQ,CACbM,MAAO,CAAA,EACPC,MAAO,CAAA,EACPC,OAAQ,CACN,CACEC,WAAY,GACZC,KAAM,CACJ,CAAC,GAAM,MACP,CAAC,KAAM,MACP,CAAC,GAAM,MACP,CAAC,KAAM,MACP,CAAC,GAAM,MACP,CAAC,GAAM,MACP,CAAC,KAAM,MACP,CAAC,GAAM,MACP,CAAC,GAAM,MACP,CAAC,KAAM,MACP,CAAC,KAAM,KACP,CAAC,KAAM,KACP,CAAC,KAAM,MACP,CAAC,KAAM,MACP,CAAC,KAAM,MACP,CAAC,KAAM,MACP,CAAC,KAAM,MACP,CAAC,KAAM,MACP,CAAC,GAAM,MACP,CAAC,GAAM,MACP,CAAC,KAAM,MACP,CAAC,KAAM,OAETC,KAAM,aAKSC,EAAAC,sBAEvBC,EAAU,CAAEC,SAAUjB,EAAkBe,aAAcT,EAAqBY,UAAWX,EAAS,IAAMO,EAAAI,yBAInGC,EAGE,MAAA,SAFI,mBAAJlB,IAAID,EACJoB,MAAM"}
@@ -1,2 +1,2 @@
1
- import{ElTable as e,ElTableColumn as t}from"element-plus/es";import"element-plus/es/components/base/style/index";import"element-plus/es/components/table/style/index";import"element-plus/es/components/table-column/style/index";import{defineComponent as a,computed as o,createElementBlock as l,openBlock as s,normalizeClass as r,unref as c,createCommentVNode as n,createVNode as p,createElementVNode as m,toDisplayString as i,withCtx as u,Fragment as d,renderList as h,createBlock as D,createTextVNode as f}from"vue";import{useNamespace as b}from"@qxs-bns/hooks";import y from"./empty.vue.mjs";const x={key:0,class:"title"};var w=a({name:"DataChartTable",__name:"table",props:{chartData:{type:Object,default:()=>({colDesc:[],xGroupByDesc:[],data:[],modelName:""})}},setup(a){const w=a,g=b("data-chart"),v=o((()=>w.chartData.groupByDesc.find((e=>!e.xAxis))));function $(e){if(!e)return 100;const t=14*e.length+20+30;return t<100?100:t}return(o,b)=>{const w=t,_=e;return s(),l("div",{class:r([c(g).e("table")])},[a.chartData.modelName?(s(),l("p",x,[m("span",null,i(a.chartData.modelName),1)])):n("v-if",!0),p(_,{class:"customize-table",data:a.chartData.data,stripe:"",height:"100%"},{empty:u((()=>[p(y)])),default:u((()=>[(s(!0),l(d,null,h(a.chartData.groupByDesc,((e,t)=>(s(),D(w,{key:`${e.colDesc}${e.groupByDesc}${t}`,align:"center","show-overflow-tooltip":"",sortable:"","min-width":`${$(e.colDesc)}px`,prop:e.colDesc||""},{header:u((()=>[f(i(e.colDesc),1)])),default:u((t=>[f(i((c(v)&&(c(v).colDesc,e.colDesc),t.row[e.colDesc||""]||"--")),1)])),_:2},1032,["min-width","prop"])))),128)),(s(!0),l(d,null,h(a.chartData.colDesc,((e,t)=>(s(),D(w,{key:e+t,align:"center","min-width":`${$(e)}px`,label:e,"show-overflow-tooltip":"",sortable:"",prop:e},{header:u((()=>[f(i(e),1)])),_:2},1032,["min-width","label","prop"])))),128))])),_:1},8,["data"])],2)}}});export{w as default};
1
+ import{ElTable as e,ElTableColumn as t}from"element-plus/es";import"element-plus/es/components/base/style/index";import"element-plus/es/components/table/style/index";import"element-plus/es/components/table-column/style/index";import{defineComponent as a,computed as o,createElementBlock as l,openBlock as s,normalizeClass as r,unref as c,createCommentVNode as n,createVNode as p,createElementVNode as m,toDisplayString as i,withCtx as u,Fragment as d,renderList as h,createBlock as D,createTextVNode as f}from"vue";import{useNamespace as b}from"@qxs-bns/hooks";import y from"./empty.vue.mjs";const x={key:0,class:"title"};var w=a({name:"DataChartTable",__name:"table",props:{chartData:{type:Object,default:()=>({colDesc:[],xGroupByDesc:[],data:[],modelName:""})}},setup(a){const w=a,g=b("data-chart"),v=o(()=>w.chartData.groupByDesc.find(e=>!e.xAxis));function $(e){if(!e)return 100;const t=14*e.length+20+30;return t<100?100:t}return(o,b)=>{const w=t,_=e;return s(),l("div",{class:r([c(g).e("table")])},[a.chartData.modelName?(s(),l("p",x,[m("span",null,i(a.chartData.modelName),1)])):n("v-if",!0),p(_,{class:"customize-table",data:a.chartData.data,stripe:"",height:"100%"},{empty:u(()=>[p(y)]),default:u(()=>[(s(!0),l(d,null,h(a.chartData.groupByDesc,(e,t)=>(s(),D(w,{key:`${e.colDesc}${e.groupByDesc}${t}`,align:"center","show-overflow-tooltip":"",sortable:"","min-width":`${$(e.colDesc)}px`,prop:e.colDesc||""},{header:u(()=>[f(i(e.colDesc),1)]),default:u(t=>[f(i((c(v)&&(c(v).colDesc,e.colDesc),t.row[e.colDesc||""]||"--")),1)]),_:2},1032,["min-width","prop"]))),128)),(s(!0),l(d,null,h(a.chartData.colDesc,(e,t)=>(s(),D(w,{key:e+t,align:"center","min-width":`${$(e)}px`,label:e,"show-overflow-tooltip":"",sortable:"",prop:e},{header:u(()=>[f(i(e),1)]),_:2},1032,["min-width","label","prop"]))),128))]),_:1},8,["data"])],2)}}});export{w as default};
2
2
  //# sourceMappingURL=table.vue.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"table.vue.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/table.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { PropType } from 'vue'\nimport type { IFormatPublicData } from '../utils/types'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport Empty from './empty.vue'\n\ndefineOptions({\n name: 'DataChartTable',\n})\n\nconst props = defineProps({\n chartData: {\n type: Object as PropType<IFormatPublicData>,\n default: () => ({\n colDesc: [],\n xGroupByDesc: [],\n data: [],\n modelName: '',\n }),\n },\n})\n\nconst ns = useNamespace('data-chart')\n\nconst yGroupByDesc = computed(() => {\n const row = props.chartData.groupByDesc.find(item => !item.xAxis)\n return row\n})\n\nfunction baseWidth(str: string | null) {\n if (!str) {\n return 100\n }\n const strWidth = str.length * 14 + 20 + 30\n return strWidth < 100 ? 100 : strWidth\n}\n</script>\n\n<template>\n <div :class=\"[ns.e('table')]\">\n <p\n v-if=\"chartData.modelName\"\n class=\"title\"\n >\n <span>{{ chartData.modelName }}</span>\n </p>\n <el-table\n class=\"customize-table\"\n :data=\"chartData.data\"\n stripe\n height=\"100%\"\n >\n <el-table-column\n v-for=\"(item, index) in chartData.groupByDesc\"\n :key=\"`${item.colDesc}${item.groupByDesc}${index}`\"\n align=\"center\"\n show-overflow-tooltip\n sortable\n :min-width=\"`${baseWidth(item.colDesc)}px`\"\n :prop=\"item.colDesc || ''\"\n >\n <template #header>\n {{ item.colDesc }}\n </template>\n <template #default=\"scoped\">\n {{ (yGroupByDesc && yGroupByDesc.colDesc === item.colDesc ? scoped.row[item.colDesc || ''] : scoped.row[item.colDesc || '']) || '--' }}\n </template>\n </el-table-column>\n <el-table-column\n v-for=\"(item, index) in chartData.colDesc\"\n :key=\"item + index\"\n align=\"center\"\n :min-width=\"`${baseWidth(item)}px`\"\n :label=\"item\"\n show-overflow-tooltip\n sortable\n :prop=\"item\"\n >\n <template #header>\n {{ item }}\n </template>\n </el-table-column>\n <template #empty>\n <Empty />\n </template>\n </el-table>\n </div>\n</template>\n"],"names":["props","__props","ns","useNamespace","yGroupByDesc","computed","chartData","groupByDesc","find","item","xAxis","baseWidth","str","strWidth","length"],"mappings":"qwBAUA,MAAMA,EAAQC,EAYRC,EAAKC,EAAa,cAElBC,EAAeC,GAAS,IAChBL,EAAMM,UAAUC,YAAYC,MAAaC,IAACA,EAAKC,UAI7D,SAASC,EAAUC,GACjB,IAAKA,EACI,OAAA,IAET,MAAMC,EAAwB,GAAbD,EAAIE,OAAc,GAAK,GACjC,OAAAD,EAAW,IAAM,IAAMA,CAAA"}
1
+ {"version":3,"file":"table.vue.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/table.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { PropType } from 'vue'\nimport type { IFormatPublicData } from '../utils/types'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport Empty from './empty.vue'\n\ndefineOptions({\n name: 'DataChartTable',\n})\n\nconst props = defineProps({\n chartData: {\n type: Object as PropType<IFormatPublicData>,\n default: () => ({\n colDesc: [],\n xGroupByDesc: [],\n data: [],\n modelName: '',\n }),\n },\n})\n\nconst ns = useNamespace('data-chart')\n\nconst yGroupByDesc = computed(() => {\n const row = props.chartData.groupByDesc.find(item => !item.xAxis)\n return row\n})\n\nfunction baseWidth(str: string | null) {\n if (!str) {\n return 100\n }\n const strWidth = str.length * 14 + 20 + 30\n return strWidth < 100 ? 100 : strWidth\n}\n</script>\n\n<template>\n <div :class=\"[ns.e('table')]\">\n <p\n v-if=\"chartData.modelName\"\n class=\"title\"\n >\n <span>{{ chartData.modelName }}</span>\n </p>\n <el-table\n class=\"customize-table\"\n :data=\"chartData.data\"\n stripe\n height=\"100%\"\n >\n <el-table-column\n v-for=\"(item, index) in chartData.groupByDesc\"\n :key=\"`${item.colDesc}${item.groupByDesc}${index}`\"\n align=\"center\"\n show-overflow-tooltip\n sortable\n :min-width=\"`${baseWidth(item.colDesc)}px`\"\n :prop=\"item.colDesc || ''\"\n >\n <template #header>\n {{ item.colDesc }}\n </template>\n <template #default=\"scoped\">\n {{ (yGroupByDesc && yGroupByDesc.colDesc === item.colDesc ? scoped.row[item.colDesc || ''] : scoped.row[item.colDesc || '']) || '--' }}\n </template>\n </el-table-column>\n <el-table-column\n v-for=\"(item, index) in chartData.colDesc\"\n :key=\"item + index\"\n align=\"center\"\n :min-width=\"`${baseWidth(item)}px`\"\n :label=\"item\"\n show-overflow-tooltip\n sortable\n :prop=\"item\"\n >\n <template #header>\n {{ item }}\n </template>\n </el-table-column>\n <template #empty>\n <Empty />\n </template>\n </el-table>\n </div>\n</template>\n"],"names":["props","__props","ns","useNamespace","yGroupByDesc","computed","chartData","groupByDesc","find","item","xAxis","baseWidth","str","strWidth","length","_createElementBlock","class","_normalizeClass","_unref","e","modelName","_openBlock","_hoisted_1","_createElementVNode","_toDisplayString","_createVNode","_component_el_table","data","stripe","height","empty","Empty","_Fragment","index","_createBlock","_component_el_table_column","key","colDesc","align","sortable","prop","header","_createTextVNode","default","_withCtx","scoped","row","label"],"mappings":"qwBAUA,MAAMA,EAAQC,EAYRC,EAAKC,EAAa,cAElBC,EAAeC,EAAS,IAChBL,EAAMM,UAAUC,YAAYC,KAAKC,IAASA,EAAKC,QAI7D,SAASC,EAAUC,GACjB,IAAKA,EACH,OAAO,IAET,MAAMC,EAAwB,GAAbD,EAAIE,OAAc,GAAK,GACxC,OAAOD,EAAW,IAAM,IAAMA,CAChC,wCAIEE,EA+CM,MAAA,CA/CAC,MAAKC,EAAA,CAAGC,EAAAhB,GAAGiB,EAAC,aAERlB,EAAAK,UAAUc,WADlBC,IAAAN,EAKI,IALJO,EAKI,CADFC,EAAsC,OAAA,KAAAC,EAA7BvB,EAAAK,UAAUc,WAAS,mBAE9BK,EAuCWC,EAAA,CAtCTV,MAAM,kBACLW,KAAM1B,EAAAK,UAAUqB,KACjBC,OAAA,GACAC,OAAO,SAgCIC,QACT,IAAS,CAATL,EAASM,eA9BT,IAA8C,EADhDV,GAAA,GAAAN,EAekBiB,SAdQ/B,EAAAK,UAAUC,YAAW,CAArCE,EAAMwB,SADhBC,EAekBC,EAAA,CAbfC,IAAG,GAAK3B,EAAK4B,UAAU5B,EAAKF,cAAc0B,IAC3CK,MAAM,SACN,wBAAA,GACAC,SAAA,GACC,YAAS,GAAK5B,EAAUF,EAAK4B,aAC7BG,KAAM/B,EAAK4B,SAAO,KAERI,SACT,IAAkB,CAAfC,EAAAlB,EAAAf,EAAK4B,SAAO,KAENM,QAAOC,EACuHC,GAD/G,MACpB3B,EAAAd,KAAgBc,KAAamB,QAAY5B,EAAK4B,SAAUQ,EAAOC,IAAIrC,EAAK4B,SAAO,KAAiC,OAAA,8CAGxHhB,GAAA,GAAAN,EAakBiB,SAZQ/B,EAAAK,UAAU+B,QAAO,CAAjC5B,EAAMwB,SADhBC,EAakBC,EAAA,CAXfC,IAAK3B,EAAOwB,EACbK,MAAM,SACL,YAAS,GAAK3B,EAAUF,OACxBsC,MAAOtC,EACR,wBAAA,GACA8B,SAAA,GACCC,KAAM/B,IAEIgC,SACT,IAAU,KAAPhC,GAAI"}
@@ -1,2 +1,2 @@
1
- import{defineComponent as e,computed as o,provide as t,createBlock as s,openBlock as r,resolveDynamicComponent as a,unref as m,normalizeClass as p}from"vue";import{useNamespace as n}from"@qxs-bns/hooks";import{JsonToExcel as i}from"@qxs-bns/utils";import{cloneDeep as c,merge as u}from"lodash-es";import*as l from"./analyze.mjs";import d from"./components/area.vue.mjs";import f from"./components/bar.vue.mjs";import y from"./components/card.vue.mjs";import h from"./components/funnel.vue.mjs";import j from"./components/line.vue.mjs";import g from"./components/pie.vue.mjs";import v from"./components/radar.vue.mjs";import b from"./components/scatter-simple.vue.mjs";import w from"./components/scatter.vue.mjs";import x from"./components/table.vue.mjs";import*as D from"./utils/config.mjs";import{defaultChartOption as S}from"./utils/config.mjs";import{InjectionChartMerge as T}from"./utils/injectionKeys.mjs";import{safeEvalConfig as q}from"./utils/safe-eval.mjs";import*as C from"./utils/types.mjs";import{useDataToExcelJson as N}from"./utils/useCharts.mjs";var B=e({name:"QxsDataChart",__name:"data-chart",props:{modelName:{type:String,required:!1,default:""},showTypeName:{type:String,required:!1,default:"table"},subShowType:{type:String,required:!1},data:{type:Object,required:!1,default:()=>({data:[],desc:{colDesc:[],showDesc:{showType:0,chartOptions:"{}",jsCodeSnippet:""},groupByDesc:[]}})},chartOptions:{type:null,required:!1,default:()=>({})},jsCodeSnippet:{type:String,required:!1,default:""}},setup(e,{expose:B}){const O=n("data-chart"),k={analyze:l,config:D,types:C},z={table:x,bar:f,line:j,pie:g,radar:v,scatter:w,funnel:h,area:d,card:y,"scatter-simple":b},A=o((()=>c(S[e.showTypeName]))),Q=o((()=>{const{desc:{colDesc:o=[],groupByDesc:t=[]}={},data:s=[]}=e.data;let r=[],a=null;r=t?.map((e=>(e.xAxis&&(a=e),e)));const m=a?s.filter((e=>e&&e[a.colDesc])):s;return{colDesc:o||[],modelName:e.modelName,subShowType:e.subShowType,xGroupByDesc:a||{colDesc:"",groupByDesc:"",groupByValues:[],xAxis:!1},groupByDesc:r,data:m}}));return B({exportExal:function(){if(0===e.data.data.length)return void console.log("暂无数据");const o=N(e.data);i(e.modelName,o)},QxsDataChartConfig:k}),t(T,(function(o,t){let s=u({},A.value,o,t)||{};if(e.jsCodeSnippet)try{s=q(e.jsCodeSnippet,s)}catch(e){console.error("代码执行失败:",e)}return s})),(e,o)=>(r(),s(a(z[e.showTypeName]),{key:e.showTypeName,class:p([m(O).e("wrapper")]),"sub-show-type":e.subShowType,"chart-data":m(Q),"chart-options":e.chartOptions},null,8,["class","sub-show-type","chart-data","chart-options"]))}});export{B as default};
1
+ import{defineComponent as e,computed as o,provide as t,createBlock as s,openBlock as r,resolveDynamicComponent as a,unref as m,normalizeClass as p}from"vue";import{useNamespace as n}from"@qxs-bns/hooks";import{JsonToExcel as i}from"@qxs-bns/utils";import{cloneDeep as c,merge as u}from"lodash-es";import*as l from"./analyze.mjs";import d from"./components/area.vue.mjs";import f from"./components/bar.vue.mjs";import y from"./components/card.vue.mjs";import h from"./components/funnel.vue.mjs";import j from"./components/line.vue.mjs";import g from"./components/pie.vue.mjs";import v from"./components/radar.vue.mjs";import b from"./components/scatter-simple.vue.mjs";import w from"./components/scatter.vue.mjs";import x from"./components/table.vue.mjs";import*as D from"./utils/config.mjs";import{defaultChartOption as S}from"./utils/config.mjs";import{InjectionChartMerge as T}from"./utils/injectionKeys.mjs";import{safeEvalConfig as q}from"./utils/safe-eval.mjs";import*as C from"./utils/types.mjs";import{useDataToExcelJson as N}from"./utils/useCharts.mjs";var B=e({name:"QxsDataChart",__name:"data-chart",props:{modelName:{type:String,required:!1,default:""},showTypeName:{type:String,required:!1,default:"table"},subShowType:{type:String,required:!1},data:{type:Object,required:!1,default:()=>({data:[],desc:{colDesc:[],showDesc:{showType:0,chartOptions:"{}",jsCodeSnippet:""},groupByDesc:[]}})},chartOptions:{type:null,required:!1,default:()=>({})},jsCodeSnippet:{type:String,required:!1,default:""}},setup(e,{expose:B}){const O=n("data-chart"),k={analyze:l,config:D,types:C},z={table:x,bar:f,line:j,pie:g,radar:v,scatter:w,funnel:h,area:d,card:y,"scatter-simple":b},A=o(()=>c(S[e.showTypeName])),Q=o(()=>{const{desc:{colDesc:o=[],groupByDesc:t=[]}={},data:s=[]}=e.data;let r=[],a=null;r=t?.map(e=>(e.xAxis&&(a=e),e));const m=a?s.filter(e=>e&&e[a.colDesc]):s;return{colDesc:o||[],modelName:e.modelName,subShowType:e.subShowType,xGroupByDesc:a||{colDesc:"",groupByDesc:"",groupByValues:[],xAxis:!1},groupByDesc:r,data:m}});return B({exportExal:function(){if(0===e.data.data.length)return void console.log("暂无数据");const o=N(e.data);i(e.modelName,o)},QxsDataChartConfig:k}),t(T,function(o,t){let s=u({},A.value,o,t)||{};if(e.jsCodeSnippet)try{s=q(e.jsCodeSnippet,s)}catch(e){console.error("代码执行失败:",e)}return s}),(e,o)=>(r(),s(a(z[e.showTypeName]),{key:e.showTypeName,class:p([m(O).e("wrapper")]),"sub-show-type":e.subShowType,"chart-data":m(Q),"chart-options":e.chartOptions},null,8,["class","sub-show-type","chart-data","chart-options"]))}});export{B as default};
2
2
  //# sourceMappingURL=data-chart.vue.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-chart.vue.mjs","sources":["../../../../../../packages/components/src/data-chart/src/data-chart.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { EChartData, EChartsOption, IconRow, IFormatPublicData } from './utils/types'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { JsonToExcel } from '@qxs-bns/utils'\nimport { cloneDeep, merge as lodashMerge } from 'lodash-es'\nimport * as analyze from './analyze'\nimport Area from './components/area.vue'\nimport Bar from './components/bar.vue'\nimport Card from './components/card.vue'\nimport Funnel from './components/funnel.vue'\nimport Line from './components/line.vue'\nimport Pie from './components/pie.vue'\nimport Radar from './components/radar.vue'\nimport ScatterSimple from './components/scatter-simple.vue'\nimport Scatter from './components/scatter.vue'\nimport Table from './components/table.vue'\nimport * as config from './utils/config'\nimport { defaultChartOption } from './utils/config'\nimport { InjectionChartMerge } from './utils/injectionKeys'\nimport { safeEvalConfig } from './utils/safe-eval'\nimport * as types from './utils/types'\nimport { useDataToExcelJson } from './utils/useCharts'\n\ndefineOptions({\n name: 'QxsDataChart',\n})\nconst {\n showTypeName = 'table',\n subShowType,\n modelName = '',\n data: propData = {\n data: [],\n desc: {\n colDesc: [],\n showDesc: {\n showType: 0,\n chartOptions: '{}',\n jsCodeSnippet: '',\n },\n groupByDesc: [],\n },\n },\n chartOptions = {},\n jsCodeSnippet = '',\n} = defineProps<{\n modelName?: string\n showTypeName?: IconRow['showTypeName']\n subShowType?: string\n data?: EChartData\n chartOptions?: EChartsOption\n jsCodeSnippet?: string\n}>()\n\nconst ns = useNamespace('data-chart')\n\nconst QxsDataChartConfig = {\n analyze,\n config,\n types,\n}\nconst coms: {\n [key: string]: any\n} = {\n 'table': Table,\n 'bar': Bar,\n 'line': Line,\n 'pie': Pie,\n 'radar': Radar,\n 'scatter': Scatter,\n 'funnel': Funnel,\n 'area': Area,\n 'card': Card,\n 'scatter-simple': ScatterSimple,\n}\n\nconst defaultChartOptionCopy = computed(() => {\n return cloneDeep(defaultChartOption[showTypeName])\n})\n\nconst formatPublicData = computed<IFormatPublicData>(() => {\n const { desc: { colDesc = [], groupByDesc = [] } = {}, data = [] } = propData\n\n // 处理 X 轴数据\n let xValue = []\n\n let xGroupByDesc: EChartData['desc']['groupByDesc'][0] | null = null\n xValue = groupByDesc?.map((groupByDescItem) => {\n // if (groupByDescItem.colValues) {\n // groupByDescItem.colValuesDesc = {}\n // groupByDescItem.colValues.split(',')?.forEach((item) => {\n // const [key, value] = item.split(':')\n // groupByDescItem.colValuesDesc[key] = value\n // })\n // }\n if (groupByDescItem.xAxis) {\n xGroupByDesc = groupByDescItem\n }\n return groupByDescItem\n })\n\n const dataValue = xGroupByDesc ? data.filter(item => item && item[xGroupByDesc!.colDesc!]) : data\n\n // if (xGroupByDesc && xGroupByDesc.colValuesDesc && Object.keys(xGroupByDesc.colValuesDesc).length) {\n // const { colDesc: colDescItem, colValuesDesc } = xGroupByDesc\n // console.log('colDesc: colDescItem, colValuesDesc: ', colDescItem, colValuesDesc)\n // dataValue = dataValue.map((item) => {\n // if (typeof item[colDescItem] === 'number') {\n // item[colDescItem] = colValuesDesc[item[colDescItem]]\n // }\n // return item\n // })\n // }\n\n const mergeConfig = {\n colDesc: colDesc || [],\n modelName,\n subShowType,\n xGroupByDesc: xGroupByDesc || {\n colDesc: '',\n groupByDesc: '',\n groupByValues: [],\n xAxis: false,\n },\n groupByDesc: xValue,\n data: dataValue,\n }\n return mergeConfig\n})\n\n// 导出数据\nfunction exportExal() {\n if (propData.data.length === 0) {\n // useMessage.error('暂无数据')\n console.log('暂无数据')\n return\n }\n const arr = useDataToExcelJson(propData)\n JsonToExcel(modelName, arr)\n}\nfunction merge(config: EChartsOption, defaultConfig: EChartsOption) {\n const mergeOpt = lodashMerge({}, defaultChartOptionCopy.value, config, defaultConfig)\n let conf = mergeOpt || {}\n\n if (jsCodeSnippet) {\n try {\n // 使用安全的配置处理函数\n conf = safeEvalConfig(jsCodeSnippet, conf)\n }\n catch (error) {\n console.error('代码执行失败:', error)\n }\n }\n\n return conf\n}\n\ndefineExpose({\n exportExal,\n QxsDataChartConfig,\n})\nprovide(InjectionChartMerge, merge)\n</script>\n\n<template>\n <component\n :is=\"coms[showTypeName]\"\n :key=\"showTypeName\"\n :class=\"[ns.e('wrapper')]\"\n :sub-show-type=\"subShowType\"\n :chart-data=\"formatPublicData\"\n :chart-options=\"chartOptions\"\n />\n</template>\n"],"names":["ns","useNamespace","QxsDataChartConfig","analyze","config","types","coms","table","Table","bar","Bar","line","Line","pie","Pie","radar","Radar","scatter","Scatter","funnel","Funnel","area","Area","card","Card","ScatterSimple","defaultChartOptionCopy","computed","cloneDeep","defaultChartOption","__props","formatPublicData","desc","colDesc","groupByDesc","data","xValue","xGroupByDesc","map","groupByDescItem","xAxis","dataValue","filter","item","modelName","subShowType","groupByValues","__expose","exportExal","length","console","log","arr","useDataToExcelJson","JsonToExcel","provide","InjectionChartMerge","defaultConfig","conf","lodashMerge","value","jsCodeSnippet","safeEvalConfig","error"],"mappings":"w/CAqDM,MAAAA,EAAKC,EAAa,cAElBC,EAAqB,CACzBC,UACAC,SACAC,SAEIC,EAEF,CACFC,MAASC,EACTC,IAAOC,EACPC,KAAQC,EACRC,IAAOC,EACPC,MAASC,EACTC,QAAWC,EACXC,OAAUC,EACVC,KAAQC,EACRC,KAAQC,EACR,iBAAkBC,GAGdC,EAAyBC,GAAS,IAC/BC,EAAUC,EAAmBC,mBAGhCC,EAAmBJ,GAA4B,KACnD,MAAQK,MAAMC,QAAEA,EAAU,eAAIC,EAAc,IAAO,CAAI,EAAAC,KAAAA,EAAO,IAAOL,EAAAK,KAGrE,IAAIC,EAAS,GAETC,EAA4D,KACvDD,EAAAF,GAAaI,KAAKC,IAQrBA,EAAgBC,QACHH,EAAAE,GAEVA,KAGH,MAAAE,EAAYJ,EAAeF,EAAKO,QAAOC,GAAQA,GAAQA,EAAKN,EAAcJ,WAAaE,EA0BtF,MAba,CAClBF,QAASA,GAAW,GACpBW,UAASd,EAAAc,UACTC,YAAWf,EAAAe,YACXR,aAAcA,GAAgB,CAC5BJ,QAAS,GACTC,YAAa,GACbY,cAAe,GACfN,OAAO,GAETN,YAAaE,EACbD,KAAMM,EAED,WA8BIM,EAAA,CACXC,WA3BF,WACE,GAA6B,IAAzBlB,OAASK,KAAKc,OAGhB,YADAC,QAAQC,IAAI,QAGR,MAAAC,EAAMC,EAAmBvB,EAAQK,MAC3BmB,EAAAxB,EAAAc,UAAWQ,EAAG,EAqB1BlD,uBAEFqD,EAAQC,GArBC,SAAMpD,EAAuBqD,GAEhC,IAAAC,EADaC,EAAY,GAAIjC,EAAuBkC,MAAOxD,EAAQqD,IAChD,CAAC,EAExB,GAAI3B,EAAA+B,cACE,IAEKH,EAAAI,EAAehC,gBAAe4B,SAEhCK,GACGb,QAAAa,MAAM,UAAWA,EAAK,CAI3B,OAAAL,CAAA"}
1
+ {"version":3,"file":"data-chart.vue.mjs","sources":["../../../../../../packages/components/src/data-chart/src/data-chart.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { EChartData, EChartsOption, IconRow, IFormatPublicData } from './utils/types'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { JsonToExcel } from '@qxs-bns/utils'\nimport { cloneDeep, merge as lodashMerge } from 'lodash-es'\nimport * as analyze from './analyze'\nimport Area from './components/area.vue'\nimport Bar from './components/bar.vue'\nimport Card from './components/card.vue'\nimport Funnel from './components/funnel.vue'\nimport Line from './components/line.vue'\nimport Pie from './components/pie.vue'\nimport Radar from './components/radar.vue'\nimport ScatterSimple from './components/scatter-simple.vue'\nimport Scatter from './components/scatter.vue'\nimport Table from './components/table.vue'\nimport * as config from './utils/config'\nimport { defaultChartOption } from './utils/config'\nimport { InjectionChartMerge } from './utils/injectionKeys'\nimport { safeEvalConfig } from './utils/safe-eval'\nimport * as types from './utils/types'\nimport { useDataToExcelJson } from './utils/useCharts'\n\ndefineOptions({\n name: 'QxsDataChart',\n})\nconst {\n showTypeName = 'table',\n subShowType,\n modelName = '',\n data: propData = {\n data: [],\n desc: {\n colDesc: [],\n showDesc: {\n showType: 0,\n chartOptions: '{}',\n jsCodeSnippet: '',\n },\n groupByDesc: [],\n },\n },\n chartOptions = {},\n jsCodeSnippet = '',\n} = defineProps<{\n modelName?: string\n showTypeName?: IconRow['showTypeName']\n subShowType?: string\n data?: EChartData\n chartOptions?: EChartsOption\n jsCodeSnippet?: string\n}>()\n\nconst ns = useNamespace('data-chart')\n\nconst QxsDataChartConfig = {\n analyze,\n config,\n types,\n}\nconst coms: {\n [key: string]: any\n} = {\n 'table': Table,\n 'bar': Bar,\n 'line': Line,\n 'pie': Pie,\n 'radar': Radar,\n 'scatter': Scatter,\n 'funnel': Funnel,\n 'area': Area,\n 'card': Card,\n 'scatter-simple': ScatterSimple,\n}\n\nconst defaultChartOptionCopy = computed(() => {\n return cloneDeep(defaultChartOption[showTypeName])\n})\n\nconst formatPublicData = computed<IFormatPublicData>(() => {\n const { desc: { colDesc = [], groupByDesc = [] } = {}, data = [] } = propData\n\n // 处理 X 轴数据\n let xValue = []\n\n let xGroupByDesc: EChartData['desc']['groupByDesc'][0] | null = null\n xValue = groupByDesc?.map((groupByDescItem) => {\n // if (groupByDescItem.colValues) {\n // groupByDescItem.colValuesDesc = {}\n // groupByDescItem.colValues.split(',')?.forEach((item) => {\n // const [key, value] = item.split(':')\n // groupByDescItem.colValuesDesc[key] = value\n // })\n // }\n if (groupByDescItem.xAxis) {\n xGroupByDesc = groupByDescItem\n }\n return groupByDescItem\n })\n\n const dataValue = xGroupByDesc ? data.filter(item => item && item[xGroupByDesc!.colDesc!]) : data\n\n // if (xGroupByDesc && xGroupByDesc.colValuesDesc && Object.keys(xGroupByDesc.colValuesDesc).length) {\n // const { colDesc: colDescItem, colValuesDesc } = xGroupByDesc\n // console.log('colDesc: colDescItem, colValuesDesc: ', colDescItem, colValuesDesc)\n // dataValue = dataValue.map((item) => {\n // if (typeof item[colDescItem] === 'number') {\n // item[colDescItem] = colValuesDesc[item[colDescItem]]\n // }\n // return item\n // })\n // }\n\n const mergeConfig = {\n colDesc: colDesc || [],\n modelName,\n subShowType,\n xGroupByDesc: xGroupByDesc || {\n colDesc: '',\n groupByDesc: '',\n groupByValues: [],\n xAxis: false,\n },\n groupByDesc: xValue,\n data: dataValue,\n }\n return mergeConfig\n})\n\n// 导出数据\nfunction exportExal() {\n if (propData.data.length === 0) {\n // useMessage.error('暂无数据')\n console.log('暂无数据')\n return\n }\n const arr = useDataToExcelJson(propData)\n JsonToExcel(modelName, arr)\n}\nfunction merge(config: EChartsOption, defaultConfig: EChartsOption) {\n const mergeOpt = lodashMerge({}, defaultChartOptionCopy.value, config, defaultConfig)\n let conf = mergeOpt || {}\n\n if (jsCodeSnippet) {\n try {\n // 使用安全的配置处理函数\n conf = safeEvalConfig(jsCodeSnippet, conf)\n }\n catch (error) {\n console.error('代码执行失败:', error)\n }\n }\n\n return conf\n}\n\ndefineExpose({\n exportExal,\n QxsDataChartConfig,\n})\nprovide(InjectionChartMerge, merge)\n</script>\n\n<template>\n <component\n :is=\"coms[showTypeName]\"\n :key=\"showTypeName\"\n :class=\"[ns.e('wrapper')]\"\n :sub-show-type=\"subShowType\"\n :chart-data=\"formatPublicData\"\n :chart-options=\"chartOptions\"\n />\n</template>\n"],"names":["ns","useNamespace","QxsDataChartConfig","analyze","config","types","coms","table","Table","bar","Bar","line","Line","pie","Pie","radar","Radar","scatter","Scatter","funnel","Funnel","area","Area","card","Card","ScatterSimple","defaultChartOptionCopy","computed","cloneDeep","defaultChartOption","__props","formatPublicData","desc","colDesc","groupByDesc","data","xValue","xGroupByDesc","map","groupByDescItem","xAxis","dataValue","filter","item","modelName","subShowType","groupByValues","__expose","exportExal","length","console","log","arr","useDataToExcelJson","JsonToExcel","provide","InjectionChartMerge","defaultConfig","conf","lodashMerge","value","jsCodeSnippet","safeEvalConfig","error","_createBlock","_resolveDynamicComponent","showTypeName","key","class","_normalizeClass","_unref","e","chartOptions"],"mappings":"w/CAqDA,MAAMA,EAAKC,EAAa,cAElBC,EAAqB,CACzBC,UACAC,SACAC,SAEIC,EAEF,CACFC,MAASC,EACTC,IAAOC,EACPC,KAAQC,EACRC,IAAOC,EACPC,MAASC,EACTC,QAAWC,EACXC,OAAUC,EACVC,KAAQC,EACRC,KAAQC,EACR,iBAAkBC,GAGdC,EAAyBC,EAAS,IAC/BC,EAAUC,EAAmBC,kBAGhCC,EAAmBJ,EAA4B,KACnD,MAAQK,MAAMC,QAAEA,EAAU,eAAIC,EAAc,IAAO,CAAA,EAACC,KAAGA,EAAO,IAAOL,EAAAK,KAGrE,IAAIC,EAAS,GAETC,EAA4D,KAChED,EAASF,GAAaI,IAAKC,IAQrBA,EAAgBC,QAClBH,EAAeE,GAEVA,IAGT,MAAME,EAAYJ,EAAeF,EAAKO,OAAOC,GAAQA,GAAQA,EAAKN,EAAcJ,UAAaE,EA0B7F,MAboB,CAClBF,QAASA,GAAW,GACpBW,UAAQd,EAAAc,UACRC,YAAUf,EAAAe,YACVR,aAAcA,GAAgB,CAC5BJ,QAAS,GACTC,YAAa,GACbY,cAAe,GACfN,OAAO,GAETN,YAAaE,EACbD,KAAMM,YAgCVM,EAAa,CACXC,WA3BF,WACE,GAA6B,IAAzBlB,OAASK,KAAKc,OAGhB,YADAC,QAAQC,IAAI,QAGd,MAAMC,EAAMC,EAAmBvB,EAAAK,MAC/BmB,EAAYxB,EAAAc,UAAWQ,EACzB,EAoBElD,uBAEFqD,EAAQC,EArBR,SAAepD,EAAuBqD,GAEpC,IAAIC,EADaC,EAAY,CAAA,EAAIjC,EAAuBkC,MAAOxD,EAAQqD,IAChD,CAAA,EAEvB,GAAI3B,EAAA+B,cACF,IAEEH,EAAOI,EAAehC,gBAAe4B,EACvC,OACOK,GACLb,QAAQa,MAAM,UAAWA,EAC3B,CAGF,OAAOL,CACT,eAUEM,EAOEC,EANK3D,EAAK4D,EAAAA,eAAY,CACrBC,IAAKD,EAAAA,aACLE,MAAKC,EAAA,CAAGC,EAAAtE,GAAGuE,EAAC,aACZ,gBAAe1B,EAAAA,YACf,aAAYyB,EAAAvC,GACZ,gBAAeyC,EAAAA"}
@@ -1,2 +1,2 @@
1
- import{merge as e}from"lodash-es";const t={get:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"showTypeName",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"table";return t.data.find((t=>t[e].toString()===o||t[e]===o))},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 o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.get("showType",e)}function a(t,o){const a={};return t.forEach((t=>{a[t.showTypeName]=e(t.baseConfig,o)})),a}const i=a(t.data,{backgroundColor:"transparent",title:{textStyle:{fontSize:14,lineHeight:16}}}),s=new Map;function l(e){const{adcode:t}=e;if(s.has(t)){const e=s.get(t);if(e)return Promise.resolve(e)}return new Promise((o=>{const a={showbiz:!1,extensions:"all",...e};import("@amap/amap-jsapi-loader").then((e=>{let{default:t}=e;return t.load({key:"2e820fac2a528b016a4cb95bb463e69e",version:"1.4.15",plugins:["AMap.DistrictSearch"],AMapUI:{version:"1.1",plugins:["geo/DistrictExplorer"]}})})).then((i=>{new i.DistrictSearch(a).search(e.adcode,((e,a)=>{AMapUI.loadUI(["geo/DistrictExplorer"],(e=>{(new e).loadAreaNode(a.districtList[0].adcode,((e,a)=>{if(e)return void console.error(e);const i={features:[],type:"FeatureCollection"};i.features=a.getSubFeatures(),s.set(t,i),o(i)}))}))}))})).catch((e=>{console.error("Failed to load map:",e),o({features:[],type:"FeatureCollection"})}))}))}export{i as defaultChartOption,l as getGeoJsonData,t as iconList,a as setDefaultChartOption,o 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'\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>()\nexport function getGeoJsonData(options: any): Promise<GeoJson> {\n const { adcode } = options\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 return new Promise((resolve) => {\n const opt = {\n showbiz: false,\n extensions: 'all',\n ...options,\n }\n\n import('@amap/amap-jsapi-loader')\n .then(({ default: AMapLoader }) => AMapLoader.load({\n key: '2e820fac2a528b016a4cb95bb463e69e',\n version: '1.4.15',\n plugins: ['AMap.DistrictSearch'],\n AMapUI: {\n version: '1.1',\n plugins: ['geo/DistrictExplorer'],\n },\n }))\n .then((AMap) => {\n const district = new AMap.DistrictSearch(opt)\n // 行政区查询\n district.search(options.adcode, (_: any, result: any) => {\n // eslint-disable-next-line\n // @ts-expect-error\n AMapUI.loadUI(['geo/DistrictExplorer'], (DistrictExplorer: any) => {\n // 创建一个实例\n const districtExplorer = new DistrictExplorer()\n districtExplorer.loadAreaNode(result.districtList[0].adcode, (error: any, areaNode: any) => {\n if (error) {\n console.error(error)\n return\n }\n const mapJson: GeoJson = {\n features: [],\n type: 'FeatureCollection',\n }\n // geoJson必须这种格式\n mapJson.features = areaNode.getSubFeatures()\n\n // 将获取到的 GeoJSON 数据存入缓存\n geoJsonCache.set(adcode, mapJson)\n\n resolve(mapJson)\n })\n })\n })\n })\n .catch((error) => {\n console.error('Failed to load map:', error)\n resolve({\n features: [],\n type: 'FeatureCollection',\n })\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","getGeoJsonData","options","adcode","has","cachedGeoJson","Promise","resolve","opt","showbiz","extensions","import","then","_ref2","default","AMapLoader","load","key","version","plugins","AMapUI","AMap","DistrictSearch","search","result","loadUI","DistrictExplorer","loadAreaNode","districtList","error","areaNode","console","mapJson","features","getSubFeatures","set","catch"],"mappings":"kCAYO,MAAMA,EAGT,CACFC,IAAK,WAAgE,IAA/DC,EAAsBC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAA,eAAgBG,yDAAa,QACvD,OAAON,EAASO,KAAKC,MAAKC,GAAQA,EAAKP,GAAMQ,aAAeJ,GAASG,EAAKP,KAAUI,GACtF,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,Q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KAAM,CACrEoE,gBAAiB,cACjBC,MAAO,CACLC,UAAW,CACTC,SAAU,GACVC,WAAY,OAMZC,MAAmBC,IAClB,SAASC,EAAeC,GACvB,MAAAC,OAAEA,GAAWD,EAGf,GAAAH,EAAaK,IAAID,GAAS,CACtB,MAAAE,EAAgBN,EAAa/E,IAAImF,GACvC,GAAIE,EACK,OAAAC,QAAQC,QAAQF,EAE3B,CAEO,OAAA,IAAIC,SAASC,IAClB,MAAMC,EAAM,CACVC,SAAS,EACTC,WAAY,SACTR,GAGES,OAAA,2BACJC,MAAKC,IAAA,IAAGC,QAASC,GAAiBF,EAAA,OAAAE,EAAWC,KAAK,CACjDC,IAAK,mCACLC,QAAS,SACTC,QAAS,CAAC,uBACVC,OAAQ,CACNF,QAAS,MACTC,QAAS,CAAC,0BAEZ,IACDP,MAAMS,IACY,IAAIA,EAAKC,eAAed,GAEhCe,OAAOrB,EAAQC,QAAQ,CAAC7C,EAAQkE,KAGvCJ,OAAOK,OAAO,CAAC,yBAA0BC,KAEd,IAAIA,GACZC,aAAaH,EAAOI,aAAa,GAAGzB,QAAQ,CAAC0B,EAAYC,KACxE,GAAID,EAEF,YADAE,QAAQF,MAAMA,GAGhB,MAAMG,EAAmB,CACvBC,SAAU,GACVhH,KAAM,qBAGA+G,EAAAC,SAAWH,EAASI,iBAGfnC,EAAAoC,IAAIhC,EAAQ6B,GAEzBzB,EAAQyB,EAAO,GAChB,GACF,GACF,IAEFI,OAAOP,IACEE,QAAAF,MAAM,sBAAuBA,GAC7BtB,EAAA,CACN0B,SAAU,GACVhH,KAAM,qBACP,GACF,GAEP"}
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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OH,EAASG,OAEpB,OACOC,GACLC,QAAQC,KAAK,mCAAoCF,EACnD,CAGA,MAAO,CACLrF,KAAM,oBACNwF,SAAU,KAGP,SAASC,EAAeC,GAC7B,IAAIC,OAAEA,GAAWD,EACbE,EAAU,iDAQd,GALsB,iBAAXD,GAAwBA,EAAOE,MAAM,YAAyB,OAAXF,GAA8B,WAAXA,IAC/EA,EAASG,EAAgBH,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"}
@@ -0,0 +1,2 @@
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
+ //# sourceMappingURL=mapData.mjs.map
@@ -0,0 +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":["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 +1 @@
1
- {"version":3,"file":"safe-eval.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/utils/safe-eval.ts"],"sourcesContent":["import type { EChartsOption } from './types'\n\n/**\n * 安全的配置处理函数\n * @param jsCode - JavaScript 代码片段\n * @param config - ECharts 配置对象\n * @returns 处理后的配置对象\n */\nexport function safeEvalConfig(jsCode: string, config: EChartsOption): EChartsOption {\n // 预定义允许的操作和函数\n const allowedGlobals = {\n Math,\n Date,\n Array,\n Object,\n String,\n Number,\n Boolean,\n console,\n JSON,\n }\n\n // 创建安全的执行环境\n const sandbox = {\n ...allowedGlobals,\n config: { ...config },\n }\n\n // 使用 with 和 Proxy 创建安全的执行环境\n const handler: ProxyHandler<typeof sandbox> = {\n has: (_target, _key) => {\n return true // 使所有变量查找都在 sandbox 中\n },\n get: (target, key) => {\n // 处理 Symbol 类型的 key\n if (typeof key === 'symbol') {\n if (key === Symbol.unscopables) {\n return undefined\n }\n return Reflect.get(target, key)\n }\n return target[key as keyof typeof target]\n },\n }\n\n const proxiedSandbox = new Proxy(sandbox, handler)\n\n try {\n // 使用 with 语句创建局部作用域\n const code = `with (sandbox) { ${jsCode} }`\n // eslint-disable-next-line no-new-func\n const fn = new Function('sandbox', code)\n fn(proxiedSandbox)\n\n return proxiedSandbox.config as EChartsOption\n }\n catch (error) {\n console.error('配置处理失败:', error)\n return config\n }\n}\n"],"names":["safeEvalConfig","jsCode","config","sandbox","Math","Date","Array","Object","String","Number","Boolean","console","JSON","proxiedSandbox","Proxy","has","_target","_key","get","target","key","Symbol","unscopables","Reflect","code","Function","fn","error"],"mappings":"AAQgB,SAAAA,EAAeC,EAAgBC,GAE7C,MAaMC,EAAU,IAbO,CACrBC,UACAC,UACAC,YACAC,cACAC,cACAC,cACAC,gBACAC,gBACAC,WAMAV,OAAQ,IAAKA,IAoBTW,EAAiB,IAAIC,MAAMX,EAhBa,CAC5CY,IAAKA,CAACC,EAASC,KACN,EAETC,IAAKA,CAACC,EAAQC,KAER,GAAe,iBAARA,EAAkB,CACvB,GAAAA,IAAQC,OAAOC,YACV,OAEF,OAAAC,QAAQL,IAAIC,EAAQC,EAC7B,CACA,OAAOD,EAAOC,EAA0B,IAMxC,IAEI,MAAAI,EAAO,oBAAoBvB,MAKjC,OAHW,IAAIwB,SAAS,UAAWD,EACnCE,CAAGb,GAEIA,EAAeX,aAEjByB,GAEE,OADChB,QAAAgB,MAAM,UAAWA,GAClBzB,CACT,CACF"}
1
+ {"version":3,"file":"safe-eval.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/utils/safe-eval.ts"],"sourcesContent":["import type { EChartsOption } from './types'\n\n/**\n * 安全的配置处理函数\n * @param jsCode - JavaScript 代码片段\n * @param config - ECharts 配置对象\n * @returns 处理后的配置对象\n */\nexport function safeEvalConfig(jsCode: string, config: EChartsOption): EChartsOption {\n // 预定义允许的操作和函数\n const allowedGlobals = {\n Math,\n Date,\n Array,\n Object,\n String,\n Number,\n Boolean,\n console,\n JSON,\n }\n\n // 创建安全的执行环境\n const sandbox = {\n ...allowedGlobals,\n config: { ...config },\n }\n\n // 使用 with 和 Proxy 创建安全的执行环境\n const handler: ProxyHandler<typeof sandbox> = {\n has: (_target, _key) => {\n return true // 使所有变量查找都在 sandbox 中\n },\n get: (target, key) => {\n // 处理 Symbol 类型的 key\n if (typeof key === 'symbol') {\n if (key === Symbol.unscopables) {\n return undefined\n }\n return Reflect.get(target, key)\n }\n return target[key as keyof typeof target]\n },\n }\n\n const proxiedSandbox = new Proxy(sandbox, handler)\n\n try {\n // 使用 with 语句创建局部作用域\n const code = `with (sandbox) { ${jsCode} }`\n // eslint-disable-next-line no-new-func\n const fn = new Function('sandbox', code)\n fn(proxiedSandbox)\n\n return proxiedSandbox.config as EChartsOption\n }\n catch (error) {\n console.error('配置处理失败:', error)\n return config\n }\n}\n"],"names":["safeEvalConfig","jsCode","config","sandbox","Math","Date","Array","Object","String","Number","Boolean","console","JSON","proxiedSandbox","Proxy","has","_target","_key","get","target","key","Symbol","unscopables","Reflect","code","Function","fn","error"],"mappings":"AAQO,SAASA,EAAeC,EAAgBC,GAE7C,MAaMC,EAAU,IAbO,CACrBC,UACAC,UACAC,YACAC,cACAC,cACAC,cACAC,gBACAC,gBACAC,WAMAV,OAAQ,IAAKA,IAoBTW,EAAiB,IAAIC,MAAMX,EAhBa,CAC5CY,IAAKA,CAACC,EAASC,KACN,EAETC,IAAKA,CAACC,EAAQC,KAEZ,GAAmB,iBAARA,EAAkB,CAC3B,GAAIA,IAAQC,OAAOC,YACjB,OAEF,OAAOC,QAAQL,IAAIC,EAAQC,EAC7B,CACA,OAAOD,EAAOC,MAMlB,IAEE,MAAMI,EAAO,oBAAoBvB,MAKjC,OAHW,IAAIwB,SAAS,UAAWD,EACnCE,CAAGb,GAEIA,EAAeX,MACxB,OACOyB,GAEL,OADAhB,QAAQgB,MAAM,UAAWA,GAClBzB,CACT,CACF"}
@@ -1,2 +1,2 @@
1
- import*as e from"echarts";import t from"../components/empty.svg.mjs";import{useMouseInElement as o,watchDebounced as i,useElementSize as n}from"@vueuse/core";import{onMounted as a,onUnmounted as r}from"vue";function s(n){let{chartDOM:s,chartData:c,chartOptions:u,mountedBefore:d,initAfter:p,callback:m}=n,f=null,g=!1;const h=window.devicePixelRatio||1;function v(){f&&!f.isDisposed()&&(f.dispose(),f=null)}async function w(){for(var t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];if(s.value)try{f&&!f.isDisposed()||(f=e.init(s.value,null,{devicePixelRatio:h,renderer:"svg"})),f.showLoading(),c.value?.data?.length?(!0===g&&(o[1]||(o[1]={}),o[1].notMerge=!0),g=!1,f.setOption(...o)):o=await x()}catch(t){console.log("error: ",t),f&&!f.isDisposed()&&v(),s.value&&!f&&(f=e.init(s.value,null,{devicePixelRatio:h,renderer:"svg"}),o=await x("配置项错误"))}finally{f?.setOption(...o),f?.hideLoading()}}function x(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"暂无数据";return new Promise((o=>{const i=new Image;i.src=t,i.onload=()=>{const n=i.width/i.height,a={title:[{text:c.value?.modelName,...u.value.title},{subtext:e,top:"center",left:"center",text:"{a|}",itemGap:-20,subtextStyle:{fontSize:14},textStyle:{align:"center",rich:{a:{height:100/n,width:100,backgroundColor:{image:t}}}}}]};g=!0,o([a,{notMerge:!0,replaceMerge:["xAxis","yAxis","series"],lazyUpdate:!1}])}}))}const{isOutside:y}=o(s);return i(y,(e=>{var t;"boolean"==typeof e&&(t=!e,f?.isDisposed()||f?.setOption({toolbox:{show:t}}))}),{debounce:200}),i((()=>u.value),(()=>w(u.value)),{debounce:500,deep:!0}),a((async()=>{d&&await d(),w(u.value),m&&m(f),p&&await p(),f&&l(f,s)})),r((()=>{f&&(f.getZr()?.off("mousemove"),f.getZr()?.off("mouseout"),v())})),{myChart:f}}function l(e,t){const{width:o,height:a}=n(t);i([o,a],(()=>{e&&e.resize()}))}function c(e){const{desc:{colDesc:t=[],groupByDesc:o=[]}={},data:i=[]}=e,n=[...o.map((e=>e.colDesc)),...t].filter((e=>e)),a=i.map((e=>n.map((t=>e[t]||""))));return[n,...a]}export{s as useCharts,c as useDataToExcelJson,l as useResize};
1
+ import*as e from"echarts";import{onMounted as t,onUnmounted as o}from"vue";import{useMouseInElement as i,watchDebounced as r,useElementSize as n}from"@vueuse/core";import s from"../components/empty.svg.mjs";function a(n){let{chartDOM:a,chartData:l,chartOptions:u,initBefore:d,initAfter:p}=n,f=null,h=!1;const g=window.devicePixelRatio||1;function m(){if(f&&!f.isDisposed()){try{f.dispose()}catch(e){console.warn("Error disposing chart:",e)}f=null}}function w(){return f&&!f.isDisposed()||(f=e.init(a.value,null,{devicePixelRatio:g,renderer:"svg"})),f}function y(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"暂无数据";return new Promise(t=>{const o=new Image;o.src=s,o.onload=()=>{const i=o.width/o.height,r={title:[{text:l.value?.modelName,...u.value.title},{subtext:e,top:"center",left:"center",text:"{a|}",itemGap:-20,subtextStyle:{fontSize:14},textStyle:{align:"center",rich:{a:{height:100/i,width:100,backgroundColor:{image:s}}}}}]};h=!0,t([r,{notMerge:!0,replaceMerge:["xAxis","yAxis","series"],lazyUpdate:!1}])}})}const{isOutside:v}=i(a);return r(v,e=>{"boolean"==typeof e&&f&&!f.isDisposed()&&function(e){if(f&&!f.isDisposed())try{f.setOption({toolbox:{show:e}})}catch(e){console.warn("Error toggling toolbox:",e)}}(!e)},{debounce:200}),r(()=>u.value,async()=>{f&&!f.isDisposed()&&await async function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];try{f?.showLoading(),l.value?.data?.length?(!0===h&&(t[1]||(t[1]={}),t[1].notMerge=!0),h=!1):t=await y(),f?.setOption(...t)}catch(e){f&&!f.isDisposed()&&m(),w(),t=await y("配置项错误"),f?.setOption(...t)}finally{f?.hideLoading()}}(u.value)},{debounce:500,deep:!0,immediate:!0}),t(async()=>{d&&await d(),w(),p&&await p(f),f&&!f.isDisposed()&&c(f,a)}),o(()=>{if(f&&!f.isDisposed())try{f.getZr()?.off("mousemove"),f.getZr()?.off("mouseout"),f.getZr()?.off("click"),f.off("click"),m()}catch(e){console.warn("Error during chart cleanup:",e)}}),{myChart:f}}function c(e,t){const{width:o,height:i}=n(t);r([o,i],()=>{if(e&&!e.isDisposed())try{e.resize()}catch(e){console.warn("Error during chart resize:",e)}})}function l(e){const{desc:{colDesc:t=[],groupByDesc:o=[]}={},data:i=[]}=e,r=[...o.map(e=>e.colDesc),...t].filter(e=>e),n=i.map(e=>r.map(t=>e[t]||""));return[r,...n]}export{a as useCharts,l as useDataToExcelJson,c as useResize};
2
2
  //# sourceMappingURL=useCharts.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCharts.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/utils/useCharts.ts"],"sourcesContent":["import type { ECharts, SetOptionOpts } from 'echarts'\nimport type { Ref } from 'vue'\nimport type { EChartData, EChartsOption, IFormatPublicData } from './types'\nimport * as echarts from 'echarts'\n\n// 使用别名路径导入 SVG\nimport emptyImg from '../components/empty.svg'\n\nexport function useCharts({ chartDOM, chartData, chartOptions, mountedBefore, initAfter, callback }: {\n chartDOM: Ref<HTMLElement | null>\n chartData: Ref<IFormatPublicData>\n chartOptions: Ref<EChartsOption>\n mountedBefore?: () => void\n initAfter?: () => void\n callback?: (e: ECharts | null) => void\n}) {\n let myChart: ECharts | null = null\n let isEmpty = false\n\n // 获取设备像素比\n const dpr = window.devicePixelRatio || 1\n\n function disposeChart() {\n if (myChart && !myChart.isDisposed()) {\n myChart.dispose()\n myChart = null\n }\n }\n\n async function renderChart(...opt: [EChartsOption, SetOptionOpts?]) {\n if (!chartDOM.value) {\n return\n }\n try {\n if (myChart && !myChart.isDisposed()) {\n myChart.showLoading()\n }\n else {\n // 如果实例已被销毁,重新创建\n myChart = echarts.init(chartDOM.value, null, {\n devicePixelRatio: dpr,\n renderer: 'svg',\n })\n myChart.showLoading()\n }\n if (chartData.value?.data?.length) {\n if (isEmpty === true) {\n if (!opt[1]) {\n opt[1] = {}\n }\n opt[1].notMerge = true\n }\n isEmpty = false\n myChart.setOption(...opt)\n }\n else {\n opt = await setEmpty()\n }\n }\n catch (error) {\n console.log('error: ', error)\n if (myChart && !myChart.isDisposed()) {\n disposeChart()\n }\n if (chartDOM.value && !myChart) {\n // 如果实例已被销毁,重新创建\n myChart = echarts.init(chartDOM.value, null, {\n devicePixelRatio: dpr,\n renderer: 'svg',\n })\n opt = await setEmpty('配置项错误')\n }\n }\n finally {\n myChart?.setOption(...opt)\n myChart?.hideLoading()\n }\n }\n\n function setEmpty(subtext = '暂无数据'): Promise<[EChartsOption, SetOptionOpts]> {\n return new Promise((resolve) => {\n const img = new Image()\n img.src = emptyImg\n\n img.onload = () => {\n const aspectRatio = img.width / img.height\n\n const obj: EChartsOption = {\n title: [{\n text: chartData.value?.modelName,\n ...chartOptions.value.title,\n }, {\n subtext,\n top: 'center', // 调整垂直位置\n left: 'center',\n text: '{a|}',\n itemGap: -20,\n subtextStyle: {\n fontSize: 14,\n },\n textStyle: {\n align: 'center',\n rich: {\n a: {\n height: 100 / aspectRatio,\n width: 100,\n backgroundColor: {\n image: emptyImg,\n },\n },\n },\n },\n }],\n }\n isEmpty = true\n resolve([obj, {\n notMerge: true,\n replaceMerge: ['xAxis', 'yAxis', 'series'],\n lazyUpdate: false,\n }])\n }\n })\n }\n\n function toggleToolbox(show: boolean) {\n if (!myChart?.isDisposed()) {\n myChart?.setOption({\n toolbox: {\n show,\n },\n })\n }\n }\n\n const { isOutside: mouseInChart } = useMouseInElement(chartDOM)\n watchDebounced(mouseInChart, (newVal) => {\n if (typeof newVal !== 'boolean') {\n return\n }\n toggleToolbox(!newVal)\n }, { debounce: 200 })\n\n watchDebounced(\n () => chartOptions.value,\n () => renderChart(chartOptions.value),\n { debounce: 500, deep: true },\n )\n\n onMounted(async () => {\n if (mountedBefore) {\n await mountedBefore()\n }\n renderChart(chartOptions.value)\n if (callback) {\n callback(myChart)\n }\n if (initAfter) {\n await initAfter()\n }\n if (myChart) {\n useResize(myChart, chartDOM)\n }\n })\n\n onUnmounted(() => {\n if (myChart) {\n myChart.getZr()?.off('mousemove')\n myChart.getZr()?.off('mouseout')\n disposeChart()\n }\n })\n\n return {\n myChart,\n }\n}\n\nexport function useResize(myChart: ECharts, chartDOM: Ref<HTMLElement | null>) {\n const { width, height } = useElementSize(chartDOM)\n watchDebounced([width, height], () => {\n if (myChart) {\n myChart.resize()\n }\n })\n}\n\nexport function useDataToExcelJson(dataSource: EChartData) {\n const { desc: { colDesc = [], groupByDesc = [] } = {}, data = [] } = dataSource\n const header = [...groupByDesc.map(item => item.colDesc), ...colDesc].filter(v => v) as string[]\n const json = data.map((item) => {\n return header.map((headerItem) => {\n return item[headerItem as keyof typeof item] || ''\n })\n })\n return [header, ...json]\n}\n"],"names":["useCharts","_ref","chartDOM","chartData","chartOptions","mountedBefore","initAfter","callback","myChart","isEmpty","dpr","window","devicePixelRatio","disposeChart","isDisposed","dispose","async","renderChart","_len","arguments","length","opt","Array","_key","value","echarts","init","renderer","showLoading","data","notMerge","setOption","setEmpty","error","console","log","hideLoading","subtext","Promise","resolve","img","Image","src","emptyImg","onload","aspectRatio","width","height","obj","title","text","modelName","top","left","itemGap","subtextStyle","fontSize","textStyle","align","rich","a","backgroundColor","image","replaceMerge","lazyUpdate","isOutside","mouseInChart","useMouseInElement","watchDebounced","newVal","show","toolbox","debounce","deep","onMounted","useResize","onUnmounted","getZr","off","useElementSize","resize","useDataToExcelJson","dataSource","desc","colDesc","groupByDesc","header","map","item","filter","v","json","headerItem"],"mappings":"+MAQgB,SAAAA,EAAAC,GAOb,IAPuBC,SAAEA,EAAUC,UAAAA,EAAAC,aAAWA,gBAAcC,EAAeC,UAAAA,EAAAC,SAAWA,GAOtFN,EACGO,EAA0B,KAC1BC,GAAU,EAGR,MAAAC,EAAMC,OAAOC,kBAAoB,EAEvC,SAASC,IACHL,IAAYA,EAAQM,eACtBN,EAAQO,UACEP,EAAA,KAEd,CAEAQ,eAAeC,IAAqD,IAAA,IAAAC,EAAAC,UAAAC,OAAtCC,EAAsCC,IAAAA,MAAAJ,GAAAK,EAAA,EAAAA,EAAAL,EAAAK,IAAtCF,EAAsCE,GAAAJ,UAAAI,GAC9D,GAACrB,EAASsB,MAGV,IACEhB,IAAYA,EAAQM,eAKtBN,EAAUiB,EAAQ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GACpB,CAAEE,SAAU,MAEfJ,GACE,IAAMhE,EAAaoB,QACnB,IAAMP,EAAYb,EAAaoB,QAC/B,CAAEgD,SAAU,IAAKC,MAAM,IAGzBC,GAAU1D,UACJX,SACIA,IAERY,EAAYb,EAAaoB,OACrBjB,GACFA,EAASC,GAEPF,SACIA,IAEJE,GACFmE,EAAUnE,EAASN,EACrB,IAGF0E,GAAY,KACNpE,IACMA,EAAAqE,SAASC,IAAI,aACbtE,EAAAqE,SAASC,IAAI,YACRjE,IACf,IAGK,CACLL,UAEJ,CAEgB,SAAAmE,EAAUnE,EAAkBN,GAC1C,MAAM4C,MAAEA,EAAAC,OAAOA,GAAWgC,EAAe7E,GACzCkE,EAAe,CAACtB,EAAOC,IAAS,KAC1BvC,GACFA,EAAQwE,QACV,GAEJ,CAEO,SAASC,EAAmBC,GACjC,MAAQC,MAAMC,QAAEA,EAAU,GAAIC,YAAAA,EAAc,IAAO,CAAC,EAAAxD,KAAGA,EAAO,IAAOqD,EAC/DI,EAAS,IAAID,EAAYE,KAAYC,GAAAA,EAAKJ,aAAaA,GAASK,WAAYC,IAC5EC,EAAO9D,EAAK0D,KAAKC,GACdF,EAAOC,KAAKK,GACVJ,EAAKI,IAAoC,OAG7C,MAAA,CAACN,KAAWK,EACrB"}
1
+ {"version":3,"file":"useCharts.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/utils/useCharts.ts"],"sourcesContent":["import type { ECharts, SetOptionOpts } from 'echarts'\nimport type { Ref } from 'vue'\nimport type { EChartData, EChartsOption, IFormatPublicData } from './types'\nimport * as echarts from 'echarts'\nimport { onMounted, onUnmounted } from 'vue'\nimport { useMouseInElement, useElementSize, watchDebounced } from '@vueuse/core'\n\n// 使用别名路径导入 SVG\nimport emptyImg from '../components/empty.svg'\n\nexport function useCharts({ chartDOM, chartData, chartOptions, initBefore, initAfter }: {\n chartDOM: Ref<HTMLElement | null>\n chartData: Ref<IFormatPublicData>\n chartOptions: Ref<EChartsOption>\n initBefore?: () => Promise<void>\n initAfter?: (e: ECharts | null) => void\n}) {\n // 每个组件实例的独立状态\n let myChart: ECharts | null = null\n let isEmpty = false\n\n // 获取设备像素比\n const dpr = window.devicePixelRatio || 1\n\n function disposeChart() {\n if (myChart && !myChart.isDisposed()) {\n try {\n myChart.dispose()\n }\n catch (error) {\n console.warn('Error disposing chart:', error)\n }\n myChart = null\n }\n }\n\n function initChart() {\n if (!(myChart && !myChart.isDisposed())) {\n // 如果实例已被销毁,重新创建\n myChart = echarts.init(chartDOM.value, null, {\n devicePixelRatio: dpr,\n renderer: 'svg',\n })\n }\n return myChart\n }\n\n async function renderChart(...opt: [EChartsOption, SetOptionOpts?]) {\n try {\n myChart?.showLoading()\n if (chartData.value?.data?.length) {\n if (isEmpty === true) {\n if (!opt[1]) {\n opt[1] = {}\n }\n opt[1].notMerge = true\n }\n isEmpty = false\n }\n else {\n // 数据为空时保持原有配置\n opt = await setEmpty()\n }\n myChart?.setOption(...opt)\n }\n catch (error) {\n if (myChart && !myChart.isDisposed()) {\n disposeChart()\n }\n // 如果实例已被销毁,重新创建\n initChart()\n opt = await setEmpty('配置项错误')\n myChart?.setOption(...opt)\n } finally {\n myChart?.hideLoading()\n }\n }\n\n function setEmpty(subtext = '暂无数据'): Promise<[EChartsOption, SetOptionOpts]> {\n return new Promise((resolve) => {\n const img = new Image()\n img.src = emptyImg\n\n img.onload = () => {\n const aspectRatio = img.width / img.height\n\n const obj: EChartsOption = {\n title: [{\n text: chartData.value?.modelName,\n ...chartOptions.value.title,\n }, {\n subtext,\n top: 'center',\n left: 'center',\n text: '{a|}',\n itemGap: -20,\n subtextStyle: {\n fontSize: 14,\n },\n textStyle: {\n align: 'center',\n rich: {\n a: {\n height: 100 / aspectRatio,\n width: 100,\n backgroundColor: {\n image: emptyImg,\n },\n },\n },\n },\n }],\n }\n isEmpty = true\n resolve([obj, {\n notMerge: true,\n replaceMerge: ['xAxis', 'yAxis', 'series'],\n lazyUpdate: false,\n }])\n }\n })\n }\n\n function toggleToolbox(show: boolean) {\n // 修改条件判断,移除 isDisposed 检查\n if (myChart && !myChart.isDisposed()) {\n try {\n myChart.setOption({\n toolbox: {\n show,\n },\n })\n }\n catch (error) {\n console.warn('Error toggling toolbox:', error)\n }\n }\n }\n\n const { isOutside: mouseInChart } = useMouseInElement(chartDOM)\n watchDebounced(mouseInChart, (newVal) => {\n // 修改条件判断\n if (typeof newVal !== 'boolean' || (!myChart || myChart.isDisposed())) {\n return\n }\n toggleToolbox(!newVal)\n }, { debounce: 200 })\n\n watchDebounced(\n () => chartOptions.value,\n async () => {\n // 修改条件判断\n if (myChart && !myChart.isDisposed()) {\n await renderChart(chartOptions.value)\n }\n },\n { debounce: 500, deep: true, immediate: true },\n )\n\n onMounted(async () => {\n if (initBefore) {\n await initBefore()\n }\n initChart()\n if (initAfter) {\n await initAfter(myChart)\n }\n // 修改条件判断\n if (myChart && !myChart.isDisposed()) {\n useResize(myChart, chartDOM)\n }\n })\n\n onUnmounted(() => {\n if (myChart && !myChart.isDisposed()) {\n try {\n // 清理所有事件监听器\n myChart.getZr()?.off('mousemove')\n myChart.getZr()?.off('mouseout')\n myChart.getZr()?.off('click')\n myChart.off('click')\n disposeChart()\n }\n catch (error) {\n console.warn('Error during chart cleanup:', error)\n }\n }\n })\n\n return {\n myChart,\n }\n}\n\nexport function useResize(myChart: ECharts, chartDOM: Ref<HTMLElement | null>) {\n const { width, height } = useElementSize(chartDOM)\n watchDebounced([width, height], () => {\n if (myChart && !myChart.isDisposed()) {\n try {\n myChart.resize()\n }\n catch (error) {\n console.warn('Error during chart resize:', error)\n }\n }\n })\n}\n\nexport function useDataToExcelJson(dataSource: EChartData) {\n const { desc: { colDesc = [], groupByDesc = [] } = {}, data = [] } = dataSource\n const header = [...groupByDesc.map(item => item.colDesc), ...colDesc].filter(v => v) as string[]\n const json = data.map((item) => {\n return header.map((headerItem) => {\n return item[headerItem as keyof typeof item] || ''\n })\n })\n return [header, ...json]\n}\n"],"names":["useCharts","chartDOM","chartData","chartOptions","initBefore","initAfter","_ref","myChart","isEmpty","dpr","window","devicePixelRatio","disposeChart","isDisposed","dispose","error","console","warn","initChart","echarts","init","value","renderer","setEmpty","subtext","Promise","resolve","img","Image","src","emptyImg","onload","aspectRatio","width","height","obj","title","text","modelName","top","left","itemGap","subtextStyle","fontSize","textStyle","align","rich","a","backgroundColor","image","notMerge","replaceMerge","lazyUpdate","isOutside","mouseInChart","useMouseInElement","watchDebounced","newVal","show","setOption","toolbox","toggleToolbox","debounce","async","_len","arguments","length","opt","Array","_key","showLoading","data","hideLoading","renderChart","deep","immediate","onMounted","useResize","onUnmounted","getZr","off","useElementSize","resize","useDataToExcelJson","dataSource","desc","colDesc","groupByDesc","header","map","item","filter","v","json","headerItem"],"mappings":"+MAUO,SAASA,KAMb,IANuBC,SAAEA,EAAAC,UAAUA,eAAWC,EAAAC,WAAcA,EAAAC,UAAYA,GAAUC,EAQ/EC,EAA0B,KAC1BC,GAAU,EAGd,MAAMC,EAAMC,OAAOC,kBAAoB,EAEvC,SAASC,IACP,GAAIL,IAAYA,EAAQM,aAAc,CACpC,IACEN,EAAQO,SACV,OACOC,GACLC,QAAQC,KAAK,yBAA0BF,EACzC,CACAR,EAAU,IACZ,CACF,CAEA,SAASW,IAQP,OAPMX,IAAYA,EAAQM,eAExBN,EAAUY,EAAQC,KAAKnB,EAASoB,MAAO,KAAM,CAC3CV,iBAAkBF,EAClBa,SAAU,SAGPf,CACT,CAiCA,SAASgB,IAAoE,IAA3DC,yDAAU,OAC1B,OAAO,IAAIC,QAASC,IAClB,MAAMC,EAAM,IAAIC,MAChBD,EAAIE,IAAMC,EAEVH,EAAII,OAAS,KACX,MAAMC,EAAcL,EAAIM,MAAQN,EAAIO,OAE9BC,EAAqB,CACzBC,MAAO,CAAC,CACNC,KAAMnC,EAAUmB,OAAOiB,aACpBnC,EAAakB,MAAMe,OACrB,CACDZ,UACAe,IAAK,SACLC,KAAM,SACNH,KAAM,OACNI,SAAS,GACTC,aAAc,CACZC,S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vE,IAAYA,EAAQM,aACtB,IAEEN,EAAQwE,SAASC,IAAI,aACrBzE,EAAQwE,SAASC,IAAI,YACrBzE,EAAQwE,SAASC,IAAI,SACrBzE,EAAQyE,IAAI,SACZpE,GACF,OACOG,GACLC,QAAQC,KAAK,8BAA+BF,EAC9C,IAIG,CACLR,UAEJ,CAEO,SAASsE,EAAUtE,EAAkBN,GAC1C,MAAMgC,MAAEA,EAAAC,OAAOA,GAAW+C,EAAehF,GACzCuD,EAAe,CAACvB,EAAOC,GAAS,KAC9B,GAAI3B,IAAYA,EAAQM,aACtB,IACEN,EAAQ2E,QACV,OACOnE,GACLC,QAAQC,KAAK,6BAA8BF,EAC7C,GAGN,CAEO,SAASoE,EAAmBC,GACjC,MAAQC,MAAMC,QAAEA,EAAU,GAACC,YAAGA,EAAc,IAAO,CAAA,EAAChB,KAAGA,EAAO,IAAOa,EAC/DI,EAAS,IAAID,EAAYE,IAAIC,GAAQA,EAAKJ,YAAaA,GAASK,UAAYC,GAC5EC,EAAOtB,EAAKkB,IAAKC,GACdF,EAAOC,IAAKK,GACVJ,EAAKI,IAAoC,KAGpD,MAAO,CAACN,KAAWK,EACrB"}
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.mjs","sources":["../../../../packages/components/src/defaults.ts"],"sourcesContent":["import * as components from './components'\nimport { makeInstaller } from './make-installer'\n\nexport default makeInstaller(components)\n"],"names":["makeInstaller","components"],"mappings":"wFAGA,IAAeA,EAAAA,EAAcC"}
1
+ {"version":3,"file":"defaults.mjs","sources":["../../../../packages/components/src/defaults.ts"],"sourcesContent":["import * as components from './components'\nimport { makeInstaller } from './make-installer'\n\nexport default makeInstaller(components)\n"],"names":["installer","makeInstaller","components"],"mappings":"wFAGA,IAAAA,EAAeC,EAAcC"}
@@ -1,2 +1,2 @@
1
- import{ElUpload as e,ElIcon as t,ElAlert as s,ElMessage as l}from"element-plus/es";import"element-plus/es/components/base/style/index";import"element-plus/es/components/upload/style/index";import"element-plus/es/components/alert/style/index";import"element-plus/es/components/icon/style/index";import{defineComponent as a,computed as i,createBlock as n,openBlock as o,normalizeClass as r,unref as p,withCtx as u,createElementVNode as m,createVNode as d,createTextVNode as c,createElementBlock as f,createCommentVNode as y}from"vue";import{UploadFilled as x}from"@element-plus/icons-vue";import{useNamespace as v}from"@qxs-bns/hooks";import{useNamespace as q}from"element-plus";import"element-plus/es/components/message/style/index";const $={class:"slot"},_={style:{display:"inline-block"}};var b=a({name:"QxsFileUpload",__name:"file-upload",props:{action:{type:String,required:!0},headers:{type:null,required:!1},data:{type:null,required:!1},name:{type:String,required:!1,default:"file"},size:{type:Number,required:!1,default:20},max:{type:Number,required:!1,default:3},accept:{type:String,required:!1,default:"zip,rar"},files:{type:Array,required:!1,default:()=>[]},notip:{type:Boolean,required:!1,default:!1},ext:{type:Array,required:!1}},emits:["onSuccess"],setup(a,{emit:b}){const g=b,h=v("file-upload"),z=q("file-upload"),S=i((()=>a.accept.split(","))),k=e=>{const t=e.name.split(".").at(-1)??"",s=S.value.includes(t),i=e.size/1024/1024<a.size;return s||l.error(`上传文件只支持 ${S.value.join(" / ")} 格式!`),i||l.error(`上传文件大小不能超过 ${a.size}MB!`),s&&i},B=()=>{l.warning("文件上传超过限制")},N=(e,t,s)=>{g("onSuccess",e,t,s)};return(l,a)=>{const i=t,v=s,q=e;return o(),n(q,{headers:l.headers,action:l.action,data:l.data,name:l.name,"before-upload":k,"on-exceed":B,"on-success":N,"file-list":l.files,limit:l.max,drag:"",class:r(p(h).e("control"))},{tip:u((()=>[l.notip?y("v-if",!0):(o(),f("div",{key:0,class:r(`${p(z).namespace.value}-upload__tip`)},[m("div",_,[d(v,{title:`上传文件支持 ${p(S).join(" / ")} 格式,单个文件大小不超过 ${l.size}MB,且文件数量不超过 ${l.max} 个`,type:"info","show-icon":"",closable:!1},null,8,["title"])])],2))])),default:u((()=>[m("div",$,[d(i,{class:r(`${p(z).namespace.value}-icon--upload`)},{default:u((()=>[d(p(x))])),_:1},8,["class"]),m("div",{class:r(`${p(z).namespace.value}-upload__text`)},a[0]||(a[0]=[c(" 将文件拖到此处,或"),m("em",null,"点击上传",-1)]),2)])])),_:1},8,["headers","action","data","name","file-list","limit","class"])}}});export{b as default};
1
+ import{ElUpload as e,ElIcon as t,ElAlert as s,ElMessage as l}from"element-plus/es";import"element-plus/es/components/base/style/index";import"element-plus/es/components/upload/style/index";import"element-plus/es/components/alert/style/index";import"element-plus/es/components/icon/style/index";import{defineComponent as a,computed as i,createBlock as n,openBlock as o,normalizeClass as r,unref as p,withCtx as u,createElementVNode as m,createVNode as d,createTextVNode as c,createElementBlock as f,createCommentVNode as y}from"vue";import{UploadFilled as x}from"@element-plus/icons-vue";import{useNamespace as v}from"@qxs-bns/hooks";import{useNamespace as q}from"element-plus";import"element-plus/es/components/message/style/index";const $={class:"slot"},_={style:{display:"inline-block"}};var b=a({name:"QxsFileUpload",__name:"file-upload",props:{action:{type:String,required:!0},headers:{type:null,required:!1},data:{type:null,required:!1},name:{type:String,required:!1,default:"file"},size:{type:Number,required:!1,default:20},max:{type:Number,required:!1,default:3},accept:{type:String,required:!1,default:"zip,rar"},files:{type:Array,required:!1,default:()=>[]},notip:{type:Boolean,required:!1,default:!1},ext:{type:Array,required:!1}},emits:["onSuccess"],setup(a,{emit:b}){const g=b,h=v("file-upload"),z=q("file-upload"),S=i(()=>a.accept.split(",")),k=e=>{const t=e.name.split(".").at(-1)??"",s=S.value.includes(t),i=e.size/1024/1024<a.size;return s||l.error(`上传文件只支持 ${S.value.join(" / ")} 格式!`),i||l.error(`上传文件大小不能超过 ${a.size}MB!`),s&&i},B=()=>{l.warning("文件上传超过限制")},N=(e,t,s)=>{g("onSuccess",e,t,s)};return(l,a)=>{const i=t,v=s,q=e;return o(),n(q,{headers:l.headers,action:l.action,data:l.data,name:l.name,"before-upload":k,"on-exceed":B,"on-success":N,"file-list":l.files,limit:l.max,drag:"",class:r(p(h).e("control"))},{tip:u(()=>[l.notip?y("v-if",!0):(o(),f("div",{key:0,class:r(`${p(z).namespace.value}-upload__tip`)},[m("div",_,[d(v,{title:`上传文件支持 ${p(S).join(" / ")} 格式,单个文件大小不超过 ${l.size}MB,且文件数量不超过 ${l.max} 个`,type:"info","show-icon":"",closable:!1},null,8,["title"])])],2))]),default:u(()=>[m("div",$,[d(i,{class:r(`${p(z).namespace.value}-icon--upload`)},{default:u(()=>[d(p(x))]),_:1},8,["class"]),m("div",{class:r(`${p(z).namespace.value}-upload__text`)},a[0]||(a[0]=[c(" 将文件拖到此处,或",-1),m("em",null,"点击上传",-1)]),2)])]),_:1},8,["headers","action","data","name","file-list","limit","class"])}}});export{b as default};
2
2
  //# sourceMappingURL=file-upload.vue.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-upload.vue.mjs","sources":["../../../../../../packages/components/src/file-upload/src/file-upload.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { UploadProps, UploadUserFile } from 'element-plus'\nimport { UploadFilled } from '@element-plus/icons-vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { useNamespace as useElNamespace } from 'element-plus'\n\ndefineOptions({\n name: 'QxsFileUpload',\n})\n\nconst {\n name = 'file',\n size = 20,\n max = 3,\n files = [],\n notip = false,\n accept = 'zip,rar',\n} = defineProps<{\n action: UploadProps['action']\n headers?: UploadProps['headers']\n data?: UploadProps['data']\n name?: UploadProps['name']\n size?: number\n max?: number\n accept?: string\n files?: UploadUserFile[]\n notip?: boolean\n ext?: string[]\n}>()\n\nconst emit = defineEmits(['onSuccess'])\n\nconst ns = useNamespace('file-upload')\nconst nsEl = useElNamespace('file-upload')\n\nconst exts = computed(() => {\n return accept.split(',')\n})\nconst beforeUpload: UploadProps['beforeUpload'] = (file) => {\n const fileName = file.name.split('.')\n const fileExt = fileName.at(-1) ?? ''\n const isTypeOk = exts.value.includes(fileExt)\n const isSizeOk = file.size / 1024 / 1024 < size\n if (!isTypeOk) {\n ElMessage.error(`上传文件只支持 ${exts.value.join(' / ')} 格式!`)\n }\n if (!isSizeOk) {\n ElMessage.error(`上传文件大小不能超过 ${size}MB!`)\n }\n return isTypeOk && isSizeOk\n}\n\nconst onExceed: UploadProps['onExceed'] = () => {\n ElMessage.warning('文件上传超过限制')\n}\n\nconst onSuccess: UploadProps['onSuccess'] = (res, file, fileList) => {\n emit('onSuccess', res, file, fileList)\n}\n</script>\n\n<template>\n <el-upload\n :headers=\"headers\"\n :action=\"action\"\n :data=\"data\"\n :name=\"name\"\n :before-upload=\"beforeUpload\"\n :on-exceed=\"onExceed\"\n :on-success=\"onSuccess\"\n :file-list=\"files\"\n :limit=\"max\"\n drag\n :class=\"ns.e('control')\"\n >\n <div class=\"slot\">\n <el-icon :class=\"`${nsEl.namespace.value}-icon--upload`\">\n <UploadFilled />\n </el-icon>\n <div :class=\"`${nsEl.namespace.value}-upload__text`\">\n 将文件拖到此处,或<em>点击上传</em>\n </div>\n </div>\n <template #tip>\n <div\n v-if=\"!notip\"\n :class=\"`${nsEl.namespace.value}-upload__tip`\"\n >\n <div style=\"display: inline-block;\">\n <el-alert\n :title=\"`上传文件支持 ${exts.join(\n ' / ',\n )} 格式,单个文件大小不超过 ${size}MB,且文件数量不超过 ${max} 个`\"\n type=\"info\"\n show-icon\n :closable=\"false\"\n />\n </div>\n </div>\n </template>\n </el-upload>\n</template>\n"],"names":["emit","__emit","ns","useNamespace","nsEl","useElNamespace","exts","computed","__props","accept","split","beforeUpload","file","fileExt","name","at","isTypeOk","value","includes","isSizeOk","size","ElMessage","error","join","onExceed","warning","onSuccess","res","fileList"],"mappings":"+vCA8BA,MAAMA,EAAOC,EAEPC,EAAKC,EAAa,eAClBC,EAAOC,EAAe,eAEtBC,EAAOC,GAAS,IACbC,EAAAC,OAAOC,MAAM,OAEhBC,EAA6CC,IACjD,MACMC,EADWD,EAAKE,KAAKJ,MAAM,KACRK,IAAG,IAAO,GAC7BC,EAAWV,EAAKW,MAAMC,SAASL,GAC/BM,EAAWP,EAAKQ,KAAO,KAAO,KAAOZ,EAAAY,KAO3C,OANKJ,GACHK,EAAUC,MAAM,WAAWhB,EAAKW,MAAMM,KAAK,cAExCJ,GACHE,EAAUC,MAAM,cAAcd,EAAAY,WAEzBJ,GAAYG,CAAA,EAGfK,EAAoC,KACxCH,EAAUI,QAAQ,WAAU,EAGxBC,EAAsC,CAACC,EAAKf,EAAMgB,KACjD5B,EAAA,YAAa2B,EAAKf,EAAMgB,EAAQ"}
1
+ {"version":3,"file":"file-upload.vue.mjs","sources":["../../../../../../packages/components/src/file-upload/src/file-upload.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { UploadProps, UploadUserFile } from 'element-plus'\nimport { UploadFilled } from '@element-plus/icons-vue'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { useNamespace as useElNamespace } from 'element-plus'\n\ndefineOptions({\n name: 'QxsFileUpload',\n})\n\nconst {\n name = 'file',\n size = 20,\n max = 3,\n files = [],\n notip = false,\n accept = 'zip,rar',\n} = defineProps<{\n action: UploadProps['action']\n headers?: UploadProps['headers']\n data?: UploadProps['data']\n name?: UploadProps['name']\n size?: number\n max?: number\n accept?: string\n files?: UploadUserFile[]\n notip?: boolean\n ext?: string[]\n}>()\n\nconst emit = defineEmits(['onSuccess'])\n\nconst ns = useNamespace('file-upload')\nconst nsEl = useElNamespace('file-upload')\n\nconst exts = computed(() => {\n return accept.split(',')\n})\nconst beforeUpload: UploadProps['beforeUpload'] = (file) => {\n const fileName = file.name.split('.')\n const fileExt = fileName.at(-1) ?? ''\n const isTypeOk = exts.value.includes(fileExt)\n const isSizeOk = file.size / 1024 / 1024 < size\n if (!isTypeOk) {\n ElMessage.error(`上传文件只支持 ${exts.value.join(' / ')} 格式!`)\n }\n if (!isSizeOk) {\n ElMessage.error(`上传文件大小不能超过 ${size}MB!`)\n }\n return isTypeOk && isSizeOk\n}\n\nconst onExceed: UploadProps['onExceed'] = () => {\n ElMessage.warning('文件上传超过限制')\n}\n\nconst onSuccess: UploadProps['onSuccess'] = (res, file, fileList) => {\n emit('onSuccess', res, file, fileList)\n}\n</script>\n\n<template>\n <el-upload\n :headers=\"headers\"\n :action=\"action\"\n :data=\"data\"\n :name=\"name\"\n :before-upload=\"beforeUpload\"\n :on-exceed=\"onExceed\"\n :on-success=\"onSuccess\"\n :file-list=\"files\"\n :limit=\"max\"\n drag\n :class=\"ns.e('control')\"\n >\n <div class=\"slot\">\n <el-icon :class=\"`${nsEl.namespace.value}-icon--upload`\">\n <UploadFilled />\n </el-icon>\n <div :class=\"`${nsEl.namespace.value}-upload__text`\">\n 将文件拖到此处,或<em>点击上传</em>\n </div>\n </div>\n <template #tip>\n <div\n v-if=\"!notip\"\n :class=\"`${nsEl.namespace.value}-upload__tip`\"\n >\n <div style=\"display: inline-block;\">\n <el-alert\n :title=\"`上传文件支持 ${exts.join(\n ' / ',\n )} 格式,单个文件大小不超过 ${size}MB,且文件数量不超过 ${max} 个`\"\n type=\"info\"\n show-icon\n :closable=\"false\"\n />\n </div>\n </div>\n </template>\n </el-upload>\n</template>\n"],"names":["emit","__emit","ns","useNamespace","nsEl","useElNamespace","exts","computed","__props","accept","split","beforeUpload","file","fileExt","name","at","isTypeOk","value","includes","isSizeOk","size","ElMessage","error","join","onExceed","warning","onSuccess","res","fileList","_createBlock","_component_el_upload","headers","action","data","files","limit","max","drag","class","_normalizeClass","_unref","e","tip","notip","_createElementBlock","namespace","_createElementVNode","_hoisted_2","_createVNode","_component_el_alert","title","type","closable","_hoisted_1","_component_el_icon","UploadFilled"],"mappings":"+vCA8BA,MAAMA,EAAOC,EAEPC,EAAKC,EAAa,eAClBC,EAAOC,EAAe,eAEtBC,EAAOC,EAAS,IACbC,EAAAC,OAAOC,MAAM,MAEhBC,EAA6CC,IACjD,MACMC,EADWD,EAAKE,KAAKJ,MAAM,KACRK,IAAG,IAAO,GAC7BC,EAAWV,EAAKW,MAAMC,SAASL,GAC/BM,EAAWP,EAAKQ,KAAO,KAAO,KAAOZ,EAAAY,KAO3C,OANKJ,GACHK,EAAUC,MAAM,WAAWhB,EAAKW,MAAMM,KAAK,cAExCJ,GACHE,EAAUC,MAAM,cAAcd,EAAAY,WAEzBJ,GAAYG,GAGfK,EAAoC,KACxCH,EAAUI,QAAQ,aAGdC,EAAsC,CAACC,EAAKf,EAAMgB,KACtD5B,EAAK,YAAa2B,EAAKf,EAAMgB,+CAK7BC,EAsCYC,EAAA,CArCTC,QAASA,EAAAA,QACTC,OAAQA,EAAAA,OACRC,KAAMA,EAAAA,KACNnB,KAAMA,EAAAA,KACN,gBAAeH,EACf,YAAWa,EACX,aAAYE,EACZ,YAAWQ,EAAAA,MACXC,MAAOC,EAAAA,IACRC,KAAA,GACCC,MAAKC,EAAEC,EAAAtC,GAAGuC,EAAC,cAUDC,MACT,IAcM,CAbGC,EAAAA,wBADTC,EAcM,MAAA,OAZHN,MAAKC,EAAA,GAAKC,EAAApC,GAAKyC,UAAU5B,uBAE1B6B,EASM,MATNC,EASM,CARJC,EAOEC,EAAA,CANCC,MAAK,UAAYV,EAAAlC,GAAKiB,4BAAyDH,EAAAA,mBAAmBgB,EAAAA,QAGnGe,KAAK,OACL,YAAA,GACCC,UAAU,wCApBnB,IAOM,CAPNN,EAOM,MAPNO,EAOM,CANJL,EAEUM,EAAA,CAFAhB,MAAKC,EAAA,GAAKC,EAAApC,GAAKyC,UAAU5B,kCACjC,IAAgB,CAAhB+B,EAAgBR,EAAAe,wBAElBT,EAEM,MAAA,CAFAR,MAAKC,EAAA,GAAKC,EAAApC,GAAKyC,UAAU5B,sCAAsB,cAC1C,GAAA6B,EAAa,UAAT,QAAI"}
@@ -1,2 +1,2 @@
1
- import{defineComponent as e,ref as t,computed as a,onMounted as n,onUnmounted as i,createElementBlock as o,openBlock as r,normalizeStyle as l,unref as s,createElementVNode as d,normalizeClass as c,renderSlot as u}from"vue";import{useNamespace as p}from"@qxs-bns/hooks";import{getDeviceType as h}from"@qxs-bns/utils";import{debounce as m}from"lodash-es";var f=e({name:"QxsFixedActionBar",props:{padding:{type:Number,default:8},className:{type:String,default:""}},setup(e){const f=e,g=p("fixed-action-bar"),v=t(!1),b=t(null),x=t(null),w=t({width:0,height:0}),y=t(0),N=t(0),F={resize:null,parent:null};function R(e,t,a){const n=new ResizeObserver((e=>{e.forEach((e=>requestAnimationFrame((()=>t(e)))))}));return n.observe(e,a),n}function $(){if(!b.value||!x.value)return;F.resize=R(b.value,(e=>{const t=function(e){const t=getComputedStyle(e);return{x:Number.parseFloat(t.paddingLeft)+Number.parseFloat(t.paddingRight),y:Number.parseFloat(t.paddingTop)+Number.parseFloat(t.paddingBottom)}}(e.target);w.value={width:e.contentRect.width+t.x,height:e.contentRect.height+t.y}}),{box:"border-box"});const e=x.value.parentElement;e&&(F.parent=R(e,(()=>{const t=e.getBoundingClientRect();y.value=t.width,N.value=t.left})))}const E=m((()=>{const{scrollY:e}=window,{clientHeight:t,scrollHeight:a}=document.documentElement;v.value=Math.ceil(e+t)>=a}),100),k=a((()=>v.value?"":g.is("shadow"))),z=a((()=>"Android"===h()?Math.max(f.padding,20):f.padding)),B=a((()=>({width:`${y.value}px`,left:`${N.value}px`,...g.cssVarBlock({"actionbar-padding":`${f.padding}px`,"actionbar-padding-bottom":`${z.value}px`})})));return n((()=>{$(),window.addEventListener("scroll",E,{passive:!0})})),i((()=>{F.resize?.disconnect(),F.parent?.disconnect(),window.removeEventListener("scroll",E)})),(t,a)=>(r(),o("div",{ref_key:"placeholderRef",ref:x,style:l({width:"100%",height:`${s(w).height}px`})},[d("div",{ref_key:"actionbar",ref:b,style:l(s(B)),class:c([s(g).e("actionbar"),s(k),e.className]),"data-fixed-calc-width":""},[u(t.$slots,"default")],6)],4))}});export{f as default};
1
+ import{defineComponent as e,ref as t,computed as a,onMounted as n,onUnmounted as i,createElementBlock as o,openBlock as r,normalizeStyle as l,unref as s,createElementVNode as d,normalizeClass as c,renderSlot as u}from"vue";import{useNamespace as p}from"@qxs-bns/hooks";import{getDeviceType as h}from"@qxs-bns/utils";import{debounce as m}from"lodash-es";var f=e({name:"QxsFixedActionBar",props:{padding:{type:Number,default:8},className:{type:String,default:""}},setup(e){const f=e,g=p("fixed-action-bar"),v=t(!1),b=t(null),x=t(null),w=t({width:0,height:0}),y=t(0),N=t(0),F={resize:null,parent:null};function R(e,t,a){const n=new ResizeObserver(e=>{e.forEach(e=>requestAnimationFrame(()=>t(e)))});return n.observe(e,a),n}function $(){if(!b.value||!x.value)return;F.resize=R(b.value,e=>{const t=function(e){const t=getComputedStyle(e);return{x:Number.parseFloat(t.paddingLeft)+Number.parseFloat(t.paddingRight),y:Number.parseFloat(t.paddingTop)+Number.parseFloat(t.paddingBottom)}}(e.target);w.value={width:e.contentRect.width+t.x,height:e.contentRect.height+t.y}},{box:"border-box"});const e=x.value.parentElement;e&&(F.parent=R(e,()=>{const t=e.getBoundingClientRect();y.value=t.width,N.value=t.left}))}const E=m(()=>{const{scrollY:e}=window,{clientHeight:t,scrollHeight:a}=document.documentElement;v.value=Math.ceil(e+t)>=a},100),k=a(()=>v.value?"":g.is("shadow")),z=a(()=>"Android"===h()?Math.max(f.padding,20):f.padding),B=a(()=>({width:`${y.value}px`,left:`${N.value}px`,...g.cssVarBlock({"actionbar-padding":`${f.padding}px`,"actionbar-padding-bottom":`${z.value}px`})}));return n(()=>{$(),window.addEventListener("scroll",E,{passive:!0})}),i(()=>{F.resize?.disconnect(),F.parent?.disconnect(),window.removeEventListener("scroll",E)}),(t,a)=>(r(),o("div",{ref_key:"placeholderRef",ref:x,style:l({width:"100%",height:`${s(w).height}px`})},[d("div",{ref_key:"actionbar",ref:b,style:l(s(B)),class:c([s(g).e("actionbar"),s(k),e.className]),"data-fixed-calc-width":""},[u(t.$slots,"default")],6)],4))}});export{f as default};
2
2
  //# sourceMappingURL=fixed-action-bar.vue.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"fixed-action-bar.vue.mjs","sources":["../../../../../../packages/components/src/fixed-action-bar/src/fixed-action-bar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { getDeviceType } from '@qxs-bns/utils'\nimport { debounce } from 'lodash-es'\n\nconst props = defineProps({\n padding: {\n type: Number,\n default: 8,\n },\n className: {\n type: String,\n default: '',\n },\n})\n\ninterface ElementSize { width: number, height: number }\n\nconst ns = useNamespace('fixed-action-bar')\nconst isBottom = ref(false)\nconst actionbar = ref<HTMLElement | null>(null)\nconst placeholderRef = ref<HTMLElement | null>(null)\n\nconst elementSize = ref<ElementSize>({ width: 0, height: 0 })\nconst parentWidth = ref(0)\nconst elementLeft = ref(0)\n\nconst observers = {\n resize: null as ResizeObserver | null,\n parent: null as ResizeObserver | null,\n}\n\nfunction getTotalPadding(el: HTMLElement) {\n const style = getComputedStyle(el)\n return {\n x: Number.parseFloat(style.paddingLeft) + Number.parseFloat(style.paddingRight),\n y: Number.parseFloat(style.paddingTop) + Number.parseFloat(style.paddingBottom),\n }\n}\n\nfunction createResizeObserver(el: HTMLElement,\n callback: (entry: ResizeObserverEntry) => void,\n options?: ResizeObserverOptions) {\n const observer = new ResizeObserver((entries) => {\n entries.forEach(entry => requestAnimationFrame(() => callback(entry)))\n })\n observer.observe(el, options)\n return observer\n}\n\nfunction initObservers() {\n if (!actionbar.value || !placeholderRef.value) {\n return\n }\n\n // 主元素尺寸观察\n observers.resize = createResizeObserver(\n actionbar.value,\n (entry) => {\n const padding = getTotalPadding(entry.target as HTMLElement)\n elementSize.value = {\n width: entry.contentRect.width + padding.x,\n height: entry.contentRect.height + padding.y,\n }\n },\n { box: 'border-box' },\n )\n\n // 父元素观察\n const parent = placeholderRef.value.parentElement\n if (parent) {\n observers.parent = createResizeObserver(parent, () => {\n const rect = parent.getBoundingClientRect()\n parentWidth.value = rect.width\n elementLeft.value = rect.left\n })\n }\n}\n\nconst calculateScrollDetails = debounce(() => {\n const { scrollY } = window\n const { clientHeight, scrollHeight } = document.documentElement\n isBottom.value = Math.ceil(scrollY + clientHeight) >= scrollHeight\n}, 100)\n\nconst shadowClass = computed(() => (!isBottom.value ? ns.is('shadow') : ''))\n\nconst paddingBottom = computed(() =>\n getDeviceType() === 'Android' ? Math.max(props.padding, 20) : props.padding,\n)\n\nconst actionbarStyle = computed(() => ({\n width: `${parentWidth.value}px`,\n left: `${elementLeft.value}px`,\n ...ns.cssVarBlock({\n 'actionbar-padding': `${props.padding}px`,\n 'actionbar-padding-bottom': `${paddingBottom.value}px`,\n }),\n}))\n\nonMounted(() => {\n initObservers()\n window.addEventListener('scroll', calculateScrollDetails, { passive: true })\n})\n\nonUnmounted(() => {\n observers.resize?.disconnect()\n observers.parent?.disconnect()\n window.removeEventListener('scroll', calculateScrollDetails)\n})\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'QxsFixedActionBar',\n}\n</script>\n\n<template>\n <div\n ref=\"placeholderRef\"\n :style=\"{ width: '100%', height: `${elementSize.height}px` }\"\n >\n <div\n ref=\"actionbar\"\n :style=\"actionbarStyle\"\n :class=\"[ns.e('actionbar'), shadowClass, className]\"\n data-fixed-calc-width\n >\n <slot />\n </div>\n </div>\n</template>\n"],"names":["name","props","__props","ns","useNamespace","isBottom","ref","actionbar","placeholderRef","elementSize","width","height","parentWidth","elementLeft","observers","resize","parent","createResizeObserver","el","callback","options","observer","ResizeObserver","entries","forEach","entry","requestAnimationFrame","observe","initObservers","value","padding","style","getComputedStyle","x","Number","parseFloat","paddingLeft","paddingRight","y","paddingTop","paddingBottom","getTotalPadding","target","contentRect","box","parentElement","rect","getBoundingClientRect","left","calculateScrollDetails","debounce","scrollY","window","clientHeight","scrollHeight","document","documentElement","Math","ceil","shadowClass","computed","is","getDeviceType","max","actionbarStyle","cssVarBlock","onMounted","addEventListener","passive","onUnmounted","disconnect","removeEventListener"],"mappings":"0WAkHEA,KAAM,wGA7GR,MAAMC,EAAQC,EAaRC,EAAKC,EAAa,oBAClBC,EAAWC,GAAI,GACfC,EAAYD,EAAwB,MACpCE,EAAiBF,EAAwB,MAEzCG,EAAcH,EAAiB,CAAEI,MAAO,EAAGC,OAAQ,IACnDC,EAAcN,EAAI,GAClBO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AAM6B,UAGhEkC,EAAiBJ,GAAS,KAAO,CACrClD,MAAO,GAAGE,EAAYiB,UACtBmB,KAAM,GAAGnC,EAAYgB,aAClB1B,EAAG8D,YAAY,CAChB,oBAAqB,GAAGhE,EAAM6B,YAC9B,2BAA4B,GAAGU,EAAcX,uBAIjDqC,GAAU,KACMtC,IACdwB,OAAOe,iBAAiB,SAAUlB,EAAwB,CAAEmB,SAAS,GAAM,IAG7EC,GAAY,KACVvD,EAAUC,QAAQuD,aAClBxD,EAAUE,QAAQsD,aACXlB,OAAAmB,oBAAoB,SAAUtB,EAAsB"}
1
+ {"version":3,"file":"fixed-action-bar.vue.mjs","sources":["../../../../../../packages/components/src/fixed-action-bar/src/fixed-action-bar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { getDeviceType } from '@qxs-bns/utils'\nimport { debounce } from 'lodash-es'\n\nconst props = defineProps({\n padding: {\n type: Number,\n default: 8,\n },\n className: {\n type: String,\n default: '',\n },\n})\n\ninterface ElementSize { width: number, height: number }\n\nconst ns = useNamespace('fixed-action-bar')\nconst isBottom = ref(false)\nconst actionbar = ref<HTMLElement | null>(null)\nconst placeholderRef = ref<HTMLElement | null>(null)\n\nconst elementSize = ref<ElementSize>({ width: 0, height: 0 })\nconst parentWidth = ref(0)\nconst elementLeft = ref(0)\n\nconst observers = {\n resize: null as ResizeObserver | null,\n parent: null as ResizeObserver | null,\n}\n\nfunction getTotalPadding(el: HTMLElement) {\n const style = getComputedStyle(el)\n return {\n x: Number.parseFloat(style.paddingLeft) + Number.parseFloat(style.paddingRight),\n y: Number.parseFloat(style.paddingTop) + Number.parseFloat(style.paddingBottom),\n }\n}\n\nfunction createResizeObserver(el: HTMLElement,\n callback: (entry: ResizeObserverEntry) => void,\n options?: ResizeObserverOptions) {\n const observer = new ResizeObserver((entries) => {\n entries.forEach(entry => requestAnimationFrame(() => callback(entry)))\n })\n observer.observe(el, options)\n return observer\n}\n\nfunction initObservers() {\n if (!actionbar.value || !placeholderRef.value) {\n return\n }\n\n // 主元素尺寸观察\n observers.resize = createResizeObserver(\n actionbar.value,\n (entry) => {\n const padding = getTotalPadding(entry.target as HTMLElement)\n elementSize.value = {\n width: entry.contentRect.width + padding.x,\n height: entry.contentRect.height + padding.y,\n }\n },\n { box: 'border-box' },\n )\n\n // 父元素观察\n const parent = placeholderRef.value.parentElement\n if (parent) {\n observers.parent = createResizeObserver(parent, () => {\n const rect = parent.getBoundingClientRect()\n parentWidth.value = rect.width\n elementLeft.value = rect.left\n })\n }\n}\n\nconst calculateScrollDetails = debounce(() => {\n const { scrollY } = window\n const { clientHeight, scrollHeight } = document.documentElement\n isBottom.value = Math.ceil(scrollY + clientHeight) >= scrollHeight\n}, 100)\n\nconst shadowClass = computed(() => (!isBottom.value ? ns.is('shadow') : ''))\n\nconst paddingBottom = computed(() =>\n getDeviceType() === 'Android' ? Math.max(props.padding, 20) : props.padding,\n)\n\nconst actionbarStyle = computed(() => ({\n width: `${parentWidth.value}px`,\n left: `${elementLeft.value}px`,\n ...ns.cssVarBlock({\n 'actionbar-padding': `${props.padding}px`,\n 'actionbar-padding-bottom': `${paddingBottom.value}px`,\n }),\n}))\n\nonMounted(() => {\n initObservers()\n window.addEventListener('scroll', calculateScrollDetails, { passive: true })\n})\n\nonUnmounted(() => {\n observers.resize?.disconnect()\n observers.parent?.disconnect()\n window.removeEventListener('scroll', calculateScrollDetails)\n})\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'QxsFixedActionBar',\n}\n</script>\n\n<template>\n <div\n ref=\"placeholderRef\"\n :style=\"{ width: '100%', height: `${elementSize.height}px` }\"\n >\n <div\n ref=\"actionbar\"\n :style=\"actionbarStyle\"\n :class=\"[ns.e('actionbar'), shadowClass, className]\"\n data-fixed-calc-width\n >\n <slot />\n </div>\n </div>\n</template>\n"],"names":["name","props","__props","ns","useNamespace","isBottom","ref","actionbar","placeholderRef","elementSize","width","height","parentWidth","elementLeft","observers","resize","parent","createResizeObserver","el","callback","options","observer","ResizeObserver","entries","forEach","entry","requestAnimationFrame","observe","initObservers","value","padding","style","getComputedStyle","x","Number","parseFloat","paddingLeft","paddingRight","y","paddingTop","paddingBottom","getTotalPadding","target","contentRect","box","parentElement","rect","getBoundingClientRect","left","calculateScrollDetails","debounce","scrollY","window","clientHeight","scrollHeight","document","documentElement","Math","ceil","shadowClass","computed","is","getDeviceType","max","actionbarStyle","cssVarBlock","onMounted","addEventListener","passive","onUnmounted","disconnect","removeEventListener","_createElementBlock","_normalizeStyle","_unref","_createElementVNode","class","e","className","_renderSlot","_ctx","$slots"],"mappings":"0WAkHEA,KAAM,wGA7GR,MAAMC,EAAQC,EAaRC,EAAKC,EAAa,oBAClBC,EAAWC,GAAI,GACfC,EAAYD,EAAwB,MACpCE,EAAiBF,EAAwB,MAEzCG,EAAcH,EAAiB,CAAEI,MAAO,EAAGC,OAAQ,IACnDC,EAAcN,EAAI,GAClBO,EAAcP,EAAI,GAElBQ,EAAY,CAChBC,OAAQ,KACRC,OAAQ,MAWV,SAASC,EAAqBC,EAC5BC,EACAC,GACA,MAAMC,EAAW,IAAIC,eAAgBC,IACnCA,EAAQC,QAAQC,GAASC,sBAAsB,IAAMP,EAASM,OAGhE,OADAJ,EAASM,QAAQT,EAAIE,GACdC,CACT,CAEA,SAASO,IACP,IAAKrB,EAAUsB,QAAUrB,EAAeqB,MACtC,OAIFf,EAAUC,OAASE,EACjBV,EAAUsB,MACTJ,IACC,MAAMK,EA3BZ,SAAyBZ,GACvB,MAAMa,EAAQC,iBAAiBd,GAC/B,MAAO,CACLe,EAAGC,OAAOC,WAAWJ,EAAMK,aAAeF,OAAOC,WAAWJ,EAAMM,cAClEC,EAAGJ,OAAOC,WAAWJ,EAAMQ,YAAcL,OAAOC,WAAWJ,EAAMS,eAErE,CAqBsBC,CAAgBhB,EAAMiB,QACtCjC,EAAYoB,MAAQ,CAClBnB,MAAOe,EAAMkB,YAAYjC,MAAQoB,EAAQG,EACzCtB,OA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import{withInstall as o}from"../withInstall.mjs";import t from"./src/icon.vue.mjs";const m=o(t);export{m as Icon,m as default};
1
+ import{withInstall as o}from"../withInstall.mjs";import t from"./src/icon.vue.mjs";const m=o(t);export{m as QxsIcon,m as default};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../packages/components/src/icon/index.ts"],"sourcesContent":["import { withInstall } from '../withInstall'\nimport component from './src/icon.vue'\n\nconst Icon = withInstall(component)\n\nexport {\n Icon,\n}\n\nexport default Icon"],"names":["Icon","withInstall","component"],"mappings":"mFAGA,MAAMA,EAAOC,EAAYC"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../packages/components/src/icon/index.ts"],"sourcesContent":["import { withInstall } from '../withInstall'\nimport component from './src/icon.vue'\n\nconst QxsIcon = withInstall(component)\n\nexport {\n QxsIcon,\n}\n\nexport default QxsIcon\n"],"names":["QxsIcon","withInstall","component"],"mappings":"mFAGA,MAAMA,EAAUC,EAAYC"}