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

2 lines
2.6 KiB
JavaScript

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