@qxs-bns/components 0.0.49 → 0.0.50

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 (141) hide show
  1. package/es/index.mjs +1 -1
  2. package/es/index.mjs.map +1 -1
  3. package/es/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.mjs +2 -0
  4. package/es/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.mjs.map +1 -0
  5. package/es/package.json.mjs +1 -1
  6. package/es/src/components.mjs +1 -1
  7. package/es/src/data-chart/index.mjs +1 -1
  8. package/es/src/data-chart/index.mjs.map +1 -1
  9. package/es/src/data-chart/src/analyze.mjs +2 -0
  10. package/es/src/data-chart/src/analyze.mjs.map +1 -0
  11. package/es/src/data-chart/src/components/area.vue.mjs +1 -1
  12. package/es/src/data-chart/src/components/area.vue2.mjs.map +1 -1
  13. package/es/src/data-chart/src/components/area.vue3.mjs +2 -0
  14. package/es/src/data-chart/src/components/area.vue3.mjs.map +1 -0
  15. package/es/src/data-chart/src/components/bar.vue.mjs +1 -1
  16. package/es/src/data-chart/src/components/bar.vue.mjs.map +1 -1
  17. package/es/src/data-chart/src/components/card.vue.mjs +1 -1
  18. package/es/src/data-chart/src/components/card.vue2.mjs +1 -1
  19. package/es/src/data-chart/src/components/card.vue2.mjs.map +1 -1
  20. package/es/src/data-chart/src/components/card.vue3.mjs +2 -0
  21. package/es/src/data-chart/src/components/card.vue3.mjs.map +1 -0
  22. package/es/src/data-chart/src/components/data-chart-card-bg-left.svg.mjs +2 -0
  23. package/es/src/data-chart/src/components/data-chart-card-bg-left.svg.mjs.map +1 -0
  24. package/es/src/data-chart/src/components/data-chart-card-bg-right.svg.mjs +2 -0
  25. package/es/src/data-chart/src/components/data-chart-card-bg-right.svg.mjs.map +1 -0
  26. package/es/src/data-chart/src/components/empty.vue.mjs +1 -1
  27. package/es/src/data-chart/src/components/empty.vue.mjs.map +1 -1
  28. package/es/src/data-chart/src/components/funnel.vue.mjs.map +1 -1
  29. package/es/src/data-chart/src/components/line.vue.mjs +1 -1
  30. package/es/src/data-chart/src/components/line.vue2.mjs +1 -1
  31. package/es/src/data-chart/src/components/line.vue2.mjs.map +1 -1
  32. package/es/src/data-chart/src/components/line.vue3.mjs +2 -0
  33. package/es/src/data-chart/src/components/line.vue3.mjs.map +1 -0
  34. package/es/src/data-chart/src/components/pie.vue.mjs.map +1 -1
  35. package/es/src/data-chart/src/components/radar.vue.mjs +1 -1
  36. package/es/src/data-chart/src/components/radar.vue.mjs.map +1 -1
  37. package/es/src/data-chart/src/components/scatter-simple.vue.mjs.map +1 -1
  38. package/es/src/data-chart/src/components/scatter.vue.mjs.map +1 -1
  39. package/es/src/data-chart/src/components/table.vue.mjs +1 -1
  40. package/es/src/data-chart/src/components/table.vue.mjs.map +1 -1
  41. package/es/src/data-chart/src/data-chart.vue.mjs +1 -1
  42. package/es/src/data-chart/src/data-chart.vue.mjs.map +1 -1
  43. package/es/src/data-chart/src/utils/config.mjs +1 -1
  44. package/es/src/data-chart/src/utils/config.mjs.map +1 -1
  45. package/es/src/data-chart/src/utils/safe-eval.mjs.map +1 -1
  46. package/es/src/data-chart/src/utils/useCharts.mjs +1 -1
  47. package/es/src/data-chart/src/utils/useCharts.mjs.map +1 -1
  48. package/lib/index.cjs +1 -1
  49. package/lib/index.cjs.map +1 -1
  50. package/lib/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.cjs +2 -0
  51. package/lib/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.cjs.map +1 -0
  52. package/lib/package.json.cjs +1 -1
  53. package/lib/src/components.cjs +1 -1
  54. package/lib/src/data-chart/index.cjs +1 -1
  55. package/lib/src/data-chart/index.cjs.map +1 -1
  56. package/lib/src/data-chart/src/analyze.cjs +2 -0
  57. package/lib/src/data-chart/src/analyze.cjs.map +1 -0
  58. package/lib/src/data-chart/src/components/area.vue.cjs +1 -1
  59. package/lib/src/data-chart/src/components/area.vue2.cjs.map +1 -1
  60. package/lib/src/data-chart/src/components/area.vue3.cjs +2 -0
  61. package/lib/src/data-chart/src/components/area.vue3.cjs.map +1 -0
  62. package/lib/src/data-chart/src/components/bar.vue.cjs +1 -1
  63. package/lib/src/data-chart/src/components/bar.vue.cjs.map +1 -1
  64. package/lib/src/data-chart/src/components/card.vue.cjs +1 -1
  65. package/lib/src/data-chart/src/components/card.vue2.cjs +1 -1
  66. package/lib/src/data-chart/src/components/card.vue2.cjs.map +1 -1
  67. package/lib/src/data-chart/src/components/card.vue3.cjs +2 -0
  68. package/lib/src/data-chart/src/components/card.vue3.cjs.map +1 -0
  69. package/lib/src/data-chart/src/components/data-chart-card-bg-left.svg.cjs +2 -0
  70. package/lib/src/data-chart/src/components/data-chart-card-bg-left.svg.cjs.map +1 -0
  71. package/lib/src/data-chart/src/components/data-chart-card-bg-right.svg.cjs +2 -0
  72. package/lib/src/data-chart/src/components/data-chart-card-bg-right.svg.cjs.map +1 -0
  73. package/lib/src/data-chart/src/components/empty.vue.cjs +1 -1
  74. package/lib/src/data-chart/src/components/empty.vue.cjs.map +1 -1
  75. package/lib/src/data-chart/src/components/funnel.vue.cjs.map +1 -1
  76. package/lib/src/data-chart/src/components/line.vue.cjs +1 -1
  77. package/lib/src/data-chart/src/components/line.vue2.cjs +1 -1
  78. package/lib/src/data-chart/src/components/line.vue2.cjs.map +1 -1
  79. package/lib/src/data-chart/src/components/line.vue3.cjs +2 -0
  80. package/lib/src/data-chart/src/components/line.vue3.cjs.map +1 -0
  81. package/lib/src/data-chart/src/components/pie.vue.cjs.map +1 -1
  82. package/lib/src/data-chart/src/components/radar.vue.cjs +1 -1
  83. package/lib/src/data-chart/src/components/radar.vue.cjs.map +1 -1
  84. package/lib/src/data-chart/src/components/scatter-simple.vue.cjs.map +1 -1
  85. package/lib/src/data-chart/src/components/scatter.vue.cjs.map +1 -1
  86. package/lib/src/data-chart/src/components/table.vue.cjs +1 -1
  87. package/lib/src/data-chart/src/components/table.vue.cjs.map +1 -1
  88. package/lib/src/data-chart/src/data-chart.vue.cjs +1 -1
  89. package/lib/src/data-chart/src/data-chart.vue.cjs.map +1 -1
  90. package/lib/src/data-chart/src/utils/config.cjs +1 -1
  91. package/lib/src/data-chart/src/utils/config.cjs.map +1 -1
  92. package/lib/src/data-chart/src/utils/safe-eval.cjs.map +1 -1
  93. package/lib/src/data-chart/src/utils/useCharts.cjs +1 -1
  94. package/lib/src/data-chart/src/utils/useCharts.cjs.map +1 -1
  95. package/package.json +5 -5
  96. package/theme-chalk/index.css +1 -1
  97. package/theme-chalk/src/common/element-plus.css +1 -1
  98. package/theme-chalk/src/common/element-plus.scss +1 -1
  99. package/theme-chalk/src/data-chart/empty.css +1 -1
  100. package/theme-chalk/src/data-chart/empty.scss +3 -3
  101. package/theme-chalk/src/data-chart/index.css +1 -1
  102. package/theme-chalk/src/data-chart/table.css +1 -1
  103. package/theme-chalk/src/data-chart/table.scss +8 -4
  104. package/types/src/data-chart/index.d.ts +7 -4
  105. package/types/src/data-chart/index.d.ts.map +1 -1
  106. package/types/src/data-chart/src/analyze.d.ts +1 -1
  107. package/types/src/data-chart/src/analyze.d.ts.map +1 -1
  108. package/types/src/data-chart/src/components/area.vue.d.ts +1 -1
  109. package/types/src/data-chart/src/components/area.vue.d.ts.map +1 -1
  110. package/types/src/data-chart/src/components/bar.vue.d.ts +1 -1
  111. package/types/src/data-chart/src/components/bar.vue.d.ts.map +1 -1
  112. package/types/src/data-chart/src/components/card.vue.d.ts +1 -1
  113. package/types/src/data-chart/src/components/card.vue.d.ts.map +1 -1
  114. package/types/src/data-chart/src/components/empty.vue.d.ts.map +1 -1
  115. package/types/src/data-chart/src/components/funnel.vue.d.ts +1 -1
  116. package/types/src/data-chart/src/components/funnel.vue.d.ts.map +1 -1
  117. package/types/src/data-chart/src/components/line.vue.d.ts +1 -1
  118. package/types/src/data-chart/src/components/line.vue.d.ts.map +1 -1
  119. package/types/src/data-chart/src/components/pie.vue.d.ts +1 -1
  120. package/types/src/data-chart/src/components/pie.vue.d.ts.map +1 -1
  121. package/types/src/data-chart/src/components/radar.vue.d.ts +1 -1
  122. package/types/src/data-chart/src/components/radar.vue.d.ts.map +1 -1
  123. package/types/src/data-chart/src/components/scatter-simple.vue.d.ts +1 -1
  124. package/types/src/data-chart/src/components/scatter-simple.vue.d.ts.map +1 -1
  125. package/types/src/data-chart/src/components/scatter.vue.d.ts +1 -1
  126. package/types/src/data-chart/src/components/scatter.vue.d.ts.map +1 -1
  127. package/types/src/data-chart/src/components/table.vue.d.ts +1 -1
  128. package/types/src/data-chart/src/components/table.vue.d.ts.map +1 -1
  129. package/types/src/data-chart/src/data-chart.vue.d.ts +2 -2
  130. package/types/src/data-chart/src/data-chart.vue.d.ts.map +1 -1
  131. package/types/src/data-chart/src/utils/config.d.ts +1 -1
  132. package/types/src/data-chart/src/utils/config.d.ts.map +1 -1
  133. package/types/src/data-chart/src/utils/safe-eval.d.ts +1 -1
  134. package/types/src/data-chart/src/utils/safe-eval.d.ts.map +1 -1
  135. package/types/src/data-chart/src/utils/types.d.ts +68 -0
  136. package/types/src/data-chart/src/utils/types.d.ts.map +1 -0
  137. package/types/src/data-chart/src/utils/useCharts.d.ts +1 -1
  138. package/types/src/data-chart/src/utils/useCharts.d.ts.map +1 -1
  139. package/types/tsconfig.tsbuildinfo +1 -1
  140. package/es/index.css +0 -83
  141. package/lib/index.css +0 -83
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),a=require("lodash-es"),t=require("../utils/injectionKeys.cjs"),r=require("../utils/useCharts.cjs"),s=e.defineComponent({name:"DataChartBar",__name:"bar",props:{chartData:{type:Object,required:!0},subShowType:{type:String,required:!0,default:"bar-simple"},chartOptions:{type:null,required:!0}},setup(s){const c=e.inject(t.InjectionChartMerge,(e=>e),!0),l=e.ref(null),o=e.computed((()=>{const{colDesc:e,xGroupByDesc:t,groupByDesc:r,data:l=[],modelName:o}=s.chartData,i=Array.from(new Set(l.map((e=>e[t.colDesc||""])))).filter((e=>null!=e))||[],n=r.find((e=>!e.xAxis))||{groupByValues:[],colDesc:""};n.groupByValues=a.uniq(l.map((e=>n.colDesc?String(e[n.colDesc]):""))),t&&t.groupByValues&&(t.groupByValues=a.uniq(l.map((e=>t.colDesc?String(e[t.colDesc]):""))));const u={title:{text:o},xAxis:{name:"",type:"category",axisLabel:{interval:0,formatter:e=>e.length>5?`${e.substring(0,5)}...`:e},data:i},yAxis:{type:"value"},legend:{data:[]},dataZoom:[{type:"inside",disabled:i.length<15}]};if(1===r.length)u.series=e.map((e=>({name:e,data:l.map((a=>a[e])),type:"bar",emphasis:{focus:"series"},label:{show:!0,position:"inside"}}))),u.legend.data=e;else if(2===r.length){const a=e.map((e=>n.groupByValues?.map((a=>{const r={name:`${a||"/"}-${e}`,type:"bar",stack:e,emphasis:{focus:"series"},data:[],label:{show:!0,position:"inside"}};return r.data=(t.groupByValues||[]).map((e=>{let s=null;return l.forEach((c=>{n.colDesc&&c[n.colDesc]===a&&t.colDesc&&c[t.colDesc]===e&&r.stack&&(s=c[r.stack]??null)})),s||""})).filter((e=>""!==e)),r}))||[])).flat();u.series=a,delete u.legend}function p(e,a,t,r){Array.isArray(e)?e.forEach((e=>{e&&(e.type=a,"category"===a&&(e.data=t||[],e.name=r||""))})):e&&(e.type=a,"category"===a&&(e.data=t||[],e.name=r||""))}switch(s.subShowType){case"bar-simple":case"default":p(u.xAxis,"category",i,t.colDesc||""),p(u.yAxis,"value");break;case"bar-y-category":p(u.xAxis,"value"),p(u.yAxis,"category",i,t.colDesc||"")}return c(u,s.chartOptions)}));return r.useCharts({chartDOM:l,chartOptions:o,chartData:e.computed((()=>s.chartData))}),(a,t)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dataChartBar",ref:l,class:"data-chart-bar"},null,512))}});exports.default=s;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),a=require("lodash-es"),t=require("../utils/injectionKeys.cjs"),r=require("../utils/useCharts.cjs"),s=e.defineComponent({name:"DataChartBar",__name:"bar",props:{chartData:{type:Object,required:!0},subShowType:{type:String,required:!0,default:"bar-simple"},chartOptions:{type:null,required:!0}},setup(s){const c=e.inject(t.InjectionChartMerge,(e=>e),!0),l=e.ref(null),o=e.computed((()=>{const{colDesc:e,xGroupByDesc:t,groupByDesc:r,data:l=[],modelName:o}=s.chartData,i=Array.from(new Set(l.map((e=>e[t.colDesc||""])))).filter((e=>null!=e))||[],n=r.find((e=>!e.xAxis))||{groupByValues:[],colDesc:""};n.groupByValues=a.uniq(l.map((e=>n.colDesc?String(e[n.colDesc]):""))),t&&t.groupByValues&&(t.groupByValues=a.uniq(l.map((e=>t.colDesc?String(e[t.colDesc]):""))));const u={title:{text:o},xAxis:{name:"",type:"category",axisLabel:{interval:0,formatter:e=>e.length>5?`${e.substring(0,5)}...`:e},data:i},yAxis:{type:"value"},legend:{data:[]},dataZoom:[{type:"inside",disabled:i.length<15}]};if(1===r.length)u.series=e.map((e=>({name:e,data:l.map((a=>a[e])),type:"bar",emphasis:{focus:"series"},label:{show:!0,position:"inside"}}))),u.legend.data=e;else if(2===r.length){const a=e.map((e=>n.groupByValues?.map((a=>{const r={name:`${a||"/"}-${e}`,type:"bar",stack:e,emphasis:{focus:"series"},data:[],label:{show:!0,position:"inside"}};return r.data=(t.groupByValues||[]).map((e=>{let s=null;return l.forEach((c=>{n.colDesc&&c[n.colDesc]===a&&t.colDesc&&c[t.colDesc]===e&&r.stack&&(s=c[r.stack]??null)})),s||""})).filter((e=>""!==e)),r}))||[])).flat();u.series=a,delete u.legend}function p(e,a,t,r){Array.isArray(e)?e.forEach((e=>{e&&(e.type=a,"category"===a&&(e.data=t||[],e.name=r||""))})):e&&(e.type=a,"category"===a&&(e.data=t||[],e.name=r||""))}switch(s.subShowType){case"bar-simple":case"default":p(u.xAxis,"category",i,t?.colDesc||""),p(u.yAxis,"value");break;case"bar-y-category":p(u.xAxis,"value"),p(u.yAxis,"category",i,t?.colDesc||"")}return c(u,s.chartOptions)}));return r.useCharts({chartDOM:l,chartOptions:o,chartData:e.computed((()=>s.chartData))}),(a,t)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dataChartBar",ref:l,class:"data-chart-bar"},null,512))}});exports.default=s;
2
2
  //# sourceMappingURL=bar.vue.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"bar.vue.cjs","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":"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"}
