@qxs-bns/components 0.0.87 → 0.0.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/package.json.mjs +1 -1
- package/es/src/data-chart/src/components/bar.vue2.mjs +1 -1
- package/es/src/data-chart/src/components/bar.vue2.mjs.map +1 -1
- package/es/src/data-chart/src/components/pie.vue2.mjs +1 -1
- package/es/src/data-chart/src/components/pie.vue2.mjs.map +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/src/data-chart/src/components/bar.vue2.cjs +1 -1
- package/lib/src/data-chart/src/components/bar.vue2.cjs.map +1 -1
- package/lib/src/data-chart/src/components/pie.vue2.cjs +1 -1
- package/lib/src/data-chart/src/components/pie.vue2.cjs.map +1 -1
- package/package.json +2 -2
- package/types/src/data-chart/src/components/bar.vue.d.ts.map +1 -1
- package/types/src/data-chart/src/components/pie.vue.d.ts.map +1 -1
- package/types/tsconfig.tsbuildinfo +1 -1
package/es/package.json.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var r="0.0.
|
|
1
|
+
var r="0.0.89";export{r as version};
|
|
2
2
|
//# sourceMappingURL=package.json.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{defineComponent as e,inject as a,ref as t,computed as
|
|
1
|
+
import{defineComponent as e,inject as a,ref as t,computed as r,createElementBlock as s,openBlock as l}from"vue";import{uniq as o}from"lodash-es";import{InjectionChartMerge as i}from"../utils/injectionKeys.mjs";import{useCharts as c}from"../utils/useCharts.mjs";var n=e({name:"DataChartBar",__name:"bar",props:{chartData:{type:Object,required:!0},subShowType:{type:String,required:!0,default:"bar-simple"},chartOptions:{type:null,required:!0},lazyLoad:{type:Boolean,required:!1,default:!0}},setup(e,{expose:n}){const p=a(i,e=>e,!0),u=t(null),y=r(()=>{const{colDesc:a,xGroupByDesc:t,groupByDesc:r,data:s=[],modelName:l}=e.chartData,i=Array.from(new Set(s.map(e=>e[t.colDesc||""]))).filter(e=>null!=e)||[],c={...r.find(e=>!e.xAxis)||{groupByDesc:null,groupByValues:[],colDesc:"",xAxis:!1},groupByValues:o(s.map(e=>r.find(e=>!e.xAxis)?.colDesc?String(e[r.find(e=>!e.xAxis)?.colDesc||""]):""))},n=t?{...t,groupByValues:o(s.map(e=>t.colDesc?String(e[t.colDesc]):""))}:t,u={title:{text:l},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=a.map(e=>({name:e,data:s.map(a=>a[e]),type:"bar",emphasis:{focus:"series"},label:{show:!0,position:"inside"}})),u.legend.data=a;else if(2===r.length){const e=a.map(e=>c.groupByValues?.map(a=>{const t={name:`${a||"/"}-${e}`,type:"bar",stack:e,emphasis:{focus:"series"},data:[],label:{show:!0,position:"inside"}};return t.data=(n?.groupByValues||[]).map(e=>{let r=null;return s.forEach(s=>{c.colDesc&&s[c.colDesc]===a&&n?.colDesc&&s[n.colDesc]===e&&t.stack&&(r=s[t.stack]??null)}),r||""}).filter(e=>""!==e),t})||[]).flat();u.series=e,delete u.legend}function y(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(e.subShowType){case"bar-simple":case"default":y(u.xAxis,"category",i,t?.colDesc||""),y(u.yAxis,"value");break;case"bar-y-category":y(u.xAxis,"value"),y(u.yAxis,"category",i,t?.colDesc||""),u.grid={top:80,...u.grid}}return p(u,e.chartOptions)}),{myChart:d}=c({chartDOM:u,chartOptions:y,chartData:r(()=>e.chartData),lazyLoad:e.lazyLoad});return n({myChart:d}),(e,a)=>(l(),s("div",{ref_key:"dataChartBar",ref:u,class:"data-chart-bar"},null,512))}});export{n as default};
|
|
2
2
|
//# sourceMappingURL=bar.vue2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar.vue2.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/bar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { LegendComponentOption, XAXisComponentOption, YAXisComponentOption } from 'echarts'\nimport type {\n EChartsOption,\n IFormatPublicData,\n SeriesOption,\n} from '../utils/types'\nimport { uniq } from 'lodash-es'\nimport { computed, inject, ref } from 'vue'\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 lazyLoad = true,\n} = defineProps<{\n chartData: IFormatPublicData\n subShowType: string\n chartOptions: EChartsOption\n lazyLoad?: boolean\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\n // 创建新的对象而不是修改原对象\n const yGroupByDesc = {\n ...groupByDesc.find(item => !item.xAxis) || {\n groupByDesc: null,\n groupByValues: [],\n colDesc: '',\n xAxis: false,\n },\n groupByValues: uniq(data.map(item => groupByDesc.find(item => !item.xAxis)?.colDesc ? String(item[groupByDesc.find(item => !item.xAxis)?.colDesc || '']) : '')),\n }\n\n // 创建新的 xGroupByDesc 对象\n const newXGroupByDesc = xGroupByDesc\n ? {\n ...xGroupByDesc,\n groupByValues: uniq(data.map(item => xGroupByDesc.colDesc ? String(item[xGroupByDesc.colDesc]) : '')),\n }\n : xGroupByDesc\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 = (newXGroupByDesc?.groupByValues || []).map((xGroupByDescItem) => {\n let targetVal: number | string | null = null\n data.forEach((item) => {\n if (yGroupByDesc.colDesc && item[yGroupByDesc.colDesc] === yGroupByDescItem && newXGroupByDesc?.colDesc && item[newXGroupByDesc.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\nconst { myChart } = useCharts({\n chartDOM: dataChartBar,\n chartOptions: barChartOptions,\n chartData: computed(() => chartData),\n lazyLoad,\n})\n\n// 暴露 myChart 方法供父组件访问\ndefineExpose({\n myChart,\n})\n</script>\n\n<template>\n <div\n ref=\"dataChartBar\"\n class=\"data-chart-bar\"\n />\n</template>\n\n<style scoped lang=\"scss\">\n.data-chart-bar {\n width: 100%;\n height: 100%;\n}\n</style>\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","newXGroupByDesc","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","myChart","useCharts","chartDOM","lazyLoad","__expose","_createElementBlock","class"],"mappings":"8fA+BA,MAAMA,EAAQC,EAAOC,EAAsBC,GAAWA,GAAG,GACnDC,EAAeC,EAAwB,MAGvCC,EAAkBC,EAAwB,KAC9C,MAAMC,QAAEA,eAASC,EAAAC,YAAcA,EAAAC,KAAaA,EAAO,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CnB,KAAM,MACNsB,MAAOH,EACPN,SAAU,CACRC,MAAO,UAETpC,KAAM,GACNqC,MAAO,CACLC,MAAM,EACNC,SAAU,WAcd,OAXAI,EAAI3C,MAAQiB,GAAiBH,eAAiB,IAAIN,IAAKqC,IACrD,IAAIC,EAAoC,KAQxC,OAPA9C,EAAK+C,QAAStC,IACRE,EAAad,SAAWY,EAAKE,EAAad,WAAa6C,GAAoBzB,GAAiBpB,SAAWY,EAAKQ,EAAgBpB,WAAagD,GACvIF,EAAIC,QACNE,EAAYrC,EAAKkC,EAAIC,QAAU,QAI9BE,GAAa,KACnBpC,OAAOlB,GAAW,KAANA,GACRmD,KACH,IACLK,OAEH9B,EAAOe,OAASO,SACTtB,EAAOY,MAChB,CASA,SAASmB,EACPC,EACA5B,EACAtB,EACAqB,GAEIhB,MAAM8C,QAAQD,GAChBA,EAAKH,QAAStC,IACRA,IACFA,EAAKa,KAAOA,EACC,aAATA,IACDb,EAA4BT,KAAOA,GAAQ,GAC5CS,EAAKY,KAAOA,GAAQ,OAKnB6B,IACPA,EAAK5B,KAAOA,EACC,aAATA,IACD4B,EAA4BlD,KAAOA,GAAQ,GAC5CkD,EAAK7B,KAAOA,GAAQ,IAG1B,CAGA,OAAQnB,EAAAkD,aACN,IAAK,aACL,IAAK,UACHH,EAAc/B,EAAOL,MAAO,WAAYT,EAAUN,GAAcD,SAAW,IAC3EoD,EAAc/B,EAAOW,MAAO,SAC5B,MAEF,IAAK,iBACHoB,EAAc/B,EAAOL,MAAO,SAC5BoC,EAAc/B,EAAOW,MAAO,WAAYzB,EAAUN,GAAcD,SAAW,
|
|
1
|
+
{"version":3,"file":"bar.vue2.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/bar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { LegendComponentOption, XAXisComponentOption, YAXisComponentOption } from 'echarts'\nimport type {\n EChartsOption,\n IFormatPublicData,\n SeriesOption,\n} from '../utils/types'\nimport { uniq } from 'lodash-es'\nimport { computed, inject, ref } from 'vue'\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 lazyLoad = true,\n} = defineProps<{\n chartData: IFormatPublicData\n subShowType: string\n chartOptions: EChartsOption\n lazyLoad?: boolean\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\n // 创建新的对象而不是修改原对象\n const yGroupByDesc = {\n ...groupByDesc.find(item => !item.xAxis) || {\n groupByDesc: null,\n groupByValues: [],\n colDesc: '',\n xAxis: false,\n },\n groupByValues: uniq(data.map(item => groupByDesc.find(item => !item.xAxis)?.colDesc ? String(item[groupByDesc.find(item => !item.xAxis)?.colDesc || '']) : '')),\n }\n\n // 创建新的 xGroupByDesc 对象\n const newXGroupByDesc = xGroupByDesc\n ? {\n ...xGroupByDesc,\n groupByValues: uniq(data.map(item => xGroupByDesc.colDesc ? String(item[xGroupByDesc.colDesc]) : '')),\n }\n : xGroupByDesc\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 = (newXGroupByDesc?.groupByValues || []).map((xGroupByDescItem) => {\n let targetVal: number | string | null = null\n data.forEach((item) => {\n if (yGroupByDesc.colDesc && item[yGroupByDesc.colDesc] === yGroupByDescItem && newXGroupByDesc?.colDesc && item[newXGroupByDesc.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 // 增加顶部距离,为图例和轴名称预留空间\n config.grid = {\n top: 80,\n ...config.grid,\n }\n break\n }\n\n return merge(config, chartOptions)\n})\n\nconst { myChart } = useCharts({\n chartDOM: dataChartBar,\n chartOptions: barChartOptions,\n chartData: computed(() => chartData),\n lazyLoad,\n})\n\n// 暴露 myChart 方法供父组件访问\ndefineExpose({\n myChart,\n})\n</script>\n\n<template>\n <div\n ref=\"dataChartBar\"\n class=\"data-chart-bar\"\n />\n</template>\n\n<style scoped lang=\"scss\">\n.data-chart-bar {\n width: 100%;\n height: 100%;\n}\n</style>\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","newXGroupByDesc","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","grid","top","chartOptions","myChart","useCharts","chartDOM","lazyLoad","__expose","_createElementBlock","class"],"mappings":"8fA+BA,MAAMA,EAAQC,EAAOC,EAAsBC,GAAWA,GAAG,GACnDC,EAAeC,EAAwB,MAGvCC,EAAkBC,EAAwB,KAC9C,MAAMC,QAAEA,eAASC,EAAAC,YAAcA,EAAAC,KAAaA,EAAO,GAACC,UAAGA,GAAcC,EAAAC,UAE/DC,EAAWC,MAAMC,KAAK,IAAIC,IAAIP,EAAKQ,IAAIC,GAAQA,EAAKX,EAAaD,SAAW,OAAOa,OAAOD,GAAQA,UAAwC,GAG1IE,EAAe,IAChBZ,EAAYa,SAAcH,EAAKI,Q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OAPA9C,EAAK+C,QAAStC,IACRE,EAAad,SAAWY,EAAKE,EAAad,WAAa6C,GAAoBzB,GAAiBpB,SAAWY,EAAKQ,EAAgBpB,WAAagD,GACvIF,EAAIC,QACNE,EAAYrC,EAAKkC,EAAIC,QAAU,QAI9BE,GAAa,KACnBpC,OAAOlB,GAAW,KAANA,GACRmD,KACH,IACLK,OAEH9B,EAAOe,OAASO,SACTtB,EAAOY,MAChB,CASA,SAASmB,EACPC,EACA5B,EACAtB,EACAqB,GAEIhB,MAAM8C,QAAQD,GAChBA,EAAKH,QAAStC,IACRA,IACFA,EAAKa,KAAOA,EACC,aAATA,IACDb,EAA4BT,KAAOA,GAAQ,GAC5CS,EAAKY,KAAOA,GAAQ,OAKnB6B,IACPA,EAAK5B,KAAOA,EACC,aAATA,IACD4B,EAA4BlD,KAAOA,GAAQ,GAC5CkD,EAAK7B,KAAOA,GAAQ,IAG1B,CAGA,OAAQnB,EAAAkD,aACN,IAAK,aACL,IAAK,UACHH,EAAc/B,EAAOL,MAAO,WAAYT,EAAUN,GAAcD,SAAW,IAC3EoD,EAAc/B,EAAOW,MAAO,SAC5B,MAEF,IAAK,iBACHoB,EAAc/B,EAAOL,MAAO,SAC5BoC,EAAc/B,EAAOW,MAAO,WAAYzB,EAAUN,GAAcD,SAAW,IAE3EqB,EAAOmC,KAAO,CACZC,IAAK,MACFpC,EAAOmC,MAKhB,OAAOhE,EAAM6B,EAAQhB,EAAAqD,iBAGjBC,QAAEA,GAAYC,EAAU,CAC5BC,SAAUjE,EACV8D,aAAc5D,EACdQ,UAAWP,EAAS,IAAMM,EAAAC,WAC1BwD,SAAOzD,EAAAyD,kBAITC,EAAa,CACXJ,wBAKAK,EAGE,MAAA,SAFI,eAAJnE,IAAID,EACJqE,MAAM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{defineComponent as e,inject as t,ref as r,computed as a,createElementBlock as o,openBlock as i}from"vue";import{orderBy as l}from"lodash-es";import{InjectionChartMerge as s}from"../utils/injectionKeys.mjs";import{useCharts as c}from"../utils/useCharts.mjs";var n=e({name:"DataChartPie",__name:"pie",props:{chartData:{type:Object,required:!0},subShowType:{type:String,required:!0,default:"pie-simple"},chartOptions:{type:null,required:!0},lazyLoad:{type:Boolean,required:!1,default:!0}},setup(e,{expose:n}){const
|
|
1
|
+
import{defineComponent as e,inject as t,ref as r,computed as a,createElementBlock as o,openBlock as i}from"vue";import{orderBy as l}from"lodash-es";import{InjectionChartMerge as s}from"../utils/injectionKeys.mjs";import{useCharts as c}from"../utils/useCharts.mjs";var n=e({name:"DataChartPie",__name:"pie",props:{chartData:{type:Object,required:!0},subShowType:{type:String,required:!0,default:"pie-simple"},chartOptions:{type:null,required:!0},lazyLoad:{type:Boolean,required:!1,default:!0}},setup(e,{expose:n}){const m=t(s,e=>e,!0),u=r(null),p=a(()=>{const{colDesc:t,xGroupByDesc:r,data:a,modelName:o}=e.chartData,i=t.length,s={title:{text:o},series:t.map((t,o)=>{const s={name:t,type:"pie",center:["50%","50%"],data:[],emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}},label:{formatter:"{b}:{c}({d}%)",rich:{b:{color:"#4C5058",fontSize:14,fontWeight:"bold",lineHeight:33}}}};let c=5;const n=a.filter(e=>void 0!==e[t]),m=l(n,[t],["desc"]),u=m.reduce((e,r)=>{const a=Number(r[t])||0;return Number.isNaN(a)?e:e+a},0);if(n.length>c)for(;c<9;){const e=m.slice(0,c);if(e.reduce((e,r)=>e+Number(r[t]),0)/u>.9||8===c){const a=m.slice(c);s.data=e.map(e=>({name:r?.colDesc?String(e[r.colDesc]||""):"",value:Number(e[t])||0}));const o=a.reduce((e,r)=>e+Number(r[t]),0);o>0&&s.data&&s.data.push({name:"其它",value:o});break}c++}else s.data=n.map(e=>({name:r?.colDesc&&e[r.colDesc]||"",value:Number(e[t]||0)}));if(1===i?s.center=["50%","60%"]:2===i?0===o?(s.right="40%",s.left="",s.center=["40%","60%"]):(s.right="",s.left="40%",s.center=["60%","60%"]):3===i?0===o?(s.right="40%",s.bottom="50%",s.top="",s.left="",s.center=["40%","78%"]):1===o?(s.right="",s.bottom="50%",s.top="",s.left="40%",s.center=["60%","78%"]):(s.right="40%",s.bottom="",s.top="50%",s.left="",s.center=["40%","60%"]):4===i&&(0===o?(s.right="40%",s.bottom="50%",s.top="",s.left="",s.center=["40%","78%"]):1===o?(s.right="",s.bottom="50%",s.top="",s.left="40%",s.center=["60%","78%"]):2===o?(s.right="40%",s.bottom="",s.top="50%",s.left="",s.center=["40%","60%"]):(s.right="",s.bottom="",s.top="50%",s.left="40%",s.center=["60%","60%"])),"pie-borderRadius"===e.subShowType)s.radius=["50%","70%"];else s.radius="50%";return s})};return console.log(s),m(s,e.chartOptions)}),{myChart:h}=c({chartDOM:u,chartOptions:p,chartData:a(()=>e.chartData),lazyLoad:e.lazyLoad});return n({myChart:h}),(e,t)=>(i(),o("div",{ref_key:"dataChartPie",ref:u,class:"data-chart-pie"},null,512))}});export{n as default};
|
|
2
2
|
//# sourceMappingURL=pie.vue2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pie.vue2.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/pie.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { PieSeriesOption } from 'echarts/charts'\nimport type { EChartsOption, IFormatPublicData } from '../utils/types'\nimport { orderBy } from 'lodash-es'\nimport { computed, inject, ref } from 'vue'\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 lazyLoad = true,\n} = defineProps<{\n chartData: IFormatPublicData\n subShowType: string\n chartOptions: EChartsOption\n lazyLoad?: boolean\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\nconst { myChart } = useCharts({\n chartDOM: dataChartPie,\n chartOptions: pieChartOptions,\n chartData: computed(() => chartData),\n lazyLoad,\n})\n\n// 暴露 myChart 方法供父组件访问\ndefineExpose({\n myChart,\n})\n</script>\n\n<template>\n <div\n ref=\"dataChartPie\"\n class=\"data-chart-pie\"\n />\n</template>\n\n<style scoped lang=\"scss\">\n.data-chart-pie {\n width: 100%;\n height: 100%;\n}\n</style>\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","myChart","useCharts","chartDOM","lazyLoad","__expose","_createElementBlock","class"],"mappings":"igBAsBA,MAAMA,EAAQC,EAAOC,EAAsBC,GAAWA,GAAG,GAEnDC,EAAeC,EAAI,MACnBC,EAAkBC,EAAwB,KAC9C,MAAMC,QAAEA,EAAAC,aAASA,EAAAC,KAAcA,EAAAC,UAAMA,GAAcC,EAAAC,UAC7CC,EAAgBN,EAAQO,OACxBC,EAAS,CACbC,MAAO,CAAEC,KAAMP,GACfQ,OAAQX,EAAQY,IAAI,CAACC,EAAMC,KACzB,MAAMC,EAA8B,CAClCC,KAAMH,EACNI,KAAM,MACNC,OAAQ,CAAC,MAAO,OAChBhB,KAAM,GACNiB,SAAU,CACRC,UAAW,CACTC,WAAY,GACZC,cAAe,EACfC,YAAa,uBAGjBC,MAAO,CACLC,UAAW,gBACXC,KAAM,CACJC,EAAG,CACDC,MAAO,UACPC,SAAU,GACVC,WAAY,OACZC,WAAY,OAMpB,IAAIC,EAAS,EACb,MAAMC,EAAkB/B,EAAKgC,eAA4B,IAAdC,EAAItB,IACzCuB,EAAcC,EAAQJ,EAAiB,CAACpB,GAAO,CAAC,SAEhDy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kBAITC,EAAa,CACXJ,wBAKAK,EAGE,MAAA,SAFI,eAAJxE,IAAID,EACJ0E,MAAM"}
|
|
1
|
+
{"version":3,"file":"pie.vue2.mjs","sources":["../../../../../../../packages/components/src/data-chart/src/components/pie.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { PieSeriesOption } from 'echarts/charts'\nimport type { EChartsOption, IFormatPublicData } from '../utils/types'\nimport { orderBy } from 'lodash-es'\nimport { computed, inject, ref } from 'vue'\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 lazyLoad = true,\n} = defineProps<{\n chartData: IFormatPublicData\n subShowType: string\n chartOptions: EChartsOption\n lazyLoad?: boolean\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项总占比\n const headerScale = headerTotal / totalDesc\n if (headerScale > 0.9 || cutNum === 8) {\n const footerData = orderByData.slice(cutNum)\n\n // 处理前N项数据\n seriesItem.data = headerData.map(headerItem => ({\n name: xGroupByDesc?.colDesc\n ? String(headerItem[xGroupByDesc.colDesc] || '')\n : '',\n value: Number(headerItem[item]) || 0,\n }))\n\n // 添加\"其它\"项,包含剩余所有数据\n const footerTotal = footerData.reduce(\n (prev, cur) => prev + Number(cur[item]),\n 0,\n )\n\n if (footerTotal > 0 && seriesItem.data) {\n seriesItem.data.push({\n name: '其它',\n value: footerTotal,\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 console.log(config)\n\n return merge(config, chartOptions)\n})\n\nconst { myChart } = useCharts({\n chartDOM: dataChartPie,\n chartOptions: pieChartOptions,\n chartData: computed(() => chartData),\n lazyLoad,\n})\n\n// 暴露 myChart 方法供父组件访问\ndefineExpose({\n myChart,\n})\n</script>\n\n<template>\n <div\n ref=\"dataChartPie\"\n class=\"data-chart-pie\"\n />\n</template>\n\n<style scoped lang=\"scss\">\n.data-chart-pie {\n width: 100%;\n height: 100%;\n}\n</style>\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","headerItem","String","footerTotal","push","yItem","right","left","bottom","top","subShowType","radius","console","log","chartOptions","myChart","useCharts","chartDOM","lazyLoad","__expose","_createElementBlock","class"],"mappings":"igBAsBA,MAAMA,EAAQC,EAAOC,EAAsBC,GAAWA,GAAG,GAEnDC,EAAeC,EAAI,MACnBC,EAAkB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C,EAAWyC,IAAM,MACjBzC,EAAWuC,KAAO,GAClBvC,EAAWG,OAAS,CAAC,MAAO,SAG5BH,EAAWsC,MAAQ,GACnBtC,EAAWwC,OAAS,GACpBxC,EAAWyC,IAAM,MACjBzC,EAAWuC,KAAO,MAClBvC,EAAWG,OAAS,CAAC,MAAO,SAKzB,qBADCd,EAAAqD,YAEJ1C,EAAW2C,OAAS,CAAC,MAAO,YAM5B3C,EAAW2C,OAAS,MAGxB,OAAO3C,KAKX,OAFA4C,QAAQC,IAAIpD,GAELhB,EAAMgB,EAAQJ,EAAAyD,iBAGjBC,QAAEA,GAAYC,EAAU,CAC5BC,SAAUpE,EACViE,aAAc/D,EACdO,UAAWN,EAAS,IAAMK,EAAAC,WAC1B4D,SAAO7D,EAAA6D,kBAITC,EAAa,CACXJ,wBAKAK,EAGE,MAAA,SAFI,eAAJtE,IAAID,EACJwE,MAAM"}
|
package/lib/package.json.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";exports.version="0.0.
|
|
1
|
+
"use strict";exports.version="0.0.89";
|
|
2
2
|
//# sourceMappingURL=package.json.cjs.map
|
|
@@ -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},lazyLoad:{type:Boolean,required:!1,default:!0}},setup(s,{expose:l}){const c=e.inject(t.InjectionChartMerge,e=>e,!0),o=e.ref(null),i=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)||{groupByDesc:null,groupByValues:[],colDesc:"",xAxis:!1},groupByValues:a.uniq(l.map(e=>r.find(e=>!e.xAxis)?.colDesc?String(e[r.find(e=>!e.xAxis)?.colDesc||""]):""))},u=t?{...t,groupByValues:a.uniq(l.map(e=>t.colDesc?String(e[t.colDesc]):""))}:t,p={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)p.series=e.map(e=>({name:e,data:l.map(a=>a[e]),type:"bar",emphasis:{focus:"series"},label:{show:!0,position:"inside"}})),p.legend.data=e;else if(2===r.length){const a=e.map(e=>n.groupByValues?.map(a=>{const t={name:`${a||"/"}-${e}`,type:"bar",stack:e,emphasis:{focus:"series"},data:[],label:{show:!0,position:"inside"}};return t.data=(u?.groupByValues||[]).map(e=>{let r=null;return l.forEach(s=>{n.colDesc&&s[n.colDesc]===a&&u?.colDesc&&s[u.colDesc]===e&&t.stack&&(r=s[t.stack]??null)}),r||""}).filter(e=>""!==e),t})||[]).flat();p.series=a,delete p.legend}function d(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":d(p.xAxis,"category",i,t?.colDesc||""),d(p.yAxis,"value");break;case"bar-y-category":d(p.xAxis,"value"),d(p.yAxis,"category",i,t?.colDesc||"")}return c(p,s.chartOptions)}),{myChart:n}=r.useCharts({chartDOM:o,chartOptions:i,chartData:e.computed(()=>s.chartData),lazyLoad:s.lazyLoad});return l({myChart:n}),(a,t)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dataChartBar",ref:o,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},lazyLoad:{type:Boolean,required:!1,default:!0}},setup(s,{expose:l}){const c=e.inject(t.InjectionChartMerge,e=>e,!0),o=e.ref(null),i=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)||{groupByDesc:null,groupByValues:[],colDesc:"",xAxis:!1},groupByValues:a.uniq(l.map(e=>r.find(e=>!e.xAxis)?.colDesc?String(e[r.find(e=>!e.xAxis)?.colDesc||""]):""))},u=t?{...t,groupByValues:a.uniq(l.map(e=>t.colDesc?String(e[t.colDesc]):""))}:t,p={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)p.series=e.map(e=>({name:e,data:l.map(a=>a[e]),type:"bar",emphasis:{focus:"series"},label:{show:!0,position:"inside"}})),p.legend.data=e;else if(2===r.length){const a=e.map(e=>n.groupByValues?.map(a=>{const t={name:`${a||"/"}-${e}`,type:"bar",stack:e,emphasis:{focus:"series"},data:[],label:{show:!0,position:"inside"}};return t.data=(u?.groupByValues||[]).map(e=>{let r=null;return l.forEach(s=>{n.colDesc&&s[n.colDesc]===a&&u?.colDesc&&s[u.colDesc]===e&&t.stack&&(r=s[t.stack]??null)}),r||""}).filter(e=>""!==e),t})||[]).flat();p.series=a,delete p.legend}function d(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":d(p.xAxis,"category",i,t?.colDesc||""),d(p.yAxis,"value");break;case"bar-y-category":d(p.xAxis,"value"),d(p.yAxis,"category",i,t?.colDesc||""),p.grid={top:80,...p.grid}}return c(p,s.chartOptions)}),{myChart:n}=r.useCharts({chartDOM:o,chartOptions:i,chartData:e.computed(()=>s.chartData),lazyLoad:s.lazyLoad});return l({myChart:n}),(a,t)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dataChartBar",ref:o,class:"data-chart-bar"},null,512))}});exports.default=s;
|
|
2
2
|
//# sourceMappingURL=bar.vue2.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar.vue2.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 EChartsOption,\n IFormatPublicData,\n SeriesOption,\n} from '../utils/types'\nimport { uniq } from 'lodash-es'\nimport { computed, inject, ref } from 'vue'\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 lazyLoad = true,\n} = defineProps<{\n chartData: IFormatPublicData\n subShowType: string\n chartOptions: EChartsOption\n lazyLoad?: boolean\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\n // 创建新的对象而不是修改原对象\n const yGroupByDesc = {\n ...groupByDesc.find(item => !item.xAxis) || {\n groupByDesc: null,\n groupByValues: [],\n colDesc: '',\n xAxis: false,\n },\n groupByValues: uniq(data.map(item => groupByDesc.find(item => !item.xAxis)?.colDesc ? String(item[groupByDesc.find(item => !item.xAxis)?.colDesc || '']) : '')),\n }\n\n // 创建新的 xGroupByDesc 对象\n const newXGroupByDesc = xGroupByDesc\n ? {\n ...xGroupByDesc,\n groupByValues: uniq(data.map(item => xGroupByDesc.colDesc ? String(item[xGroupByDesc.colDesc]) : '')),\n }\n : xGroupByDesc\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 = (newXGroupByDesc?.groupByValues || []).map((xGroupByDescItem) => {\n let targetVal: number | string | null = null\n data.forEach((item) => {\n if (yGroupByDesc.colDesc && item[yGroupByDesc.colDesc] === yGroupByDescItem && newXGroupByDesc?.colDesc && item[newXGroupByDesc.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\nconst { myChart } = useCharts({\n chartDOM: dataChartBar,\n chartOptions: barChartOptions,\n chartData: computed(() => chartData),\n lazyLoad,\n})\n\n// 暴露 myChart 方法供父组件访问\ndefineExpose({\n myChart,\n})\n</script>\n\n<template>\n <div\n ref=\"dataChartBar\"\n class=\"data-chart-bar\"\n />\n</template>\n\n<style scoped lang=\"scss\">\n.data-chart-bar {\n width: 100%;\n height: 100%;\n}\n</style>\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","newXGroupByDesc","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","myChart","useCharts","chartDOM","lazyLoad","__expose","_createElementBlock","class"],"mappings":"icA+BA,MAAMA,EAAQC,EAAAA,OAAOC,EAAAA,oBAAsBC,GAAWA,GAAG,GACnDC,EAAeC,EAAAA,IAAwB,MAGvCC,EAAkBC,EAAAA,SAAwB,KAC9C,MAAMC,QAAEA,eAASC,EAAAC,YAAcA,EAAAC,KAAaA,EAAO,GAACC,UAAGA,GAAcC,EAAAC,UAE/DC,EAAWC,MAAMC,KAAK,IAAIC,IAAIP,EAAKQ,IAAIC,GAAQA,EAAKX,EAAaD,SAAW,OAAOa,OAAOD,GAAQA,UAAwC,GAG1IE,EAAe,IAChBZ,EAAYa,SAAcH,EAAKI,QAAU,CAC1Cd,YAAa,KACbe,cAAe,GACfjB,QAAS,GACTgB,OAAO,GAETC,cAAeC,EAAAA,KAAKf,EAAKQ,IAAIC,GAAQV,EAAYa,KAAKH,IAASA,EAAKI,QAAQhB,QAAUmB,OAAOP,EAAKV,EAAYa,KAAKH,IAASA,EAAKI,QAAQhB,SAAW,KAAO,MAIvJoB,EAAkBnB,EACpB,IACKA,EACHgB,cAAeC,EAAAA,KAAKf,EAAKQ,OAAYV,EAAaD,QAAUmB,OAAOP,EAAKX,EAAaD,UAAY,MAEnGC,EAEEoB,EAAwB,CAC5BC,MAAO,CACLC,KAAMnB,GAERY,MAAO,CACLQ,KAAM,GACNC,KAAM,WACNC,UAAW,CACTC,SAAU,EACVC,UAAUC,GAEDA,EAAMC,OADY,EACgB,GAAGD,EAAME,UAAU,EADnC,QAC+DF,GAG5F1B,KAAMI,GAERyB,MAAO,CACLP,KAAM,SAERQ,OAAQ,CACN9B,KAAM,IAER+B,SAAU,CAAC,CACTT,KAAM,SACNU,SAAU5B,EAASuB,OAAS,MAKhC,GAA2B,IAA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AcD,SAAW,IAC3EoD,EAAc/B,EAAOW,MAAO,SAC5B,MAEF,IAAK,iBACHoB,EAAc/B,EAAOL,MAAO,SAC5BoC,EAAc/B,EAAOW,MAAO,WAAYzB,EAAUN,GAAcD,SAAW,
|
|
1
|
+
{"version":3,"file":"bar.vue2.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 EChartsOption,\n IFormatPublicData,\n SeriesOption,\n} from '../utils/types'\nimport { uniq } from 'lodash-es'\nimport { computed, inject, ref } from 'vue'\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 lazyLoad = true,\n} = defineProps<{\n chartData: IFormatPublicData\n subShowType: string\n chartOptions: EChartsOption\n lazyLoad?: boolean\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\n // 创建新的对象而不是修改原对象\n const yGroupByDesc = {\n ...groupByDesc.find(item => !item.xAxis) || {\n groupByDesc: null,\n groupByValues: [],\n colDesc: '',\n xAxis: false,\n },\n groupByValues: uniq(data.map(item => groupByDesc.find(item => !item.xAxis)?.colDesc ? String(item[groupByDesc.find(item => !item.xAxis)?.colDesc || '']) : '')),\n }\n\n // 创建新的 xGroupByDesc 对象\n const newXGroupByDesc = xGroupByDesc\n ? {\n ...xGroupByDesc,\n groupByValues: uniq(data.map(item => xGroupByDesc.colDesc ? String(item[xGroupByDesc.colDesc]) : '')),\n }\n : xGroupByDesc\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 = (newXGroupByDesc?.groupByValues || []).map((xGroupByDescItem) => {\n let targetVal: number | string | null = null\n data.forEach((item) => {\n if (yGroupByDesc.colDesc && item[yGroupByDesc.colDesc] === yGroupByDescItem && newXGroupByDesc?.colDesc && item[newXGroupByDesc.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 // 增加顶部距离,为图例和轴名称预留空间\n config.grid = {\n top: 80,\n ...config.grid,\n }\n break\n }\n\n return merge(config, chartOptions)\n})\n\nconst { myChart } = useCharts({\n chartDOM: dataChartBar,\n chartOptions: barChartOptions,\n chartData: computed(() => chartData),\n lazyLoad,\n})\n\n// 暴露 myChart 方法供父组件访问\ndefineExpose({\n myChart,\n})\n</script>\n\n<template>\n <div\n ref=\"dataChartBar\"\n class=\"data-chart-bar\"\n />\n</template>\n\n<style scoped lang=\"scss\">\n.data-chart-bar {\n width: 100%;\n height: 100%;\n}\n</style>\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","newXGroupByDesc","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","grid","top","chartOptions","myChart","useCharts","ch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SAAW,IAE3EqB,EAAOmC,KAAO,CACZC,IAAK,MACFpC,EAAOmC,MAKhB,OAAOhE,EAAM6B,EAAQhB,EAAAqD,iBAGjBC,QAAEA,GAAYC,YAAU,CAC5BC,SAAUjE,EACV8D,aAAc5D,EACdQ,UAAWP,EAAAA,SAAS,IAAMM,EAAAC,WAC1BwD,SAAOzD,EAAAyD,kBAITC,EAAa,CACXJ,kCAKAK,EAAAA,mBAGE,MAAA,SAFI,eAAJnE,IAAID,EACJqE,MAAM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("lodash-es"),r=require("../utils/injectionKeys.cjs"),a=require("../utils/useCharts.cjs"),o=e.defineComponent({name:"DataChartPie",__name:"pie",props:{chartData:{type:Object,required:!0},subShowType:{type:String,required:!0,default:"pie-simple"},chartOptions:{type:null,required:!0},lazyLoad:{type:Boolean,required:!1,default:!0}},setup(o,{expose:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("lodash-es"),r=require("../utils/injectionKeys.cjs"),a=require("../utils/useCharts.cjs"),o=e.defineComponent({name:"DataChartPie",__name:"pie",props:{chartData:{type:Object,required:!0},subShowType:{type:String,required:!0,default:"pie-simple"},chartOptions:{type:null,required:!0},lazyLoad:{type:Boolean,required:!1,default:!0}},setup(o,{expose:c}){const i=e.inject(r.InjectionChartMerge,e=>e,!0),l=e.ref(null),s=e.computed(()=>{const{colDesc:e,xGroupByDesc:r,data:a,modelName:c}=o.chartData,l=e.length,s={title:{text:c},series:e.map((e,c)=>{const i={name:e,type:"pie",center:["50%","50%"],data:[],emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}},label:{formatter:"{b}:{c}({d}%)",rich:{b:{color:"#4C5058",fontSize:14,fontWeight:"bold",lineHeight:33}}}};let s=5;const n=a.filter(t=>void 0!==t[e]),u=t.orderBy(n,[e],["desc"]),d=u.reduce((t,r)=>{const a=Number(r[e])||0;return Number.isNaN(a)?t:t+a},0);if(n.length>s)for(;s<9;){const t=u.slice(0,s);if(t.reduce((t,r)=>t+Number(r[e]),0)/d>.9||8===s){const a=u.slice(s);i.data=t.map(t=>({name:r?.colDesc?String(t[r.colDesc]||""):"",value:Number(t[e])||0}));const o=a.reduce((t,r)=>t+Number(r[e]),0);o>0&&i.data&&i.data.push({name:"其它",value:o});break}s++}else i.data=n.map(t=>({name:r?.colDesc&&t[r.colDesc]||"",value:Number(t[e]||0)}));if(1===l?i.center=["50%","60%"]:2===l?0===c?(i.right="40%",i.left="",i.center=["40%","60%"]):(i.right="",i.left="40%",i.center=["60%","60%"]):3===l?0===c?(i.right="40%",i.bottom="50%",i.top="",i.left="",i.center=["40%","78%"]):1===c?(i.right="",i.bottom="50%",i.top="",i.left="40%",i.center=["60%","78%"]):(i.right="40%",i.bottom="",i.top="50%",i.left="",i.center=["40%","60%"]):4===l&&(0===c?(i.right="40%",i.bottom="50%",i.top="",i.left="",i.center=["40%","78%"]):1===c?(i.right="",i.bottom="50%",i.top="",i.left="40%",i.center=["60%","78%"]):2===c?(i.right="40%",i.bottom="",i.top="50%",i.left="",i.center=["40%","60%"]):(i.right="",i.bottom="",i.top="50%",i.left="40%",i.center=["60%","60%"])),"pie-borderRadius"===o.subShowType)i.radius=["50%","70%"];else i.radius="50%";return i})};return console.log(s),i(s,o.chartOptions)}),{myChart:n}=a.useCharts({chartDOM:l,chartOptions:s,chartData:e.computed(()=>o.chartData),lazyLoad:o.lazyLoad});return c({myChart:n}),(t,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dataChartPie",ref:l,class:"data-chart-pie"},null,512))}});exports.default=o;
|
|
2
2
|
//# sourceMappingURL=pie.vue2.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pie.vue2.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 { computed, inject, ref } from 'vue'\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 lazyLoad = true,\n} = defineProps<{\n chartData: IFormatPublicData\n subShowType: string\n chartOptions: EChartsOption\n lazyLoad?: boolean\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\nconst { myChart } = useCharts({\n chartDOM: dataChartPie,\n chartOptions: pieChartOptions,\n chartData: computed(() => chartData),\n lazyLoad,\n})\n\n// 暴露 myChart 方法供父组件访问\ndefineExpose({\n myChart,\n})\n</script>\n\n<template>\n <div\n ref=\"dataChartPie\"\n class=\"data-chart-pie\"\n />\n</template>\n\n<style scoped lang=\"scss\">\n.data-chart-pie {\n width: 100%;\n height: 100%;\n}\n</style>\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","myChart","useCharts","chartDOM","lazyLoad","__expose","_createElementBlock","class"],"mappings":"icAsBA,MAAMA,EAAQC,EAAAA,OAAOC,EAAAA,oBAAsBC,GAAWA,GAAG,GAEnDC,EAAeC,EAAAA,IAAI,MACnBC,EAAkBC,EAAAA,SAAwB,KAC9C,MAAMC,QAAEA,EAAAC,aAASA,EAAAC,KAAcA,EAAAC,UAAMA,GAAcC,EAAAC,UAC7CC,EAAgBN,EAA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AS,GACpB5C,EAAW6C,IAAM,MACjB7C,EAAW2C,KAAO,GAClB3C,EAAWG,OAAS,CAAC,MAAO,SAG5BH,EAAW0C,MAAQ,GACnB1C,EAAW4C,OAAS,GACpB5C,EAAW6C,IAAM,MACjB7C,EAAW2C,KAAO,MAClB3C,EAAWG,OAAS,CAAC,MAAO,SAKzB,qBADCd,EAAAyD,YAEJ9C,EAAW+C,OAAS,CAAC,MAAO,YAM5B/C,EAAW+C,OAAS,MAGxB,OAAO/C,KAIX,OAAOvB,EAAMgB,EAAQJ,EAAA2D,iBAGjBC,QAAEA,GAAYC,YAAU,CAC5BC,SAAUtE,EACVmE,aAAcjE,EACdO,UAAWN,EAAAA,SAAS,IAAMK,EAAAC,WAC1B8D,SAAO/D,EAAA+D,kBAITC,EAAa,CACXJ,kCAKAK,EAAAA,mBAGE,MAAA,SAFI,eAAJxE,IAAID,EACJ0E,MAAM"}
|
|
1
|
+
{"version":3,"file":"pie.vue2.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 { computed, inject, ref } from 'vue'\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 lazyLoad = true,\n} = defineProps<{\n chartData: IFormatPublicData\n subShowType: string\n chartOptions: EChartsOption\n lazyLoad?: boolean\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项总占比\n const headerScale = headerTotal / totalDesc\n if (headerScale > 0.9 || cutNum === 8) {\n const footerData = orderByData.slice(cutNum)\n\n // 处理前N项数据\n seriesItem.data = headerData.map(headerItem => ({\n name: xGroupByDesc?.colDesc\n ? String(headerItem[xGroupByDesc.colDesc] || '')\n : '',\n value: Number(headerItem[item]) || 0,\n }))\n\n // 添加\"其它\"项,包含剩余所有数据\n const footerTotal = footerData.reduce(\n (prev, cur) => prev + Number(cur[item]),\n 0,\n )\n\n if (footerTotal > 0 && seriesItem.data) {\n seriesItem.data.push({\n name: '其它',\n value: footerTotal,\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 console.log(config)\n\n return merge(config, chartOptions)\n})\n\nconst { myChart } = useCharts({\n chartDOM: dataChartPie,\n chartOptions: pieChartOptions,\n chartData: computed(() => chartData),\n lazyLoad,\n})\n\n// 暴露 myChart 方法供父组件访问\ndefineExpose({\n myChart,\n})\n</script>\n\n<template>\n <div\n ref=\"dataChartPie\"\n class=\"data-chart-pie\"\n />\n</template>\n\n<style scoped lang=\"scss\">\n.data-chart-pie {\n width: 100%;\n height: 100%;\n}\n</style>\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","headerItem","String","footerTotal","push","yItem","right","left","bottom","top","subShowType","radius","console","log","chartOptions","myChart","useCharts","chartDOM","lazyLoad","__expose","_createElementBlock","class"],"mappings":"icAsBA,MAAMA,EAAQC,EAAAA,OAAOC,EAAAA,oBAAsBC,GAAWA,GAAG,GAEnDC,EAAeC,EAAAA,IAAI,MACnBC,EAAkBC,EAAAA,SAAwB,KAC9C,MAAMC,QAAEA,EAAAC,aAASA,EAAAC,KAAcA,EAAAC,UAAMA,GAAcC,EAAAC,UAC7CC,EAAgBN,EAAQO,OACxBC,EAAS,CACbC,MAAO,CAAEC,KAAMP,GACfQ,OAAQX,EAAQY,IAAI,CAACC,EAAMC,KACzB,MAAMC,EAA8B,CAClCC,KAAMH,EACNI,KAAM,MACNC,OAAQ,CAAC,MAAO,OAChBhB,KAAM,GACNiB,SAAU,CACRC,UAAW,CACTC,WAAY,GACZC,cAAe,EACfC,YAAa,uBAGjBC,MAAO,CACLC,UAAW,gBACXC,KAAM,CACJC,EAAG,CACDC,MAAO,UACPC,SAAU,GACVC,WAAY,OACZC,WAAY,OAMpB,IAAIC,EAAS,EACb,MAAMC,EAAkB/B,EAAKgC,eAA4B,IAAdC,EAAItB,IACzCuB,EAAcC,EAAAA,QAAQJ,EAAiB,CAACpB,GAAO,CAAC,SAEhDyB,EAAYF,EAAYG,OAAO,CAACC,EAAMC,KAC1C,MAAMC,EAAQC,OAAOF,EAAI5B,KAAU,EACnC,OAAO8B,OAAOC,MAAMF,GAASF,EAAOA,EAAOE,GAC1C,GAC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
|
+
"version": "0.0.89",
|
|
5
5
|
"description": "Vue 3 Component Library",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://qxs-bns.pages.dev/guide/components/overview.html",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@qxs-bns/directives": "0.0.19",
|
|
47
47
|
"@qxs-bns/hooks": "0.0.7",
|
|
48
48
|
"@qxs-bns/icons": "0.0.10",
|
|
49
|
-
"@qxs-bns/utils": "0.0.
|
|
49
|
+
"@qxs-bns/utils": "0.0.34",
|
|
50
50
|
"@vueuse/core": "^11.3.0",
|
|
51
51
|
"echarts": "^5.5.1",
|
|
52
52
|
"lodash-es": "^4.17.21",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar.vue.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/data-chart/src/components/bar.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bar.vue.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/data-chart/src/components/bar.vue"],"names":[],"mappings":"AAgOA,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EAElB,MAAM,gBAAgB,CAAA;AAYvB,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,iBAAiB,CAAA;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,aAAa,CAAA;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC;;;;AAiOF,wBAGG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pie.vue.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/data-chart/src/components/pie.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pie.vue.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/data-chart/src/components/pie.vue"],"names":[],"mappings":"AAqOA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAStE,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,iBAAiB,CAAA;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,aAAa,CAAA;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC;;;;AA6OF,wBAGG"}
|