2 lines
2.4 KiB
JavaScript
2 lines
2.4 KiB
JavaScript
var d=(o,r,s)=>new Promise((c,n)=>{var u=a=>{try{t(s.next(a))}catch(e){n(e)}},l=a=>{try{t(s.throw(a))}catch(e){n(e)}},t=a=>a.done?c(a.value):Promise.resolve(a.value).then(u,l);t((s=s.apply(o,r)).next())});import k from"./Box.148249ef.js";import{u as B}from"./useECharts.ce337e2d.js";import{i as C}from"./other.e182adb3.js";import{u as w}from"./visualization.56ba3c43.js";import{a as m}from"./colors.d19e85ff.js";import{L,a as T,w as y,v,bq as D,aG as S,o as h,j as E,z as F,i as _,h as b,F as $,aJ as z,q as j,t as A}from"./index.10d06543.js";const q=T({components:{Box:k},setup(){const o=y([{key:"1",value:"\u9972\u6599"},{key:"2",value:"\u80A5\u6599"}]),r=y({x_axis:[],series:[]}),s=v("1"),c=w(),n=v(null),u=e=>{s.value!=e&&(s.value=e,t())},{setOptions:l}=B(n);function t(){return d(this,null,function*(){const e=yield C({year:c.getYear,type:s.value});r.x_axis=e.x_axis,r.series=e.series,a()})}const a=()=>{const e={legendData:[],series:[]};r.series.forEach(({name:f,data:i,diffs:p},x)=>{const g=m[x%m.length];e.legendData.push(f),e.series.push({name:"Placeholder",type:"bar",stack:"Total"+x,itemStyle:{borderColor:"transparent",color:"transparent"},data:i}),e.series.push({name:f,type:"bar",stack:"Total"+x,itemStyle:{color:g.itemColor1},label:{show:!0,position:"inside",color:"#fff"},data:p})}),l({grid:{left:"2%",right:"2%",top:"3%",bottom:"2%",containLabel:!0},tooltip:{trigger:"axis",axisPointer:{lineStyle:{width:1,color:"#019680"}},formatter:function(f){var p;var i=f[1];return i.name+"<br/>"+i.seriesName+" : "+((p=i==null?void 0:i.value)!=null?p:0)}},xAxis:{type:"category",data:r.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 D(()=>{t()}),{tabList:o,currentTab:s,chartRef:n,changeTab:u}}}),I={class:"h-full flex flex-col"},M={class:"py-10px"},N={class:"flex items-center justify-center m-0"},P=["onClick"],R={class:"flex-1",ref:"chartRef"};function V(o,r,s,c,n,u){const l=S("Box");return h(),E(l,{title:"\u5927\u5B97\u7269\u8D28"},{default:F(()=>[_("div",I,[_("div",M,[_("ul",N,[(h(!0),b($,null,z(o.tabList,t=>(h(),b("li",{class:j(["mx-11px text-white text-12px cursor-pointer",{active:o.currentTab==t.key}]),onClick:a=>o.changeTab(t.key),key:t.key},A(t.value),11,P))),128))])]),_("div",R,null,512)])]),_:1})}var U=L(q,[["render",V],["__scopeId","data-v-1b3f5eff"]]);export{U as default};
|