1
+ {"version":3,"file":"bar.vue.cjs","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 '../utils/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":"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"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./card.vue2.cjs"),r=require("../../../../_virtual/_plugin-vue_export-helper.cjs").default(e.default,[["__scopeId","data-v-1c14c088"]]);exports.default=r;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./card.vue2.cjs");require("./card.vue3.cjs");var r=require("../../../../_virtual/_plugin-vue_export-helper.cjs").default(e.default,[["__scopeId","data-v-1c14c088"]]);exports.default=r;
2
2
  //# sourceMappingURL=card.vue.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("element-plus/es");require("element-plus/es/components/base/style/index"),require("element-plus/es/components/scrollbar/style/index");var t=require("vue"),a=require("./empty.vue.cjs");const l={class:"data-chart-card"},c={key:0,class:"title"},r=["title"],o={class:"context"},n={class:"suffix-icon"},s={key:2,class:"data-chart-card-wrap"},i=["title"],d={class:"context"};var m=t.defineComponent({name:"DataChartCard",__name:"card",props:{chartData:{type:Object,default:()=>({colDesc:[],xGroupByDesc:[],data:[],modelName:""})}},setup(m){const p=m;function D(e){const t=p.chartData.xGroupByDesc?.colDesc||"";return t?t+e[t]:""}return(p,u)=>{const k=e.ElScrollbar;return t.openBlock(),t.createElementBlock("div",l,[m.chartData.groupByDesc.length?(t.openBlock(),t.createElementBlock("p",c,t.toDisplayString(m.chartData.modelName),1)):t.createCommentVNode("v-if",!0),m.chartData.groupByDesc.length?t.withDirectives((t.openBlock(),t.createBlock(k,{key:1},{default:t.withCtx((()=>[t.createElementVNode("div",{class:t.normalizeClass({"data-chart-card-grid-layout":m.chartData.groupByDesc.length})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.chartData.data,((e,a)=>(t.openBlock(),t.createElementBlock("div",{key:a,class:"card-item"},[t.createElementVNode("div",{class:"card-title",title:D(e)},t.toDisplayString(D(e)),9,r),t.createElementVNode("div",o,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.chartData.colDesc,((a,l)=>(t.openBlock(),t.createElementBlock("span",{key:a},[t.createTextVNode(t.toDisplayString(`${a}: `||"-"),1),t.createElementVNode("strong",null,t.toDisplayString(e[a]||"-"),1),t.createTextVNode(" "+t.toDisplayString(l===m.chartData.colDesc.length-1?"":","),1)])))),128))]),t.createElementVNode("div",n,t.toDisplayString(a+1),1)])))),128))],2)])),_:1},512)),[[t.vShow,m.chartData.data.length]]):(t.openBlock(),t.createElementBlock("div",s,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.chartData.data,((e,a)=>(t.openBlock(),t.createElementBlock("div",{key:a,class:"card-item"},[t.createElementVNode("div",{class:"card-title",title:m.chartData.modelName},t.toDisplayString(m.chartData.modelName),9,i),t.createElementVNode("div",d,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.chartData.colDesc,((a,l)=>(t.openBlock(),t.createElementBlock("span",{key:a},[e?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(`${a}: `||"-"),1),t.createElementVNode("strong",null,t.toDisplayString(e[a]||"-"),1),t.createTextVNode(" "+t.toDisplayString(l===m.chartData.colDesc.length-1?"":","),1)],64)):t.createCommentVNode("v-if",!0)])))),128))])])))),128))])),t.withDirectives(t.createVNode(a.default,null,null,512),[[t.vShow,!m.chartData.data.length]])])}}});exports.default=m;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("element-plus/es");require("element-plus/es/components/base/style/index"),require("element-plus/es/components/scrollbar/style/index");var t=require("vue"),a=require("./data-chart-card-bg-left.svg.cjs"),l=require("./data-chart-card-bg-right.svg.cjs"),c=require("./empty.vue.cjs");const r={class:"data-chart-card"},o={class:"title"},n=["title"],s={class:"context"},i={class:"suffix-icon"},d={key:1,class:"data-chart-card-wrap"},m=["title"],p={class:"context"};var u=t.defineComponent({name:"DataChartCard",__name:"card",props:{chartData:{type:Object,default:()=>({colDesc:[],xGroupByDesc:[],data:[],modelName:""})}},setup(u){const k=u,g=`url(${a.default})`,D=`url(${l.default})`;function y(e){const t=k.chartData.xGroupByDesc?.colDesc||"";return t?t+e[t]:""}return(a,l)=>{const k=e.ElScrollbar;return t.openBlock(),t.createElementBlock("div",r,[t.createElementVNode("p",o,t.toDisplayString(u.chartData.modelName),1),u.chartData.data.length?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[u.chartData.groupByDesc.length?(t.openBlock(),t.createBlock(k,{key:0},{default:t.withCtx((()=>[t.createElementVNode("div",{class:t.normalizeClass({"data-chart-card-grid-layout":u.chartData.groupByDesc.length})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.chartData.data,((e,a)=>(t.openBlock(),t.createElementBlock("div",{key:a,class:"card-item",style:t.normalizeStyle({"background-image":`${g}, ${D}`})},[t.createElementVNode("div",{class:"card-title",title:y(e)},t.toDisplayString(y(e)),9,n),t.createElementVNode("div",s,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.chartData.colDesc,((a,l)=>(t.openBlock(),t.createElementBlock("span",{key:a},[t.createTextVNode(t.toDisplayString(`${a}: `||"-"),1),t.createElementVNode("strong",null,t.toDisplayString(e[a]||"-"),1),t.createTextVNode(" "+t.toDisplayString(l===u.chartData.colDesc.length-1?"":","),1)])))),128))]),t.createElementVNode("div",i,t.toDisplayString(a+1),1)],4)))),128))],2)])),_:1})):(t.openBlock(),t.createElementBlock("div",d,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.chartData.data,((e,a)=>(t.openBlock(),t.createElementBlock("div",{key:a,class:"card-item",style:t.normalizeStyle({"background-image":`${g}, ${D}`})},[t.createElementVNode("div",{class:"card-title",title:u.chartData.modelName},t.toDisplayString(u.chartData.modelName),9,m),t.createElementVNode("div",p,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.chartData.colDesc,((a,l)=>(t.openBlock(),t.createElementBlock("span",{key:a},[e?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(`${a}: `||"-"),1),t.createElementVNode("strong",null,t.toDisplayString(e[a]||"-"),1),t.createTextVNode(" "+t.toDisplayString(l===u.chartData.colDesc.length-1?"":","),1)],64)):t.createCommentVNode("v-if",!0)])))),128))])],4)))),128))]))],64)):(t.openBlock(),t.createBlock(c.default,{key:1}))])}}});exports.default=u;
