@qxs-bns/components 0.0.48 → 0.0.49

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 (177) hide show
  1. package/es/index.css +5 -5
  2. package/es/package.json.mjs +1 -1
  3. package/es/src/data-chart/src/components/area.vue2.mjs.map +1 -1
  4. package/es/src/data-chart/src/components/bar.vue.mjs +1 -1
  5. package/es/src/data-chart/src/components/bar.vue.mjs.map +1 -1
  6. package/es/src/data-chart/src/components/card.vue2.mjs.map +1 -1
  7. package/es/src/data-chart/src/components/empty.svg.mjs +1 -1
  8. package/es/src/data-chart/src/components/empty.svg.mjs.map +1 -1
  9. package/es/src/data-chart/src/components/empty.vue.mjs +1 -1
  10. package/es/src/data-chart/src/components/empty.vue.mjs.map +1 -1
  11. package/es/src/data-chart/src/components/funnel.vue.mjs +1 -1
  12. package/es/src/data-chart/src/components/funnel.vue.mjs.map +1 -1
  13. package/es/src/data-chart/src/components/line.vue2.mjs +1 -1
  14. package/es/src/data-chart/src/components/line.vue2.mjs.map +1 -1
  15. package/es/src/data-chart/src/components/pie.vue.mjs +1 -1
  16. package/es/src/data-chart/src/components/pie.vue.mjs.map +1 -1
  17. package/es/src/data-chart/src/components/radar.vue.mjs +1 -1
  18. package/es/src/data-chart/src/components/radar.vue.mjs.map +1 -1
  19. package/es/src/data-chart/src/components/scatter-simple.vue.mjs +1 -1
  20. package/es/src/data-chart/src/components/scatter-simple.vue.mjs.map +1 -1
  21. package/es/src/data-chart/src/components/scatter.vue.mjs +1 -1
  22. package/es/src/data-chart/src/components/scatter.vue.mjs.map +1 -1
  23. package/es/src/data-chart/src/components/table.vue.mjs +1 -1
  24. package/es/src/data-chart/src/components/table.vue.mjs.map +1 -1
  25. package/es/src/data-chart/src/data-chart.vue.mjs +1 -1
  26. package/es/src/data-chart/src/data-chart.vue.mjs.map +1 -1
  27. package/es/src/data-chart/src/utils/config.mjs +1 -1
  28. package/es/src/data-chart/src/utils/config.mjs.map +1 -1
  29. package/es/src/data-chart/src/utils/safe-eval.mjs +2 -0
  30. package/es/src/data-chart/src/utils/safe-eval.mjs.map +1 -0
  31. package/es/src/data-chart/src/utils/useCharts.mjs +1 -1
  32. package/es/src/data-chart/src/utils/useCharts.mjs.map +1 -1
  33. package/es/src/file-upload/src/file-upload.vue.mjs +1 -1
  34. package/es/src/file-upload/src/file-upload.vue.mjs.map +1 -1
  35. package/es/src/fixed-action-bar/src/fixed-action-bar.vue.mjs +1 -1
  36. package/es/src/fixed-action-bar/src/fixed-action-bar.vue.mjs.map +1 -1
  37. package/es/src/image-upload/src/image-upload.vue.mjs +1 -1
  38. package/es/src/image-upload/src/image-upload.vue.mjs.map +1 -1
  39. package/es/src/photo-crop-tool/src/photo-crop-tool.vue.mjs.map +1 -1
  40. package/es/src/subject-action/index.mjs.map +1 -1
  41. package/es/src/subject-action/src/subject-action.vue.mjs +1 -1
  42. package/es/src/subject-action/src/subject-action.vue.mjs.map +1 -1
  43. package/es/src/subject-layout/index.mjs.map +1 -1
  44. package/es/src/subject-layout/src/subject-layout.vue.mjs.map +1 -1
  45. package/es/src/subject-list/src/components/SubjectPageEnd.vue.mjs +1 -1
  46. package/es/src/subject-list/src/components/SubjectPageEnd.vue.mjs.map +1 -1
  47. package/es/src/subject-list/src/components/SubjectRichText.vue.mjs +1 -1
  48. package/es/src/subject-list/src/components/SubjectRichText.vue.mjs.map +1 -1
  49. package/es/src/subject-list/src/components/subject-blank-fill.vue.mjs +1 -1
  50. package/es/src/subject-list/src/components/subject-blank-fill.vue.mjs.map +1 -1
  51. package/es/src/subject-list/src/components/subject-scale.vue.mjs +1 -1
  52. package/es/src/subject-list/src/components/subject-scale.vue.mjs.map +1 -1
  53. package/es/src/subject-list/src/components/subject-single.vue.mjs +1 -1
  54. package/es/src/subject-list/src/components/subject-single.vue.mjs.map +1 -1
  55. package/es/src/subject-list/src/components/subject-text-fill.vue.mjs +1 -1
  56. package/es/src/subject-list/src/components/subject-text-fill.vue.mjs.map +1 -1
  57. package/es/src/subject-list/src/subject-list.vue.mjs +1 -1
  58. package/es/src/subject-list/src/subject-list.vue.mjs.map +1 -1
  59. package/es/src/subject-type/index.mjs.map +1 -1
  60. package/es/src/subject-type/src/subject-type.vue.mjs.map +1 -1
  61. package/lib/index.css +5 -5
  62. package/lib/package.json.cjs +1 -1
  63. package/lib/src/data-chart/src/components/area.vue2.cjs.map +1 -1
  64. package/lib/src/data-chart/src/components/bar.vue.cjs +1 -1
  65. package/lib/src/data-chart/src/components/bar.vue.cjs.map +1 -1
  66. package/lib/src/data-chart/src/components/card.vue2.cjs.map +1 -1
  67. package/lib/src/data-chart/src/components/empty.svg.cjs +1 -1
  68. package/lib/src/data-chart/src/components/empty.svg.cjs.map +1 -1
  69. package/lib/src/data-chart/src/components/empty.vue.cjs +1 -1
  70. package/lib/src/data-chart/src/components/empty.vue.cjs.map +1 -1
  71. package/lib/src/data-chart/src/components/funnel.vue.cjs +1 -1
  72. package/lib/src/data-chart/src/components/funnel.vue.cjs.map +1 -1
  73. package/lib/src/data-chart/src/components/line.vue2.cjs +1 -1
  74. package/lib/src/data-chart/src/components/line.vue2.cjs.map +1 -1
  75. package/lib/src/data-chart/src/components/pie.vue.cjs +1 -1
  76. package/lib/src/data-chart/src/components/pie.vue.cjs.map +1 -1
  77. package/lib/src/data-chart/src/components/radar.vue.cjs +1 -1
  78. package/lib/src/data-chart/src/components/radar.vue.cjs.map +1 -1
  79. package/lib/src/data-chart/src/components/scatter-simple.vue.cjs +1 -1
  80. package/lib/src/data-chart/src/components/scatter-simple.vue.cjs.map +1 -1
  81. package/lib/src/data-chart/src/components/scatter.vue.cjs +1 -1
  82. package/lib/src/data-chart/src/components/scatter.vue.cjs.map +1 -1
  83. package/lib/src/data-chart/src/components/table.vue.cjs +1 -1
  84. package/lib/src/data-chart/src/components/table.vue.cjs.map +1 -1
  85. package/lib/src/data-chart/src/data-chart.vue.cjs +1 -1
  86. package/lib/src/data-chart/src/data-chart.vue.cjs.map +1 -1
  87. package/lib/src/data-chart/src/utils/config.cjs +1 -1
  88. package/lib/src/data-chart/src/utils/config.cjs.map +1 -1
  89. package/lib/src/data-chart/src/utils/safe-eval.cjs +2 -0
  90. package/lib/src/data-chart/src/utils/safe-eval.cjs.map +1 -0
  91. package/lib/src/data-chart/src/utils/useCharts.cjs +1 -1
  92. package/lib/src/data-chart/src/utils/useCharts.cjs.map +1 -1
  93. package/lib/src/file-upload/src/file-upload.vue.cjs +1 -1
  94. package/lib/src/file-upload/src/file-upload.vue.cjs.map +1 -1
  95. package/lib/src/fixed-action-bar/src/fixed-action-bar.vue.cjs +1 -1
  96. package/lib/src/fixed-action-bar/src/fixed-action-bar.vue.cjs.map +1 -1
  97. package/lib/src/image-upload/src/image-upload.vue.cjs +1 -1
  98. package/lib/src/image-upload/src/image-upload.vue.cjs.map +1 -1
  99. package/lib/src/photo-crop-tool/src/photo-crop-tool.vue.cjs.map +1 -1
  100. package/lib/src/subject-action/index.cjs.map +1 -1
  101. package/lib/src/subject-action/src/subject-action.vue.cjs +1 -1
  102. package/lib/src/subject-action/src/subject-action.vue.cjs.map +1 -1
  103. package/lib/src/subject-layout/index.cjs.map +1 -1
  104. package/lib/src/subject-layout/src/subject-layout.vue.cjs.map +1 -1
  105. package/lib/src/subject-list/src/components/SubjectPageEnd.vue.cjs +1 -1
  106. package/lib/src/subject-list/src/components/SubjectPageEnd.vue.cjs.map +1 -1
  107. package/lib/src/subject-list/src/components/SubjectRichText.vue.cjs +1 -1
  108. package/lib/src/subject-list/src/components/SubjectRichText.vue.cjs.map +1 -1
  109. package/lib/src/subject-list/src/components/subject-blank-fill.vue.cjs +1 -1
  110. package/lib/src/subject-list/src/components/subject-blank-fill.vue.cjs.map +1 -1
  111. package/lib/src/subject-list/src/components/subject-scale.vue.cjs +1 -1
  112. package/lib/src/subject-list/src/components/subject-scale.vue.cjs.map +1 -1
  113. package/lib/src/subject-list/src/components/subject-single.vue.cjs +1 -1
  114. package/lib/src/subject-list/src/components/subject-single.vue.cjs.map +1 -1
  115. package/lib/src/subject-list/src/components/subject-text-fill.vue.cjs +1 -1
  116. package/lib/src/subject-list/src/components/subject-text-fill.vue.cjs.map +1 -1
  117. package/lib/src/subject-list/src/subject-list.vue.cjs +1 -1
  118. package/lib/src/subject-list/src/subject-list.vue.cjs.map +1 -1
  119. package/lib/src/subject-type/index.cjs.map +1 -1
  120. package/lib/src/subject-type/src/subject-type.vue.cjs.map +1 -1
  121. package/package.json +4 -11
  122. package/theme-chalk/index.css +1 -1
  123. package/theme-chalk/src/base.scss +2 -2
  124. package/theme-chalk/src/fixed-action-bar.css +1 -1
  125. package/theme-chalk/src/fixed-action-bar.scss +1 -1
  126. package/theme-chalk/src/image-upload.css +1 -1
  127. package/theme-chalk/src/image-upload.scss +3 -1
  128. package/theme-chalk/src/subject-action.css +1 -1
  129. package/theme-chalk/src/subject-action.scss +3 -2
  130. package/theme-chalk/src/subject-layout.scss +19 -19
  131. package/theme-chalk/src/subject-list.css +1 -1
  132. package/theme-chalk/src/subject-list.scss +15 -14
  133. package/theme-chalk/src/tiny-mce-editor.scss +4 -2
  134. package/types/src/data-chart/src/components/area.vue.d.ts.map +1 -1
  135. package/types/src/data-chart/src/components/bar.vue.d.ts.map +1 -1
  136. package/types/src/data-chart/src/components/card.vue.d.ts.map +1 -1
  137. package/types/src/data-chart/src/components/empty.vue.d.ts.map +1 -1
  138. package/types/src/data-chart/src/components/funnel.vue.d.ts.map +1 -1
  139. package/types/src/data-chart/src/components/line.vue.d.ts.map +1 -1
  140. package/types/src/data-chart/src/components/pie.vue.d.ts +1 -1
  141. package/types/src/data-chart/src/components/pie.vue.d.ts.map +1 -1
  142. package/types/src/data-chart/src/components/radar.vue.d.ts.map +1 -1
  143. package/types/src/data-chart/src/components/scatter-simple.vue.d.ts.map +1 -1
  144. package/types/src/data-chart/src/components/scatter.vue.d.ts.map +1 -1
  145. package/types/src/data-chart/src/components/table.vue.d.ts.map +1 -1
  146. package/types/src/data-chart/src/data-chart.vue.d.ts.map +1 -1
  147. package/types/src/data-chart/src/utils/config.d.ts.map +1 -1
  148. package/types/src/data-chart/src/utils/safe-eval.d.ts +9 -0
  149. package/types/src/data-chart/src/utils/safe-eval.d.ts.map +1 -0
  150. package/types/src/data-chart/src/utils/useCharts.d.ts +4 -4
  151. package/types/src/data-chart/src/utils/useCharts.d.ts.map +1 -1
  152. package/types/src/file-upload/src/file-upload.vue.d.ts +5 -5
  153. package/types/src/file-upload/src/file-upload.vue.d.ts.map +1 -1
  154. package/types/src/fixed-action-bar/index.d.ts +3 -3
  155. package/types/src/fixed-action-bar/src/fixed-action-bar.vue.d.ts +1 -1
  156. package/types/src/fixed-action-bar/src/fixed-action-bar.vue.d.ts.map +1 -1
  157. package/types/src/image-upload/src/image-upload.vue.d.ts +6 -6
  158. package/types/src/image-upload/src/image-upload.vue.d.ts.map +1 -1
  159. package/types/src/photo-crop-tool/src/photo-crop-tool.vue.d.ts.map +1 -1
  160. package/types/src/subject-action/index.d.ts +11 -11
  161. package/types/src/subject-action/index.d.ts.map +1 -1
  162. package/types/src/subject-action/src/subject-action.vue.d.ts +10 -10
  163. package/types/src/subject-action/src/subject-action.vue.d.ts.map +1 -1
  164. package/types/src/subject-layout/index.d.ts +1 -1
  165. package/types/src/subject-layout/index.d.ts.map +1 -1
  166. package/types/src/subject-layout/src/subject-layout.vue.d.ts.map +1 -1
  167. package/types/src/subject-list/src/components/SubjectPageEnd.vue.d.ts.map +1 -1
  168. package/types/src/subject-list/src/components/SubjectRichText.vue.d.ts.map +1 -1
  169. package/types/src/subject-list/src/components/subject-blank-fill.vue.d.ts.map +1 -1
  170. package/types/src/subject-list/src/components/subject-scale.vue.d.ts.map +1 -1
  171. package/types/src/subject-list/src/components/subject-single.vue.d.ts.map +1 -1
  172. package/types/src/subject-list/src/components/subject-text-fill.vue.d.ts.map +1 -1
  173. package/types/src/subject-list/src/subject-list.vue.d.ts.map +1 -1
  174. package/types/src/subject-type/index.d.ts +1 -1
  175. package/types/src/subject-type/index.d.ts.map +1 -1
  176. package/types/src/subject-type/src/subject-type.vue.d.ts.map +1 -1
  177. package/types/tsconfig.tsbuildinfo +1 -1
package/es/index.css CHANGED
@@ -1,9 +1,4 @@
1
1
  /* unplugin-vue-components disabled */
2
- .line-vue-vue-type-style-index-0-scoped-397864aa-lang_data-chart-line__IKZEs[data-v-397864aa] {
3
- width: 100%;
4
- height: 100%;
5
- }
6
- /* unplugin-vue-components disabled */
7
2
  .area-vue-vue-type-style-index-0-scoped-51660d7b-lang_data-chart-area-wrap__nAnr8[data-v-51660d7b] {
8
3
  position: relative;
9
4
  }
@@ -80,4 +75,9 @@
80
75
  padding: 0 30px 10px 20px;
81
76
  font-size: 14px;
82
77
  color: #464646;
78
+ }
79
+ /* unplugin-vue-components disabled */
80
+ .line-vue-vue-type-style-index-0-scoped-397864aa-lang_data-chart-line__IKZEs[data-v-397864aa] {
81
+ width: 100%;
82
+ height: 100%;
83
83
  }
