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