2
2
  //# sourceMappingURL=card.vue2.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"card.vue2.cjs","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":"wmBASA,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.cjs","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 '../utils/types'\nimport bgLeft from './data-chart-card-bg-left.svg'\nimport bgRight from './data-chart-card-bg-right.svg'\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\n// 将 SVG 文件转换为 URL\nconst bgLeftUrl = `url(${bgLeft})`\nconst bgRightUrl = `url(${bgRight})`\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 class=\"title\">\n {{ chartData.modelName }}\n </p>\n <template v-if=\"chartData.data.length\">\n <el-scrollbar 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 :style=\"{\n 'background-image': `${bgLeftUrl}, ${bgRightUrl}`,\n }\"\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\n - 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 :style=\"{\n 'background-image': `${bgLeftUrl}, ${bgRightUrl}`,\n }\"\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\n - 1 ? '' : ',' }}\n </template>\n </span>\n </div>\n </div>\n </div>\n </template>\n <Empty v-else />\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 margin: 0;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 5.5px;\n line-height: 26px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: 600;\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-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","bgLeftUrl","bgLeft","bgRightUrl","bgRight","cardTitle","dataItem","colDesc","chartData","xGroupByDesc"],"mappings":"isBAWA,MAAMA,EAAQC,EAaRC,EAAY,OAAOC,EAAAA,WACnBC,EAAa,OAAOC,EAAAA,WAE1B,SAASC,EAAUC,GACjB,MAAMC,EAAUR,EAAMS,UAAUC,cAAcF,SAAW,GAEzD,OAAOA,EAAWA,EAAUD,EAASC,GAAY,EAAA"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t="/* unplugin-vue-components disabled */\n.data-chart-card[data-v-1c14c088] {\n display: flex;\n flex-direction: column;\n}\n.data-chart-card .title[data-v-1c14c088] {\n margin: 0;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 5.5px;\n line-height: 26px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: 600;\n color: #464646;\n}\n.data-chart-card .data-chart-card-grid-layout[data-v-1c14c088] {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));\n gap: 10px;\n width: calc(100% - 3px);\n}\n.data-chart-card .data-chart-card-wrap[data-v-1c14c088] {\n height: 100% !important;\n}\n.data-chart-card .data-chart-card-wrap .card-item[data-v-1c14c088] {\n width: 100% !important;\n}\n.data-chart-card .card-item[data-v-1c14c088] {\n position: relative;\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.data-chart-card .card-item .suffix-icon[data-v-1c14c088] {\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.data-chart-card .card-item .card-title[data-v-1c14c088] {\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.data-chart-card .card-item .context[data-v-1c14c088] {\n padding: 0 30px 10px 20px;\n font-size: 14px;\n color: #464646;\n}";require("../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.cjs").default(t),exports.default=t;
2
+ //# sourceMappingURL=card.vue3.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.vue3.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.default="data:image/svg+xml,%3Csvg%20width%3D%2260%22%20height%3D%22115%22%20viewBox%3D%220%200%2060%20115%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.0%22%3E%20%20%3Cpath%20d%3D%22m0.25005%2C137.62501l15.625%2C0l-0.075%2C-42.475c-0.175%2C-37.25%200.75%2C-43.125%202.15%2C-45.825c0.9%2C-1.8%204.925%2C-6.675%208.925%2C-11.075c11.275%2C-10.875%2011.36335%2C-10.92808%2011.15752%2C-24.664c-0.0767%2C-13.461%20-0.19369%2C-13.52265%20-0.04757%2C-13.661l-37.73495%2C0%22%20%20%20%20%20%20%20%20fill%3D%22%23F2F2F2%22%20%2F%3E%3C%2Fsvg%3E";
2
+ //# sourceMappingURL=data-chart-card-bg-left.svg.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-chart-card-bg-left.svg.cjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/data-chart-card-bg-left.svg"],"sourcesContent":["export default \"data:image/svg+xml,%3Csvg%20width%3D%2260%22%20height%3D%22115%22%20viewBox%3D%220%200%2060%20115%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.0%22%3E%20%20%3Cpath%20d%3D%22m0.25005%2C137.62501l15.625%2C0l-0.075%2C-42.475c-0.175%2C-37.25%200.75%2C-43.125%202.15%2C-45.825c0.9%2C-1.8%204.925%2C-6.675%208.925%2C-11.075c11.275%2C-10.875%2011.36335%2C-10.92808%2011.15752%2C-24.664c-0.0767%2C-13.461%20-0.19369%2C-13.52265%20-0.04757%2C-13.661l-37.73495%2C0%22%20%20%20%20%20%20%20%20fill%3D%22%23F2F2F2%22%20%2F%3E%3C%2Fsvg%3E\""],"names":[],"mappings":"oFAAe"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.default="data:image/svg+xml,%3Csvg%20width%3D%2250%22%20height%3D%22115%22%20viewBox%3D%220%200%2050%20115%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.0%22%3E%20%20%3Cpath%20fill%3D%22%232096f3%22%20%20%20%20%20%20%20%20d%3D%22m22.90361%2C35.16812c-0.47044%2C29.57319%200.59424%2C27.27527%20-11.58759%2C40.16359c-10.69624%2C11.28976%20-11.31674%2C12.23822%20-11.19174%2C36.96648l-0.07428%2C25.57681l51.575%2C0l0%2C-137.875l-28.52331%2C0l-0.19808%2C35.16812z%22%20%2F%3E%3C%2Fsvg%3E";
2
+ //# sourceMappingURL=data-chart-card-bg-right.svg.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-chart-card-bg-right.svg.cjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/data-chart-card-bg-right.svg"],"sourcesContent":["export default \"data:image/svg+xml,%3Csvg%20width%3D%2250%22%20height%3D%22115%22%20viewBox%3D%220%200%2050%20115%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.0%22%3E%20%20%3Cpath%20fill%3D%22%232096f3%22%20%20%20%20%20%20%20%20d%3D%22m22.90361%2C35.16812c-0.47044%2C29.57319%200.59424%2C27.27527%20-11.58759%2C40.16359c-10.69624%2C11.28976%20-11.31674%2C12.23822%20-11.19174%2C36.96648l-0.07428%2C25.57681l51.575%2C0l0%2C-137.875l-28.52331%2C0l-0.19808%2C35.16812z%22%20%2F%3E%3C%2Fsvg%3E\""],"names":[],"mappings":"oFAAe"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("@qxs-bns/hooks"),r=require("./empty.svg.cjs");const a={class:"empty-content"},i=["src","alt"],s={class:"empty-description"};var n=e.defineComponent({name:"Empty",__name:"empty",props:{image:{type:String,required:!1,default:()=>r.default},description:{type:String,required:!1,default:"暂无数据"},imageSize:{type:Object,required:!1,default:()=>({width:"100px",height:"auto"})}},setup(r){const n=t.useNamespace("data-chart");return(t,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(n).e("empty")])},[e.createElementVNode("div",a,[e.createElementVNode("img",{style:e.normalizeStyle(t.imageSize),src:t.image,alt:t.description},null,12,i),e.createElementVNode("span",s,e.toDisplayString(t.description),1)])],2))}});exports.default=n;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("@qxs-bns/hooks"),r=require("./empty.svg.cjs");const a=["src","alt"];var s=e.defineComponent({name:"Empty",__name:"empty",props:{image:{type:String,required:!1,default:()=>r.default},description:{type:String,required:!1,default:"暂无数据"},imageSize:{type:Object,required:!1,default:()=>({width:"100px",height:"auto"})}},setup(r){const s=t.useNamespace("data-chart");return(t,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(s).e("empty")])},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(s).e("empty-content")])},[e.createElementVNode("img",{style:e.normalizeStyle(t.imageSize),src:t.image,alt:t.description},null,12,a),e.createElementVNode("span",{class:e.normalizeClass([e.unref(s).e("empty-description")])},e.toDisplayString(t.description),3)],2)],2))}});exports.default=s;
2
2
  //# sourceMappingURL=empty.vue.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"empty.vue.cjs","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":"ieAqBM,MAAAA,EAAKC,eAAa"}
1
+ {"version":3,"file":"empty.vue.cjs","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=\"[ns.e('empty-content')]\">\n <img\n :style=\"imageSize\"\n :src=\"image\"\n :alt=\"description\"\n ><span :class=\"[ns.e('empty-description')]\">{{ description }}</span>\n </div>\n </div>\n</template>\n"],"names":["ns","useNamespace"],"mappings":"yaAqBM,MAAAA,EAAKC,eAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"funnel.vue.cjs","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":"2TAgBA,MAAMA,EAAkBC,EAAAA,MAClBC,EAAQC,EAAAA,OAAOC,EAAAA,qBAAsBC,GAAWA,IAAG,GACnDC,EAAqBC,EAAAA,UAAwB,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,EAAAA,UAAA,CAAEC,SAAUtC,EAAiBoC,aAAc9B,EAAoBO,UAAWN,YAAS,IAAMK,EAAAC"}
1
+ {"version":3,"file":"funnel.vue.cjs","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 '../utils/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":"2TAgBA,MAAMA,EAAkBC,EAAAA,MAClBC,EAAQC,EAAAA,OAAOC,EAAAA,qBAAsBC,GAAWA,IAAG,GACnDC,EAAqBC,EAAAA,UAAwB,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,EAAAA,UAAA,CAAEC,SAAUtC,EAAiBoC,aAAc9B,EAAoBO,UAAWN,YAAS,IAAMK,EAAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./line.vue2.cjs"),r=require("../../../../_virtual/_plugin-vue_export-helper.cjs").default(e.default,[["__scopeId","data-v-397864aa"]]);exports.default=r;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./line.vue2.cjs");require("./line.vue3.cjs");var r=require("../../../../_virtual/_plugin-vue_export-helper.cjs").default(e.default,[["__scopeId","data-v-397864aa"]]);exports.default=r;
2
2
  //# sourceMappingURL=line.vue.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("../utils/injectionKeys.cjs"),a=require("../utils/useCharts.cjs"),r=e.defineComponent({name:"DataChartLine",__name:"line",props:{chartData:{type:Object,required:!0},subShowType:{type:String,required:!0,default:"line-simple"},chartOptions:{type:null,required:!0}},setup(r){const s=e.ref(),n=e.inject(t.InjectionChartMerge,(e=>e),!0),c=15,i="Total";const l=e.computed((()=>{const{colDesc:e,xGroupByDesc:t,groupByDesc:a,data:s,modelName:l}=r.chartData,o=Array.from(new Set(s?.map((e=>e[t?.colDesc||""])))).filter((e=>null!=e))||[],u=a?.find((e=>!e.xAxis)),p={title:{text:l},legend:{data:[]},xAxis:{name:t?.colDesc||"",data:o},dataZoom:[{type:"inside",disabled:o.length<c}]};if(1===a?.length)p.series=e.map((e=>({name:e,type:"line",data:s.map((t=>t[e])).filter((e=>null!=e))}))),p.legend.data=e;else if(2===a?.length){const a=[...new Set(s.map((e=>String(e[u?.colDesc||""]))))];p.legend.data=a,p.series=a.map((a=>function(e,t,a,r,s,n){const c=[];return t.forEach((t=>{const i=a.find((a=>a[r?.colDesc]===t&&a[s?.colDesc]===e));i?c.push(i[n[0]]):c.push(0)})),{name:e,type:"line",stack:i,areaStyle:{},data:c}}(a,o,s,t,u,e)))}return p.series=p.series?.map((e=>{const t={...e};switch(r.subShowType){case"line-simple":default:delete t.areaStyle;break;case"area-basic":t.areaStyle={}}return t})),n(p,r.chartOptions)}));return a.useCharts({chartDOM:s,chartOptions:l,chartData:e.computed((()=>r.chartData))}),(t,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dataChartLine",ref:s,class:"data-chart-line"},null,512))}});exports.default=r;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("../utils/injectionKeys.cjs"),a=require("../utils/useCharts.cjs"),r=e.defineComponent({name:"DataChartLine",__name:"line",props:{chartData:{type:Object,required:!0},subShowType:{type:String,required:!0,default:"line-simple"},chartOptions:{type:null,required:!0}},setup(r){const s=e.ref(),n=e.inject(t.InjectionChartMerge,(e=>e),!0),c=15,i="Total",l=!0;const o=e.computed((()=>{const{colDesc:e,xGroupByDesc:t,groupByDesc:a,data:s,modelName:o}=r.chartData,u=Array.from(new Set(s?.map((e=>e[t?.colDesc||""])))).filter((e=>null!=e))||[],p=a?.find((e=>!e.xAxis)),d={title:{text:o},legend:{data:[]},xAxis:{name:t?.colDesc||"",data:u},dataZoom:[{type:"inside",disabled:u.length<c}]};if(1===a?.length)d.series=e.map((e=>({name:e,type:"line",smooth:l,data:s.map((t=>t[e])).filter((e=>null!=e))}))),d.legend.data=e;else if(2===a?.length){const a=[...new Set(s.map((e=>String(e[p?.colDesc||""]))))];d.legend.data=a,d.series=a.map((a=>function(e,t,a,r,s,n){const c=[];return t.forEach((t=>{const i=a.find((a=>a[r?.colDesc]===t&&a[s?.colDesc]===e));i?c.push(i[n[0]]):c.push(0)})),{name:e,type:"line",smooth:l,stack:i,areaStyle:{},data:c}}(a,u,s,t,p,e)))}return d.series=d.series?.map((e=>{const t={...e};switch(r.subShowType){case"line-simple":default:delete t.areaStyle;break;case"area-basic":t.areaStyle={}}return t})),n(d,r.chartOptions)}));return a.useCharts({chartDOM:s,chartOptions:o,chartData:e.computed((()=>r.chartData))}),(t,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dataChartLine",ref:s,class:"data-chart-line"},null,512))}});exports.default=r;