@@ -1,2 +1,2 @@
1
- var r="0.0.48";export{r as version};
1
+ var r="0.0.49";export{r as version};
2
2
  //# sourceMappingURL=package.json.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"area.vue2.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/area.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ECharts } from 'echarts/types/dist/echarts'\nimport type { EChartsOption, GeoJson, IFormatPublicData } from '../types'\nimport * as echarts from 'echarts'\nimport { getGeoJsonData } from '../utils/config'\nimport { InjectionChartMerge } from '../utils/injectionKeys'\nimport { useCharts } from '../utils/useCharts'\n\ndefineOptions({\n name: 'DataChartArea',\n})\n\nconst {\n chartOptions,\n chartData = {\n colDesc: [],\n xGroupByDesc: {\n colDesc: '',\n groupByDesc: '',\n groupByValues: [],\n xAxis: false,\n },\n groupByDesc: [],\n data: [],\n modelName: '',\n },\n} = defineProps<{\n chartOptions: EChartsOption\n chartData?: IFormatPublicData\n}>()\n\nconst merge = inject(InjectionChartMerge, (v: any) => v, true)\n\nlet adcode = '中国'\nconst currentGeoJson = ref<GeoJson>({\n features: [],\n type: 'FeatureCollection',\n})\nconst dataChartArea = ref(null)\nlet myChart: ECharts | null = null\n\nconst areaChartOptions = computed<EChartsOption>(() => {\n const { xGroupByDesc, groupByDesc, colDesc, modelName, data } = chartData\n const allNums: number[] = []\n colDesc.forEach((item) => {\n data.forEach((dataItem) => {\n allNums.push(Number(dataItem[item]))\n })\n })\n const config = {\n title: {\n text: modelName,\n },\n tooltip: {\n formatter(params: { name: string }) {\n let res = `${params.name}<br/>`\n config.series?.forEach((colDescItem) => {\n colDescItem.data?.forEach((item) => {\n if (item.name === params.name) {\n res += `${colDescItem.name}:${item.value}</br>`\n }\n })\n if (!res.includes(colDescItem.name)) {\n res += `${colDescItem.name}:-</br>`\n }\n })\n return res\n },\n },\n visualMap: {\n min: Math.min(...allNums, 0),\n max: Math.max(...allNums, 0),\n },\n series: colDesc?.map((colDescItem) => {\n const seriesData = []\n const row = groupByDesc.find(item => item.colDesc === (adcode === '中国' ? '医院所在省' : '医院所在市'))\n // 先用省份数据,如果没有再用市级数据\n\n const arr: {\n [key: string]: number\n } = {}\n data.map((item) => {\n const sourceName = item[(adcode === '中国' ? (xGroupByDesc?.colDesc || '') : row?.colDesc) || '']\n const find = currentGeoJson.value.features?.find(({ properties: { name } }: { properties: { name?: string } }) => name?.includes(sourceName as string))\n return {\n name: find?.properties?.name || '',\n value: Number(item[colDescItem]),\n }\n }).forEach((item) => {\n if (!arr[item.name]) {\n arr[item.name] = item.value\n }\n else {\n arr[item.name] = arr[item.name] + item.value\n }\n })\n for (const key in arr) {\n seriesData.push({\n name: key,\n value: arr[key],\n })\n }\n return {\n name: colDescItem,\n type: 'map',\n map: adcode,\n data: seriesData,\n }\n }),\n }\n\n return merge(config, chartOptions)\n})\n// const propsXgroupByInfos = computed(() => {\n// const { groupByDesc } = chartData\n// const [row] = groupByDesc.filter(item => item.colDesc === '医院所在省')\n// if (row) {\n// return row\n// }\n// else {\n// const [res] = groupByDesc.filter(item => item.colDesc === '医院所在市')\n// return res\n// }\n// })\n// const selectList = computed(() => {\n// let arr = [{ label: '中国', value: '中国' }]\n// if (chartData.groupByDesc.length === 1 && propsXgroupByInfos.value?.colDesc === '医院所在市') {\n// const {\n// data,\n// xGroupByDesc: { colDesc },\n// } = chartData\n// arr = data.map((item) => {\n// return {\n// label: item[colDesc],\n// value: item[colDesc],\n// }\n// })\n// }\n// return arr\n// })\n\n// const isShowSelect = computed(() => {\n// const { groupByDesc } = chartData.value\n// return groupByDesc[0] && groupByDesc[0].colDesc !== '医院所在省' && groupByDesc.length === 1 && selectList.value.length\n// })\n\nasync function initAfter() {\n await registerMap()\n // 添加判断,确保图表实例存在且未被销毁\n if (myChart && !myChart.isDisposed()) {\n // charts 监听事件\n myChart.getZr()?.on('click', (params: { target: HTMLElement }) => {\n if (!params.target && adcode !== '中国') {\n registerMap('中国')\n }\n })\n myChart.on('click', (params: { name: string }) => {\n const flag = chartData.groupByDesc?.some(item => item.colDesc === '医院所在市')\n\n if (adcode === '中国' && flag) {\n registerMap(params.name).then(() => {\n if (myChart && !myChart.isDisposed()) {\n myChart.setOption(areaChartOptions.value)\n }\n })\n }\n })\n }\n}\n// function selectChina() {\n// registerMap(adcode)\n// }\nasync function registerMap(keyword = '中国') {\n if (!myChart || myChart.isDisposed()) {\n return\n }\n\n myChart.showLoading()\n try {\n const geoJson = await getGeoJsonData({ adcode: keyword })\n if (!geoJson) {\n myChart.hideLoading() // 添加加载状态的清除\n return\n }\n currentGeoJson.value = geoJson\n adcode = keyword\n\n const result = echarts.registerMap(keyword, geoJson as any)\n myChart.hideLoading() // 添加加载状态的清除\n return result\n }\n catch (error) {\n console.log(error)\n myChart.hideLoading() // 添加加载状态的清除\n }\n}\nuseCharts({\n chartDOM: dataChartArea,\n chartOptions: areaChartOptions,\n chartData: computed(() => chartData),\n initAfter,\n callback: (chart) => {\n myChart = chart\n },\n})\n</script>\n\n<template>\n <div class=\"data-chart-area-wrap\">\n <!-- <el-select\n v-if=\"isShowSelect\"\n v-model=\"adcode\"\n class=\"city-select\"\n size=\"small\"\n @change=\"selectChina\"\n >\n <el-option\n v-for=\"item in selectList\"\n :key=\"item.value\"\n :label=\"item.label\"\n :value=\"item.value\"\n />\n </el-select> -->\n <div ref=\"dataChartArea\" class=\"data-chart-area\" />\n </div>\n</template>\n\n<style scoped lang=\"scss\">\n.data-chart-area-wrap {\n position: relative;\n\n .city-select {\n position: absolute;\n top: 10px;\n right: 100px;\n z-index: 1;\n width: 120px;\n }\n\n .data-chart-area {\n height: 100%;\n }\n}\n</style>\n"],"names":["merge","inject","InjectionChartMerge","v","adcode","currentGeoJson","ref","features","type","dataChartArea","myChart","areaChartOptions","computed","xGroupByDesc","groupByDesc","colDesc","modelName","data","__props","chartData","allNums","forEach","item","dataItem","push","Number","config","title","text","tooltip","formatter","params","res","name","series","colDescItem","value","includes","visualMap","min","Math","max","map","seriesData","row","find","arr","sourceName","properties","key","chartOptions","async","registerMap","keyword","isDisposed","showLoading","geoJson","getGeoJsonData","hideLoading","result","echarts","error","console","log","useCharts","chartDOM","initAfter","getZr","on","target","flag","some","then","setOption","callback","chart"],"mappings":"kpBA+BA,MAAMA,EAAQC,EAAOC,GAAsBC,GAAWA,IAAG,GAEzD,IAAIC,EAAS,KACb,MAAMC,EAAiBC,EAAa,CAClCC,SAAU,GACVC,KAAM,sBAEFC,EAAgBH,EAAI,MAC1B,IAAII,EAA0B,KAExB,MAAAC,EAAmBC,GAAwB,KAC/C,MAAMC,aAAEA,EAAcC,YAAAA,EAAAC,QAAaA,YAASC,EAAWC,KAAAA,GAASC,EAAAC,UAC1DC,EAAoB,GAClBL,EAAAM,SAASC,IACVL,EAAAI,SAASE,IACZH,EAAQI,KAAKC,OAAOF,EAASD,IAAM,GACpC,IAEH,MAAMI,EAAS,CACbC,MAAO,CACLC,KAAMZ,GAERa,QAAS,CACP,SAAAC,CAAUC,GACJ,IAAAC,EAAM,GAAGD,EAAOE,YAWb,OAVAP,EAAA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e+B,MAAQoB,EACdpD,EAAAiD,EAET,MAAMM,EAASC,EAAQR,YAAYC,EAASG,GAErC,OADP9C,EAAQgD,cACDC,QAEFE,GACLC,QAAQC,IAAIF,GACZnD,EAAQgD,aAAY,CAnBpB,CAoBF,QAEQM,EAAA,CACRC,SAAUxD,EACVyC,aAAcvC,EACdQ,UAAWP,GAAS,IAAMM,EAAAC,YAC1B+C,UAtDFf,uBACQC,IAEF1C,IAAYA,EAAQ4C,eAEtB5C,EAAQyD,SAASC,GAAG,SAAUrC,IACvBA,EAAOsC,QAAqB,OAAXjE,GACpBgD,EAAY,KAAI,IAGZ1C,EAAA0D,GAAG,SAAUrC,IACb,MAAAuC,EAAOpD,EAASC,UAACL,aAAayD,MAAajD,GAAiB,UAAjBA,EAAKP,UAEvC,OAAXX,GAAmBkE,GACrBlB,EAAYrB,EAAOE,MAAMuC,MAAK,KACxB9D,IAAYA,EAAQ4C,cACd5C,EAAA+D,UAAU9D,EAAiByB,MAAK,GAE3C,IAGP,EAkCAsC,SAAWC,IACCjE,EAAAiE,CAAA"}
