lcny-vue3-antd-admin/dist/assets/DZWZ.998788d5.js

2 lines
2.5 KiB
JavaScript

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