2
2
  //# sourceMappingURL=line.vue2.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"line.vue2.cjs","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":"mXAkBA,MAAMA,EAAgBC,EAAAA,MAChBC,EAAQC,EAAAA,OAAOC,EAAAA,qBAAsBC,GAAWA,IAAG,GAYnDC,EACa,GADbA,EAEQ,QAoCR,MAAAC,EAAmBC,EAAAA,UAAwB,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,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,EAAAA,UAAA,CAAEC,SAAUrD,EAAemD,aAAc5C,EAAkBQ,UAAWP,YAAS,IAAMM,EAAAC"}
1
+ {"version":3,"file":"line.vue2.cjs","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 '../utils/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 smooth?: boolean\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 SMOOTH: true,\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 smooth: CHART_CONSTANTS.SMOOTH,\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 smooth: CHART_CONSTANTS.SMOOTH,\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({\n chartDOM: dataChartLine,\n chartOptions: lineChartOptions,\n chartData: computed(() => chartData),\n})\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","smooth","legendData","String","legendDataItem","seriesData","forEach","xAxisItem","targetData","dataItem","push","stack","areaStyle","processSeriesData","seriesItem","subShowType","chartOptions","useCharts","chartDOM"],"mappings":"mXAkBA,MAAMA,EAAgBC,EAAAA,MAChBC,EAAQC,EAAAA,OAAOC,EAAAA,qBAAsBC,GAAWA,IAAG,GAanDC,EACa,GADbA,EAEQ,QAFRA,GAGI,EAqCJ,MAAAC,EAAmBC,EAAAA,UAAwB,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,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,OACNK,OAAQ/B,EACRM,KAAMA,EAAKQ,KAAIC,GAAQA,EAAKe,KAAQd,QAAOD,GAAQA,cAEpDK,EAAOG,OAAiCjB,KAAOH,OAClD,GACiC,IAAxBE,GAAauB,OAAc,CAClC,MAAMI,EAAa,IAAI,IAAInB,IAAIP,EAAKQ,KAAIC,GAAQkB,OAAOlB,EAAKE,GAAcd,SAAW,SACnFiB,EAAOG,OAAiCjB,KAAO0B,EAEjDZ,EAAOS,OAASG,EAAWlB,QAjE/B,SAA2BoB,EACzBxB,EACAJ,EACAF,EACAa,EACAd,GACA,MAAMgC,EAAkC,GAiBjC,OAfGzB,EAAA0B,SAASC,IACjB,MAAMC,EAAahC,EAChBY,MAAKqB,GACJA,EAASnC,GAAcD,WAAakC,GACjCE,EAAStB,GAAcd,WAAa+B,IAGvCI,EACFH,EAAWK,KAAKF,EAAWnC,EAAQ,KAGnCgC,EAAWK,KAAK,EAAC,IAId,CACLhB,KAAMU,EACNR,KAAM,OACNK,OAAQ/B,EACRyC,MAAOzC,EACP0C,UAAW,CAAC,EACZpC,KAAM6B,EACR,CAoCIQ,CAAkBT,EAAgBxB,EAAWJ,EAAMF,EAAca,EAAcd,IACjF,CAqBK,OAjBPiB,EAAOS,OAAST,EAAOS,QAAQf,KAAKC,IAC5B,MAAA6B,EAAa,IAAK7B,GAExB,OAAQP,EAAAqC,aACN,IAAK,cAML,eACSD,EAAWF,gBAJpB,IAAK,aACHE,EAAWF,UAAY,CAAC,EAMrB,OAAAE,CAAA,IAGFhD,EAAMwB,EAAQZ,EAAYsC,aAAA,WAEzBC,YAAA,CACRC,SAAUtD,EACVoD,aAAc7C,EACdQ,UAAWP,EAAAA,UAAS,IAAMM,EAAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="/* unplugin-vue-components disabled */\n.data-chart-line[data-v-397864aa] {\n width: 100%;\n height: 100%;\n}";require("../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.cjs").default(e),exports.default=e;
2
+ //# sourceMappingURL=line.vue3.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line.vue3.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"pie.vue.cjs","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":"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"}
1
+ {"version":3,"file":"pie.vue.cjs","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 '../utils/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":"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"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),a=require("lodash-es"),r=require("../utils/injectionKeys.cjs"),t=require("../utils/useCharts.cjs"),u=e.defineComponent({name:"DataChartRadar",__name:"radar",props:{chartData:{type:Object,required:!0},chartOptions:{type:null,required:!0}},setup(u){const s=e.ref(),c=e.inject(r.InjectionChartMerge,(e=>e),!0),o=e.computed((()=>{const{colDesc:e,xGroupByDesc:r,modelName:t,data:s}=u.chartData;r?.groupByValues&&(r.groupByValues=[]),r.groupByValues=a.uniq(s.map((e=>e[r.colDesc||""])).filter((e=>e)));const o={title:{text:t},radar:{indicator:r?.groupByValues?.map((a=>({name:a,max:Math.max(...s.map((a=>Number(a[e[0]]))))})))||[]},series:[{name:r?.colDesc,type:"radar",tooltip:{trigger:"item"},data:e.map((e=>({name:e,value:r?.groupByValues?.map((a=>s.map((t=>a===t[r.colDesc||""]?t[e]:null)).filter((e=>e)).reduce(((e,a)=>Number(e||0)+Number(a||0)),0)))})))}]};return c(o,u.chartOptions)}));return t.useCharts({chartDOM:s,chartOptions:o,chartData:e.computed((()=>u.chartData))}),(a,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dataChartRadar",ref:s,class:"data-chart-radar"},null,512))}});exports.default=u;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),a=require("lodash-es"),r=require("../utils/injectionKeys.cjs"),t=require("../utils/useCharts.cjs"),u=e.defineComponent({name:"DataChartRadar",__name:"radar",props:{chartData:{type:Object,required:!0},chartOptions:{type:null,required:!0}},setup(u){const s=e.ref(),c=e.inject(r.InjectionChartMerge,(e=>e),!0),o=e.computed((()=>{const{colDesc:e,xGroupByDesc:r,modelName:t,data:s}=u.chartData;r?.groupByValues||(r.groupByValues=[]),r.groupByValues=a.uniq(s.map((e=>e[r.colDesc||""])).filter((e=>e)));const o={title:{text:t},radar:{indicator:r?.groupByValues?.map((a=>({name:a,max:Math.max(...s.map((a=>Number(a[e[0]]))))})))||[]},series:[{name:r?.colDesc,type:"radar",tooltip:{trigger:"item"},data:e.map((e=>({name:e,value:r?.groupByValues?.map((a=>s.map((t=>a===t[r.colDesc||""]?t[e]:null)).filter((e=>e)).reduce(((e,a)=>Number(e||0)+Number(a||0)),0)))})))}]};return c(o,u.chartOptions)}));return t.useCharts({chartDOM:s,chartOptions:o,chartData:e.computed((()=>u.chartData))}),(a,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dataChartRadar",ref:s,class:"data-chart-radar"},null,512))}});exports.default=u;
2
2
  //# sourceMappingURL=radar.vue.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"radar.vue.cjs","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":"gVAkBA,MAAMA,EAAiBC,EAAAA,MACjBC,EAAQC,EAAAA,OAAOC,EAAAA,qBAAsBC,GAAWA,IAAG,GACnDC,EAAoBC,EAAAA,UAAwB,KAChD,MAAMC,QAAEA,EAASC,aAAAA,EAAAC,UAAcA,EAAWC,KAAAA,GAASC,EAAAC,UAE/CJ,GAAcK,gBAChBL,EAAaK,cAAgB,IAE/BL,EAAaK,cAAgBC,EAAAA,KAAKJ,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,EAAAA,UAAA,CAAEC,SAAUzC,EAAgBuC,aAAcjC,EAAmBO,UAAWN,YAAS,IAAMK,EAAAC"}