1
+ {"version":3,"file":"area.vue2.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/area.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ECharts } from 'echarts/types/dist/echarts'\nimport type { EChartsOption, GeoJson, IFormatPublicData } from '../types'\nimport * as echarts from 'echarts'\nimport { getGeoJsonData } from '../utils/config'\nimport { InjectionChartMerge } from '../utils/injectionKeys'\nimport { useCharts } from '../utils/useCharts'\n\ndefineOptions({\n name: 'DataChartArea',\n})\n\nconst {\n chartOptions,\n chartData = {\n colDesc: [],\n xGroupByDesc: {\n colDesc: '',\n groupByDesc: '',\n groupByValues: [],\n xAxis: false,\n },\n groupByDesc: [],\n data: [],\n modelName: '',\n },\n} = defineProps<{\n chartOptions: EChartsOption\n chartData?: IFormatPublicData\n}>()\n\nconst merge = inject(InjectionChartMerge, (v: any) => v, true)\n\nlet adcode = '中国'\nconst currentGeoJson = ref<GeoJson>({\n features: [],\n type: 'FeatureCollection',\n})\nconst dataChartArea = ref(null)\nlet myChart: ECharts | null = null\n\nconst areaChartOptions = computed<EChartsOption>(() => {\n const { xGroupByDesc, groupByDesc, colDesc, modelName, data } = chartData\n const allNums: number[] = []\n colDesc.forEach((item) => {\n data.forEach((dataItem) => {\n allNums.push(Number(dataItem[item]))\n })\n })\n const config = {\n title: {\n text: modelName,\n },\n tooltip: {\n formatter(params: { name: string }) {\n let res = `${params.name}<br/>`\n config.series?.forEach((colDescItem) => {\n colDescItem.data?.forEach((item) => {\n if (item.name === params.name) {\n res += `${colDescItem.name}:${item.value}</br>`\n }\n })\n if (!res.includes(colDescItem.name)) {\n res += `${colDescItem.name}:-</br>`\n }\n })\n return res\n },\n },\n visualMap: {\n min: Math.min(...allNums, 0),\n max: Math.max(...allNums, 0),\n },\n series: colDesc?.map((colDescItem) => {\n const seriesData = []\n const row = groupByDesc.find(item => item.colDesc === (adcode === '中国' ? '医院所在省' : '医院所在市'))\n // 先用省份数据,如果没有再用市级数据\n\n const arr: {\n [key: string]: number\n } = {}\n data.map((item) => {\n const sourceName = item[(adcode === '中国' ? (xGroupByDesc?.colDesc || '') : row?.colDesc) || '']\n const find = currentGeoJson.value.features?.find(({ properties: { name } }: { properties: { name?: string } }) => name?.includes(sourceName as string))\n return {\n name: find?.properties?.name || '',\n value: Number(item[colDescItem]),\n }\n }).forEach((item) => {\n if (!arr[item.name]) {\n arr[item.name] = item.value\n }\n else {\n arr[item.name] = arr[item.name] + item.value\n }\n })\n for (const key in arr) {\n seriesData.push({\n name: key,\n value: arr[key],\n })\n }\n return {\n name: colDescItem,\n type: 'map',\n map: adcode,\n data: seriesData,\n }\n }),\n }\n\n return merge(config, chartOptions)\n})\n\nasync function initAfter() {\n await registerMap()\n // 添加判断,确保图表实例存在且未被销毁\n if (myChart && !myChart.isDisposed()) {\n // charts 监听事件\n myChart.getZr()?.on('click', (params: { target: HTMLElement }) => {\n if (!params.target && adcode !== '中国') {\n registerMap('中国')\n }\n })\n myChart.on('click', (params: { name: string }) => {\n const flag = chartData.groupByDesc?.some(item => item.colDesc === '医院所在市')\n\n if (adcode === '中国' && flag) {\n registerMap(params.name).then(() => {\n if (myChart && !myChart.isDisposed()) {\n myChart.setOption(areaChartOptions.value)\n }\n })\n }\n })\n }\n}\n// function selectChina() {\n// registerMap(adcode)\n// }\nasync function registerMap(keyword = '中国') {\n if (!myChart || myChart.isDisposed()) {\n return\n }\n\n myChart.showLoading()\n try {\n const geoJson = await getGeoJsonData({ adcode: keyword })\n if (!geoJson) {\n myChart.hideLoading() // 添加加载状态的清除\n return\n }\n currentGeoJson.value = geoJson\n adcode = keyword\n\n const result = echarts.registerMap(keyword, geoJson as any)\n myChart.hideLoading() // 添加加载状态的清除\n return result\n }\n catch (error) {\n console.log(error)\n myChart.hideLoading() // 添加加载状态的清除\n }\n}\nuseCharts({\n chartDOM: dataChartArea,\n chartOptions: areaChartOptions,\n chartData: computed(() => chartData),\n initAfter,\n callback: (chart) => {\n myChart = chart\n },\n})\n</script>\n\n<template>\n <div class=\"data-chart-area-wrap\">\n <!-- <el-select\n v-if=\"isShowSelect\"\n v-model=\"adcode\"\n class=\"city-select\"\n size=\"small\"\n @change=\"selectChina\"\n >\n <el-option\n v-for=\"item in selectList\"\n :key=\"item.value\"\n :label=\"item.label\"\n :value=\"item.value\"\n />\n </el-select> -->\n <div\n ref=\"dataChartArea\"\n class=\"data-chart-area\"\n />\n </div>\n</template>\n\n<style scoped lang=\"scss\">\n.data-chart-area-wrap {\n position: relative;\n\n .city-select {\n position: absolute;\n top: 10px;\n right: 100px;\n z-index: 1;\n width: 120px;\n }\n\n .data-chart-area {\n height: 100%;\n }\n}\n</style>\n"],"names":["merge","inject","InjectionChartMerge","v","adcode","currentGeoJson","ref","features","type","dataChartArea","myChart","areaChartOptions","computed","xGroupByDesc","groupByDesc","colDesc","modelName","data","__props","chartData","allNums","forEach","item","dataItem","push","Number","config","title","text","tooltip","formatter","params","res","name","series","colDescItem","value","includes","visualMap","min","Math","max","map","seriesData","row","find","arr","sourceName","properties","key","chartOptions","async","registerMap","keyword","isDisposed","showLoading","geoJson","getGeoJsonData","hideLoading","result","echarts","error","console","log","useCharts","chartDOM","initAfter","getZr","on","target","flag","some","then","setOption","callback","chart"],"mappings":"kpBA+BA,MAAMA,EAAQC,EAAOC,GAAsBC,GAAWA,IAAG,GAEzD,IAAIC,EAAS,KACb,MAAMC,EAAiBC,EAAa,CAClCC,SAAU,GACVC,KAAM,sBAEFC,EAAgBH,EAAI,MAC1B,IAAII,EAA0B,KAExB,MAAAC,EAAmBC,GAAwB,KAC/C,MAAMC,aAAEA,EAAcC,YAAAA,EAAAC,QAAaA,YAASC,EAAWC,KAAAA,GAASC,EAAAC,UAC1DC,EAAoB,GAClBL,EAAAM,SAASC,IACVL,EAAAI,SAASE,IACZH,EAAQI,KAAKC,OAAOF,EAASD,IAAM,GACpC,IAEH,MAAMI,EAAS,CACbC,MAAO,CACLC,KAAMZ,GAERa,QAAS,CACP,SAAAC,CAAUC,GACJ,IAAAC,EAAM,GAAGD,EAAOE,YAWb,OAVAP,EAAAQ,QAAQb,SAASc,IACVA,EAAAlB,MAAMI,SAASC,IACrBA,EAAKW,OAASF,EAAOE,OACvBD,GAAO,GAAGG,EAAYF,QAAQX,EAAKc,aAAK,IAGvCJ,EAAIK,SAASF,EAAYF,QACrBD,GAAA,GAAGG,EAAYF,cAAI,IAGvBD,CAAA,GAGXM,UAAW,CACTC,IAAKC,KAAKD,OAAOnB,EAAS,GAC1BqB,IAAKD,KAAKC,OAAOrB,EAAS,IAE5Bc,OAAQnB,GAAS2B,KAAKP,IACpB,MAAMQ,EAAa,GACbC,EAAM9B,EAAY+B,MAAKvB,GAAQA,EAAKP,WAAwB,OAAXX,EAAkB,QAAU,WAG7E0C,EAEF,CAAC,EACA7B,EAAAyB,KAAKpB,IACF,MAAAyB,EAAazB,GAAiB,OAAXlB,EAAmBS,GAAcE,SAAW,GAAM6B,GAAK7B,UAAY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,MAAK,KACxB9D,IAAYA,EAAQ4C,cACd5C,EAAA+D,UAAU9D,EAAiByB,MAAK,GAE3C,IAGP,EAkCAsC,SAAWC,IACCjE,EAAAiE,CAAA"}
@@ -1,2 +1,2 @@
1
- import{defineComponent as e,inject as a,ref as t,computed as s,createElementBlock as r,openBlock as o}from"vue";import{uniq as c}from"lodash-es";import{InjectionChartMerge as l}from"../utils/injectionKeys.mjs";import{useCharts as i}from"../utils/useCharts.mjs";var u=e({name:"DataChartBar",__name:"bar",props:{chartData:{type:Object,required:!0,default:()=>({colDesc:[],xGroupByDesc:{colDesc:"",groupByDesc:"",groupByValues:[],xAxis:!1},groupByDesc:[],data:[],modelName:""})},subShowType:{type:String,required:!0,default:"bar-simple"},chartOptions:{type:null,required:!0}},setup(e){const u=a(l,(e=>e),!0),p=t(null),n=s((()=>{const{colDesc:a,xGroupByDesc:t,groupByDesc:s,data:r=[],modelName:o}=e.chartData,l=Array.from(new Set(r.map((e=>e[t.colDesc||""])))).filter((e=>null!=e))||[],i=s.find((e=>!e.xAxis))||{groupByValues:[],colDesc:""};i.groupByValues=c(r.map((e=>i.colDesc?String(e[i.colDesc]):""))),t&&t.groupByValues&&(t.groupByValues=c(r.map((e=>t.colDesc?String(e[t.colDesc]):""))));const p={title:{text:o},xAxis:{name:"",type:"category",axisLabel:{interval:0,formatter:e=>e.length>5?`${e.substring(0,5)}...`:e},data:l},yAxis:{type:"value"},legend:{data:[]},dataZoom:[{type:"inside",disabled:l.length<15}]};if(1===s.length)p.series=a.map((e=>({name:e,data:r.map((a=>a[e])),type:"bar",emphasis:{focus:"series"},label:{show:!0,position:"inside"}}))),p.legend.data=a;else if(2===s.length){const e=a.map((e=>i.groupByValues?.map((a=>{const s={name:`${a||"/"}-${e}`,type:"bar",stack:e,emphasis:{focus:"series"},data:[],label:{show:!0,position:"inside"}};return s.data=(t.groupByValues||[]).map((e=>{let o=null;return r.forEach((r=>{i.colDesc&&r[i.colDesc]===a&&t.colDesc&&r[t.colDesc]===e&&s.stack&&(o=r[s.stack]??null)})),o||""})).filter((e=>""!==e)),s}))||[])).flat();p.series=e,delete p.legend}function n(e,a,t,s){Array.isArray(e)?e.forEach((e=>{e&&(e.type=a,"category"===a&&(e.data=t||[],e.name=s||""))})):e&&(e.type=a,"category"===a&&(e.data=t||[],e.name=s||""))}switch(e.subShowType){case"bar-simple":case"default":n(p.xAxis,"category",l,t.colDesc||""),n(p.yAxis,"value");break;case"bar-y-category":n(p.xAxis,"value"),n(p.yAxis,"category",l,t.colDesc||"")}return u(p,e.chartOptions)}));return i({chartDOM:p,chartOptions:n,chartData:s((()=>e.chartData))}),(e,a)=>(o(),r("div",{ref_key:"dataChartBar",ref:p,class:"data-chart-bar"},null,512))}});export{u as default};
1
+ import{defineComponent as e,inject as a,ref as t,computed as s,createElementBlock as r,openBlock as l}from"vue";import{uniq as o}from"lodash-es";import{InjectionChartMerge as c}from"../utils/injectionKeys.mjs";import{useCharts as i}from"../utils/useCharts.mjs";var n=e({name:"DataChartBar",__name:"bar",props:{chartData:{type:Object,required:!0},subShowType:{type:String,required:!0,default:"bar-simple"},chartOptions:{type:null,required:!0}},setup(e){const n=a(c,(e=>e),!0),p=t(null),u=s((()=>{const{colDesc:a,xGroupByDesc:t,groupByDesc:s,data:r=[],modelName:l}=e.chartData,c=Array.from(new Set(r.map((e=>e[t.colDesc||""])))).filter((e=>null!=e))||[],i=s.find((e=>!e.xAxis))||{groupByValues:[],colDesc:""};i.groupByValues=o(r.map((e=>i.colDesc?String(e[i.colDesc]):""))),t&&t.groupByValues&&(t.groupByValues=o(r.map((e=>t.colDesc?String(e[t.colDesc]):""))));const p={title:{text:l},xAxis:{name:"",type:"category",axisLabel:{interval:0,formatter:e=>e.length>5?`${e.substring(0,5)}...`:e},data:c},yAxis:{type:"value"},legend:{data:[]},dataZoom:[{type:"inside",disabled:c.length<15}]};if(1===s.length)p.series=a.map((e=>({name:e,data:r.map((a=>a[e])),type:"bar",emphasis:{focus:"series"},label:{show:!0,position:"inside"}}))),p.legend.data=a;else if(2===s.length){const e=a.map((e=>i.groupByValues?.map((a=>{const s={name:`${a||"/"}-${e}`,type:"bar",stack:e,emphasis:{focus:"series"},data:[],label:{show:!0,position:"inside"}};return s.data=(t.groupByValues||[]).map((e=>{let l=null;return r.forEach((r=>{i.colDesc&&r[i.colDesc]===a&&t.colDesc&&r[t.colDesc]===e&&s.stack&&(l=r[s.stack]??null)})),l||""})).filter((e=>""!==e)),s}))||[])).flat();p.series=e,delete p.legend}function u(e,a,t,s){Array.isArray(e)?e.forEach((e=>{e&&(e.type=a,"category"===a&&(e.data=t||[],e.name=s||""))})):e&&(e.type=a,"category"===a&&(e.data=t||[],e.name=s||""))}switch(e.subShowType){case"bar-simple":case"default":u(p.xAxis,"category",c,t.colDesc||""),u(p.yAxis,"value");break;case"bar-y-category":u(p.xAxis,"value"),u(p.yAxis,"category",c,t.colDesc||"")}return n(p,e.chartOptions)}));return i({chartDOM:p,chartOptions:u,chartData:s((()=>e.chartData))}),(e,a)=>(l(),r("div",{ref_key:"dataChartBar",ref:p,class:"data-chart-bar"},null,512))}});export{n as default};
2
2
  //# sourceMappingURL=bar.vue.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"bar.vue.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/bar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { LegendComponentOption, XAXisComponentOption, YAXisComponentOption } from 'echarts'\nimport type {\n EChartData,\n EChartsOption,\n IFormatPublicData,\n SeriesOption,\n} from '../types'\nimport { uniq } from 'lodash-es'\nimport { InjectionChartMerge } from '../utils/injectionKeys'\nimport { useCharts } from '../utils/useCharts'\n\n// 定义组件名称\ndefineOptions({\n name: 'DataChartBar',\n})\n\n// 定义组件属性\nconst {\n chartOptions,\n chartData = {\n colDesc: [],\n xGroupByDesc: {\n colDesc: '',\n groupByDesc: '',\n groupByValues: [],\n xAxis: false,\n },\n groupByDesc: [],\n data: [],\n modelName: '',\n },\n subShowType = 'bar-simple',\n} = defineProps<{\n chartData: IFormatPublicData\n subShowType: string\n chartOptions: EChartsOption\n}>()\n\n// 注入合并函数,并明确类型\nconst merge = inject(InjectionChartMerge, (v: any) => v, true) as (config: EChartsOption, chartOptions: EChartsOption) => EChartsOption\nconst dataChartBar = ref<HTMLElement | null>(null)\n\n// 计算图表选项\nconst barChartOptions = computed<EChartsOption>(() => {\n const { colDesc, xGroupByDesc, groupByDesc, data = [], modelName } = chartData\n\n const axisData = Array.from(new Set(data.map(item => item[xGroupByDesc.colDesc || '']))).filter(item => item !== undefined && item !== null) || []\n const yGroupByDesc: EChartData['desc']['groupByDesc'][0] = groupByDesc.find(item => !item.xAxis) || {\n groupByDesc: null,\n groupByValues: [],\n colDesc: '',\n xAxis: false,\n }\n\n yGroupByDesc.groupByValues = uniq(data.map(item => yGroupByDesc.colDesc ? String(item[yGroupByDesc.colDesc]) : ''))\n if (xGroupByDesc && xGroupByDesc.groupByValues) {\n xGroupByDesc.groupByValues = uniq(data.map(item => xGroupByDesc.colDesc ? String(item[xGroupByDesc.colDesc]) : ''))\n }\n\n const config: EChartsOption = {\n title: {\n text: modelName,\n },\n xAxis: {\n name: '',\n type: 'category',\n axisLabel: {\n interval: 0, // 强制显示所有标签\n formatter(value: string) {\n const screenshotLength = 5\n return value.length > screenshotLength ? `${value.substring(0, screenshotLength)}...` : value // 截取前5个字符并添加省略号\n },\n },\n data: axisData,\n },\n yAxis: {\n type: 'value',\n },\n legend: {\n data: [],\n },\n dataZoom: [{\n type: 'inside',\n disabled: axisData.length < 15,\n }],\n }\n\n // 堆叠图\n if (groupByDesc.length === 1) {\n config.series = colDesc.map((yItem) => {\n return {\n name: yItem,\n data: data.map(item => item[yItem]),\n type: 'bar',\n emphasis: {\n focus: 'series',\n },\n label: {\n show: true,\n position: 'inside',\n },\n }\n });\n (config.legend as LegendComponentOption).data = colDesc\n }\n else if (groupByDesc.length === 2) {\n const arr = colDesc.map((colDescItem) => {\n return yGroupByDesc.groupByValues?.map((yGroupByDescItem) => {\n const obj: SeriesOption = {\n name: `${yGroupByDescItem || '/'}-${colDescItem}`,\n type: 'bar',\n stack: colDescItem,\n emphasis: {\n focus: 'series',\n },\n data: [],\n label: {\n show: true,\n position: 'inside',\n },\n }\n obj.data = (xGroupByDesc.groupByValues || []).map((xGroupByDescItem) => {\n let targetVal: number | string | null = null\n data.forEach((item) => {\n if (yGroupByDesc.colDesc && item[yGroupByDesc.colDesc] === yGroupByDescItem && xGroupByDesc.colDesc && item[xGroupByDesc.colDesc] === xGroupByDescItem) {\n if (obj.stack) {\n targetVal = item[obj.stack] ?? null\n }\n }\n })\n return targetVal || ''\n }).filter(v => v !== '')\n return obj\n }) || []\n }).flat()\n\n config.series = arr\n delete config.legend\n }\n\n // 1. 定义轴类型\n type CategoryAxisOption = XAXisComponentOption & {\n type: 'category'\n data: (string | number)[]\n }\n\n // 2. 创建配置轴的辅助函数\n function configureAxis(\n axis: XAXisComponentOption | XAXisComponentOption[] | YAXisComponentOption | YAXisComponentOption[] | undefined,\n type: 'category' | 'value',\n data?: (string | number)[],\n name?: string,\n ) {\n if (Array.isArray(axis)) {\n axis.forEach((item) => {\n if (item) {\n item.type = type\n if (type === 'category') {\n (item as CategoryAxisOption).data = data || []\n item.name = name || ''\n }\n }\n })\n }\n else if (axis) {\n axis.type = type\n if (type === 'category') {\n (axis as CategoryAxisOption).data = data || []\n axis.name = name || ''\n }\n }\n }\n\n // 3. 使用配置函数\n switch (subShowType) {\n case 'bar-simple':\n case 'default':\n configureAxis(config.xAxis, 'category', axisData, xGroupByDesc.colDesc || '')\n configureAxis(config.yAxis, 'value')\n break\n\n case 'bar-y-category':\n configureAxis(config.xAxis, 'value')\n configureAxis(config.yAxis, 'category', axisData, xGroupByDesc.colDesc || '')\n break\n }\n\n return merge(config, chartOptions)\n})\n\nuseCharts({ chartDOM: dataChartBar, chartOptions: barChartOptions, chartData: computed(() => chartData) })\n</script>\n\n<template>\n <div ref=\"dataChartBar\" class=\"data-chart-bar\" />\n</template>\n"],"names":["merge","inject","InjectionChartMerge","v","dataChartBar","ref","barChartOptions","computed","colDesc","xGroupByDesc","groupByDesc","data","modelName","__props","chartData","axisData","Array","from","Set","map","item","filter","yGroupByDesc","find","xAxis","groupByValues","uniq","String","config","title","text","name","type","axisLabel","interval","formatter","value","length","substring","yAxis","legend","dataZoom","disabled","series","yItem","emphasis","focus","label","show","position","arr","colDescItem","yGroupByDescItem","obj","stack","xGroupByDescItem","targetVal","forEach","flat","configureAxis","axis","isArray","subShowType","chartOptions","useCharts","chartDOM"],"mappings":"skBAwCA,MAAMA,EAAQC,EAAOC,GAAsBC,GAAWA,IAAG,GACnDC,EAAeC,EAAwB,MAGvCC,EAAkBC,GAAwB,KACxC,MAAAC,QAAEA,eAASC,EAAcC,YAAAA,EAAAC,KAAaA,EAAO,GAACC,UAAGA,GAAcC,EAAAC,UAE/DC,EAAWC,MAAMC,KAAK,IAAIC,IAAIP,EAAKQ,KAAYC,GAAAA,EAAKX,EAAaD,SAAW,QAAOa,QAAOD,GAAQA,WAAwC,GAC1IE,EAAqDZ,EAAYa,UAAcH,EAAKI,SAAU,CAElGC,cAAe,GACfjB,QAAS,IAIXc,EAAaG,cAAgBC,EAAKf,EAAKQ,QAAYG,EAAad,QAAUmB,OAAOP,EAAKE,EAAad,UAAY,MAC3GC,GAAgBA,EAAagB,gBAC/BhB,EAAagB,cAAgBC,EAAKf,EAAKQ,QAAYV,EAAaD,QAAUmB,OAAOP,EAAKX,EAAaD,UAAY,OAGjH,MAAMoB,EAAwB,CAC5BC,MAAO,CACLC,KAAMlB,GAERY,MAAO,CACLO,KAAM,GACNC,KAAM,WACNC,UAAW,CACTC,SAAU,EACVC,UAAUC,GAEDA,EAAMC,OADY,EACgB,GAAGD,EAAME,UAAU,EADnC,QAC+DF,GAG5FzB,KAAMI,GAERwB,MAAO,CACLP,KAAM,SAERQ,OAAQ,CACN7B,KAAM,IAER8B,SAAU,CAAC,CACTT,KAAM,SACNU,SAAU3B,EAASsB,OA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/B,EAAOJ,MAAO,WAAYT,EAAUN,EAAaD,SAAW,IAC5DmD,EAAA/B,EAAOW,MAAO,SAC5B,MAEF,IAAK,iBACWoB,EAAA/B,EAAOJ,MAAO,SAC5BmC,EAAc/B,EAAOW,MAAO,WAAYxB,EAAUN,EAAaD,SAAW,IAIvE,OAAAR,EAAM4B,EAAQf,EAAYkD,aAAA,WAGzBC,EAAA,CAAEC,SAAU7D,EAAc2D,aAAczD,EAAiBQ,UAAWP,GAAS,IAAMM,EAAAC"}
