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

2 lines
2.8 KiB
JavaScript

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