lcny-vue3-antd-admin/dist/assets/DXLX.dcc5e7ce.js

2 lines
2.9 KiB
JavaScript

var v=(d,f,i)=>new Promise((u,m)=>{var n=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(n,l);o((i=i.apply(d,f)).next())});import S from"./Box.9d7bfa42.js";import{u as w}from"./useECharts.6bc1a3f6.js";import{m as A}from"./other.a9ed122c.js";import{u as B}from"./visualization.429da61c.js";import{c as I}from"./colors.69d1b0cd.js";import{u as E}from"./useVContext.6b437877.js";import{a as k,s as F,r as T,br as X,G as $,ah as j,H as D,J as M,aC as N,o as P,j as R,x as V,i as b}from"./index.caefd1ac.js";const z=k({components:{Box:S},setup(){const{rootEmitter:d}=E(),f=F({x_axis:[],series:[]}),i=T(null),u=B(),{setOptions:m,getInstance:n}=w(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():C()})}let o=[];function s(){const e={legendData:[],series:[]};return f.series.forEach(({name:a,data:r},p)=>{const c=I[p%I.length];e.legendData.push(a+""),e.series.push({name:a,data:r,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 r=0,p=0;const c=2;t=setInterval(()=>{var h;r=e%4,p=e%(4*c),(h=n())==null||h.dispatchAction({type:"showTip",seriesIndex:0,dataIndex:r}),p+1>=4*c&&(t&&clearInterval(t),setTimeout(()=>{var _;(_=n())==null||_.dispatchAction({type:"hideTip"})},a),l(!1)),e++},a)}function C(){const e=s();let a=0,r=0;const p=3e3;t&&clearInterval(t),t=setInterval(()=>{var c,h;r=a%o.length,r==0&&o.forEach((_,L)=>{var y;(y=n())==null||y.dispatchAction({type:"legendUnSelect",name:o[L]})}),(c=n())==null||c.setOption({series:[e.series[r]]}),(h=n())==null||h.dispatchAction({type:"legendSelect",name:o[r]}),r==o.length-1&&(t&&clearInterval(t),setTimeout(()=>{g()},p)),a++},p)}return X(()=>{l(),d.on("interval:auto",()=>{})}),$(()=>{var e,a;(a=(e=n())==null?void 0:e.getZr())==null||a.on("click",()=>{d.emit("leftModel:click","DXLX")})}),j(()=>{t&&clearInterval(t)}),D(()=>u.getYear,()=>l()),D(()=>u.getPlay,()=>{t&&clearInterval(t),l()}),{chartRef:i}}}),G={class:"h-full flex flex-col"},O={class:"flex-1",ref:"chartRef"};function U(d,f,i,u,m,n){const l=N("Box");return P(),R(l,{title:"\u7A3B\u867E\u6D41\u5411\uFF08\u5428\uFF09"},{default:V(()=>[b("div",G,[b("div",O,null,512)])]),_:1})}var ee=M(z,[["render",U],["__scopeId","data-v-944ed840"]]);export{ee as default};