1
+ {"version":3,"file":"bar.vue.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/bar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { LegendComponentOption, XAXisComponentOption, YAXisComponentOption } from 'echarts'\nimport type {\n EChartData,\n EChartsOption,\n IFormatPublicData,\n SeriesOption,\n} from '../types'\nimport { uniq } from 'lodash-es'\nimport { InjectionChartMerge } from '../utils/injectionKeys'\nimport { useCharts } from '../utils/useCharts'\n\n// 定义组件名称\ndefineOptions({\n name: 'DataChartBar',\n})\n\n// 定义组件属性\nconst {\n chartOptions,\n chartData,\n subShowType = 'bar-simple',\n} = defineProps<{\n chartData: IFormatPublicData\n subShowType: string\n chartOptions: EChartsOption\n}>()\n\n// 注入合并函数,并明确类型\nconst merge = inject(InjectionChartMerge, (v: any) => v, true) as (config: EChartsOption, chartOptions: EChartsOption) => EChartsOption\nconst dataChartBar = ref<HTMLElement | null>(null)\n\n// 计算图表选项\nconst barChartOptions = computed<EChartsOption>(() => {\n const { colDesc, xGroupByDesc, groupByDesc, data = [], modelName } = chartData\n\n const axisData = Array.from(new Set(data.map(item => item[xGroupByDesc.colDesc || '']))).filter(item => item !== undefined && item !== null) || []\n const yGroupByDesc: EChartData['desc']['groupByDesc'][0] = groupByDesc.find(item => !item.xAxis) || {\n groupByDesc: null,\n groupByValues: [],\n colDesc: '',\n xAxis: false,\n }\n\n yGroupByDesc.groupByValues = uniq(data.map(item => yGroupByDesc.colDesc ? String(item[yGroupByDesc.colDesc]) : ''))\n if (xGroupByDesc && xGroupByDesc.groupByValues) {\n xGroupByDesc.groupByValues = uniq(data.map(item => xGroupByDesc.colDesc ? String(item[xGroupByDesc.colDesc]) : ''))\n }\n\n const config: EChartsOption = {\n title: {\n text: modelName,\n },\n xAxis: {\n name: '',\n type: 'category',\n axisLabel: {\n interval: 0, // 强制显示所有标签\n formatter(value: string) {\n const screenshotLength = 5\n return value.length > screenshotLength ? `${value.substring(0, screenshotLength)}...` : value // 截取前5个字符并添加省略号\n },\n },\n data: axisData,\n },\n yAxis: {\n type: 'value',\n },\n legend: {\n data: [],\n },\n dataZoom: [{\n type: 'inside',\n disabled: axisData.length < 15,\n }],\n }\n\n // 堆叠图\n if (groupByDesc.length === 1) {\n config.series = colDesc.map((yItem) => {\n return {\n name: yItem,\n data: data.map(item => item[yItem]),\n type: 'bar',\n emphasis: {\n focus: 'series',\n },\n label: {\n show: true,\n position: 'inside',\n },\n }\n });\n (config.legend as LegendComponentOption).data = colDesc\n }\n else if (groupByDesc.length === 2) {\n const arr = colDesc.map((colDescItem) => {\n return yGroupByDesc.groupByValues?.map((yGroupByDescItem) => {\n const obj: SeriesOption = {\n name: `${yGroupByDescItem || '/'}-${colDescItem}`,\n type: 'bar',\n stack: colDescItem,\n emphasis: {\n focus: 'series',\n },\n data: [],\n label: {\n show: true,\n position: 'inside',\n },\n }\n obj.data = (xGroupByDesc.groupByValues || []).map((xGroupByDescItem) => {\n let targetVal: number | string | null = null\n data.forEach((item) => {\n if (yGroupByDesc.colDesc && item[yGroupByDesc.colDesc] === yGroupByDescItem && xGroupByDesc.colDesc && item[xGroupByDesc.colDesc] === xGroupByDescItem) {\n if (obj.stack) {\n targetVal = item[obj.stack] ?? null\n }\n }\n })\n return targetVal || ''\n }).filter(v => v !== '')\n return obj\n }) || []\n }).flat()\n\n config.series = arr\n delete config.legend\n }\n\n // 1. 定义轴类型\n type CategoryAxisOption = XAXisComponentOption & {\n type: 'category'\n data: (string | number)[]\n }\n\n // 2. 创建配置轴的辅助函数\n function configureAxis(\n axis: XAXisComponentOption | XAXisComponentOption[] | YAXisComponentOption | YAXisComponentOption[] | undefined,\n type: 'category' | 'value',\n data?: (string | number)[],\n name?: string,\n ) {\n if (Array.isArray(axis)) {\n axis.forEach((item) => {\n if (item) {\n item.type = type\n if (type === 'category') {\n (item as CategoryAxisOption).data = data || []\n item.name = name || ''\n }\n }\n })\n }\n else if (axis) {\n axis.type = type\n if (type === 'category') {\n (axis as CategoryAxisOption).data = data || []\n axis.name = name || ''\n }\n }\n }\n\n // 3. 使用配置函数\n switch (subShowType) {\n case 'bar-simple':\n case 'default':\n configureAxis(config.xAxis, 'category', axisData, xGroupByDesc.colDesc || '')\n configureAxis(config.yAxis, 'value')\n break\n\n case 'bar-y-category':\n configureAxis(config.xAxis, 'value')\n configureAxis(config.yAxis, 'category', axisData, xGroupByDesc.colDesc || '')\n break\n }\n\n return merge(config, chartOptions)\n})\n\nuseCharts({ chartDOM: dataChartBar, chartOptions: barChartOptions, chartData: computed(() => chartData) })\n</script>\n\n<template>\n <div\n ref=\"dataChartBar\"\n class=\"data-chart-bar\"\n />\n</template>\n"],"names":["merge","inject","InjectionChartMerge","v","dataChartBar","ref","barChartOptions","computed","colDesc","xGroupByDesc","groupByDesc","data","modelName","__props","chartData","axisData","Array","from","Set","map","item","filter","yGroupByDesc","find","xAxis","groupByValues","uniq","String","config","title","text","name","type","axisLabel","interval","formatter","value","length","substring","yAxis","legend","dataZoom","disabled","series","yItem","emphasis","focus","label","show","position","arr","colDescItem","yGroupByDescItem","obj","stack","xGroupByDescItem","targetVal","forEach","flat","configureAxis","axis","isArray","subShowType","chartOptions","useCharts","chartDOM"],"mappings":"ocA6BA,MAAMA,EAAQC,EAAOC,GAAsBC,GAAWA,IAAG,GACnDC,EAAeC,EAAwB,MAGvCC,EAAkBC,GAAwB,KACxC,MAAAC,QAAEA,eAASC,EAAcC,YAAAA,EAAAC,KAAaA,EAAO,GAACC,UAAGA,GAAcC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EAAI1C,MAAQF,EAAagB,eAAiB,IAAIN,KAAKoC,IACjD,IAAIC,EAAoC,KAQxC,OAPK7C,EAAA8C,SAASrC,IACRE,EAAad,SAAWY,EAAKE,EAAad,WAAa4C,GAAoB3C,EAAaD,SAAWY,EAAKX,EAAaD,WAAa+C,GAChIF,EAAIC,QACME,EAAApC,EAAKiC,EAAIC,QAAU,KACjC,IAGGE,GAAa,EAAA,IACnBnC,QAAOlB,GAAW,KAANA,IACRkD,CAAA,KACH,KACLK,OAEH9B,EAAOe,OAASO,SACTtB,EAAOY,MAAA,CAUhB,SAASmB,EACPC,EACA5B,EACArB,EACAoB,GAEIf,MAAM6C,QAAQD,GACXA,EAAAH,SAASrC,IACRA,IACFA,EAAKY,KAAOA,EACC,aAATA,IACDZ,EAA4BT,KAAOA,GAAQ,GAC5CS,EAAKW,KAAOA,GAAQ,IACtB,IAIG6B,IACPA,EAAK5B,KAAOA,EACC,aAATA,IACD4B,EAA4BjD,KAAOA,GAAQ,GAC5CiD,EAAK7B,KAAOA,GAAQ,IAExB,CAIF,OAAQlB,EAAWiD,aACjB,IAAK,aACL,IAAK,UACHH,EAAc/B,EAAOJ,MAAO,WAAYT,EAAUN,EAAaD,SAAW,IAC5DmD,EAAA/B,EAAOW,MAAO,SAC5B,MAEF,IAAK,iBACWoB,EAAA/B,EAAOJ,MAAO,SAC5BmC,EAAc/B,EAAOW,MAAO,WAAYxB,EAAUN,EAAaD,SAAW,IAIvE,OAAAR,EAAM4B,EAAQf,EAAYkD,aAAA,WAGzBC,EAAA,CAAEC,SAAU7D,EAAc2D,aAAczD,EAAiBQ,UAAWP,GAAS,IAAMM,EAAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"card.vue2.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/card.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { PropType } from 'vue'\nimport type { EChartData, IFormatPublicData } from '../types'\nimport Empty from './empty.vue'\n\ndefineOptions({\n name: 'DataChartCard',\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\nfunction cardTitle(dataItem: EChartData['data'][0]) {\n const colDesc = props.chartData.xGroupByDesc?.colDesc || ''\n\n return colDesc ? (colDesc + dataItem[colDesc]) : ''\n}\n</script>\n\n<template>\n <div class=\"data-chart-card\">\n <p v-if=\"chartData.groupByDesc.length\" class=\"title\">\n {{ chartData.modelName }}\n </p>\n <el-scrollbar v-show=\"chartData.data.length\" v-if=\"chartData.groupByDesc.length\">\n <div :class=\"{ 'data-chart-card-grid-layout': chartData.groupByDesc.length }\">\n <div\n v-for=\"(dataItem, dataIndex) in chartData.data\"\n :key=\"dataIndex\"\n class=\"card-item\"\n >\n <div class=\"card-title\" :title=\"cardTitle(dataItem)\">\n {{ cardTitle(dataItem) }}\n </div>\n <div class=\"context\">\n <span v-for=\"(item, index) in chartData.colDesc\" :key=\"item\">\n {{ `${item}: ` || '-' }}<strong>{{ dataItem[item] || '-' }}</strong> {{ index === chartData.colDesc.length - 1 ? '' : ',' }}\n </span>\n </div>\n <div class=\"suffix-icon\">\n {{ dataIndex + 1 }}\n </div>\n </div>\n </div>\n </el-scrollbar>\n <div v-else class=\"data-chart-card-wrap\">\n <div\n v-for=\"(dataItem, dataIndex) in chartData.data\"\n :key=\"dataIndex\"\n class=\"card-item\"\n >\n <div class=\"card-title\" :title=\"chartData.modelName\">\n {{ chartData.modelName }}\n </div>\n <div class=\"context\">\n <span v-for=\"(item, index) in chartData.colDesc\" :key=\"item\">\n <template v-if=\"dataItem\">\n {{ `${item}: ` || '-' }}<strong>{{ dataItem[item] || '-' }}</strong> {{ index === chartData.colDesc.length - 1 ? '' : ',' }}\n </template>\n </span>\n </div>\n </div>\n </div>\n <Empty v-show=\"!chartData.data.length\" />\n </div>\n</template>\n\n<style scoped lang=\"scss\">\n.data-chart-card {\n display: flex;\n flex-direction: column;\n\n .title {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 5px;\n margin-top: 2px;\n margin-bottom: 7px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: bolder;\n color: #464646;\n }\n\n .data-chart-card-grid-layout {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));\n gap: 10px;\n width: calc(100% - 3px);\n }\n\n .data-chart-card-wrap {\n height: 100% !important;\n\n .card-item {\n width: 100% !important;\n }\n }\n\n .card-item {\n position: relative;\n background-image: url(\"./data-chart-card-bg-left.svg\"), url(\"./data-chart-card-bg-right.svg\");\n background-repeat: no-repeat;\n background-position: left top, right top;\n background-size: contain, contain;\n border: 2px solid #2196f3;\n border-radius: 6px;\n\n .suffix-icon {\n position: absolute;\n right: 1px;\n bottom: calc(25% - 14px);\n width: 20px;\n font-size: 20px;\n font-weight: bold;\n color: #fff;\n text-align: center;\n }\n\n .card-title {\n padding-left: 15px;\n margin-top: 10px;\n margin-bottom: 5px;\n overflow: hidden;\n font-size: 16px;\n font-weight: bold;\n color: #2196f3;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .context {\n padding: 0 30px 10px 20px;\n font-size: 14px;\n color: #464646;\n }\n }\n}\n</style>\n"],"names":["props","__props","cardTitle","dataItem","colDesc","chartData","xGroupByDesc"],"mappings":"+yBASA,MAAMA,EAAQC,EAYd,SAASC,EAAUC,GACjB,MAAMC,EAAUJ,EAAMK,UAAUC,cAAcF,SAAW,GAEzD,OAAOA,EAAWA,EAAUD,EAASC,GAAY,EAAA"}
1
+ {"version":3,"file":"card.vue2.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/card.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { PropType } from 'vue'\nimport type { EChartData, IFormatPublicData } from '../types'\nimport Empty from './empty.vue'\n\ndefineOptions({\n name: 'DataChartCard',\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\nfunction cardTitle(dataItem: EChartData['data'][0]) {\n const colDesc = props.chartData.xGroupByDesc?.colDesc || ''\n\n return colDesc ? (colDesc + dataItem[colDesc]) : ''\n}\n</script>\n\n<template>\n <div class=\"data-chart-card\">\n <p\n v-if=\"chartData.groupByDesc.length\"\n class=\"title\"\n >\n {{ chartData.modelName }}\n </p>\n <el-scrollbar\n v-show=\"chartData.data.length\"\n v-if=\"chartData.groupByDesc.length\"\n >\n <div :class=\"{ 'data-chart-card-grid-layout': chartData.groupByDesc.length }\">\n <div\n v-for=\"(dataItem, dataIndex) in chartData.data\"\n :key=\"dataIndex\"\n class=\"card-item\"\n >\n <div\n class=\"card-title\"\n :title=\"cardTitle(dataItem)\"\n >\n {{ cardTitle(dataItem) }}\n </div>\n <div class=\"context\">\n <span\n v-for=\"(item, index) in chartData.colDesc\"\n :key=\"item\"\n >\n {{ `${item}: ` || '-' }}<strong>{{ dataItem[item] || '-' }}</strong> {{ index === chartData.colDesc.length - 1 ? '' : ',' }}\n </span>\n </div>\n <div class=\"suffix-icon\">\n {{ dataIndex + 1 }}\n </div>\n </div>\n </div>\n </el-scrollbar>\n <div\n v-else\n class=\"data-chart-card-wrap\"\n >\n <div\n v-for=\"(dataItem, dataIndex) in chartData.data\"\n :key=\"dataIndex\"\n class=\"card-item\"\n >\n <div\n class=\"card-title\"\n :title=\"chartData.modelName\"\n >\n {{ chartData.modelName }}\n </div>\n <div class=\"context\">\n <span\n v-for=\"(item, index) in chartData.colDesc\"\n :key=\"item\"\n >\n <template v-if=\"dataItem\">\n {{ `${item}: ` || '-' }}<strong>{{ dataItem[item] || '-' }}</strong> {{ index === chartData.colDesc.length - 1 ? '' : ',' }}\n </template>\n </span>\n </div>\n </div>\n </div>\n <Empty v-show=\"!chartData.data.length\" />\n </div>\n</template>\n\n<style scoped lang=\"scss\">\n.data-chart-card {\n display: flex;\n flex-direction: column;\n\n .title {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 5px;\n margin-top: 2px;\n margin-bottom: 7px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: bolder;\n color: #464646;\n }\n\n .data-chart-card-grid-layout {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));\n gap: 10px;\n width: calc(100% - 3px);\n }\n\n .data-chart-card-wrap {\n height: 100% !important;\n\n .card-item {\n width: 100% !important;\n }\n }\n\n .card-item {\n position: relative;\n background-image: url(\"./data-chart-card-bg-left.svg\"), url(\"./data-chart-card-bg-right.svg\");\n background-repeat: no-repeat;\n background-position: left top, right top;\n background-size: contain, contain;\n border: 2px solid #2196f3;\n border-radius: 6px;\n\n .suffix-icon {\n position: absolute;\n right: 1px;\n bottom: calc(25% - 14px);\n width: 20px;\n font-size: 20px;\n font-weight: bold;\n color: #fff;\n text-align: center;\n }\n\n .card-title {\n padding-left: 15px;\n margin-top: 10px;\n margin-bottom: 5px;\n overflow: hidden;\n font-size: 16px;\n font-weight: bold;\n color: #2196f3;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .context {\n padding: 0 30px 10px 20px;\n font-size: 14px;\n color: #464646;\n }\n }\n}\n</style>\n"],"names":["props","__props","cardTitle","dataItem","colDesc","chartData","xGroupByDesc"],"mappings":"+yBASA,MAAMA,EAAQC,EAYd,SAASC,EAAUC,GACjB,MAAMC,EAAUJ,EAAMK,UAAUC,cAAcF,SAAW,GAEzD,OAAOA,EAAWA,EAAUD,EAASC,GAAY,EAAA"}
@@ -1,2 +1,2 @@
1
- var t="data:image/svg+xml,%3Csvg%20width%3D%2264%22%20height%3D%2241%22%20viewBox%3D%220%200%2064%2041%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%20%3Cg%20transform%3D%22translate%280%201%29%22%20fill%3D%22none%22%20fillRule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%20%20%3Cpath%20%20%20%20%20%20%20%20d%3D%22M25%2024h14M25%2028h14M25%2032h14%22%20%20%20%20%20%20%20%20stroke%3D%22%23E8E8E8%22%20%20%20%20%20%20%20%20strokeLinecap%3D%22round%22%20%20%20%20%20%20%20%20strokeWidth%3D%221.5%22%20%20%20%20%20%20%2F%3E%20%20%20%20%3C%2Fg%3E%20%20%3C%2Fg%3E%3C%2Fsvg%3E";export{t as default};
1
+ var D="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2264%22%20height%3D%2241%22%3E%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20transform%3D%22translate%280%201%29%22%3E%20%20%20%20%3Cellipse%20cx%3D%2232%22%20cy%3D%2233%22%20fill%3D%22%23F5F5F5%22%20rx%3D%2232%22%20ry%3D%227%22%20%2F%3E%20%20%20%20%3Cg%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%3Cpath%20fill%3D%22%23FAFAFA%22%20stroke%3D%22%23D9D9D9%22%20%20%20%20%20%20%20%20%20%20%20%20d%3D%22M55%2012.76%2044.854%201.258C44.367.474%2043.656%200%2042.907%200H21.093c-.749%200-1.46.474-1.947%201.257L9%2012.761V22h46v-9.24z%22%20%2F%3E%20%20%20%20%20%20%3Cpath%20fill%3D%22%23FFF%22%20stroke%3D%22%23D9D9D9%22%20%20%20%20%20%20%20%20%20%20%20%20d%3D%22M41.613%2015.931c0-1.605.994-2.93%202.227-2.931H55v18.137C55%2033.26%2053.68%2035%2052.05%2035h-40.1C10.32%2035%209%2033.259%209%2031.137V13h11.16c1.233%200%202.227%201.323%202.227%202.928v.022c0%201.605%201.005%202.901%202.237%202.901h14.752c1.232%200%202.237-1.308%202.237-2.913v-.007z%22%20%2F%3E%20%20%20%20%20%20%3Cpath%20stroke%3D%22%23E8E8E8%22%20stroke-linecap%3D%22round%22%20stroke-width%3D%221.5%22%20d%3D%22M25%2024h14m-14%204h14m-14%204h14%22%20%2F%3E%20%20%20%20%3C%2Fg%3E%20%20%3C%2Fg%3E%3C%2Fsvg%3E";export{D as default};
2
2
  //# sourceMappingURL=empty.svg.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"empty.svg.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/empty.svg"],"sourcesContent":["export default \"data:image/svg+xml,%3Csvg%20width%3D%2264%22%20height%3D%2241%22%20viewBox%3D%220%200%2064%2041%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%20%3Cg%20transform%3D%22translate%280%201%29%22%20fill%3D%22none%22%20fillRule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%20%20%3Cpath%20%20%20%20%20%20%20%20d%3D%22M25%2024h14M25%2028h14M25%2032h14%22%20%20%20%20%20%20%20%20stroke%3D%22%23E8E8E8%22%20%20%20%20%20%20%20%20strokeLinecap%3D%22round%22%20%20%20%20%20%20%20%20strokeWidth%3D%221.5%22%20%20%20%20%20%20%2F%3E%20%20%20%20%3C%2Fg%3E%20%20%3C%2Fg%3E%3C%2Fsvg%3E\""],"names":["emptyIcon"],"mappings":"AAAA,IAAeA,EAAA"}
1
+ {"version":3,"file":"empty.svg.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/empty.svg"],"sourcesContent":["export default \"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2264%22%20height%3D%2241%22%3E%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20transform%3D%22translate%280%201%29%22%3E%20%20%20%20%3Cellipse%20cx%3D%2232%22%20cy%3D%2233%22%20fill%3D%22%23F5F5F5%22%20rx%3D%2232%22%20ry%3D%227%22%20%2F%3E%20%20%20%20%3Cg%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%3Cpath%20fill%3D%22%23FAFAFA%22%20stroke%3D%22%23D9D9D9%22%20%20%20%20%20%20%20%20%20%20%20%20d%3D%22M55%2012.76%2044.854%201.258C44.367.474%2043.656%200%2042.907%200H21.093c-.749%200-1.46.474-1.947%201.257L9%2012.761V22h46v-9.24z%22%20%2F%3E%20%20%20%20%20%20%3Cpath%20fill%3D%22%23FFF%22%20stroke%3D%22%23D9D9D9%22%20%20%20%20%20%20%20%20%20%20%20%20d%3D%22M41.613%2015.931c0-1.605.994-2.93%202.227-2.931H55v18.137C55%2033.26%2053.68%2035%2052.05%2035h-40.1C10.32%2035%209%2033.259%209%2031.137V13h11.16c1.233%200%202.227%201.323%202.227%202.928v.022c0%201.605%201.005%202.901%202.237%202.901h14.752c1.232%200%202.237-1.308%202.237-2.913v-.007z%22%20%2F%3E%20%20%20%20%20%20%3Cpath%20stroke%3D%22%23E8E8E8%22%20stroke-linecap%3D%22round%22%20stroke-width%3D%221.5%22%20d%3D%22M25%2024h14m-14%204h14m-14%204h14%22%20%2F%3E%20%20%20%20%3C%2Fg%3E%20%20%3C%2Fg%3E%3C%2Fsvg%3E\""],"names":["emptyIcon"],"mappings":"AAAA,IAAeA,EAAA"}
@@ -1,2 +1,2 @@
1
- import{defineComponent as e,createElementBlock as t,openBlock as i,normalizeClass as r,unref as s,createElementVNode as p,normalizeStyle as a,toDisplayString as m}from"vue";import o from"./empty.svg.mjs";import{useNamespace as n}from"@qxs-bns/hooks";const d={class:"empty-content"},c=["src","alt"],l={class:"empty-description"};var u=e({name:"Empty",__name:"empty",props:{image:{type:String,required:!1,default:()=>o},description:{type:String,required:!1,default:"暂无数据"},imageSize:{type:Object,required:!1,default:()=>({width:"200px",height:"80px"})}},setup(e){const o=n("data-chart");return(e,n)=>(i(),t("div",{class:r([s(o).e("empty")])},[p("div",d,[p("img",{style:a(e.imageSize),src:e.image,alt:e.description},null,12,c),p("span",l,m(e.description),1)])],2))}});export{u as default};
1
+ import{defineComponent as e,createElementBlock as t,openBlock as i,normalizeClass as r,unref as s,createElementVNode as a,normalizeStyle as p,toDisplayString as m}from"vue";import{useNamespace as o}from"@qxs-bns/hooks";import n from"./empty.svg.mjs";const d={class:"empty-content"},c=["src","alt"],l={class:"empty-description"};var u=e({name:"Empty",__name:"empty",props:{image:{type:String,required:!1,default:()=>n},description:{type:String,required:!1,default:"暂无数据"},imageSize:{type:Object,required:!1,default:()=>({width:"100px",height:"auto"})}},setup(e){const n=o("data-chart");return(e,o)=>(i(),t("div",{class:r([s(n).e("empty")])},[a("div",d,[a("img",{style:p(e.imageSize),src:e.image,alt:e.description},null,12,c),a("span",l,m(e.description),1)])],2))}});export{u as default};
2
2
  //# sourceMappingURL=empty.vue.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"empty.vue.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/empty.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// 导入 SVG\nimport emptyIcon from \"./empty.svg\";\nimport { useNamespace } from \"@qxs-bns/hooks\";\n\ndefineOptions({\n name: \"Empty\",\n});\n\nconst {\n image = emptyIcon,\n description = \"暂无数据\",\n imageSize = { width: \"200px\", height: \"80px\" },\n} = defineProps<Props>();\n\ninterface Props {\n image?: string;\n description?: string;\n imageSize?: { width: string; height: string };\n}\n\nconst ns = useNamespace(\"data-chart\");\n</script>\n\n<template>\n <div :class=\"[ns.e('empty')]\">\n <div class=\"empty-content\">\n <img :style=\"imageSize\" :src=\"image\" :alt=\"description\" />\n <span class=\"empty-description\">{{ description }}</span>\n </div>\n </div>\n</template>\n\n<style scoped lang=\"scss\"></style>\n"],"names":["ns","useNamespace"],"mappings":"ijBAqBM,MAAAA,EAAKC,EAAa"}
