lcny-vue3-antd-admin/dist/assets/DXLX.707e79c3.js

2 lines
2.8 KiB
JavaScript

var v=(h,f,n)=>new Promise((p,d)=>{var i=s=>{try{o(n.next(s))}catch(m){d(m)}},l=s=>{try{o(n.throw(s))}catch(m){d(m)}},o=s=>s.done?p(s.value):Promise.resolve(s.value).then(i,l);o((n=n.apply(h,f)).next())});import w from"./Box.c1666315.js";import{u as B}from"./useECharts.a3cff6fb.js";import{k as C}from"./other.f85781d0.js";import{u as L}from"./visualization.2b3ccd72.js";import{c as I}from"./colors.69d1b0cd.js";import{u as E}from"./useVContext.5265d20c.js";import{a as F,s as T,r as k,bp as $,af as j,H as D,J as X,aA as N,o as P,j as R,x as V,i as b}from"./index.83b5c11b.js";const z=F({components:{Box:w},setup(){const{rootEmitter:h}=E(),f=T({x_axis:[],series:[]}),n=k(null),p=L(),{setOptions:d,getInstance:i}=B(n);function l(e=!0){return v(this,null,function*(){const a=yield C({year:p.getYear});f.x_axis=a.x_axis,f.series=a.series,e?m():A()})}let o=[];function s(){const e={legendData:[],series:[]};return f.series.forEach(({name:a,data:r},u)=>{const c=I[u%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 m=()=>{const e=s();d({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}),p.getPlay&&g()};let t=null;function g(){let e=0;const a=3e3;t&&clearInterval(t);let r=0,u=0;const c=2;t=setInterval(()=>{var x;r=e%4,u=e%(4*c),(x=i())==null||x.dispatchAction({type:"showTip",seriesIndex:0,dataIndex:r}),u+1>=4*c&&(t&&clearInterval(t),setTimeout(()=>{var _;(_=i())==null||_.dispatchAction({type:"hideTip"})},a),l(!1)),e++},a)}function A(){const e=s();let a=0,r=0;const u=3e3;t&&clearInterval(t),t=setInterval(()=>{var c,x;r=a%o.length,r==0&&o.forEach((_,S)=>{var y;(y=i())==null||y.dispatchAction({type:"legendUnSelect",name:o[S]})}),(c=i())==null||c.setOption({series:[e.series[r]]}),(x=i())==null||x.dispatchAction({type:"legendSelect",name:o[r]}),r==o.length-1&&(t&&clearInterval(t),setTimeout(()=>{g()},u)),a++},u)}return $(()=>{l(),h.on("interval:auto",()=>{})}),j(()=>{t&&clearInterval(t)}),D(()=>p.getYear,()=>l()),D(()=>p.getPlay,()=>{t&&clearInterval(t),l()}),{chartRef:n}}}),O={class:"h-full flex flex-col"},U={class:"flex-1",ref:"chartRef"};function Y(h,f,n,p,d,i){const l=N("Box");return P(),R(l,{title:"\u7A3B\u867E\u6D41\u5411\uFF08\u5428\uFF09"},{default:V(()=>[b("div",O,[b("div",U,null,512)])]),_:1})}var Z=X(z,[["render",Y],["__scopeId","data-v-0c9a9398"]]);export{Z as default};