1
+ {"version":3,"file":"radar.vue.cjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/radar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { EChartsOption, IFormatPublicData } from '../utils/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":"gVAkBA,MAAMA,EAAiBC,EAAAA,MACjBC,EAAQC,EAAAA,OAAOC,EAAAA,qBAAsBC,GAAWA,IAAG,GACnDC,EAAoBC,EAAAA,UAAwB,KAChD,MAAMC,QAAEA,EAASC,aAAAA,EAAAC,UAAcA,EAAWC,KAAAA,GAASC,EAAAC,UAE9CJ,GAAcK,gBACjBL,EAAaK,cAAgB,IAE/BL,EAAaK,cAAgBC,EAAAA,KAAKJ,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,EAAAA,UAAA,CAAEC,SAAUzC,EAAgBuC,aAAcjC,EAAmBO,UAAWN,YAAS,IAAMK,EAAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"scatter-simple.vue.cjs","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":"0UAeA,MAAMA,EAAyBC,EAAAA,MACzBC,EAAQC,EAAAA,OAAOC,EAAAA,qBAAsBC,GAAWA,IAAG,GAEnDC,EAAsBC,EAAAA,UAAwB,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,EAAAA,UAAA,CAAEC,SAAUhC,EAAwB8B,aAAcxB,EAAqBO,UAAWN,YAAS,IAAMK,EAAAC"}
1
+ {"version":3,"file":"scatter-simple.vue.cjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/scatter-simple.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { EChartsOption, IFormatPublicData } from '../utils/types'\nimport { InjectionChartMerge } from '../utils/injectionKeys'\nimport { useCharts } from '../utils/useCharts'\n\ndefineOptions({\n name: 'DataChartScatterSimple',\n})\nconst {\n chartData,\n chartOptions,\n} = defineProps<{\n chartData: IFormatPublicData\n chartOptions: EChartsOption\n}>()\nconst dataChartScatterSimple = ref()\nconst merge = inject(InjectionChartMerge, (v: any) => v, true)\n\nconst scatterChartOptions = computed<EChartsOption>(() => {\n const { colDesc, xGroupByDesc, modelName, data } = chartData\n const config = {\n title: {\n text: modelName,\n },\n tooltip: {\n formatter(params: { value: string, seriesName: string, name: string }) {\n if (params.value.length > 1) {\n return (\n `${params.seriesName\n } :<br/>${params.value[0]\n } ${params.value[1]\n } `\n )\n }\n else {\n return (\n `${params.seriesName\n } :<br/>${params.name\n } : ${params.value\n } `\n )\n }\n },\n },\n series: colDesc.map((colDescItem) => {\n return {\n symbolSize: 20,\n name: colDescItem,\n data: data.map((dataItem) => {\n return [dataItem[colDescItem], dataItem[xGroupByDesc?.colDesc || '']]\n }),\n type: 'scatter',\n }\n }),\n }\n return merge(config, chartOptions)\n})\nuseCharts({ chartDOM: dataChartScatterSimple, chartOptions: scatterChartOptions, chartData: computed(() => chartData) })\n</script>\n\n<template>\n <div\n ref=\"dataChartScatterSimple\"\n class=\"data-chart-scatter-simple\"\n />\n</template>\n"],"names":["dataChartScatterSimple","ref","merge","inject","InjectionChartMerge","v","scatterChartOptions","computed","colDesc","xGroupByDesc","modelName","data","__props","chartData","config","title","text","tooltip","formatter","params","value","length","seriesName","name","series","map","colDescItem","symbolSize","dataItem","type","chartOptions","useCharts","chartDOM"],"mappings":"0UAeA,MAAMA,EAAyBC,EAAAA,MACzBC,EAAQC,EAAAA,OAAOC,EAAAA,qBAAsBC,GAAWA,IAAG,GAEnDC,EAAsBC,EAAAA,UAAwB,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,EAAAA,UAAA,CAAEC,SAAUhC,EAAwB8B,aAAcxB,EAAqBO,UAAWN,YAAS,IAAMK,EAAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"scatter.vue.cjs","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":"6TAiBA,MAAMA,EAAmBC,EAAAA,MACnBC,EAAQC,EAAAA,OAAOC,EAAAA,qBAAsBC,GAAWA,IAAG,GAEnDC,EAAsBC,EAAAA,UAAwB,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,EAAAA,UAAA,CAAEC,SAAUjB,EAAkBe,aAAcT,EAAqBY,UAAWX,YAAS,IAAMO,EAAAI"}
1
+ {"version":3,"file":"scatter.vue.cjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/scatter.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { EChartsOption, IFormatPublicData } from '../utils/types'\nimport { InjectionChartMerge } from '../utils/injectionKeys'\nimport { useCharts } from '../utils/useCharts'\n\ndefineOptions({\n name: 'DataChartScatter',\n})\n\nconst {\n chartData,\n chartOptions,\n} = defineProps<{\n chartData: IFormatPublicData\n chartOptions: EChartsOption\n}>()\n\nconst dataChartScatter = ref()\nconst merge = inject(InjectionChartMerge, (v: any) => v, true)\n\nconst scatterChartOptions = computed<EChartsOption>(() => {\n const config = {\n xAxis: {},\n yAxis: {},\n series: [\n {\n symbolSize: 20,\n data: [\n [10.0, 8.04],\n [8.07, 6.95],\n [13.0, 7.58],\n [9.05, 8.81],\n [11.0, 8.33],\n [14.0, 7.66],\n [13.4, 6.81],\n [10.0, 6.33],\n [14.0, 8.96],\n [12.5, 6.82],\n [9.15, 7.2],\n [11.5, 7.2],\n [3.03, 4.23],\n [12.2, 7.83],\n [2.02, 4.47],\n [1.05, 3.33],\n [4.05, 4.96],\n [6.03, 7.24],\n [12.0, 6.26],\n [12.0, 8.84],\n [7.08, 5.82],\n [5.02, 5.68],\n ],\n type: 'scatter',\n },\n ],\n }\n\n return merge(config, chartOptions)\n})\nuseCharts({ chartDOM: dataChartScatter, chartOptions: scatterChartOptions, chartData: computed(() => chartData) })\n</script>\n\n<template>\n <div\n ref=\"dataChartScatter\"\n class=\"data-chart-scatter\"\n />\n</template>\n"],"names":["dataChartScatter","ref","merge","inject","InjectionChartMerge","v","scatterChartOptions","computed","xAxis","yAxis","series","symbolSize","data","type","__props","chartOptions","useCharts","chartDOM","chartData"],"mappings":"6TAiBA,MAAMA,EAAmBC,EAAAA,MACnBC,EAAQC,EAAAA,OAAOC,EAAAA,qBAAsBC,GAAWA,IAAG,GAEnDC,EAAsBC,EAAAA,UAAwB,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,EAAAA,UAAA,CAAEC,SAAUjB,EAAkBe,aAAcT,EAAqBY,UAAWX,YAAS,IAAMO,EAAAI"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("element-plus/es");require("element-plus/es/components/base/style/index"),require("element-plus/es/components/table/style/index"),require("element-plus/es/components/table-column/style/index");var t=require("vue"),a=require("@qxs-bns/hooks"),l=require("./empty.vue.cjs");const o={key:0,class:"title"};var r=t.defineComponent({name:"DataChartTable",__name:"table",props:{chartData:{type:Object,default:()=>({colDesc:[],xGroupByDesc:[],data:[],modelName:""})}},setup(r){const c=r,n=a.useNamespace("data-chart"),s=t.computed((()=>c.chartData.groupByDesc.find((e=>!e.xAxis))));function i(e){if(!e)return 100;const t=14*e.length+20+30;return t<100?100:t}return(a,c)=>{const p=e.ElTableColumn,u=e.ElTable;return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([t.unref(n).e("data-chart-table")])},[r.chartData.modelName?(t.openBlock(),t.createElementBlock("p",o,[t.createElementVNode("span",null,t.toDisplayString(r.chartData.modelName),1)])):t.createCommentVNode("v-if",!0),t.createVNode(u,{class:"customize-table data-chart-table-content",data:r.chartData.data,stripe:"",height:"100%"},{empty:t.withCtx((()=>[t.createVNode(l.default)])),default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.chartData.groupByDesc,((e,a)=>(t.openBlock(),t.createBlock(p,{key:`${e.colDesc}${e.groupByDesc}${a}`,align:"center","show-overflow-tooltip":"",sortable:"","min-width":`${i(e.colDesc)}px`,prop:e.colDesc||""},{header:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.colDesc),1)])),default:t.withCtx((a=>[t.createTextVNode(t.toDisplayString((t.unref(s)&&(t.unref(s).colDesc,e.colDesc),a.row[e.colDesc||""]||"--")),1)])),_:2},1032,["min-width","prop"])))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.chartData.colDesc,((e,a)=>(t.openBlock(),t.createBlock(p,{key:e+a,align:"center","min-width":`${i(e)}px`,label:e,"show-overflow-tooltip":"",sortable:"",prop:e},{header:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e),1)])),_:2},1032,["min-width","label","prop"])))),128))])),_:1},8,["data"])],2)}}});exports.default=r;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("element-plus/es");require("element-plus/es/components/base/style/index"),require("element-plus/es/components/table/style/index"),require("element-plus/es/components/table-column/style/index");var t=require("vue"),a=require("@qxs-bns/hooks"),l=require("./empty.vue.cjs");const o={key:0,class:"title"};var r=t.defineComponent({name:"DataChartTable",__name:"table",props:{chartData:{type:Object,default:()=>({colDesc:[],xGroupByDesc:[],data:[],modelName:""})}},setup(r){const c=r,n=a.useNamespace("data-chart"),s=t.computed((()=>c.chartData.groupByDesc.find((e=>!e.xAxis))));function i(e){if(!e)return 100;const t=14*e.length+20+30;return t<100?100:t}return(a,c)=>{const p=e.ElTableColumn,u=e.ElTable;return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([t.unref(n).e("table")])},[r.chartData.modelName?(t.openBlock(),t.createElementBlock("p",o,[t.createElementVNode("span",null,t.toDisplayString(r.chartData.modelName),1)])):t.createCommentVNode("v-if",!0),t.createVNode(u,{class:"customize-table",data:r.chartData.data,stripe:"",height:"100%"},{empty:t.withCtx((()=>[t.createVNode(l.default)])),default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.chartData.groupByDesc,((e,a)=>(t.openBlock(),t.createBlock(p,{key:`${e.colDesc}${e.groupByDesc}${a}`,align:"center","show-overflow-tooltip":"",sortable:"","min-width":`${i(e.colDesc)}px`,prop:e.colDesc||""},{header:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.colDesc),1)])),default:t.withCtx((a=>[t.createTextVNode(t.toDisplayString((t.unref(s)&&(t.unref(s).colDesc,e.colDesc),a.row[e.colDesc||""]||"--")),1)])),_:2},1032,["min-width","prop"])))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.chartData.colDesc,((e,a)=>(t.openBlock(),t.createBlock(p,{key:e+a,align:"center","min-width":`${i(e)}px`,label:e,"show-overflow-tooltip":"",sortable:"",prop:e},{header:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e),1)])),_:2},1032,["min-width","label","prop"])))),128))])),_:1},8,["data"])],2)}}});exports.default=r;
2
2
  //# sourceMappingURL=table.vue.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"table.vue.cjs","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":"siBAUA,MAAMA,EAAQC,EAYRC,EAAKC,eAAa,cAElBC,EAAeC,EAAAA,UAAS,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.cjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/table.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { PropType } from 'vue'\nimport type { IFormatPublicData } from '../utils/types'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport Empty from './empty.vue'\n\ndefineOptions({\n name: 'DataChartTable',\n})\n\nconst props = defineProps({\n chartData: {\n type: Object as PropType<IFormatPublicData>,\n default: () => ({\n colDesc: [],\n xGroupByDesc: [],\n data: [],\n modelName: '',\n }),\n },\n})\n\nconst ns = useNamespace('data-chart')\n\nconst yGroupByDesc = computed(() => {\n const row = props.chartData.groupByDesc.find(item => !item.xAxis)\n return row\n})\n\nfunction baseWidth(str: string | null) {\n if (!str) {\n return 100\n }\n const strWidth = str.length * 14 + 20 + 30\n return strWidth < 100 ? 100 : strWidth\n}\n</script>\n\n<template>\n <div :class=\"[ns.e('table')]\">\n <p\n v-if=\"chartData.modelName\"\n class=\"title\"\n >\n <span>{{ chartData.modelName }}</span>\n </p>\n <el-table\n class=\"customize-table\"\n :data=\"chartData.data\"\n stripe\n height=\"100%\"\n >\n <el-table-column\n v-for=\"(item, index) in chartData.groupByDesc\"\n :key=\"`${item.colDesc}${item.groupByDesc}${index}`\"\n align=\"center\"\n show-overflow-tooltip\n sortable\n :min-width=\"`${baseWidth(item.colDesc)}px`\"\n :prop=\"item.colDesc || ''\"\n >\n <template #header>\n {{ item.colDesc }}\n </template>\n <template #default=\"scoped\">\n {{ (yGroupByDesc && yGroupByDesc.colDesc === item.colDesc ? scoped.row[item.colDesc || ''] : scoped.row[item.colDesc || '']) || '--' }}\n </template>\n </el-table-column>\n <el-table-column\n v-for=\"(item, index) in chartData.colDesc\"\n :key=\"item + index\"\n align=\"center\"\n :min-width=\"`${baseWidth(item)}px`\"\n :label=\"item\"\n show-overflow-tooltip\n sortable\n :prop=\"item\"\n >\n <template #header>\n {{ item }}\n </template>\n </el-table-column>\n <template #empty>\n <Empty />\n </template>\n </el-table>\n </div>\n</template>\n"],"names":["props","__props","ns","useNamespace","yGroupByDesc","computed","chartData","groupByDesc","find","item","xAxis","baseWidth","str","strWidth","length"],"mappings":"siBAUA,MAAMA,EAAQC,EAYRC,EAAKC,eAAa,cAElBC,EAAeC,EAAAA,UAAS,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
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("@qxs-bns/hooks"),r=require("@qxs-bns/utils"),s=require("lodash-es"),a=require("./components/area.vue.cjs"),o=require("./components/bar.vue.cjs"),u=require("./components/card.vue.cjs"),c=require("./components/funnel.vue.cjs"),n=require("./components/line.vue.cjs"),l=require("./components/pie.vue.cjs"),p=require("./components/radar.vue.cjs"),i=require("./components/scatter-simple.vue.cjs"),d=require("./components/scatter.vue.cjs"),m=require("./components/table.vue.cjs"),f=require("./utils/config.cjs"),y=require("./utils/injectionKeys.cjs"),h=require("./utils/safe-eval.cjs"),q=require("./utils/useCharts.cjs"),j=e.defineComponent({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(j,{expose:v}){const D=t.useNamespace("data-chart"),g={table:m.default,bar:o.default,line:n.default,pie:l.default,radar:p.default,scatter:d.default,funnel:c.default,area:a.default,card:u.default,"scatter-simple":i.default},x=e.computed((()=>s.cloneDeep(f.defaultChartOption[j.showTypeName]))),b=e.computed((()=>{const{desc:{colDesc:e=[],groupByDesc:t=[]}={},data:r=[]}=j.data;let s=[],a=null;s=t?.map((e=>(e.xAxis&&(a=e),e)));const o=a?r.filter((e=>e&&e[a.colDesc])):r;return w({colDesc:[],xGroupByDesc:{colDesc:"",groupByDesc:"",groupByValues:[],xAxis:!1},groupByDesc:[],data:[],modelName:""},{colDesc:e,modelName:j.modelName,subShowType:j.subShowType,xGroupByDesc:a,groupByDesc:s,data:o})}));function w(e,t){let r=s.merge({},x.value,e,t)||{};if(j.jsCodeSnippet)try{r=h.safeEvalConfig(j.jsCodeSnippet,r)}catch(e){console.error("代码执行失败:",e)}return r}return v({exportExal:function(){if(0===j.data.data.length)return void console.log("暂无数据");const e=q.useDataToExcelJson(j.data);r.JsonToExcel(j.modelName,e)}}),e.provide(y.InjectionChartMerge,w),(t,r)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g[t.showTypeName]),{key:t.showTypeName,class:e.normalizeClass([e.unref(D).e("wrapper")]),"sub-show-type":t.subShowType,"chart-data":e.unref(b),"chart-options":t.chartOptions},null,8,["class","sub-show-type","chart-data","chart-options"]))}});exports.default=j;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("@qxs-bns/hooks"),r=require("@qxs-bns/utils"),s=require("lodash-es"),a=require("./components/area.vue.cjs"),o=require("./components/bar.vue.cjs"),u=require("./components/card.vue.cjs"),c=require("./components/funnel.vue.cjs"),n=require("./components/line.vue.cjs"),l=require("./components/pie.vue.cjs"),p=require("./components/radar.vue.cjs"),i=require("./components/scatter-simple.vue.cjs"),d=require("./components/scatter.vue.cjs"),m=require("./components/table.vue.cjs"),f=require("./utils/config.cjs"),h=require("./utils/injectionKeys.cjs"),y=require("./utils/safe-eval.cjs"),q=require("./utils/useCharts.cjs"),j=e.defineComponent({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(j,{expose:v}){const b=t.useNamespace("data-chart"),g={table:m.default,bar:o.default,line:n.default,pie:l.default,radar:p.default,scatter:d.default,funnel:c.default,area:a.default,card:u.default,"scatter-simple":i.default},x=e.computed((()=>s.cloneDeep(f.defaultChartOption[j.showTypeName]))),D=e.computed((()=>{const{desc:{colDesc:e=[],groupByDesc:t=[]}={},data:r=[]}=j.data;let s=[],a=null;s=t?.map((e=>(e.xAxis&&(a=e),e)));const o=a?r.filter((e=>e&&e[a.colDesc])):r;return{colDesc:e||[],modelName:j.modelName,subShowType:j.subShowType,xGroupByDesc:a||{colDesc:"",groupByDesc:"",groupByValues:[],xAxis:!1},groupByDesc:s,data:o}}));return v({exportExal:function(){if(0===j.data.data.length)return void console.log("暂无数据");const e=q.useDataToExcelJson(j.data);r.JsonToExcel(j.modelName,e)}}),e.provide(h.InjectionChartMerge,(function(e,t){let r=s.merge({},x.value,e,t)||{};if(j.jsCodeSnippet)try{r=y.safeEvalConfig(j.jsCodeSnippet,r)}catch(e){console.error("代码执行失败:",e)}return r})),(t,r)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g[t.showTypeName]),{key:t.showTypeName,class:e.normalizeClass([e.unref(b).e("wrapper")]),"sub-show-type":t.subShowType,"chart-data":e.unref(D),"chart-options":t.chartOptions},null,8,["class","sub-show-type","chart-data","chart-options"]))}});exports.default=j;
2
2
  //# sourceMappingURL=data-chart.vue.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-chart.vue.cjs","sources":["../../../../../../packages/components/src/data-chart/src/data-chart.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { EChartData, EChartsOption, IFormatPublicData } from './types'\nimport type { IconRow } from './types/index'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { JsonToExcel } from '@qxs-bns/utils'\nimport { cloneDeep, merge as lodashMerge } from 'lodash-es'\nimport Area from './components/area.vue'\nimport Bar from './components/bar.vue'\nimport Card from './components/card.vue'\nimport Funnel from './components/funnel.vue'\nimport Line from './components/line.vue'\nimport Pie from './components/pie.vue'\nimport Radar from './components/radar.vue'\nimport ScatterSimple from './components/scatter-simple.vue'\nimport Scatter from './components/scatter.vue'\nimport Table from './components/table.vue'\nimport { defaultChartOption } from './utils/config'\nimport { InjectionChartMerge } from './utils/injectionKeys'\nimport { safeEvalConfig } from './utils/safe-eval'\nimport { useDataToExcelJson } from './utils/useCharts'\n\ndefineOptions({\n name: 'QxsDataChart',\n})\n\nconst {\n showTypeName = 'table',\n subShowType,\n modelName = '',\n data: propData = {\n data: [],\n desc: {\n colDesc: [],\n showDesc: {\n showType: 0,\n chartOptions: '{}',\n jsCodeSnippet: '',\n },\n groupByDesc: [],\n },\n },\n chartOptions = {},\n jsCodeSnippet = '',\n} = defineProps<{\n modelName?: string\n showTypeName?: IconRow['showTypeName']\n subShowType?: string\n data?: EChartData\n chartOptions?: EChartsOption\n jsCodeSnippet?: string\n}>()\n\nconst ns = useNamespace('data-chart')\n\nconst coms: {\n [key: string]: any\n} = {\n 'table': Table,\n 'bar': Bar,\n 'line': Line,\n 'pie': Pie,\n 'radar': Radar,\n 'scatter': Scatter,\n 'funnel': Funnel,\n 'area': Area,\n 'card': Card,\n 'scatter-simple': ScatterSimple,\n}\n\nconst defaultChartOptionCopy = computed(() => {\n return cloneDeep(defaultChartOption[showTypeName])\n})\n\nconst formatPublicData = computed<IFormatPublicData>(() => {\n const { desc: { colDesc = [], groupByDesc = [] } = {}, data = [] } = propData\n\n // 处理 X 轴数据\n let xValue = []\n\n let xGroupByDesc: EChartData['desc']['groupByDesc'][0] | null = null\n xValue = groupByDesc?.map((groupByDescItem) => {\n // if (groupByDescItem.colValues) {\n // groupByDescItem.colValuesDesc = {}\n // groupByDescItem.colValues.split(',')?.forEach((item) => {\n // const [key, value] = item.split(':')\n // groupByDescItem.colValuesDesc[key] = value\n // })\n // }\n if (groupByDescItem.xAxis) {\n xGroupByDesc = groupByDescItem\n }\n return groupByDescItem\n })\n\n const dataValue = xGroupByDesc ? data.filter(item => item && item[xGroupByDesc!.colDesc!]) : data\n\n // if (xGroupByDesc && xGroupByDesc.colValuesDesc && Object.keys(xGroupByDesc.colValuesDesc).length) {\n // const { colDesc: colDescItem, colValuesDesc } = xGroupByDesc\n // console.log('colDesc: colDescItem, colValuesDesc: ', colDescItem, colValuesDesc)\n // dataValue = dataValue.map((item) => {\n // if (typeof item[colDescItem] === 'number') {\n // item[colDescItem] = colValuesDesc[item[colDescItem]]\n // }\n // return item\n // })\n // }\n\n const chartDataDefault = {\n colDesc: [],\n xGroupByDesc: {\n colDesc: '',\n groupByDesc: '',\n groupByValues: [],\n xAxis: false,\n },\n groupByDesc: [],\n data: [],\n modelName: '',\n }\n\n const mergeConfig = merge(chartDataDefault, {\n colDesc,\n modelName,\n subShowType,\n xGroupByDesc,\n groupByDesc: xValue,\n data: dataValue,\n })\n return mergeConfig\n})\n\n// 导出数据\nfunction exportExal() {\n if (propData.data.length === 0) {\n // useMessage.error('暂无数据')\n console.log('暂无数据')\n return\n }\n const arr = useDataToExcelJson(propData)\n JsonToExcel(modelName, arr)\n}\nfunction merge(config: EChartsOption, defaultConfig: EChartsOption) {\n const mergeOpt = lodashMerge({}, defaultChartOptionCopy.value, config, defaultConfig)\n let conf = mergeOpt || {}\n\n if (jsCodeSnippet) {\n try {\n // 使用安全的配置处理函数\n conf = safeEvalConfig(jsCodeSnippet, conf)\n }\n catch (error) {\n console.error('代码执行失败:', error)\n }\n }\n\n return conf\n}\n\ndefineExpose({\n exportExal,\n})\nprovide(InjectionChartMerge, merge)\n</script>\n\n<template>\n <component\n :is=\"coms[showTypeName]\"\n :key=\"showTypeName\"\n :class=\"[ns.e('wrapper')]\"\n :sub-show-type=\"subShowType\"\n :chart-data=\"formatPublicData\"\n :chart-options=\"chartOptions\"\n />\n</template>\n"],"names":["ns","useNamespace","coms","table","Table","default","bar","Bar","line","Line","pie","Pie","radar","Radar","scatter","Scatter","funnel","Funnel","area","Area","card","Card","ScatterSimple","defaultChartOptionCopy","computed","cloneDeep","defaultChartOption","__props","formatPublicData","desc","colDesc","groupByDesc","data","xValue","xGroupByDesc","map","groupByDescItem","xAxis","dataValue","filter","item","merge","groupByValues","modelName","subShowType","config","defaultConfig","conf","lodashMerge","value","jsCodeSnippet","safeEvalConfig","error","console","__expose","exportExal","length","log","arr","useDataToExcelJson","JsonToExcel","provide","InjectionChartMerge"],"mappings":"yqCAoDM,MAAAA,EAAKC,eAAa,cAElBC,EAEF,CACFC,MAASC,EAAAC,QACTC,IAAOC,EAAAF,QACPG,KAAQC,EAAAJ,QACRK,IAAOC,EAAAN,QACPO,MAASC,EAAAR,QACTS,QAAWC,EAAAV,QACXW,OAAUC,EAAAZ,QACVa,KAAQC,EAAAd,QACRe,KAAQC,EAAAhB,QACR,iBAAkBiB,EAAAA,SAGdC,EAAyBC,EAAAA,UAAS,IAC/BC,YAAUC,EAAAA,mBAAmBC,mBAGhCC,EAAmBJ,EAAAA,UAA4B,KACnD,MAAQK,MAAMC,QAAEA,EAAU,eAAIC,EAAc,IAAO,CAAI,EAAAC,KAAAA,EAAO,IAAOL,EAAAK,KAGrE,IAAIC,EAAS,GAETC,EAA4D,KACvDD,EAAAF,GAAaI,KAAKC,IAQrBA,EAAgBC,QACHH,EAAAE,GAEVA,KAGH,MAAAE,EAAYJ,EAAeF,EAAKO,QAAOC,GAAQA,GAAQA,EAAKN,EAAcJ,WAAaE,EAkCtF,OARaS,EAbK,CACvBX,QAAS,GACTI,aAAc,CACZJ,QAAS,GACTC,YAAa,GACbW,cAAe,GACfL,OAAO,GAETN,YAAa,GACbC,KAAM,GACNW,UAAW,IAG+B,CAC1Cb,UACAa,UAAShB,EAAAgB,UACTC,YAAWjB,EAAAiB,YACXV,eACAH,YAAaE,EACbD,KAAMM,GAED,IAaA,SAAAG,EAAMI,EAAuBC,GAEhC,IAAAC,EADaC,EAAAA,MAAY,GAAIzB,EAAuB0B,MAAOJ,EAAQC,IAChD,CAAC,EAExB,GAAInB,EAAAuB,cACE,IAEKH,EAAAI,EAAAA,eAAexB,gBAAeoB,SAEhCK,GACGC,QAAAD,MAAM,UAAWA,EAAK,CAI3B,OAAAL,CAAA,QAGIO,EAAA,CACXC,WA3BF,WACE,GAA6B,IAAzB5B,OAASK,KAAKwB,OAGhB,YADAH,QAAQI,IAAI,QAGR,MAAAC,EAAMC,EAAAA,mBAAmBhC,EAAQK,MAC3B4B,cAAAjC,EAAAgB,UAAWe,EAAG,IAsB5BG,EAAAA,QAAQC,sBAAqBrB"}