1
+ {"version":3,"file":"empty.vue.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/empty.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useNamespace } from '@qxs-bns/hooks'\n// 导入 SVG\nimport emptyIcon from './empty.svg'\n\ndefineOptions({\n name: 'Empty',\n})\n\nconst {\n image = emptyIcon,\n description = '暂无数据',\n imageSize = { width: '100px', height: 'auto' },\n} = defineProps<Props>()\n\ninterface Props {\n image?: string\n description?: string\n imageSize?: { width: string, height: string }\n}\n\nconst ns = useNamespace('data-chart')\n</script>\n\n<template>\n <div :class=\"[ns.e('empty')]\">\n <div class=\"empty-content\">\n <img\n :style=\"imageSize\"\n :src=\"image\"\n :alt=\"description\"\n >\n <span class=\"empty-description\">{{ description }}</span>\n </div>\n </div>\n</template>\n"],"names":["ns","useNamespace"],"mappings":"ijBAqBM,MAAAA,EAAKC,EAAa"}
@@ -1,2 +1,2 @@
1
- import{defineComponent as e,ref as t,inject as a,computed as r,createElementBlock as l,openBlock as s}from"vue";import{InjectionChartMerge as n}from"../utils/injectionKeys.mjs";import{useCharts as o}from"../utils/useCharts.mjs";var c=e({name:"DataChartFunnel",__name:"funnel",props:{chartData:{type:Object,required:!0,default:()=>({colDesc:[],xGroupByDesc:{colDesc:"",groupByDesc:"",groupByValues:[],xAxis:!1},groupByDesc:[],data:[],modelName:""})},chartOptions:{type:null,required:!0}},setup(e){const c=t(),i=a(n,(e=>e),!0),u=r((()=>{const{colDesc:t,xGroupByDesc:a,modelName:r,data:l}=e.chartData,s={title:{text:r},legend:{},series:t.map((e=>({name:e,type:"funnel",left:"10%",width:"80%",label:{formatter:"{c}"},labelLine:{show:!1},itemStyle:{opacity:.7},emphasis:{label:{position:"inside",formatter:`{b}${e}: {c}`}},data:l.map((t=>({name:t[a?.colDesc||""],value:t[e]})))})))};return 1!==t.length&&(s.legend.data=t),i(s,e.chartOptions)}));return o({chartDOM:c,chartOptions:u,chartData:r((()=>e.chartData))}),(e,t)=>(s(),l("div",{ref_key:"dataChartFunnel",ref:c,class:"data-chart-funnel"},null,512))}});export{c as default};
1
+ import{defineComponent as t,ref as e,inject as a,computed as r,createElementBlock as n,openBlock as l}from"vue";import{InjectionChartMerge as s}from"../utils/injectionKeys.mjs";import{useCharts as i}from"../utils/useCharts.mjs";var o=t({name:"DataChartFunnel",__name:"funnel",props:{chartData:{type:Object,required:!0},chartOptions:{type:null,required:!0}},setup(t){const o=e(),c=a(s,(t=>t),!0),m=r((()=>{const{colDesc:e,xGroupByDesc:a,modelName:r,data:n}=t.chartData,l={title:{text:r},legend:{},series:e.map((t=>({name:t,type:"funnel",left:"10%",width:"80%",label:{formatter:"{c}"},labelLine:{show:!1},itemStyle:{opacity:.7},emphasis:{label:{position:"inside",formatter:`{b}${t}: {c}`}},data:n.map((e=>({name:e[a?.colDesc||""],value:e[t]||""})))})))};return 1!==e.length&&(l.legend.data=e),c(l,t.chartOptions)}));return i({chartDOM:o,chartOptions:m,chartData:r((()=>t.chartData))}),(t,e)=>(l(),n("div",{ref_key:"dataChartFunnel",ref:o,class:"data-chart-funnel"},null,512))}});export{o as default};
2
2
  //# sourceMappingURL=funnel.vue.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"funnel.vue.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/funnel.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { LegendOption } from 'echarts/types/dist/shared'\nimport type { EChartsOption, IFormatPublicData } from '../types'\nimport { InjectionChartMerge } from '../utils/injectionKeys'\nimport { useCharts } from '../utils/useCharts'\n\ndefineOptions({\n name: 'DataChartFunnel',\n})\nconst {\n chartOptions,\n chartData = {\n colDesc: [],\n xGroupByDesc: {\n colDesc: '',\n groupByDesc: '',\n groupByValues: [],\n xAxis: false,\n },\n groupByDesc: [],\n data: [],\n modelName: '',\n },\n} = defineProps<{\n chartData: IFormatPublicData\n chartOptions: EChartsOption\n}>()\nconst dataChartFunnel = ref()\nconst merge = inject(InjectionChartMerge, (v: any) => v, true)\nconst funnelChartOptions = computed<EChartsOption>(() => {\n const { colDesc, xGroupByDesc, modelName, data } = chartData\n\n const config = {\n title: {\n text: modelName,\n },\n legend: {},\n series: colDesc.map((item) => {\n return {\n name: item,\n type: 'funnel',\n left: '10%',\n width: '80%',\n label: {\n formatter: '{c}',\n },\n labelLine: {\n show: false,\n },\n itemStyle: {\n opacity: 0.7,\n },\n emphasis: {\n label: {\n position: 'inside',\n formatter: `{b}${item}: {c}`,\n },\n },\n data: data.map(yItem => ({\n name: yItem[xGroupByDesc?.colDesc || ''],\n value: yItem[item],\n })),\n }\n }),\n }\n if (colDesc.length !== 1) {\n (config.legend as LegendOption).data = colDesc\n }\n return merge(config, chartOptions)\n})\nuseCharts({ chartDOM: dataChartFunnel, chartOptions: funnelChartOptions, chartData: computed(() => chartData) })\n</script>\n\n<template>\n <div ref=\"dataChartFunnel\" class=\"data-chart-funnel\" />\n</template>\n"],"names":["dataChartFunnel","ref","merge","inject","InjectionChartMerge","v","funnelChartOptions","computed","colDesc","xGroupByDesc","modelName","data","__props","chartData","config","title","text","legend","series","map","item","name","type","left","width","label","formatter","labelLine","show","itemStyle","opacity","emphasis","position","yItem","value","length","chartOptions","useCharts","chartDOM"],"mappings":"gfA2BA,MAAMA,EAAkBC,IAClBC,EAAQC,EAAOC,GAAsBC,GAAWA,IAAG,GACnDC,EAAqBC,GAAwB,KACjD,MAAMC,QAAEA,EAASC,aAAAA,EAAAC,UAAcA,EAAWC,KAAAA,GAASC,EAAAC,UAE7CC,EAAS,CACbC,MAAO,CACLC,KAAMN,GAERO,OAAQ,CAAC,EACTC,OAAQV,EAAQW,KAAKC,IACZ,CACLC,KAAMD,EACNE,KAAM,SACNC,KAAM,MACNC,MAAO,MACPC,MAAO,CACLC,UAAW,OAEbC,UAAW,CACTC,MAAM,GAERC,UAAW,CACTC,QAAS,IAEXC,SAAU,CACRN,MAAO,CACLO,SAAU,SACVN,UAAW,MAAMN,WAGrBT,KAAMA,EAAKQ,KAAcc,IAAA,CACvBZ,KAAMY,EAAMxB,GAAcD,SAAW,IACrC0B,MAAOD,EAAMb,YAQd,OAHgB,IAAnBZ,EAAQ2B,SACTrB,EAAOG,OAAwBN,KAAOH,GAElCN,EAAMY,EAAQF,EAAYwB,aAAA,WAEzBC,EAAA,CAAEC,SAAUtC,EAAiBoC,aAAc9B,EAAoBO,UAAWN,GAAS,IAAMK,EAAAC"}
1
+ {"version":3,"file":"funnel.vue.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/funnel.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { LegendOption } from 'echarts/types/dist/shared'\nimport type { EChartsOption, IFormatPublicData } from '../types'\nimport { InjectionChartMerge } from '../utils/injectionKeys'\nimport { useCharts } from '../utils/useCharts'\n\ndefineOptions({\n name: 'DataChartFunnel',\n})\nconst {\n chartOptions,\n chartData,\n} = defineProps<{\n chartData: IFormatPublicData\n chartOptions: EChartsOption\n}>()\nconst dataChartFunnel = ref()\nconst merge = inject(InjectionChartMerge, (v: any) => v, true)\nconst funnelChartOptions = computed<EChartsOption>(() => {\n const { colDesc, xGroupByDesc, modelName, data } = chartData\n\n const config = {\n title: {\n text: modelName,\n },\n legend: {},\n series: colDesc.map((item) => {\n return {\n name: item,\n type: 'funnel',\n left: '10%',\n width: '80%',\n label: {\n formatter: '{c}',\n },\n labelLine: {\n show: false,\n },\n itemStyle: {\n opacity: 0.7,\n },\n emphasis: {\n label: {\n position: 'inside',\n formatter: `{b}${item}: {c}`,\n },\n },\n data: data.map(yItem => ({\n name: yItem[xGroupByDesc?.colDesc || ''],\n value: yItem[item] || '',\n })),\n }\n }),\n }\n if (colDesc.length !== 1) {\n (config.legend as LegendOption).data = colDesc\n }\n return merge(config, chartOptions)\n})\nuseCharts({ chartDOM: dataChartFunnel, chartOptions: funnelChartOptions, chartData: computed(() => chartData) })\n</script>\n\n<template>\n <div\n ref=\"dataChartFunnel\"\n class=\"data-chart-funnel\"\n />\n</template>\n"],"names":["dataChartFunnel","ref","merge","inject","InjectionChartMerge","v","funnelChartOptions","computed","colDesc","xGroupByDesc","modelName","data","__props","chartData","config","title","text","legend","series","map","item","name","type","left","width","label","formatter","labelLine","show","itemStyle","opacity","emphasis","position","yItem","value","length","chartOptions","useCharts","chartDOM"],"mappings":"8WAgBA,MAAMA,EAAkBC,IAClBC,EAAQC,EAAOC,GAAsBC,GAAWA,IAAG,GACnDC,EAAqBC,GAAwB,KACjD,MAAMC,QAAEA,EAASC,aAAAA,EAAAC,UAAcA,EAAWC,KAAAA,GAASC,EAAAC,UAE7CC,EAAS,CACbC,MAAO,CACLC,KAAMN,GAERO,OAAQ,CAAC,EACTC,OAAQV,EAAQW,KAAKC,IACZ,CACLC,KAAMD,EACNE,KAAM,SACNC,KAAM,MACNC,MAAO,MACPC,MAAO,CACLC,UAAW,OAEbC,UAAW,CACTC,MAAM,GAERC,UAAW,CACTC,QAAS,IAEXC,SAAU,CACRN,MAAO,CACLO,SAAU,SACVN,UAAW,MAAMN,WAGrBT,KAAMA,EAAKQ,KAAcc,IAAA,CACvBZ,KAAMY,EAAMxB,GAAcD,SAAW,IACrC0B,MAAOD,EAAMb,IAAS,YAQvB,OAHgB,IAAnBZ,EAAQ2B,SACTrB,EAAOG,OAAwBN,KAAOH,GAElCN,EAAMY,EAAQF,EAAYwB,aAAA,WAEzBC,EAAA,CAAEC,SAAUtC,EAAiBoC,aAAc9B,EAAoBO,UAAWN,GAAS,IAAMK,EAAAC"}
@@ -1,2 +1,2 @@
1
- import{defineComponent as e,ref as a,inject as t,computed as s,createElementBlock as r,openBlock as l}from"vue";import{InjectionChartMerge as n}from"../utils/injectionKeys.mjs";import{useCharts as c}from"../utils/useCharts.mjs";var i=e({name:"DataChartLine",__name:"line",props:{chartData:{type:Object,required:!0,default:()=>({colDesc:[],xGroupByDesc:{colDesc:"",groupByDesc:"",groupByValues:[],xAxis:!1},groupByDesc:[],data:[],modelName:""})},subShowType:{type:String,required:!0,default:"line-simple"},chartOptions:{type:null,required:!0}},setup(e){const i=a(),o=t(n,(e=>e),!0),p=15,u="Total";const d=s((()=>{const{colDesc:a,xGroupByDesc:t,groupByDesc:s,data:r,modelName:l}=e.chartData,n=Array.from(new Set(r?.map((e=>e[t?.colDesc||""])))).filter((e=>null!=e))||[],c=s?.find((e=>!e.xAxis)),i={title:{text:l},legend:{data:[]},xAxis:{name:t?.colDesc||"",data:n},dataZoom:[{type:"inside",disabled:n.length<p}]};if(1===s?.length)i.series=a.map((e=>({name:e,type:"line",data:r.map((a=>a[e])).filter((e=>null!=e))}))),i.legend.data=a;else if(2===s?.length){const e=[...new Set(r.map((e=>String(e[c?.colDesc||""]))))];i.legend.data=e,i.series=e.map((e=>function(e,a,t,s,r,l){const n=[];return a.forEach((a=>{const c=t.find((t=>t[s?.colDesc]===a&&t[r?.colDesc]===e));c?n.push(c[l[0]]):n.push(0)})),{name:e,type:"line",stack:u,areaStyle:{},data:n}}(e,n,r,t,c,a)))}return i.series=i.series?.map((a=>{const t={...a};switch(e.subShowType){case"line-simple":default:delete t.areaStyle;break;case"area-basic":t.areaStyle={}}return t})),o(i,e.chartOptions)}));return c({chartDOM:i,chartOptions:d,chartData:s((()=>e.chartData))}),(e,a)=>(l(),r("div",{ref_key:"dataChartLine",ref:i,class:"data-chart-line"},null,512))}});export{i as default};
1
+ import{defineComponent as e,ref as t,inject as a,computed as r,createElementBlock as s,openBlock as n}from"vue";import{InjectionChartMerge as i}from"../utils/injectionKeys.mjs";import{useCharts as l}from"../utils/useCharts.mjs";var c=e({name:"DataChartLine",__name:"line",props:{chartData:{type:Object,required:!0},subShowType:{type:String,required:!0,default:"line-simple"},chartOptions:{type:null,required:!0}},setup(e){const c=t(),o=a(i,(e=>e),!0),p=15,d="Total";const u=r((()=>{const{colDesc:t,xGroupByDesc:a,groupByDesc:r,data:s,modelName:n}=e.chartData,i=Array.from(new Set(s?.map((e=>e[a?.colDesc||""])))).filter((e=>null!=e))||[],l=r?.find((e=>!e.xAxis)),c={title:{text:n},legend:{data:[]},xAxis:{name:a?.colDesc||"",data:i},dataZoom:[{type:"inside",disabled:i.length<p}]};if(1===r?.length)c.series=t.map((e=>({name:e,type:"line",data:s.map((t=>t[e])).filter((e=>null!=e))}))),c.legend.data=t;else if(2===r?.length){const e=[...new Set(s.map((e=>String(e[l?.colDesc||""]))))];c.legend.data=e,c.series=e.map((e=>function(e,t,a,r,s,n){const i=[];return t.forEach((t=>{const l=a.find((a=>a[r?.colDesc]===t&&a[s?.colDesc]===e));l?i.push(l[n[0]]):i.push(0)})),{name:e,type:"line",stack:d,areaStyle:{},data:i}}(e,i,s,a,l,t)))}return c.series=c.series?.map((t=>{const a={...t};switch(e.subShowType){case"line-simple":default:delete a.areaStyle;break;case"area-basic":a.areaStyle={}}return a})),o(c,e.chartOptions)}));return l({chartDOM:c,chartOptions:u,chartData:r((()=>e.chartData))}),(e,t)=>(n(),s("div",{ref_key:"dataChartLine",ref:c,class:"data-chart-line"},null,512))}});export{c as default};
2
2
  //# sourceMappingURL=line.vue2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"line.vue2.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/line.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { LegendComponentOption } from 'echarts'\nimport type { EChartsOption, IFormatPublicData } from '../types'\nimport { InjectionChartMerge } from '../utils/injectionKeys'\nimport { useCharts } from '../utils/useCharts'\n\ndefineOptions({\n name: 'DataChartLine',\n})\nconst {\n chartData = {\n colDesc: [],\n xGroupByDesc: {\n colDesc: '',\n groupByDesc: '',\n groupByValues: [],\n xAxis: false,\n },\n groupByDesc: [],\n data: [],\n modelName: '',\n },\n subShowType = 'line-simple',\n chartOptions,\n} = defineProps<{\n chartData: IFormatPublicData\n subShowType: string\n chartOptions: EChartsOption\n}>()\nconst dataChartLine = ref()\nconst merge = inject(InjectionChartMerge, (v: any) => v, true)\n\n// 抽取类型定义\ninterface SeriesItem {\n name: string\n type: 'line'\n stack?: string\n areaStyle?: Record<string, any>\n data: Array<string | number>\n}\n\n// 将配置提取为常量\nconst CHART_CONSTANTS = {\n MIN_ZOOM_LENGTH: 15,\n STACK_NAME: 'Total',\n} as const\n\n// 提取处理图表系列数据的函数\nfunction processSeriesData(legendDataItem: string,\n xAxisData: (string | number)[],\n data: any[],\n xGroupByDesc: any,\n yGroupByDesc: any,\n colDesc: string[]): SeriesItem {\n const seriesData: (string | number)[] = []\n\n xAxisData.forEach((xAxisItem) => {\n const targetData = data\n .find(dataItem =>\n dataItem[xGroupByDesc?.colDesc] === xAxisItem\n && dataItem[yGroupByDesc?.colDesc] === legendDataItem,\n )\n\n if (targetData) {\n seriesData.push(targetData[colDesc[0]])\n }\n else {\n seriesData.push(0) // 或者其他默认值\n }\n })\n\n return {\n name: legendDataItem,\n type: 'line',\n stack: CHART_CONSTANTS.STACK_NAME,\n areaStyle: {},\n data: seriesData,\n }\n}\n\nconst lineChartOptions = computed<EChartsOption>(() => {\n const { colDesc, xGroupByDesc, groupByDesc, data, modelName } = chartData\n const xAxisData = Array.from(new Set(data?.map(item => item[xGroupByDesc?.colDesc || '']))).filter(item => item !== undefined && item !== null ) || []\n const yGroupByDesc = groupByDesc?.find(item => !item.xAxis)\n\n const config: EChartsOption & { series?: SeriesItem[] } = {\n title: { text: modelName },\n legend: { data: [] },\n xAxis: {\n name: xGroupByDesc?.colDesc || '',\n data: xAxisData,\n },\n dataZoom: [{\n type: 'inside',\n disabled: xAxisData.length < CHART_CONSTANTS.MIN_ZOOM_LENGTH,\n }],\n }\n\n // 处理系列数据\n if (groupByDesc?.length === 1) {\n config.series = colDesc.map(yItem => ({\n name: yItem,\n type: 'line',\n data: data.map(item => item[yItem]).filter(item => item !== undefined && item !== null),\n }));\n (config.legend as LegendComponentOption).data = colDesc\n }\n else if (groupByDesc?.length === 2) {\n const legendData = [...new Set(data.map(item => String(item[yGroupByDesc?.colDesc || ''])))]\n ;(config.legend as LegendComponentOption).data = legendData\n\n config.series = legendData.map(legendDataItem =>\n processSeriesData(legendDataItem, xAxisData, data, xGroupByDesc, yGroupByDesc, colDesc),\n )\n }\n\n // 处理图表展示类型\n config.series = config.series?.map((item) => {\n const seriesItem = { ...item }\n\n switch (subShowType) {\n case 'line-simple':\n delete seriesItem.areaStyle\n break\n case 'area-basic':\n seriesItem.areaStyle = {}\n break\n default:\n delete seriesItem.areaStyle\n }\n\n return seriesItem\n })\n\n return merge(config, chartOptions)\n})\nuseCharts({ chartDOM: dataChartLine, chartOptions: lineChartOptions, chartData: computed(() => chartData) })\n</script>\n\n<template>\n <div ref=\"dataChartLine\" class=\"data-chart-line\" />\n</template>\n\n<style scoped lang=\"scss\">\n.data-chart-line {\n width: 100%;\n height: 100%;\n}\n</style>\n"],"names":["dataChartLine","ref","merge","inject","InjectionChartMerge","v","CHART_CONSTANTS","lineChartOptions","computed","colDesc","xGroupByDesc","groupByDesc","data","modelName","__props","chartData","xAxisData","Array","from","Set","map","item","filter","yGroupByDesc","find","xAxis","config","title","text","legend","name","dataZoom","type","disabled","length","series","yItem","legendData","String","legendDataItem","seriesData","forEach","xAxisItem","targetData","dataItem","push","stack","areaStyle","processSeriesData","seriesItem","subShowType","chartOptions","useCharts","chartDOM"],"mappings":"wiBA6BA,MAAMA,EAAgBC,IAChBC,EAAQC,EAAOC,GAAsBC,GAAWA,IAAG,GAYnDC,EACa,GADbA,EAEQ,QAoCR,MAAAC,EAAmBC,GAAwB,KAC/C,MAAMC,QAAEA,EAASC,aAAAA,EAAAC,YAAcA,OAAaC,EAAMC,UAAAA,GAAcC,EAAAC,UAC1DC,EAAYC,MAAMC,KAAK,IAAIC,IAAIP,GAAMQ,KAAYC,GAAAA,EAAKX,GAAcD,SAAW,QAAOa,QAAOD,GAAQA,WAAyC,GAC9IE,EAAeZ,GAAaa,MAAaH,IAACA,EAAKI,QAE/CC,EAAoD,CACxDC,MAAO,CAAEC,KAAMf,GACfgB,OAAQ,CAAEjB,KAAM,IAChBa,MAAO,CACLK,KAAMpB,GAAcD,SAAW,GAC/BG,KAAMI,GAERe,SAAU,CAAC,CACTC,KAAM,SACNC,SAAUjB,EAAUkB,OAAS5B,KAK7B,GAAwB,IAAxBK,GAAauB,OACRR,EAAAS,OAAS1B,EAAQW,KAAcgB,IAAA,CACpCN,KAAMM,EACNJ,KAAM,OACNpB,KAAMA,EAAKQ,KAAIC,GAAQA,EAAKe,KAAQd,QAAOD,GAAQA,cAEpDK,EAAOG,OAAiCjB,KAAOH,OAClD,GACiC,IAAxBE,GAAauB,OAAc,CAClC,MAAMG,EAAa,IAAI,IAAIlB,IAAIP,EAAKQ,KAAIC,GAAQiB,OAAOjB,EAAKE,GAAcd,SAAW,SACnFiB,EAAOG,OAAiCjB,KAAOyB,EAEjDX,EAAOS,OAASE,EAAWjB,QA/D/B,SAA2BmB,EACzBvB,EACAJ,EACAF,EACAa,EACAd,GACA,MAAM+B,EAAkC,GAiBjC,OAfGxB,EAAAyB,SAASC,IACjB,MAAMC,EAAa/B,EAChBY,MAAKoB,GACJA,EAASlC,GAAcD,WAAaiC,GACjCE,EAASrB,GAAcd,WAAa8B,IAGvCI,EACFH,EAAWK,KAAKF,EAAWlC,EAAQ,KAGnC+B,EAAWK,KAAK,EAAC,IAId,CACLf,KAAMS,EACNP,KAAM,OACNc,MAAOxC,EACPyC,UAAW,CAAC,EACZnC,KAAM4B,EACR,CAmCIQ,CAAkBT,EAAgBvB,EAAWJ,EAAMF,EAAca,EAAcd,IACjF,CAqBK,OAjBPiB,EAAOS,OAAST,EAAOS,QAAQf,KAAKC,IAC5B,MAAA4B,EAAa,IAAK5B,GAExB,OAAQP,EAAAoC,aACN,IAAK,cAML,eACSD,EAAWF,gBAJpB,IAAK,aACHE,EAAWF,UAAY,CAAC,EAMrB,OAAAE,CAAA,IAGF/C,EAAMwB,EAAQZ,EAAYqC,aAAA,WAEzBC,EAAA,CAAEC,SAAUrD,EAAemD,aAAc5C,EAAkBQ,UAAWP,GAAS,IAAMM,EAAAC"}
