lcny-vue3-antd-admin/dist/assets/DXJG.40c6a04d.js

2 lines
2.7 KiB
JavaScript

var D=(x,h,t)=>new Promise((n,i)=>{var m=a=>{try{u(t.next(a))}catch(s){i(s)}},f=a=>{try{u(t.throw(a))}catch(s){i(s)}},u=a=>a.done?n(a.value):Promise.resolve(a.value).then(m,f);u((t=t.apply(x,h)).next())});import F from"./Box.919d3885.js";import{u as w}from"./useECharts.4f91628a.js";import{e as L}from"./other.3bf6469d.js";import{c as E}from"./colors.69d1b0cd.js";import{u as k}from"./useVContext.b1f2ed7c.js";import{a as $,s as A,r as I,bp as G,J,aA as R,o as j,j as M,x as N,i as S}from"./index.db2a1f5e.js";const O=$({components:{Box:F},setup(){const{rootEmitter:x}=k(),h=A([{key:"0",value:"\u5168\u90E8"},{key:"1",value:"\u9C7C"},{key:"2",value:"\u867E"}]),t=A({x_axis:[],series:[]}),n=I("0"),i=I(null),m=e=>{n.value!=e&&(n.value=e,g())},f=(e,o)=>o>e?o:e;function u(e){return e.map(({data:o})=>o.reduce(f))}const{setOptions:a,getInstance:s}=w(i);let l=[];const g=()=>{var o;const e={legendData:[],series:[]};t.series.forEach(({name:r,data:c},p)=>{const d=E[p%E.length];e.legendData.push(r+""),e.series.push({name:r,data:c,type:"line",smooth:!1,itemStyle:{color:d.itemColor},areaStyle:{color:d.areaColor}})}),(o=Math.max(...u(t.series)))!=null,l=e.legendData,a({grid:{left:"4%",right:"4%",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:t.x_axis,boundaryGap:!1,axisTick:{show:!1},axisLine:{show:!1},axisLabel:{color:"#fff"}},yAxis:[{type:"value",axisTick:{show:!1},nameTextStyle:{color:"#fff"},splitLine:{lineStyle:{type:"solid",color:"#8EEEFF",opacity:.3}},axisLabel:{color:"#fff",formatter:r=>r}}],series:e.series,animationDuration:2e3}),T()};let _=null;function T(){let e=1;const o=3e3;_&&clearInterval(_);let r=1,c="showTip",p=l.length;_=setInterval(()=>{var v,b;if(l.length==0)return;const d=(e-1)%4;r=e%(4*2),(v=s())==null||v.dispatchAction({type:c,seriesIndex:0,dataIndex:d}),c=="hideTip"&&d==0&&l.forEach((U,B)=>{var C;(C=s())==null||C.dispatchAction({type:"legendUnSelect",name:l[B]})}),c=="hideTip"&&((b=s())==null||b.dispatchAction({type:"legendSelect",name:l[p-1]}),p==0&&y(),p--),r==0&&(c="hideTip"),e++},o)}function y(){return D(this,null,function*(){const e=yield L();t.x_axis=e.x_axis,t.series=e.series,g()})}return G(()=>{y(),x.on("interval:auto",()=>{})}),{tabList:h,currentTab:n,chartRef:i,changeTab:m}}}),P={class:"h-full flex flex-col"},V={class:"flex-1",ref:"chartRef"};function X(x,h,t,n,i,m){const f=R("Box");return j(),M(f,{title:"\u7A3B\u867E\u4EF7\u683C\uFF08\u5143/\u65A4\uFF09"},{default:N(()=>[S("div",P,[S("div",V,null,512)])]),_:1})}var Z=J(O,[["render",X],["__scopeId","data-v-3b2470a2"]]);export{Z as default};