lcny-vue3-antd-admin/dist/assets/DXLX.8057fcba.js

2 lines
2.9 KiB
JavaScript

var v=(d,f,i)=>new Promise((u,m)=>{var r=s=>{try{o(i.next(s))}catch(x){m(x)}},l=s=>{try{o(i.throw(s))}catch(x){m(x)}},o=s=>s.done?u(s.value):Promise.resolve(s.value).then(r,l);o((i=i.apply(d,f)).next())});import B from"./Box.2d654bbb.js";import{u as S}from"./useECharts.51a88359.js";import{n as A}from"./other.8de15476.js";import{u as C}from"./visualization.f14b8121.js";import{c as I}from"./colors.69d1b0cd.js";import{u as E}from"./useVContext.761d3448.js";import{a as k,w as F,v as T,x as X,K as j,aj as $,L as D,q as M,aE as N,o as P,j as R,B as V,i as L}from"./index.5b1de205.js";const z=k({components:{Box:B},setup(){const{rootEmitter:d}=E(),f=F({x_axis:[],series:[]}),i=T(null),u=C(),{setOptions:m,getInstance:r}=S(i);function l(e=!0){return v(this,null,function*(){const a=yield A({year:u.getYear});f.x_axis=a.x_axis,f.series=a.series,e?x():b()})}let o=[];function s(){const e={legendData:[],series:[]};return f.series.forEach(({name:a,data:n},p)=>{const c=I[p%I.length];e.legendData.push(a+""),e.series.push({name:a,data:n,type:"line",smooth:!1,stack:"Total",itemStyle:{color:c.itemColor},areaStyle:{color:c.areaColor}})}),o=e.legendData,e}const x=()=>{const e=s();m({grid:{left:"2%",right:"20px",top:"10%",bottom:"2%",containLabel:!0},legend:{data:e.legendData,top:"0%",right:"0",textStyle:{color:"#ffffff"}},tooltip:{trigger:"axis",axisPointer:{lineStyle:{width:1,color:"#019680"}}},xAxis:{type:"category",data:f.x_axis,boundaryGap:!1,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,animationDuration:2e3}),u.getPlay&&g()};let t=null;function g(){let e=0;const a=3e3;t&&clearInterval(t);let n=0,p=0;const c=2;t=setInterval(()=>{var h;n=e%4,p=e%(4*c),(h=r())==null||h.dispatchAction({type:"showTip",seriesIndex:0,dataIndex:n}),p+1>=4*c&&(t&&clearInterval(t),setTimeout(()=>{var _;(_=r())==null||_.dispatchAction({type:"hideTip"})},a),l(!1)),e++},a)}function b(){const e=s();let a=0,n=0;const p=3e3;t&&clearInterval(t),t=setInterval(()=>{var c,h;n=a%o.length,n==0&&o.forEach((_,w)=>{var y;(y=r())==null||y.dispatchAction({type:"legendUnSelect",name:o[w]})}),(c=r())==null||c.setOption({series:[e.series[n]]}),(h=r())==null||h.dispatchAction({type:"legendSelect",name:o[n]}),n==o.length-1&&(t&&clearInterval(t),setTimeout(()=>{g()},p)),a++},p)}return X(()=>{l(),d.on("interval:auto",()=>{})}),j(()=>{var e,a;(a=(e=r())==null?void 0:e.getZr())==null||a.on("click",()=>{d.emit("leftModel:click","DXLX")})}),$(()=>{t&&clearInterval(t)}),D(()=>u.getYear,()=>l()),D(()=>u.getPlay,()=>{t&&clearInterval(t),l()}),{chartRef:i}}}),O={class:"h-full flex flex-col"},U={class:"flex-1",ref:"chartRef"};function Y(d,f,i,u,m,r){const l=N("Box");return P(),R(l,{title:"\u7A3B\u867E\u6D41\u5411\uFF08\u5428\uFF09"},{default:V(()=>[L("div",O,[L("div",U,null,512)])]),_:1})}var ee=M(z,[["render",Y],["__scopeId","data-v-944ed840"]]);export{ee as default};