1
+ {"version":3,"file":"line.vue2.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/line.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { LegendComponentOption } from 'echarts'\nimport type { EChartsOption, IFormatPublicData } from '../types'\nimport { InjectionChartMerge } from '../utils/injectionKeys'\nimport { useCharts } from '../utils/useCharts'\n\ndefineOptions({\n name: 'DataChartLine',\n})\nconst {\n chartData,\n subShowType = 'line-simple',\n chartOptions,\n} = defineProps<{\n chartData: IFormatPublicData\n subShowType: string\n chartOptions: EChartsOption\n}>()\nconst dataChartLine = ref()\nconst merge = inject(InjectionChartMerge, (v: any) => v, true)\n\n// 抽取类型定义\ninterface SeriesItem {\n name: string\n type: 'line'\n stack?: string\n areaStyle?: Record<string, any>\n data: Array<string | number>\n}\n\n// 将配置提取为常量\nconst CHART_CONSTANTS = {\n MIN_ZOOM_LENGTH: 15,\n STACK_NAME: 'Total',\n} as const\n\n// 提取处理图表系列数据的函数\nfunction processSeriesData(legendDataItem: string,\n xAxisData: (string | number)[],\n data: any[],\n xGroupByDesc: any,\n yGroupByDesc: any,\n colDesc: string[]): SeriesItem {\n const seriesData: (string | number)[] = []\n\n xAxisData.forEach((xAxisItem) => {\n const targetData = data\n .find(dataItem =>\n dataItem[xGroupByDesc?.colDesc] === xAxisItem\n && dataItem[yGroupByDesc?.colDesc] === legendDataItem,\n )\n\n if (targetData) {\n seriesData.push(targetData[colDesc[0]])\n }\n else {\n seriesData.push(0) // 或者其他默认值\n }\n })\n\n return {\n name: legendDataItem,\n type: 'line',\n stack: CHART_CONSTANTS.STACK_NAME,\n areaStyle: {},\n data: seriesData,\n }\n}\n\nconst lineChartOptions = computed<EChartsOption>(() => {\n const { colDesc, xGroupByDesc, groupByDesc, data, modelName } = chartData\n const xAxisData = Array.from(new Set(data?.map(item => item[xGroupByDesc?.colDesc || '']))).filter(item => item !== undefined && item !== null) || []\n const yGroupByDesc = groupByDesc?.find(item => !item.xAxis)\n\n const config: EChartsOption & { series?: SeriesItem[] } = {\n title: { text: modelName },\n legend: { data: [] },\n xAxis: {\n name: xGroupByDesc?.colDesc || '',\n data: xAxisData,\n },\n dataZoom: [{\n type: 'inside',\n disabled: xAxisData.length < CHART_CONSTANTS.MIN_ZOOM_LENGTH,\n }],\n }\n\n // 处理系列数据\n if (groupByDesc?.length === 1) {\n config.series = colDesc.map(yItem => ({\n name: yItem,\n type: 'line',\n data: data.map(item => item[yItem]).filter(item => item !== undefined && item !== null),\n }));\n (config.legend as LegendComponentOption).data = colDesc\n }\n else if (groupByDesc?.length === 2) {\n const legendData = [...new Set(data.map(item => String(item[yGroupByDesc?.colDesc || ''])))]\n ;(config.legend as LegendComponentOption).data = legendData\n\n config.series = legendData.map(legendDataItem =>\n processSeriesData(legendDataItem, xAxisData, data, xGroupByDesc, yGroupByDesc, colDesc),\n )\n }\n\n // 处理图表展示类型\n config.series = config.series?.map((item) => {\n const seriesItem = { ...item }\n\n switch (subShowType) {\n case 'line-simple':\n delete seriesItem.areaStyle\n break\n case 'area-basic':\n seriesItem.areaStyle = {}\n break\n default:\n delete seriesItem.areaStyle\n }\n\n return seriesItem\n })\n\n return merge(config, chartOptions)\n})\nuseCharts({ chartDOM: dataChartLine, chartOptions: lineChartOptions, chartData: computed(() => chartData) })\n</script>\n\n<template>\n <div\n ref=\"dataChartLine\"\n class=\"data-chart-line\"\n />\n</template>\n\n<style scoped lang=\"scss\">\n.data-chart-line {\n width: 100%;\n height: 100%;\n}\n</style>\n"],"names":["dataChartLine","ref","merge","inject","InjectionChartMerge","v","CHART_CONSTANTS","lineChartOptions","computed","colDesc","xGroupByDesc","groupByDesc","data","modelName","__props","chartData","xAxisData","Array","from","Set","map","item","filter","yGroupByDesc","find","xAxis","config","title","text","legend","name","dataZoom","type","disabled","length","series","yItem","legendData","String","legendDataItem","seriesData","forEach","xAxisItem","targetData","dataItem","push","stack","areaStyle","processSeriesData","seriesItem","subShowType","chartOptions","useCharts","chartDOM"],"mappings":"saAkBA,MAAMA,EAAgBC,IAChBC,EAAQC,EAAOC,GAAsBC,GAAWA,IAAG,GAYnDC,EACa,GADbA,EAEQ,QAoCR,MAAAC,EAAmBC,GAAwB,KAC/C,MAAMC,QAAEA,EAASC,aAAAA,EAAAC,YAAcA,OAAaC,EAAMC,UAAAA,GAAcC,EAAAC,UAC1DC,EAAYC,MAAMC,KAAK,IAAIC,IAAIP,GAAMQ,KAAYC,GAAAA,EAAKX,GAAcD,SAAW,QAAOa,QAAOD,GAAQA,WAAwC,GAC7IE,EAAeZ,GAAaa,MAAaH,IAACA,EAAKI,QAE/CC,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,EAAA,CAAEC,SAAUrD,EAAemD,aAAc5C,EAAkBQ,UAAWP,GAAS,IAAMM,EAAAC"}
@@ -1,2 +1,2 @@
1
- import{defineComponent as e,inject as t,ref as r,computed as a,createElementBlock as o,openBlock as s}from"vue";import{orderBy as c,cloneDeep as i}from"lodash-es";import{InjectionChartMerge as l}from"../utils/injectionKeys.mjs";import{useCharts as n}from"../utils/useCharts.mjs";var u=e({name:"DataChartPie",__name:"pie",props:{chartData:{type:Object,required:!0,default:()=>({colDesc:[],xGroupByDesc:{colDesc:"",groupByDesc:"",groupByValues:[],xAxis:!1},groupByDesc:[],data:[],modelName:""})},subShowType:{type:String,required:!0,default:"pie-simple"},chartOptions:{type:null,required:!0}},setup(e){const u=t(l,(e=>e),!0),p=r(null),m=a((()=>{const{colDesc:t,xGroupByDesc:r,data:a,modelName:o}=e.chartData,s=t.length,l={title:{text:o},series:t.map(((t,o)=>{const l={name:t,type:"pie",center:["50%","50%"],data:[],emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}},label:{formatter:"{b}:{c}({d}%)",rich:{b:{color:"#4C5058",fontSize:14,fontWeight:"bold",lineHeight:33}}}};let n=5;const u=c(i(a),[t],["desc"]),p=u.reduce(((e,r)=>e+Number(r[t])),0);if(a.length>n)for(;n<9;){const e=u.slice(0,n);if(e.reduce(((e,r)=>e+Number(r[t])),0)/p>.9||8===n){const o=u.slice(n,u.length-1);l.data=a.map((a=>{let o={};return e.forEach((e=>{JSON.stringify(e)===JSON.stringify(a)&&(o={name:r?.colDesc?a[r.colDesc]:"",value:a[t]})})),o})).filter((e=>e)),l.data.push({name:"其它",value:o.reduce(((e,r)=>e+Number(r[t])),0)});break}n++}else l.data=a.map((e=>({name:r?.colDesc&&e[r.colDesc]||"",value:Number(e[t]||0)})));if(1===s?l.center=["50%","60%"]:2===s?0===o?(l.right="40%",l.left="",l.center=["40%","60%"]):(l.right="",l.left="40%",l.center=["60%","60%"]):3===s?0===o?(l.right="40%",l.bottom="50%",l.top="",l.left="",l.center=["40%","78%"]):1===o?(l.right="",l.bottom="50%",l.top="",l.left="40%",l.center=["60%","78%"]):(l.right="40%",l.bottom="",l.top="50%",l.left="",l.center=["40%","60%"]):4===s&&(0===o?(l.right="40%",l.bottom="50%",l.top="",l.left="",l.center=["40%","78%"]):1===o?(l.right="",l.bottom="50%",l.top="",l.left="40%",l.center=["60%","78%"]):2===o?(l.right="40%",l.bottom="",l.top="50%",l.left="",l.center=["40%","60%"]):(l.right="",l.bottom="",l.top="50%",l.left="40%",l.center=["60%","60%"])),"pie-borderRadius"===e.subShowType)l.radius=["50%","70%"];else l.radius="50%";return l}))};return u(l,e.chartOptions)}));return n({chartDOM:p,chartOptions:m,chartData:a((()=>e.chartData))}),(e,t)=>(s(),o("div",{ref_key:"dataChartPie",ref:p,class:"data-chart-pie"},null,512))}});export{u as default};
1
+ import{defineComponent as e,inject as t,ref as r,computed as a,createElementBlock as o,openBlock as i}from"vue";import{orderBy as s}from"lodash-es";import{InjectionChartMerge as c}from"../utils/injectionKeys.mjs";import{useCharts as l}from"../utils/useCharts.mjs";var n=e({name:"DataChartPie",__name:"pie",props:{chartData:{type:Object,required:!0},subShowType:{type:String,required:!0,default:"pie-simple"},chartOptions:{type:null,required:!0}},setup(e){const n=t(c,(e=>e),!0),h=r(null),m=a((()=>{const{colDesc:t,xGroupByDesc:r,data:a,modelName:o}=e.chartData,i=t.length,c={title:{text:o},series:t.map(((t,o)=>{const c={name:t,type:"pie",center:["50%","50%"],data:[],emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}},label:{formatter:"{b}:{c}({d}%)",rich:{b:{color:"#4C5058",fontSize:14,fontWeight:"bold",lineHeight:33}}}};let l=5;const n=a.filter((e=>void 0!==e[t])),h=s(n,[t],["desc"]),m=h.reduce(((e,r)=>{const a=Number(r[t])||0;return Number.isNaN(a)?e:e+a}),0);if(n.length>l)for(;l<9;){const e=h.slice(0,l);if(e.reduce(((e,r)=>e+Number(r[t])),0)/m>.9||8===l){const a=h.slice(l,h.length-1);c.data=n.map((a=>{let o={};return e.forEach((e=>{JSON.stringify(e)===JSON.stringify(a)&&(o={name:r?.colDesc?a[r.colDesc]:"",value:a[t]})})),o})).filter((e=>e&&Object.keys(e).length>0)),c.data.push({name:"其它",value:a.reduce(((e,r)=>e+Number(r[t])),0)});break}l++}else c.data=n.map((e=>({name:r?.colDesc&&e[r.colDesc]||"",value:Number(e[t]||0)})));if(1===i?c.center=["50%","60%"]:2===i?0===o?(c.right="40%",c.left="",c.center=["40%","60%"]):(c.right="",c.left="40%",c.center=["60%","60%"]):3===i?0===o?(c.right="40%",c.bottom="50%",c.top="",c.left="",c.center=["40%","78%"]):1===o?(c.right="",c.bottom="50%",c.top="",c.left="40%",c.center=["60%","78%"]):(c.right="40%",c.bottom="",c.top="50%",c.left="",c.center=["40%","60%"]):4===i&&(0===o?(c.right="40%",c.bottom="50%",c.top="",c.left="",c.center=["40%","78%"]):1===o?(c.right="",c.bottom="50%",c.top="",c.left="40%",c.center=["60%","78%"]):2===o?(c.right="40%",c.bottom="",c.top="50%",c.left="",c.center=["40%","60%"]):(c.right="",c.bottom="",c.top="50%",c.left="40%",c.center=["60%","60%"])),"pie-borderRadius"===e.subShowType)c.radius=["50%","70%"];else c.radius="50%";return c}))};return n(c,e.chartOptions)}));return l({chartDOM:h,chartOptions:m,chartData:a((()=>e.chartData))}),(e,t)=>(i(),o("div",{ref_key:"dataChartPie",ref:h,class:"data-chart-pie"},null,512))}});export{n as default};
2
2
  //# sourceMappingURL=pie.vue.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"pie.vue.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/pie.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { PieSeriesOption } from \"echarts/charts\";\nimport type { EChartsOption, IFormatPublicData } from \"../types\";\nimport { cloneDeep, orderBy } from \"lodash-es\";\nimport { InjectionChartMerge } from \"../utils/injectionKeys\";\nimport { useCharts } from \"../utils/useCharts\";\n\ndefineOptions({\n name: \"DataChartPie\",\n});\nconst {\n chartData = {\n colDesc: [],\n xGroupByDesc: {\n colDesc: \"\",\n groupByDesc: \"\",\n groupByValues: [],\n xAxis: false,\n },\n groupByDesc: [],\n data: [],\n modelName: \"\",\n },\n subShowType = \"pie-simple\",\n chartOptions,\n} = defineProps<{\n chartData: IFormatPublicData;\n subShowType: string;\n chartOptions: EChartsOption;\n}>();\nconst merge = inject(InjectionChartMerge, (v: any) => v, true);\n\nconst dataChartPie = ref(null);\nconst pieChartOptions = computed<EChartsOption>(() => {\n const { colDesc, xGroupByDesc, data, modelName } = chartData;\n const colDescLength = colDesc.length;\n const config = {\n title: { text: modelName },\n series: colDesc.map((item, index) => {\n const seriesItem: PieSeriesOption = {\n name: item,\n type: \"pie\",\n center: [\"50%\", \"50%\"],\n data: [],\n emphasis: {\n itemStyle: {\n shadowBlur: 10,\n shadowOffsetX: 0,\n shadowColor: \"rgba(0, 0, 0, 0.5)\",\n },\n },\n label: {\n formatter: \"{b}:{c}({d}%)\",\n rich: {\n b: {\n color: \"#4C5058\",\n fontSize: 14,\n fontWeight: \"bold\",\n lineHeight: 33,\n },\n },\n },\n };\n\n let cutNum = 5;\n const orderByData = orderBy(cloneDeep(data), [item], [\"desc\"]);\n // 总数\n const totalDesc = orderByData.reduce(\n (prev, cur) => prev + Number(cur[item]),\n 0\n );\n if (data.length > cutNum) {\n while (cutNum < 9) {\n const headerData = orderByData.slice(0, cutNum);\n // 前 cutNum 个总数\n const headerTotal = headerData.reduce(\n (prev, cur) => prev + Number(cur[item]),\n 0\n );\n // 前五总占比\n const headerScale = headerTotal / totalDesc;\n if (headerScale > 0.9 || cutNum === 8) {\n //\n const footerData = orderByData.slice(\n cutNum,\n orderByData.length - 1\n );\n seriesItem.data = data\n .map((yItem) => {\n let obj = {};\n headerData.forEach((headerDataItem) => {\n if (\n JSON.stringify(headerDataItem) === JSON.stringify(yItem)\n ) {\n obj = {\n name: xGroupByDesc?.colDesc\n ? yItem[xGroupByDesc.colDesc]\n : \"\",\n value: yItem[item],\n };\n }\n });\n return obj;\n })\n .filter((v) => v);\n seriesItem.data.push({\n name: \"其它\",\n value: footerData.reduce(\n (prev, cur) => prev + Number(cur[item]),\n 0\n ),\n });\n\n break;\n } else {\n cutNum++;\n }\n }\n } else {\n seriesItem.data = data.map((yItem) => ({\n name: xGroupByDesc?.colDesc ? (yItem[xGroupByDesc.colDesc] || '') : \"\",\n value: Number(yItem[item] || 0),\n }));\n }\n\n if (colDescLength === 1) {\n seriesItem.center = [\"50%\", \"60%\"];\n } else if (colDescLength === 2) {\n if (index === 0) {\n seriesItem.right = \"40%\";\n seriesItem.left = \"\";\n seriesItem.center = [\"40%\", \"60%\"];\n } else {\n seriesItem.right = \"\";\n seriesItem.left = \"40%\";\n seriesItem.center = [\"60%\", \"60%\"];\n }\n } else if (colDescLength === 3) {\n if (index === 0) {\n seriesItem.right = \"40%\";\n seriesItem.bottom = \"50%\";\n seriesItem.top = \"\";\n seriesItem.left = \"\";\n seriesItem.center = [\"40%\", \"78%\"];\n } else if (index === 1) {\n seriesItem.right = \"\";\n seriesItem.bottom = \"50%\";\n seriesItem.top = \"\";\n seriesItem.left = \"40%\";\n seriesItem.center = [\"60%\", \"78%\"];\n } else {\n seriesItem.right = \"40%\";\n seriesItem.bottom = \"\";\n seriesItem.top = \"50%\";\n seriesItem.left = \"\";\n seriesItem.center = [\"40%\", \"60%\"];\n }\n } else if (colDescLength === 4) {\n if (index === 0) {\n seriesItem.right = \"40%\";\n seriesItem.bottom = \"50%\";\n seriesItem.top = \"\";\n seriesItem.left = \"\";\n seriesItem.center = [\"40%\", \"78%\"];\n } else if (index === 1) {\n seriesItem.right = \"\";\n seriesItem.bottom = \"50%\";\n seriesItem.top = \"\";\n seriesItem.left = \"40%\";\n seriesItem.center = [\"60%\", \"78%\"];\n } else if (index === 2) {\n seriesItem.right = \"40%\";\n seriesItem.bottom = \"\";\n seriesItem.top = \"50%\";\n seriesItem.left = \"\";\n seriesItem.center = [\"40%\", \"60%\"];\n } else {\n seriesItem.right = \"\";\n seriesItem.bottom = \"\";\n seriesItem.top = \"50%\";\n seriesItem.left = \"40%\";\n seriesItem.center = [\"60%\", \"60%\"];\n }\n }\n // 处理图表形状\n switch (subShowType) {\n case \"pie-borderRadius\":\n seriesItem.radius = [\"50%\", \"70%\"];\n break;\n case \"pie-simple\":\n seriesItem.radius = \"50%\";\n break;\n default:\n seriesItem.radius = \"50%\";\n break;\n }\n return seriesItem;\n }),\n };\n return merge(config, chartOptions);\n});\n\nuseCharts({\n chartDOM: dataChartPie,\n chartOptions: pieChartOptions,\n chartData: computed(() => chartData),\n});\n</script>\n\n<template>\n <div ref=\"dataChartPie\" class=\"data-chart-pie\" />\n</template>\n"],"names":["merge","inject","InjectionChartMerge","v","dataChartPie","ref","pieChartOptions","computed","colDesc","xGroupByDesc","data","modelName","__props","chartData","colDescLength","length","config","title","text","series","map","item","index","seriesItem","name","type","center","emphasis","itemStyle","shadowBlur","shadowOffsetX","shadowColor","label","formatter","rich","b","color","fontSize","fontWeight","lineHeight","cutNum","orderByData","orderBy","cloneDeep","totalDesc","reduce","prev","cur","Number","headerData","slice","footerData","yItem","obj","forEach","headerDataItem","JSON","stringify","value","filter","push","right","left","bottom","top","subShowType","radius","chartOptions","useCharts","chartDOM"],"mappings":"wlBA8BA,MAAMA,EAAQC,EAAOC,GAAsBC,GAAWA,IAAG,GAEnDC,EAAeC,EAAI,MACnBC,EAAkBC,GAAwB,KAC9C,MAAMC,QAAEA,EAASC,aAAAA,EAAAC,KAAcA,EAAMC,UAAAA,GAAcC,EAASC,UACtDC,EAAgBN,EAAQO,OACxBC,EAAS,CACbC,MAAO,CAAEC,KAAMP,GACfQ,OAAQX,EAAQY,KAAI,CAACC,EAAMC,KACzB,MAAMC,EAA8B,CAClCC,KAAMH,EACNI,KAAM,MACNC,OAAQ,CAAC,MAAO,OAChBhB,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AvB,EAAMgB,EAAQJ,EAAAuD,aAAY,WAGzBC,EAAA,CACRC,SAAUjE,EACV+D,aAAc7D,EACdO,UAAWN,GAAS,IAAMK,EAAAC"}
