var h=(f,u,t)=>new Promise((r,n)=>{var p=o=>{try{l(t.next(o))}catch(c){n(c)}},i=o=>{try{l(t.throw(o))}catch(c){n(c)}},l=o=>o.done?r(o.value):Promise.resolve(o.value).then(p,i);l((t=t.apply(f,u)).next())});import B from"./Box.a0684c06.js";import{u as F}from"./useECharts.7e254417.js";import{e as I}from"./other.a0e0a1bb.js";import{c as y}from"./colors.d19e85ff.js";import{u as w}from"./useVContext.b155cbd7.js";import{d as A,q as v,r as g,aA as L,_ as S,P as k,o as T,i as $,s as G,h as C}from"./index.600742c0.js";import"ant-design-vue";const P=A({components:{Box:B},setup(){const{rootEmitter:f}=w(),u=v([{key:"0",value:"\u5168\u90E8"},{key:"1",value:"\u9C7C"},{key:"2",value:"\u867E"}]),t=v({x_axis:[],series:[]}),r=g("0"),n=g(null),p=e=>{r.value!=e&&(r.value=e,d())},i=(e,a)=>a>e?a:e;function l(e){return e.map(({data:a})=>a.reduce(i))}const{setOptions:o,getInstance:c}=F(n),d=()=>{var a;const e={legendData:[],series:[]};t.series.forEach(({name:s,data:b},D)=>{const m=y[D%y.length];e.legendData.push(s+""),e.series.push({name:s,data:b,type:"line",smooth:!1,itemStyle:{color:m.itemColor},areaStyle:{color:m.areaColor}})}),(a=Math.max(...l(t.series)))!=null,o({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:s=>s}}],series:e.series,animationDuration:2e3}),E()};let x=null;function E(){let e=0;x&&clearInterval(x),x=setInterval(()=>{var s;const a=e%4;(s=c())==null||s.dispatchAction({type:"showTip",seriesIndex:0,dataIndex:a}),e++},3e3)}function _(){return h(this,null,function*(){const e=yield I();t.x_axis=e.x_axis,t.series=e.series,d()})}return L(()=>{_(),f.on("interval:auto",()=>{_()})}),{tabList:u,currentTab:r,chartRef:n,changeTab:p}}}),R={class:"h-full flex flex-col"},J={class:"flex-1",ref:"chartRef"};function M(f,u,t,r,n,p){const i=k("Box");return T(),$(i,{title:"\u7A3B\u867E\u4EF7\u683C\uFF08\u5143/\u65A4\uFF09"},{default:G(()=>[C("div",R,[C("div",J,null,512)])]),_:1})}var K=S(P,[["render",M],["__scopeId","data-v-f7acfd30"]]);export{K as default};