lcny-vue3-antd-admin/dist/assets/DXJG.a9490b01.js

2 lines
2.9 KiB
JavaScript

var I=(m,x,s)=>new Promise((c,f)=>{var h=t=>{try{n(s.next(t))}catch(u){f(u)}},p=t=>{try{n(s.throw(t))}catch(u){f(u)}},n=t=>t.done?c(t.value):Promise.resolve(t.value).then(h,p);n((s=s.apply(m,x)).next())});import T from"./Box.27e2764f.js";import{u as L}from"./useECharts.0337b52c.js";import{e as w}from"./other.ec400fec.js";import{c as C}from"./colors.69d1b0cd.js";import{u as F}from"./useVContext.d7b7cbcc.js";import{a as k,s as D,r as A,bp as $,af as j,J as G,aA as J,o as N,j as R,x as O,i as E}from"./index.dd827b71.js";const P=k({components:{Box:T},setup(){const{rootEmitter:m}=F(),x=D([{key:"0",value:"\u5168\u90E8"},{key:"1",value:"\u9C7C"},{key:"2",value:"\u867E"}]),s=D({x_axis:[],series:[]}),c=A("0"),f=A(null),h=e=>{c.value!=e&&(c.value=e,v())},{setOptions:p,getInstance:n}=L(f);let t=[];function u(){const e={legendData:[],series:[]};return s.series.forEach(({name:a,data:r},l)=>{const i=C[l%C.length];e.legendData.push(a+""),e.series.push({name:a,data:r,type:"line",smooth:!1,itemStyle:{color:i.itemColor},areaStyle:{color:i.areaColor}})}),t=e.legendData,e}const v=()=>{const e=u();p({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:s.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:a=>a}}],series:e.series,animationDuration:2e3}),y()};let o=null;function y(){let e=0;const a=3e3;o&&clearInterval(o);let r=0,l=0;const i=2;o=setInterval(()=>{var d;r=e%4,l=e%(4*i),(d=n())==null||d.dispatchAction({type:"showTip",seriesIndex:0,dataIndex:r}),l+1>=4*i&&(o&&clearInterval(o),setTimeout(()=>{var _;(_=n())==null||_.dispatchAction({type:"hideTip"})},a),g(!1)),e++},a)}function B(){const e=u();let a=0,r=0;const l=3e3;o&&clearInterval(o),o=setInterval(()=>{var i,d;r=a%t.length,r==0&&t.forEach((_,S)=>{var b;(b=n())==null||b.dispatchAction({type:"legendUnSelect",name:t[S]})}),(i=n())==null||i.setOption({series:[e.series[r]]}),(d=n())==null||d.dispatchAction({type:"legendSelect",name:t[r]}),r==t.length-1&&(o&&clearInterval(o),setTimeout(()=>{y()},l)),a++},l)}function g(e=!0){return I(this,null,function*(){const a=yield w();s.x_axis=a.x_axis,s.series=a.series,e?v():B()})}return $(()=>{g(),m.on("interval:auto",()=>{})}),j(()=>{o&&clearInterval(o)}),{tabList:x,currentTab:c,chartRef:f,changeTab:h}}}),U={class:"h-full flex flex-col"},V={class:"flex-1",ref:"chartRef"};function X(m,x,s,c,f,h){const p=J("Box");return N(),R(p,{title:"\u7A3B\u867E\u4EF7\u683C\uFF08\u5143/\u65A4\uFF09"},{default:O(()=>[E("div",U,[E("div",V,null,512)])]),_:1})}var Y=G(P,[["render",X],["__scopeId","data-v-68f87935"]]);export{Y as default};