lcny-vue3-antd-admin/dist/assets/DZWZ.c80b8ef0.js

2 lines
3.2 KiB
JavaScript

var w=(n,d,t)=>new Promise((i,f)=>{var u=s=>{try{a(t.next(s))}catch(r){f(r)}},p=s=>{try{a(t.throw(s))}catch(r){f(r)}},a=s=>s.done?i(s.value):Promise.resolve(s.value).then(u,p);a((t=t.apply(n,d)).next())});import E from"./Box.148249ef.js";import{u as F}from"./useECharts.ce337e2d.js";import{i as A}from"./other.e182adb3.js";import{u as z}from"./visualization.56ba3c43.js";import{a as D}from"./colors.d19e85ff.js";import{u as N}from"./useVContext.8eed226c.js";import{a as Z,w as C,v as T,K as j,bq as P,L as V,aG as q,o as v,j as G,z as M,i as _,h as B,F as R,aJ as W,q as Y,t as J}from"./index.10d06543.js";const K=Z({components:{Box:E},setup(){const{rootEmitter:n}=N(),d=C([{key:"1",value:"\u9972\u6599"},{key:"2",value:"\u80A5\u6599"}]),t=C({x_axis:[],series:[]}),i=T("1"),f=z(),u=T(null),p=e=>{i.value!=e&&(i.value=e,r())},{setOptions:a,getInstance:s}=F(u);function r(){return w(this,null,function*(){const e=yield A({year:f.getYear,type:i.value});t.x_axis=e.x_axis,t.series=e.series,I()})}let b=[];const I=()=>{const e={legendData:[],series:[]};t.series.forEach(({name:l,data:c,diffs:x},o)=>{const m=D[o%D.length];e.legendData.push(l),e.series.push({name:"Placeholder",type:"bar",barGap:0,stack:"Total"+o,itemStyle:{borderColor:"transparent",color:"transparent"},data:c}),e.series.push({name:l,type:"bar",stack:"Total"+o,itemStyle:{color:m.itemColor1},label:{show:!1,position:"inside",color:"#fff"},data:x})}),b=e.legendData,a({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 x;let c=((x=l[0])==null?void 0:x.name)+"<br/>";return l.forEach(o=>{var m,k;if(o.seriesName!="Placeholder"){const g=t.series.find(h=>h.name==o.seriesName);if(g){const h=(m=g.data[o.dataIndex])!=null?m:0,L=(k=g.diffs[o.dataIndex])!=null?k:0,S=h+L;c+=`${o.marker}<span style="width:50px;display: inline-block;">${o.seriesName}</span> ${h}-${S}<br>`}}}),c}},xAxis:{type:"category",data:t.x_axis,axisTick:{show:!1},axisLine:{show:!1},axisLabel:{color:"#fff"}},yAxis:[{position:"left",alignTicks:!0,nameTextStyle:{color:"#fff"},type:"value",axisTick:{show:!1},splitLine:{lineStyle:{type:"solid",color:"#8EEEFF",opacity:.3}},axisLabel:{color:"#fff"}}],series:e.series}),$()};let y=null;function $(){let e=0;y&&clearInterval(y),y=setInterval(()=>{var c;const l=e%b.length;(c=s())==null||c.dispatchAction({type:"showTip",seriesIndex:0,dataIndex:l}),e++},3e3)}return j(()=>f.getYear,()=>{r()}),P(()=>{r(),n.on("interval:auto",()=>{r()})}),{tabList:d,currentTab:i,chartRef:u,changeTab:p}}}),O={class:"h-full flex flex-col"},H={class:"py-10px"},Q={class:"flex items-center justify-center m-0"},U=["onClick"],X={class:"flex-1",ref:"chartRef"};function ee(n,d,t,i,f,u){const p=q("Box");return v(),G(p,{title:"\u5927\u5B97\u7269\u8D44\uFF08\u5143/\u5428\uFF09"},{default:M(()=>[_("div",O,[_("div",H,[_("ul",Q,[(v(!0),B(R,null,W(n.tabList,a=>(v(),B("li",{class:Y(["mx-11px text-white text-12px cursor-pointer",{active:n.currentTab==a.key}]),onClick:s=>n.changeTab(a.key),key:a.key},J(a.value),11,U))),128))])]),_("div",X,null,512)])]),_:1})}var ce=V(K,[["render",ee],["__scopeId","data-v-9a93be86"]]);export{ce as default};