1
+ {"version":3,"file":"pie.vue.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/pie.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { PieSeriesOption } from 'echarts/charts'\nimport type { EChartsOption, IFormatPublicData } from '../types'\nimport { orderBy } from 'lodash-es'\nimport { InjectionChartMerge } from '../utils/injectionKeys'\nimport { useCharts } from '../utils/useCharts'\n\ndefineOptions({\n name: 'DataChartPie',\n})\nconst {\n chartData,\n subShowType = 'pie-simple',\n chartOptions,\n} = defineProps<{\n chartData: IFormatPublicData\n subShowType: string\n chartOptions: EChartsOption\n}>()\nconst merge = inject(InjectionChartMerge, (v: any) => v, true)\n\nconst dataChartPie = ref(null)\nconst pieChartOptions = computed<EChartsOption>(() => {\n const { colDesc, xGroupByDesc, data, modelName } = chartData\n const colDescLength = colDesc.length\n const config = {\n title: { text: modelName },\n series: colDesc.map((item, index) => {\n const seriesItem: PieSeriesOption = {\n name: item,\n type: 'pie',\n center: ['50%', '50%'],\n data: [],\n emphasis: {\n itemStyle: {\n shadowBlur: 10,\n shadowOffsetX: 0,\n shadowColor: 'rgba(0, 0, 0, 0.5)',\n },\n },\n label: {\n formatter: '{b}:{c}({d}%)',\n rich: {\n b: {\n color: '#4C5058',\n fontSize: 14,\n fontWeight: 'bold',\n lineHeight: 33,\n },\n },\n },\n }\n\n let cutNum = 5\n const currentItemData = data.filter(row => row[item] !== undefined)\n const orderByData = orderBy(currentItemData, [item], ['desc'])\n // 总数\n const totalDesc = orderByData.reduce((prev, cur) => {\n const value = Number(cur[item]) || 0\n return Number.isNaN(value) ? prev : prev + value\n }, 0)\n if (currentItemData.length > cutNum) {\n while (cutNum < 9) {\n const headerData = orderByData.slice(0, cutNum)\n // 前 cutNum 个总数\n const headerTotal = headerData.reduce(\n (prev, cur) => prev + Number(cur[item]),\n 0,\n )\n // 前五总占比\n const headerScale = headerTotal / totalDesc\n if (headerScale > 0.9 || cutNum === 8) {\n const footerData = orderByData.slice(\n cutNum,\n orderByData.length - 1,\n )\n seriesItem.data = currentItemData\n .map((yItem) => {\n let obj = {}\n headerData.forEach((headerDataItem) => {\n if (JSON.stringify(headerDataItem) === JSON.stringify(yItem)) {\n obj = {\n name: xGroupByDesc?.colDesc\n ? yItem[xGroupByDesc.colDesc]\n : '',\n value: yItem[item],\n }\n }\n })\n return obj\n })\n .filter(v => v && Object.keys(v).length > 0)\n seriesItem.data.push({\n name: '其它',\n value: footerData.reduce(\n (prev, cur) => prev + Number(cur[item]),\n 0,\n ),\n })\n\n break\n }\n else {\n cutNum++\n }\n }\n }\n else {\n seriesItem.data = currentItemData.map(yItem => ({\n name: xGroupByDesc?.colDesc ? (yItem[xGroupByDesc.colDesc] || '') : '',\n value: Number(yItem[item] || 0),\n }))\n }\n\n if (colDescLength === 1) {\n seriesItem.center = ['50%', '60%']\n }\n else if (colDescLength === 2) {\n if (index === 0) {\n seriesItem.right = '40%'\n seriesItem.left = ''\n seriesItem.center = ['40%', '60%']\n }\n else {\n seriesItem.right = ''\n seriesItem.left = '40%'\n seriesItem.center = ['60%', '60%']\n }\n }\n else if (colDescLength === 3) {\n if (index === 0) {\n seriesItem.right = '40%'\n seriesItem.bottom = '50%'\n seriesItem.top = ''\n seriesItem.left = ''\n seriesItem.center = ['40%', '78%']\n }\n else if (index === 1) {\n seriesItem.right = ''\n seriesItem.bottom = '50%'\n seriesItem.top = ''\n seriesItem.left = '40%'\n seriesItem.center = ['60%', '78%']\n }\n else {\n seriesItem.right = '40%'\n seriesItem.bottom = ''\n seriesItem.top = '50%'\n seriesItem.left = ''\n seriesItem.center = ['40%', '60%']\n }\n }\n else if (colDescLength === 4) {\n if (index === 0) {\n seriesItem.right = '40%'\n seriesItem.bottom = '50%'\n seriesItem.top = ''\n seriesItem.left = ''\n seriesItem.center = ['40%', '78%']\n }\n else if (index === 1) {\n seriesItem.right = ''\n seriesItem.bottom = '50%'\n seriesItem.top = ''\n seriesItem.left = '40%'\n seriesItem.center = ['60%', '78%']\n }\n else if (index === 2) {\n seriesItem.right = '40%'\n seriesItem.bottom = ''\n seriesItem.top = '50%'\n seriesItem.left = ''\n seriesItem.center = ['40%', '60%']\n }\n else {\n seriesItem.right = ''\n seriesItem.bottom = ''\n seriesItem.top = '50%'\n seriesItem.left = '40%'\n seriesItem.center = ['60%', '60%']\n }\n }\n // 处理图表形状\n switch (subShowType) {\n case 'pie-borderRadius':\n seriesItem.radius = ['50%', '70%']\n break\n case 'pie-simple':\n seriesItem.radius = '50%'\n break\n default:\n seriesItem.radius = '50%'\n break\n }\n return seriesItem\n }),\n }\n\n return merge(config, chartOptions)\n})\n\nuseCharts({\n chartDOM: dataChartPie,\n chartOptions: pieChartOptions,\n chartData: computed(() => chartData),\n})\n</script>\n\n<template>\n <div\n ref=\"dataChartPie\"\n class=\"data-chart-pie\"\n />\n</template>\n"],"names":["merge","inject","InjectionChartMerge","v","dataChartPie","ref","pieChartOptions","computed","colDesc","xGroupByDesc","data","modelName","__props","chartData","colDescLength","length","config","title","text","series","map","item","index","seriesItem","name","type","center","emphasis","itemStyle","shadowBlur","shadowOffsetX","shadowColor","label","formatter","rich","b","color","fontSize","fontWeight","lineHeight","cutNum","currentItemData","filter","row","orderByData","orderBy","totalDesc","reduce","prev","cur","value","Number","isNaN","headerData","slice","footerData","yItem","obj","forEach","headerDataItem","JSON","stringify","Object","keys","push","right","left","bottom","top","subShowType","radius","chartOptions","useCharts","chartDOM"],"mappings":"ucAmBA,MAAMA,EAAQC,EAAOC,GAAsBC,GAAWA,IAAG,GAEnDC,EAAeC,EAAI,MACnBC,EAAkBC,GAAwB,KAC9C,MAAMC,QAAEA,EAASC,aAAAA,EAAAC,KAAcA,EAAMC,UAAAA,GAAcC,EAAAC,UAC7CC,EAAgBN,EAAQO,OACxBC,EAAS,CACbC,MAAO,CAAEC,KAAMP,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W2C,KAAO,GACP3C,EAAAG,OAAS,CAAC,MAAO,SAG5BH,EAAW0C,MAAQ,GACnB1C,EAAW4C,OAAS,GACpB5C,EAAW6C,IAAM,MACjB7C,EAAW2C,KAAO,MACP3C,EAAAG,OAAS,CAAC,MAAO,SAKzB,qBADCd,EAAAyD,YAEO9C,EAAA+C,OAAS,CAAC,MAAO,YAM5B/C,EAAW+C,OAAS,MAGjB,OAAA/C,CAAA,KAIJ,OAAAvB,EAAMgB,EAAQJ,EAAY2D,aAAA,WAGzBC,EAAA,CACRC,SAAUrE,EACVmE,aAAcjE,EACdO,UAAWN,GAAS,IAAMK,EAAAC"}
@@ -1,2 +1,2 @@
1
- import{defineComponent as a,ref as r,inject as e,computed as t,createElementBlock as o,openBlock as s}from"vue";import{uniq as u}from"lodash-es";import{InjectionChartMerge as c}from"../utils/injectionKeys.mjs";import{useCharts as l}from"../utils/useCharts.mjs";var m=a({name:"DataChartRadar",__name:"radar",props:{chartData:{type:Object,required:!0,default:()=>({colDesc:[],xGroupByDesc:{colDesc:"",groupByDesc:"",groupByValues:[],xAxis:!1},groupByDesc:[],data:[],modelName:""})},chartOptions:{type:null,required:!0}},setup(a){const m=r(),p=e(c,(a=>a),!0),i=t((()=>{const{colDesc:r,xGroupByDesc:e,modelName:t,data:o}=a.chartData;e?.groupByValues&&(e.groupByValues=[]),e.groupByValues=u(o.map((a=>a[e.colDesc||""])).filter((a=>a)));const s={title:{text:t},radar:{indicator:e?.groupByValues?.map((a=>({name:a,max:Math.max(...o.map((a=>Number(a[r[0]]))))})))||[]},series:[{name:e?.colDesc,type:"radar",tooltip:{trigger:"item"},data:r.map((a=>({name:a,value:e?.groupByValues?.map((r=>o.map((t=>r===t[e.colDesc||""]?t[a]:null)).filter((a=>a)).reduce(((a,r)=>Number(a||0)+Number(r||0)),0)))})))}]};return p(s,a.chartOptions)}));return l({chartDOM:m,chartOptions:i,chartData:t((()=>a.chartData))}),(a,r)=>(s(),o("div",{ref_key:"dataChartRadar",ref:m,class:"data-chart-radar"},null,512))}});export{m as default};
1
+ import{defineComponent as a,ref as r,inject as t,computed as e,createElementBlock as o,openBlock as s}from"vue";import{uniq as m}from"lodash-es";import{InjectionChartMerge as u}from"../utils/injectionKeys.mjs";import{useCharts as p}from"../utils/useCharts.mjs";var c=a({name:"DataChartRadar",__name:"radar",props:{chartData:{type:Object,required:!0},chartOptions:{type:null,required:!0}},setup(a){const c=r(),l=t(u,(a=>a),!0),i=e((()=>{const{colDesc:r,xGroupByDesc:t,modelName:e,data:o}=a.chartData;t?.groupByValues&&(t.groupByValues=[]),t.groupByValues=m(o.map((a=>a[t.colDesc||""])).filter((a=>a)));const s={title:{text:e},radar:{indicator:t?.groupByValues?.map((a=>({name:a,max:Math.max(...o.map((a=>Number(a[r[0]]))))})))||[]},series:[{name:t?.colDesc,type:"radar",tooltip:{trigger:"item"},data:r.map((a=>({name:a,value:t?.groupByValues?.map((r=>o.map((e=>r===e[t.colDesc||""]?e[a]:null)).filter((a=>a)).reduce(((a,r)=>Number(a||0)+Number(r||0)),0)))})))}]};return l(s,a.chartOptions)}));return p({chartDOM:c,chartOptions:i,chartData:e((()=>a.chartData))}),(a,r)=>(s(),o("div",{ref_key:"dataChartRadar",ref:c,class:"data-chart-radar"},null,512))}});export{c as default};
2
2
  //# sourceMappingURL=radar.vue.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"radar.vue.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/radar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { EChartsOption, IFormatPublicData } from '../types'\nimport { uniq } from 'lodash-es'\nimport { InjectionChartMerge } from '../utils/injectionKeys'\nimport { useCharts } from '../utils/useCharts'\n\ndefineOptions({\n name: 'DataChartRadar',\n})\n\nconst {\n chartData = {\n colDesc: [],\n xGroupByDesc: {\n colDesc: '',\n groupByDesc: '',\n groupByValues: [],\n xAxis: false,\n },\n groupByDesc: [],\n data: [],\n modelName: '',\n },\n chartOptions,\n} = defineProps<{\n chartData: IFormatPublicData\n chartOptions: EChartsOption\n}>()\n\nconst dataChartRadar = ref()\nconst merge = inject(InjectionChartMerge, (v: any) => v, true)\nconst radarChartOptions = computed<EChartsOption>(() => {\n const { colDesc, xGroupByDesc, modelName, data } = chartData\n\n if (xGroupByDesc?.groupByValues) {\n xGroupByDesc.groupByValues = []\n }\n xGroupByDesc.groupByValues = uniq(data.map((item) => {\n return item[xGroupByDesc.colDesc || ''] as string\n }).filter(v => v))\n\n const config = {\n title: {\n text: modelName,\n },\n radar: {\n indicator: xGroupByDesc?.groupByValues?.map((groupByValuesItem) => {\n return {\n name: groupByValuesItem,\n max: Math.max(...data.map(item => Number(item[colDesc[0]]))),\n }\n }) || [],\n },\n series: [{\n name: xGroupByDesc?.colDesc,\n type: 'radar',\n tooltip: {\n trigger: 'item',\n },\n data: colDesc.map(colDescItem => ({\n name: colDescItem,\n value: xGroupByDesc?.groupByValues?.map((groupByValuesItem) => {\n return (data.map((dataItem) => {\n if (groupByValuesItem === dataItem[xGroupByDesc.colDesc || '']) {\n return dataItem[colDescItem]\n }\n return null\n }).filter(v => v)).reduce((pre, cur) => Number(pre || 0) + Number(cur || 0), 0)\n }),\n })),\n }],\n }\n\n return merge(config, chartOptions)\n})\nuseCharts({ chartDOM: dataChartRadar, chartOptions: radarChartOptions, chartData: computed(() => chartData) })\n</script>\n\n<template>\n <div ref=\"dataChartRadar\" class=\"data-chart-radar\" />\n</template>\n"],"names":["dataChartRadar","ref","merge","inject","InjectionChartMerge","v","radarChartOptions","computed","colDesc","xGroupByDesc","modelName","data","__props","chartData","groupByValues","uniq","map","item","filter","config","title","text","radar","indicator","groupByValuesItem","name","max","Math","Number","series","type","tooltip","trigger","colDescItem","value","dataItem","reduce","pre","cur","chartOptions","useCharts","chartDOM"],"mappings":"+gBA6BA,MAAMA,EAAiBC,IACjBC,EAAQC,EAAOC,GAAsBC,GAAWA,IAAG,GACnDC,EAAoBC,GAAwB,KAChD,MAAMC,QAAEA,EAASC,aAAAA,EAAAC,UAAcA,EAAWC,KAAAA,GAASC,EAAAC,UAE/CJ,GAAcK,gBAChBL,EAAaK,cAAgB,IAE/BL,EAAaK,cAAgBC,EAAKJ,EAAKK,KAAKC,GACnCA,EAAKR,EAAaD,SAAW,MACnCU,QAAOb,GAAKA,KAEf,MAAMc,EAAS,CACbC,MAAO,CACLC,KAAMX,GAERY,MAAO,CACLC,UAAWd,GAAcK,eAAeE,KAAKQ,IACpC,CACLC,KAAMD,EACNE,IAAKC,KAAKD,OAAOf,EAAKK,KAAIC,GAAQW,OAAOX,EAAKT,EAAQ,aAEpD,IAERqB,OAAQ,CAAC,CACPJ,KAAMhB,GAAcD,QACpBsB,KAAM,QACNC,QAAS,CACPC,QAAS,QAEXrB,KAAMH,EAAQQ,KAAoBiB,IAAA,CAChCR,KAAMQ,EACNC,MAAOzB,GAAcK,eAAeE,KAAKQ,GAC/Bb,EAAKK,KAAKmB,GACZX,IAAsBW,EAAS1B,EAAaD,SAAW,IAClD2B,EAASF,GAEX,OACNf,WAAYb,IAAI+B,QAAO,CAACC,EAAKC,IAAQV,OAAOS,GAAO,GAAKT,OAAOU,GAAO,IAAI,YAM9E,OAAApC,EAAMiB,EAAQP,EAAY2B,aAAA,WAEzBC,EAAA,CAAEC,SAAUzC,EAAgBuC,aAAcjC,EAAmBO,UAAWN,GAAS,IAAMK,EAAAC"}