1
+ {"version":3,"file":"data-chart.vue.cjs","sources":["../../../../../../packages/components/src/data-chart/src/data-chart.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { EChartData, EChartsOption, IFormatPublicData } from './utils/types'\nimport type { IconRow } from './utils/types'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { JsonToExcel } from '@qxs-bns/utils'\nimport { cloneDeep, merge as lodashMerge } from 'lodash-es'\nimport Area from './components/area.vue'\nimport Bar from './components/bar.vue'\nimport Card from './components/card.vue'\nimport Funnel from './components/funnel.vue'\nimport Line from './components/line.vue'\nimport Pie from './components/pie.vue'\nimport Radar from './components/radar.vue'\nimport ScatterSimple from './components/scatter-simple.vue'\nimport Scatter from './components/scatter.vue'\nimport Table from './components/table.vue'\nimport { defaultChartOption } from './utils/config'\nimport { InjectionChartMerge } from './utils/injectionKeys'\nimport { safeEvalConfig } from './utils/safe-eval'\nimport { useDataToExcelJson } from './utils/useCharts'\n\ndefineOptions({\n name: 'QxsDataChart',\n})\n\nconst {\n showTypeName = 'table',\n subShowType,\n modelName = '',\n data: propData = {\n data: [],\n desc: {\n colDesc: [],\n showDesc: {\n showType: 0,\n chartOptions: '{}',\n jsCodeSnippet: '',\n },\n groupByDesc: [],\n },\n },\n chartOptions = {},\n jsCodeSnippet = '',\n} = defineProps<{\n modelName?: string\n showTypeName?: IconRow['showTypeName']\n subShowType?: string\n data?: EChartData\n chartOptions?: EChartsOption\n jsCodeSnippet?: string\n}>()\n\nconst ns = useNamespace('data-chart')\n\nconst coms: {\n [key: string]: any\n} = {\n 'table': Table,\n 'bar': Bar,\n 'line': Line,\n 'pie': Pie,\n 'radar': Radar,\n 'scatter': Scatter,\n 'funnel': Funnel,\n 'area': Area,\n 'card': Card,\n 'scatter-simple': ScatterSimple,\n}\n\nconst defaultChartOptionCopy = computed(() => {\n return cloneDeep(defaultChartOption[showTypeName])\n})\n\nconst formatPublicData = computed<IFormatPublicData>(() => {\n const { desc: { colDesc = [], groupByDesc = [] } = {}, data = [] } = propData\n\n // 处理 X 轴数据\n let xValue = []\n\n let xGroupByDesc: EChartData['desc']['groupByDesc'][0] | null = null\n xValue = groupByDesc?.map((groupByDescItem) => {\n // if (groupByDescItem.colValues) {\n // groupByDescItem.colValuesDesc = {}\n // groupByDescItem.colValues.split(',')?.forEach((item) => {\n // const [key, value] = item.split(':')\n // groupByDescItem.colValuesDesc[key] = value\n // })\n // }\n if (groupByDescItem.xAxis) {\n xGroupByDesc = groupByDescItem\n }\n return groupByDescItem\n })\n\n const dataValue = xGroupByDesc ? data.filter(item => item && item[xGroupByDesc!.colDesc!]) : data\n\n // if (xGroupByDesc && xGroupByDesc.colValuesDesc && Object.keys(xGroupByDesc.colValuesDesc).length) {\n // const { colDesc: colDescItem, colValuesDesc } = xGroupByDesc\n // console.log('colDesc: colDescItem, colValuesDesc: ', colDescItem, colValuesDesc)\n // dataValue = dataValue.map((item) => {\n // if (typeof item[colDescItem] === 'number') {\n // item[colDescItem] = colValuesDesc[item[colDescItem]]\n // }\n // return item\n // })\n // }\n\n const mergeConfig = {\n colDesc: colDesc || [],\n modelName,\n subShowType,\n xGroupByDesc: xGroupByDesc || {\n colDesc: '',\n groupByDesc: '',\n groupByValues: [],\n xAxis: false,\n },\n groupByDesc: xValue,\n data: dataValue,\n }\n return mergeConfig\n})\n\n// 导出数据\nfunction exportExal() {\n if (propData.data.length === 0) {\n // useMessage.error('暂无数据')\n console.log('暂无数据')\n return\n }\n const arr = useDataToExcelJson(propData)\n JsonToExcel(modelName, arr)\n}\nfunction merge(config: EChartsOption, defaultConfig: EChartsOption) {\n const mergeOpt = lodashMerge({}, defaultChartOptionCopy.value, config, defaultConfig)\n let conf = mergeOpt || {}\n\n if (jsCodeSnippet) {\n try {\n // 使用安全的配置处理函数\n conf = safeEvalConfig(jsCodeSnippet, conf)\n }\n catch (error) {\n console.error('代码执行失败:', error)\n }\n }\n\n return conf\n}\n\ndefineExpose({\n exportExal,\n})\nprovide(InjectionChartMerge, merge)\n</script>\n\n<template>\n <component\n :is=\"coms[showTypeName]\"\n :key=\"showTypeName\"\n :class=\"[ns.e('wrapper')]\"\n :sub-show-type=\"subShowType\"\n :chart-data=\"formatPublicData\"\n :chart-options=\"chartOptions\"\n />\n</template>\n"],"names":["ns","useNamespace","coms","table","Table","default","bar","Bar","line","Line","pie","Pie","radar","Radar","scatter","Scatter","funnel","Funnel","area","Area","card","Card","ScatterSimple","defaultChartOptionCopy","computed","cloneDeep","defaultChartOption","__props","formatPublicData","desc","colDesc","groupByDesc","data","xValue","xGroupByDesc","map","groupByDescItem","xAxis","dataValue","filter","item","modelName","subShowType","groupByValues","__expose","exportExal","length","console","log","arr","useDataToExcelJson","JsonToExcel","provide","InjectionChartMerge","config","defaultConfig","conf","lodashMerge","value","jsCodeSnippet","safeEvalConfig","error"],"mappings":"yqCAoDM,MAAAA,EAAKC,eAAa,cAElBC,EAEF,CACFC,MAASC,EAAAC,QACTC,IAAOC,EAAAF,QACPG,KAAQC,EAAAJ,QACRK,IAAOC,EAAAN,QACPO,MAASC,EAAAR,QACTS,QAAWC,EAAAV,QACXW,OAAUC,EAAAZ,QACVa,KAAQC,EAAAd,QACRe,KAAQC,EAAAhB,QACR,iBAAkBiB,EAAAA,SAGdC,EAAyBC,EAAAA,UAAS,IAC/BC,YAAUC,EAAAA,mBAAmBC,mBAGhCC,EAAmBJ,EAAAA,UAA4B,KACnD,MAAQK,MAAMC,QAAEA,EAAU,eAAIC,EAAc,IAAO,CAAI,EAAAC,KAAAA,EAAO,IAAOL,EAAAK,KAGrE,IAAIC,EAAS,GAETC,EAA4D,KACvDD,EAAAF,GAAaI,KAAKC,IAQrBA,EAAgBC,QACHH,EAAAE,GAEVA,KAGH,MAAAE,EAAYJ,EAAeF,EAAKO,QAAOC,GAAQA,GAAQA,EAAKN,EAAcJ,WAAaE,EA0BtF,MAba,CAClBF,QAASA,GAAW,GACpBW,UAASd,EAAAc,UACTC,YAAWf,EAAAe,YACXR,aAAcA,GAAgB,CAC5BJ,QAAS,GACTC,YAAa,GACbY,cAAe,GACfN,OAAO,GAETN,YAAaE,EACbD,KAAMM,EAED,WA8BIM,EAAA,CACXC,WA3BF,WACE,GAA6B,IAAzBlB,OAASK,KAAKc,OAGhB,YADAC,QAAQC,IAAI,QAGR,MAAAC,EAAMC,EAAAA,mBAAmBvB,EAAQK,MAC3BmB,cAAAxB,EAAAc,UAAWQ,EAAG,IAsB5BG,EAAAA,QAAQC,uBApBC,SAAMC,EAAuBC,GAEhC,IAAAC,EADaC,EAAAA,MAAY,GAAIlC,EAAuBmC,MAAOJ,EAAQC,IAChD,CAAC,EAExB,GAAI5B,EAAAgC,cACE,IAEKH,EAAAI,EAAAA,eAAejC,gBAAe6B,SAEhCK,GACGd,QAAAc,MAAM,UAAWA,EAAK,CAI3B,OAAAL,CAAA"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("lodash-es");const t={data:[{showTypeName:"table",label:"表格",coverImg:"table.png",disabled:()=>!1,subTypeList:[],showType:0,baseConfig:{}},{showTypeName:"line",label:"折线图",coverImg:"line-stack.png",showType:1,subTypeList:[{value:"line-simple",icon:"line-smooth",tooltipContent:"折线图"},{value:"area-basic",icon:"chart-line-area",tooltipContent:"折线面积图"}],baseConfig:{tooltip:{confine:!1,trigger:"axis",axisPointer:{type:"line"}},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},legend:{type:"scroll",top:"25px"},grid:{left:"0",bottom:"10px",containLabel:!0},xAxis:{type:"category",boundaryGap:!1},yAxis:{type:"value"},dataZoom:[{type:"inside"}]},disabled:(e,t)=>{const o=t?.length;return!(o>=1&&o<2)}},{showTypeName:"bar",label:"柱状图",coverImg:"bar-tick-align.png",showType:2,baseConfig:{legend:{type:"scroll",top:"25px"},tooltip:{confine:!1,trigger:"axis",axisPointer:{type:"shadow"}},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},grid:{left:"0",bottom:"20px",containLabel:!0},xAxis:{axisLabel:{showMaxLabel:!0},axisTick:{alignWithLabel:!0}},yAxis:{},dataZoom:[{type:"inside"}]},subTypeList:[{value:"bar-simple",icon:"bar-simple",tooltipContent:"垂直条形图"},{value:"bar-y-category",icon:"bar-y-category",tooltipContent:"水平条形图"}],disabled:(e,t)=>{const o=t?.length;return!(o>=1)}},{showTypeName:"pie",label:"饼图",coverImg:"pie-simple.png",showType:4,subTypeList:[{value:"pie-simple",icon:"pie-simple",tooltipContent:"饼图"},{value:"pie-borderRadius",icon:"pie-borderRadius",tooltipContent:"环形图"}],baseConfig:{tooltip:{confine:!0,formatter:"{a}<br>{b}: {c}({d}%)",trigger:"item"},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},legend:{type:"scroll",top:"25px"}},disabled:(e,t)=>{const o=t?.length,a=e?.length;return!(a<=4&&o>0&&o<=1)}},{showTypeName:"area",label:"地图",coverImg:"area.png",showType:5,subTypeList:[],baseConfig:{tooltip:{confine:!0,trigger:"item"},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},visualMap:{text:["高","低"],realtime:!1,calculable:!0,inRange:{color:["lightskyblue","yellow","orangered"]}}},disabled:(e,t)=>{const o=t?.length,a=t?.some((e=>{let{colDesc:t}=e;return t.includes("省")||t.includes("市")}));return!(a&&o>0)}},{showTypeName:"funnel",label:"漏斗图",coverImg:"funnel.png",showType:6,subTypeList:[],baseConfig:{tooltip:{confine:!0,trigger:"item",formatter:"{a} <br/>{b} : {c}"},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},legend:{type:"scroll",top:20}},disabled:(e,t)=>{const o=t?.length,a=e?.length;return!(a<=5&&o>0&&o<=1)}},{showTypeName:"card",label:"卡片",coverImg:"card.png",showType:9,subTypeList:[],baseConfig:{},disabled:(e,t)=>{const o=t?.length,a=e?.length;return!(a>0&&o<=1)}},{showTypeName:"radar",label:"雷达图",coverImg:"radar.png",showType:10,subTypeList:[],baseConfig:{legend:{type:"scroll",orient:"vertical",left:"left",top:"25px"},tooltip:{confine:!0,trigger:"item"},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},radar:{center:["50%","55%"]}},disabled:(e,t)=>{const o=t?.length;return 1!==o||1!==e.length}},{showTypeName:"scatter-simple",label:"散点图",coverImg:"",showType:11,subTypeList:[],disabled:()=>!1,baseConfig:{grid:{left:"0",bottom:"10px",containLabel:!0},tooltip:{showDelay:0,axisPointer:{show:!0,type:"cross",lineStyle:{type:"dashed",width:1}}},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},legend:{type:"scroll",top:"25px"},xAxis:{splitLine:{lineStyle:{type:"dashed"}}},yAxis:{splitLine:{lineStyle:{type:"dashed"}}}}}]};function o(t,o){const a={};return t.forEach((t=>{a[t.showTypeName]=e.merge(t.baseConfig,o)})),a}const a=o(t.data,{backgroundColor:"transparent",title:{textStyle:{fontSize:14,lineHeight:16}}}),s=new Map;exports.defaultChartOption=a,exports.getGeoJsonData=function(e){const{adcode:t}=e;if(s.has(t)){const e=s.get(t);if(e)return Promise.resolve(e)}return new Promise((o=>{const a={showbiz:!1,extensions:"all",...e};import("@amap/amap-jsapi-loader").then((e=>{let{default:t}=e;return t.load({key:"2e820fac2a528b016a4cb95bb463e69e",version:"1.4.15",plugins:["AMap.DistrictSearch"],AMapUI:{version:"1.1",plugins:["geo/DistrictExplorer"]}})})).then((i=>{new i.DistrictSearch(a).search(e.adcode,((e,a)=>{AMapUI.loadUI(["geo/DistrictExplorer"],(e=>{(new e).loadAreaNode(a.districtList[0].adcode,((e,a)=>{if(e)return void console.error(e);const i={features:[],type:"FeatureCollection"};i.features=a.getSubFeatures(),s.set(t,i),o(i)}))}))}))})).catch((e=>{console.error("Failed to load map:",e),o({features:[],type:"FeatureCollection"})}))}))},exports.iconList=t,exports.setDefaultChartOption=o;
1
+ "use strict";var e=require("lodash-es");const t={get:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"showTypeName",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"table";return t.data.find((t=>t[e].toString()===o||t[e]===o))},data:[{showTypeName:"table",label:"表格",coverImg:"table.png",disabled:()=>!1,subTypeList:[],showType:0,baseConfig:{}},{showTypeName:"line",label:"折线图",coverImg:"line-stack.png",showType:1,subTypeList:[{value:"line-simple",icon:"line-smooth",tooltipContent:"折线图"},{value:"area-basic",icon:"chart-line-area",tooltipContent:"折线面积图"}],baseConfig:{tooltip:{confine:!1,trigger:"axis",axisPointer:{type:"line"}},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},legend:{type:"scroll",top:"25px"},grid:{left:"0",bottom:"10px",containLabel:!0},xAxis:{type:"category",boundaryGap:!1},yAxis:{type:"value"},dataZoom:[{type:"inside"}]},disabled:(e,t)=>{const o=t?.length;return!(o>=1&&o<2)}},{showTypeName:"bar",label:"柱状图",coverImg:"bar-tick-align.png",showType:2,baseConfig:{legend:{type:"scroll",top:"25px"},tooltip:{confine:!1,trigger:"axis",axisPointer:{type:"shadow"}},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},grid:{left:"0",bottom:"20px",containLabel:!0},xAxis:{axisLabel:{showMaxLabel:!0},axisTick:{alignWithLabel:!0}},yAxis:{},dataZoom:[{type:"inside"}]},subTypeList:[{value:"bar-simple",icon:"bar-simple",tooltipContent:"垂直条形图"},{value:"bar-y-category",icon:"bar-y-category",tooltipContent:"水平条形图"}],disabled:(e,t)=>{const o=t?.length;return!(o>=1)}},{showTypeName:"pie",label:"饼图",coverImg:"pie-simple.png",showType:4,subTypeList:[{value:"pie-simple",icon:"pie-simple",tooltipContent:"饼图"},{value:"pie-borderRadius",icon:"pie-borderRadius",tooltipContent:"环形图"}],baseConfig:{tooltip:{confine:!0,formatter:"{a}<br>{b}: {c}({d}%)",trigger:"item"},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},legend:{type:"scroll",top:"25px"}},disabled:(e,t)=>{const o=t?.length,a=e?.length;return!(a<=4&&o>0&&o<=1)}},{showTypeName:"area",label:"地图",coverImg:"area.png",showType:5,subTypeList:[],baseConfig:{tooltip:{confine:!0,trigger:"item"},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},visualMap:{text:["高","低"],realtime:!1,calculable:!0,inRange:{color:["lightskyblue","yellow","orangered"]}}},disabled:(e,t)=>{const o=t?.length,a=t?.some((e=>{let{colDesc:t}=e;return t.includes("省")||t.includes("市")}));return!(a&&o>0)}},{showTypeName:"funnel",label:"漏斗图",coverImg:"funnel.png",showType:6,subTypeList:[],baseConfig:{tooltip:{confine:!0,trigger:"item",formatter:"{a} <br/>{b} : {c}"},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},legend:{type:"scroll",top:20}},disabled:(e,t)=>{const o=t?.length,a=e?.length;return!(a<=5&&o>0&&o<=1)}},{showTypeName:"card",label:"卡片",coverImg:"card.png",showType:9,subTypeList:[],baseConfig:{},disabled:(e,t)=>{const o=t?.length,a=e?.length;return!(a>0&&o<=1)}},{showTypeName:"radar",label:"雷达图",coverImg:"radar.png",showType:10,subTypeList:[],baseConfig:{legend:{type:"scroll",orient:"vertical",left:"left",top:"25px"},tooltip:{confine:!0,trigger:"item"},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},radar:{center:["50%","55%"]}},disabled:(e,t)=>{const o=t?.length;return 1!==o||1!==e.length}},{showTypeName:"scatter-simple",label:"散点图",coverImg:"",showType:11,subTypeList:[],disabled:()=>!1,baseConfig:{grid:{left:"0",bottom:"10px",containLabel:!0},tooltip:{showDelay:0,axisPointer:{show:!0,type:"cross",lineStyle:{type:"dashed",width:1}}},toolbox:{show:!1,showTitle:!1,feature:{saveAsImage:{}}},legend:{type:"scroll",top:"25px"},xAxis:{splitLine:{lineStyle:{type:"dashed"}}},yAxis:{splitLine:{lineStyle:{type:"dashed"}}}}}]};function o(t,o){const a={};return t.forEach((t=>{a[t.showTypeName]=e.merge(t.baseConfig,o)})),a}const a=o(t.data,{backgroundColor:"transparent",title:{textStyle:{fontSize:14,lineHeight:16}}}),s=new Map;exports.defaultChartOption=a,exports.getGeoJsonData=function(e){const{adcode:t}=e;if(s.has(t)){const e=s.get(t);if(e)return Promise.resolve(e)}return new Promise((o=>{const a={showbiz:!1,extensions:"all",...e};import("@amap/amap-jsapi-loader").then((e=>{let{default:t}=e;return t.load({key:"2e820fac2a528b016a4cb95bb463e69e",version:"1.4.15",plugins:["AMap.DistrictSearch"],AMapUI:{version:"1.1",plugins:["geo/DistrictExplorer"]}})})).then((i=>{new i.DistrictSearch(a).search(e.adcode,((e,a)=>{AMapUI.loadUI(["geo/DistrictExplorer"],(e=>{(new e).loadAreaNode(a.districtList[0].adcode,((e,a)=>{if(e)return void console.error(e);const i={features:[],type:"FeatureCollection"};i.features=a.getSubFeatures(),s.set(t,i),o(i)}))}))}))})).catch((e=>{console.error("Failed to load map:",e),o({features:[],type:"FeatureCollection"})}))}))},exports.iconList=t,exports.setDefaultChartOption=o,exports.showTypeText=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.get("showType",e)};
2
2
  //# sourceMappingURL=config.cjs.map