2 lines
3.1 KiB
JavaScript
2 lines
3.1 KiB
JavaScript
var b=(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 L from"./Box.baa6569d.js";import{u as T}from"./useECharts.b210e265.js";import{k as F}from"./other.843cde05.js";import{c as E}from"./colors.69d1b0cd.js";import{u as j}from"./visualization.69653f17.js";import{u as $}from"./useVContext.bb1c77fb.js";import{a as G,w as C,v as S,x as P,aj as J,L as A,K as M,q as N,aE as R,o as V,j as X,B as z,i as B}from"./index.d39002cd.js";const O=G({components:{Box:L},setup(){const f=j(),{rootEmitter:p}=$(),i=C([{key:"0",value:"\u5168\u90E8"},{key:"1",value:"\u9C7C"},{key:"2",value:"\u867E"}]),l=C({x_axis:[],series:[]}),c=S("0"),d=S(null),m=e=>{c.value!=e&&(c.value=e,y())},{setOptions:x,getInstance:a}=T(d);let s=[];function v(){const e={legendData:[],series:[]};return l.series.forEach(({name:t,data:r},u)=>{const n=E[u%E.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&&I()};let o=null;function I(){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 k(){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,w)=>{var D;(D=a())==null||D.dispatchAction({type:"legendUnSelect",name:s[w]})}),(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(()=>{I()},u)),t++},u)}function _(e=!0){return b(this,null,function*(){const t=yield F();l.x_axis=t.x_axis,l.series=t.series,e?y():k()})}return P(()=>{_(),p.on("interval:auto",()=>{})}),J(()=>{o&&clearInterval(o)}),A(()=>f.getYear,()=>_()),A(()=>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"},q={class:"flex-1",ref:"chartRef"};function K(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",q,null,512)])]),_:1})}var oe=N(O,[["render",K],["__scopeId","data-v-74831ca7"]]);export{oe as default};
|