1
+ {"version":3,"file":"radar.vue.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/radar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { EChartsOption, IFormatPublicData } from '../types'\nimport { uniq } from 'lodash-es'\nimport { InjectionChartMerge } from '../utils/injectionKeys'\nimport { useCharts } from '../utils/useCharts'\n\ndefineOptions({\n name: 'DataChartRadar',\n})\n\nconst {\n chartData,\n chartOptions,\n} = defineProps<{\n chartData: IFormatPublicData\n chartOptions: EChartsOption\n}>()\n\nconst dataChartRadar = ref()\nconst merge = inject(InjectionChartMerge, (v: any) => v, true)\nconst radarChartOptions = computed<EChartsOption>(() => {\n const { colDesc, xGroupByDesc, modelName, data } = chartData\n\n if (xGroupByDesc?.groupByValues) {\n xGroupByDesc.groupByValues = []\n }\n xGroupByDesc.groupByValues = uniq(data.map((item) => {\n return item[xGroupByDesc.colDesc || ''] as string\n }).filter(v => v))\n\n const config = {\n title: {\n text: modelName,\n },\n radar: {\n indicator: xGroupByDesc?.groupByValues?.map((groupByValuesItem) => {\n return {\n name: groupByValuesItem,\n max: Math.max(...data.map(item => Number(item[colDesc[0]]))),\n }\n }) || [],\n },\n series: [{\n name: xGroupByDesc?.colDesc,\n type: 'radar',\n tooltip: {\n trigger: 'item',\n },\n data: colDesc.map(colDescItem => ({\n name: colDescItem,\n value: xGroupByDesc?.groupByValues?.map((groupByValuesItem) => {\n return (data.map((dataItem) => {\n if (groupByValuesItem === dataItem[xGroupByDesc.colDesc || '']) {\n return dataItem[colDescItem]\n }\n return null\n }).filter(v => v)).reduce((pre, cur) => Number(pre || 0) + Number(cur || 0), 0)\n }),\n })),\n }],\n }\n\n return merge(config, chartOptions)\n})\nuseCharts({ chartDOM: dataChartRadar, chartOptions: radarChartOptions, chartData: computed(() => chartData) })\n</script>\n\n<template>\n <div\n ref=\"dataChartRadar\"\n class=\"data-chart-radar\"\n />\n</template>\n"],"names":["dataChartRadar","ref","merge","inject","InjectionChartMerge","v","radarChartOptions","computed","colDesc","xGroupByDesc","modelName","data","__props","chartData","groupByValues","uniq","map","item","filter","config","title","text","radar","indicator","groupByValuesItem","name","max","Math","Number","series","type","tooltip","trigger","colDescItem","value","dataItem","reduce","pre","cur","chartOptions","useCharts","chartDOM"],"mappings":"6YAkBA,MAAMA,EAAiBC,IACjBC,EAAQC,EAAOC,GAAsBC,GAAWA,IAAG,GACnDC,EAAoBC,GAAwB,KAChD,MAAMC,QAAEA,EAASC,aAAAA,EAAAC,UAAcA,EAAWC,KAAAA,GAASC,EAAAC,UAE/CJ,GAAcK,gBAChBL,EAAaK,cAAgB,IAE/BL,EAAaK,cAAgBC,EAAKJ,EAAKK,KAAKC,GACnCA,EAAKR,EAAaD,SAAW,MACnCU,QAAOb,GAAKA,KAEf,MAAMc,EAAS,CACbC,MAAO,CACLC,KAAMX,GAERY,MAAO,CACLC,UAAWd,GAAcK,eAAeE,KAAKQ,IACpC,CACLC,KAAMD,EACNE,IAAKC,KAAKD,OAAOf,EAAKK,KAAIC,GAAQW,OAAOX,EAAKT,EAAQ,aAEpD,IAERqB,OAAQ,CAAC,CACPJ,KAAMhB,GAAcD,QACpBsB,KAAM,QACNC,QAAS,CACPC,QAAS,QAEXrB,KAAMH,EAAQQ,KAAoBiB,IAAA,CAChCR,KAAMQ,EACNC,MAAOzB,GAAcK,eAAeE,KAAKQ,GAC/Bb,EAAKK,KAAKmB,GACZX,IAAsBW,EAAS1B,EAAaD,SAAW,IAClD2B,EAASF,GAEX,OACNf,WAAYb,IAAI+B,QAAO,CAACC,EAAKC,IAAQV,OAAOS,GAAO,GAAKT,OAAOU,GAAO,IAAI,YAM9E,OAAApC,EAAMiB,EAAQP,EAAY2B,aAAA,WAEzBC,EAAA,CAAEC,SAAUzC,EAAgBuC,aAAcjC,EAAmBO,UAAWN,GAAS,IAAMK,EAAAC"}
@@ -1,2 +1,2 @@
1
- import{defineComponent as e,ref as t,inject as a,computed as r,createElementBlock as s,openBlock as c}from"vue";import{InjectionChartMerge as o}from"../utils/injectionKeys.mjs";import{useCharts as l}from"../utils/useCharts.mjs";var m=e({name:"DataChartScatterSimple",__name:"scatter-simple",props:{chartData:{type:Object,required:!0,default:()=>({colDesc:[],xGroupByDesc:{colDesc:"",groupByDesc:"",groupByValues:[],xAxis:!1},groupByDesc:[],data:[],modelName:""})},chartOptions:{type:null,required:!0}},setup(e){const m=t(),p=a(o,(e=>e),!0),i=r((()=>{const{colDesc:t,xGroupByDesc:a,modelName:r,data:s}=e.chartData,c={title:{text:r},tooltip:{formatter:e=>e.value.length>1?`${e.seriesName} :<br/>${e.value[0]} ${e.value[1]} `:`${e.seriesName} :<br/>${e.name} : ${e.value} `},series:t.map((e=>({symbolSize:20,name:e,data:s.map((t=>[t[e],t[a?.colDesc||""]])),type:"scatter"})))};return p(c,e.chartOptions)}));return l({chartDOM:m,chartOptions:i,chartData:r((()=>e.chartData))}),(e,t)=>(c(),s("div",{ref_key:"dataChartScatterSimple",ref:m,class:"data-chart-scatter-simple"},null,512))}});export{m 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 '../types'\nimport { InjectionChartMerge } from '../utils/injectionKeys'\nimport { useCharts } from '../utils/useCharts'\n\ndefineOptions({\n name: 'DataChartScatterSimple',\n})\nconst {\n chartData = {\n colDesc: [],\n xGroupByDesc: {\n colDesc: '',\n groupByDesc: '',\n groupByValues: [],\n xAxis: false,\n },\n groupByDesc: [],\n data: [],\n modelName: '',\n },\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 ref=\"dataChartScatterSimple\" class=\"data-chart-scatter-simple\" />\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":"+fA0BA,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 '../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,2 +1,2 @@
1
- import{defineComponent as t,ref as a,inject as e,computed as r,createElementBlock as s,openBlock as c}from"vue";import{InjectionChartMerge as o}from"../utils/injectionKeys.mjs";import{useCharts as i}from"../utils/useCharts.mjs";var p=t({name:"DataChartScatter",__name:"scatter",props:{chartData:{type:Object,required:!0,default:()=>({colDesc:[],xGroupByDesc:{colDesc:"",groupByDesc:"",groupByValues:[],xAxis:!1},groupByDesc:[],data:[],modelName:""})},chartOptions:{type:null,required:!0}},setup(t){const p=a(),u=e(o,(t=>t),!0),l=r((()=>u({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 i({chartDOM:p,chartOptions:l,chartData:r((()=>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 '../types'\nimport { InjectionChartMerge } from '../utils/injectionKeys'\nimport { useCharts } from '../utils/useCharts'\n\ndefineOptions({\n name: 'DataChartScatter',\n})\n\nconst {\n chartData = {\n colDesc: [],\n xGroupByDesc: {\n colDesc: '',\n groupByDesc: '',\n groupByValues: [],\n xAxis: false,\n },\n groupByDesc: [],\n data: [],\n modelName: '',\n },\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 ref=\"dataChartScatter\" class=\"data-chart-scatter\" />\n</template>\n"],"names":["dataChartScatter","ref","merge","inject","InjectionChartMerge","v","scatterChartOptions","computed","xAxis","yAxis","series","symbolSize","data","type","__props","chartOptions","useCharts","chartDOM","chartData"],"mappings":"kfA4BA,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 '../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,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 d,Fragment as u,renderList as h,createBlock as D,createTextVNode as b}from"vue";import f from"./empty.vue.mjs";import{useNamespace as y}from"@qxs-bns/hooks";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=y("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,y)=>{const w=t,_=e;return s(),l("div",{class:r([c(g).e("data-chart-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-chart-table-content",data:a.chartData.data,stripe:"",height:"100%"},{empty:d((()=>[p(f)])),default:d((()=>[(s(!0),l(u,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:d((()=>[b(i(e.colDesc),1)])),default:d((t=>[b(i((c(v)&&(c(v).colDesc,e.colDesc),t.row[e.colDesc||""]||"--")),1)])),_:2},1032,["min-width","prop"])))),128)),(s(!0),l(u,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:d((()=>[b(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 d,Fragment as u,renderList as h,createBlock as D,createTextVNode as b}from"vue";import{useNamespace as f}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=f("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,f)=>{const w=t,_=e;return s(),l("div",{class:r([c(g).e("data-chart-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-chart-table-content",data:a.chartData.data,stripe:"",height:"100%"},{empty:d((()=>[p(y)])),default:d((()=>[(s(!0),l(u,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:d((()=>[b(i(e.colDesc),1)])),default:d((t=>[b(i((c(v)&&(c(v).colDesc,e.colDesc),t.row[e.colDesc||""]||"--")),1)])),_:2},1032,["min-width","prop"])))),128)),(s(!0),l(u,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:d((()=>[b(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 '../types'\nimport Empty from './empty.vue'\nimport { useNamespace } from '@qxs-bns/hooks'\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('data-chart-table')]\">\n <p v-if=\"chartData.modelName\" class=\"title\">\n <span>{{ chartData.modelName }}</span>\n </p>\n <el-table\n class=\"customize-table data-chart-table-content\"\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>"],"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 '../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('data-chart-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 data-chart-table-content\"\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,2 +1,2 @@
1
- import{defineComponent as e,computed as t,provide as o,createBlock as r,openBlock as s,resolveDynamicComponent as a,unref as p,normalizeClass as m}from"vue";import{JsonToExcel as n}from"@qxs-bns/utils";import{cloneDeep as c,merge as i}from"lodash-es";import{defaultChartOption as u}from"./utils/config.mjs";import{InjectionChartMerge as l}from"./utils/injectionKeys.mjs";import{useDataToExcelJson as d}from"./utils/useCharts.mjs";import{useNamespace as f}from"@qxs-bns/hooks";import h from"./components/table.vue.mjs";import y from"./components/bar.vue.mjs";import j from"./components/line.vue.mjs";import b from"./components/pie.vue.mjs";import g from"./components/radar.vue.mjs";import v from"./components/scatter.vue.mjs";import w from"./components/funnel.vue.mjs";import x from"./components/area.vue.mjs";import D from"./components/card.vue.mjs";import S from"./components/scatter-simple.vue.mjs";var q=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:q}){const T=f("data-chart"),N={table:h,bar:y,line:j,pie:b,radar:g,scatter:v,funnel:w,area:x,card:D,"scatter-simple":S},B=t((()=>c(u[e.showTypeName]))),C=t((()=>{const{desc:{colDesc:t=[],groupByDesc:o=[]}={},data:r=[]}=e.data;let s=[],a=null;s=o?.map((e=>(e.xAxis&&(a=e),e)));const p=a?r.filter((e=>e&&e[a.colDesc])):r;return{colDesc:t,modelName:e.modelName,subShowType:e.subShowType,xGroupByDesc:a||{groupByDesc:null,groupByValues:null,colDesc:null,xAxis:!1},groupByDesc:s,data:p}}));return q({exportExal:function(){if(0===e.data.data.length)return void console.log("暂无数据");const t=d(e.data);n(e.modelName,t)}}),o(l,(function(t,o){let r=i({},B.value,t,o)||{};if(e.jsCodeSnippet)try{r=new Function("config",`"use strict"; ${e.jsCodeSnippet}; return config;`)(r)}catch(e){console.error("代码执行失败:",e)}return r})),(e,t)=>(s(),r(a(N[e.showTypeName]),{class:m([p(T).e("wrapper")]),"sub-show-type":e.subShowType,"chart-data":p(C),"chart-options":e.chartOptions},null,8,["class","sub-show-type","chart-data","chart-options"]))}});export{q as default};
1
+ import{defineComponent as e,computed as o,provide as t,createBlock as r,openBlock as s,resolveDynamicComponent as a,unref as m,normalizeClass as p}from"vue";import{useNamespace as n}from"@qxs-bns/hooks";import{JsonToExcel as c}from"@qxs-bns/utils";import{cloneDeep as i,merge as u}from"lodash-es";import l from"./components/area.vue.mjs";import d from"./components/bar.vue.mjs";import f from"./components/card.vue.mjs";import y from"./components/funnel.vue.mjs";import h from"./components/line.vue.mjs";import j from"./components/pie.vue.mjs";import v from"./components/radar.vue.mjs";import D from"./components/scatter-simple.vue.mjs";import b from"./components/scatter.vue.mjs";import g from"./components/table.vue.mjs";import{defaultChartOption as w}from"./utils/config.mjs";import{InjectionChartMerge as x}from"./utils/injectionKeys.mjs";import{safeEvalConfig as S}from"./utils/safe-eval.mjs";import{useDataToExcelJson as N}from"./utils/useCharts.mjs";var T=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:T}){const q=n("data-chart"),B={table:g,bar:d,line:h,pie:j,radar:v,scatter:b,funnel:y,area:l,card:f,"scatter-simple":D},C=o((()=>i(w[e.showTypeName]))),O=o((()=>{const{desc:{colDesc:o=[],groupByDesc:t=[]}={},data:r=[]}=e.data;let s=[],a=null;s=t?.map((e=>(e.xAxis&&(a=e),e)));const m=a?r.filter((e=>e&&e[a.colDesc])):r;return k({colDesc:[],xGroupByDesc:{colDesc:"",groupByDesc:"",groupByValues:[],xAxis:!1},groupByDesc:[],data:[],modelName:""},{colDesc:o,modelName:e.modelName,subShowType:e.subShowType,xGroupByDesc:a,groupByDesc:s,data:m})}));function k(o,t){let r=u({},C.value,o,t)||{};if(e.jsCodeSnippet)try{r=S(e.jsCodeSnippet,r)}catch(e){console.error("代码执行失败:",e)}return r}return T({exportExal:function(){if(0===e.data.data.length)return void console.log("暂无数据");const o=N(e.data);c(e.modelName,o)}}),t(x,k),(e,o)=>(s(),r(a(B[e.showTypeName]),{key:e.showTypeName,class:p([m(q).e("wrapper")]),"sub-show-type":e.subShowType,"chart-data":m(O),"chart-options":e.chartOptions},null,8,["class","sub-show-type","chart-data","chart-options"]))}});export{T as default};
2
2
  //# sourceMappingURL=data-chart.vue.mjs.map