lcny-vue3-antd-admin/dist/assets/DZWZ.93d6b6d6.js

2 lines
3.6 KiB
JavaScript

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