lcny-vue3-antd-admin/dist/assets/DZWZ.5ae8c549.js

2 lines
2.7 KiB
JavaScript

var k=(r,i,s)=>new Promise((f,n)=>{var p=a=>{try{t(s.next(a))}catch(e){n(e)}},c=a=>{try{t(s.throw(a))}catch(e){n(e)}},t=a=>a.done?f(a.value):Promise.resolve(a.value).then(p,c);t((s=s.apply(r,i)).next())});import L from"./Box.a393e3ff.js";import{u as S}from"./useECharts.9a99a074.js";import{i as T}from"./other.130807fc.js";import{u as E}from"./visualization.9b37c87d.js";import{a as w}from"./colors.35198826.js";import{a as $,w as B,v as C,bq as z,L as F,aG as N,o as d,j as Z,z as j,i as x,h as D,F as A,aJ as q,q as G,t as I}from"./index.78bf44cb.js";const M=$({components:{Box:L},setup(){const r=B([{key:"1",value:"\u9972\u6599"},{key:"2",value:"\u80A5\u6599"}]),i=B({x_axis:[],series:[]}),s=C("1"),f=E(),n=C(null),p=e=>{s.value!=e&&(s.value=e,t())},{setOptions:c}=S(n);function t(){return k(this,null,function*(){const e=yield T({year:f.getYear,type:s.value});i.x_axis=e.x_axis,i.series=e.series,a()})}const a=()=>{const e={legendData:[],series:[]};i.series.forEach(({name:l,data:_,diffs:h},o)=>{const u=w[o%w.length];e.legendData.push(l),e.series.push({name:"Placeholder",type:"bar",barGap:0,stack:"Total"+o,itemStyle:{borderColor:"transparent",color:"transparent"},data:_}),e.series.push({name:l,type:"bar",stack:"Total"+o,itemStyle:{color:u.itemColor1},label:{show:!1,position:"inside",color:"#fff"},data:h})}),c({grid:{left:"2%",right:"2%",top:"50px",bottom:"2%",containLabel:!0},legend:{show:!0,data:e.legendData,textStyle:{color:"#ffffff"}},tooltip:{trigger:"axis",axisPointer:{lineStyle:{width:1,color:"#019680"}},formatter:function(l){var h;let _=((h=l[0])==null?void 0:h.name)+"<br/>";return l.forEach((o,u)=>{var m,y,v,b,g;u%2&&(_+=o.seriesName+" : "+((y=(m=l[u-1])==null?void 0:m.value)!=null?y:0)+"-"+(Number((v=o==null?void 0:o.value)!=null?v:0)+Number((g=(b=l[u-1])==null?void 0:b.value)!=null?g:0))+"<br>")}),_}},xAxis:{type:"category",data:i.x_axis,axisTick:{show:!1},axisLine:{show:!1},axisLabel:{color:"#fff"}},yAxis:[{type:"value",axisTick:{show:!1},splitLine:{lineStyle:{type:"solid",color:"#8EEEFF",opacity:.3}},axisLabel:{color:"#fff"}}],series:e.series})};return z(()=>{t()}),{tabList:r,currentTab:s,chartRef:n,changeTab:p}}}),P={class:"h-full flex flex-col"},R={class:"py-10px"},V={class:"flex items-center justify-center m-0"},W=["onClick"],J={class:"flex-1",ref:"chartRef"};function O(r,i,s,f,n,p){const c=N("Box");return d(),Z(c,{title:"\u5927\u5B97\u7269\u8D44"},{default:j(()=>[x("div",P,[x("div",R,[x("ul",V,[(d(!0),D(A,null,q(r.tabList,t=>(d(),D("li",{class:G(["mx-11px text-white text-12px cursor-pointer",{active:r.currentTab==t.key}]),onClick:a=>r.changeTab(t.key),key:t.key},I(t.value),11,W))),128))])]),x("div",J,null,512)])]),_:1})}var te=F(M,[["render",O],["__scopeId","data-v-1df14952"]]);export{te as default};