2 lines
3.7 KiB
JavaScript
2 lines
3.7 KiB
JavaScript
var R=Object.defineProperty,V=Object.defineProperties;var z=Object.getOwnPropertyDescriptors;var I=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var D=(t,e,a)=>e in t?R(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,b=(t,e)=>{for(var a in e||(e={}))F.call(e,a)&&D(t,a,e[a]);if(I)for(var a of I(e))M.call(e,a)&&D(t,a,e[a]);return t},E=(t,e)=>V(t,z(e));var w=(t,e,a)=>new Promise((x,d)=>{var u=o=>{try{n(a.next(o))}catch(l){d(l)}},h=o=>{try{n(a.throw(o))}catch(l){d(l)}},n=o=>o.done?x(o.value):Promise.resolve(o.value).then(u,h);n((a=a.apply(t,e)).next())});import{a as P,w as X,v as A,x as O,K as U,aj as q,L as S,bf as G,q as K,aE as B,o as Z,j as H,B as L,i as _,y as k,z as T,p as J}from"./index.203f4f59.js";import Q from"./Box.ea9d0e0a.js";import{u as W}from"./useECharts.f2bf9eb6.js";import{l as ee}from"./other.d43d2a78.js";import{u as te}from"./visualization.0e8abb36.js";import{c as j}from"./colors.69d1b0cd.js";import ae from"./Circle.a45f4019.js";import{u as se}from"./useVContext.24ed0266.js";const oe=P({components:{Box:Q,Circle:ae},setup(){const{rootEmitter:t}=se(),e=X({x_axis:[],series:[]}),a=A(!0);function x(){a.value=!a.value}const d=A(null),u=te(),{setOptions:h,getInstance:n}=W(d);function o(s=!0){return w(this,null,function*(){const i=yield ee({year:u.getYear});e.x_axis=i.x_axis,e.series=i.series,s?Y():$()})}let l=[];function v(){const s={legendData:[],series:[]};return e.series.forEach(({name:i,data:c},p)=>{const f=j[p%j.length];s.legendData.push(i+""),s.series.push({name:i,data:c,type:"line",smooth:!1,itemStyle:{color:f.itemColor},areaStyle:{color:f.areaColor}})}),l=s.legendData,s}const Y=()=>{const s=v();h({grid:{left:"2%",right:"20px",top:"10%",bottom:"2%",containLabel:!0},legend:{data:s.legendData,top:"0%",right:"0",textStyle:{color:"#ffffff"}},tooltip:{trigger:"axis",axisPointer:{lineStyle:{width:1,color:"#019680"}}},xAxis:{type:"category",data:e.x_axis,boundaryGap:!1,axisTick:{show:!1},axisLine:{show:!1},axisLabel:{color:"#fff"}},yAxis:[{type:"value",axisTick:{show:!1},splitLine:{lineStyle:{type:"solid",color:"#8EEEFF",opacity:.3}},axisLabel:{color:"#fff"}}],series:s.series}),u.getPlay&&y()};let r=null;function y(){let s=0;const i=3e3;r&&clearInterval(r);let c=0,p=0;const f=2;r=setInterval(()=>{var m;c=s%4,p=s%(4*f),(m=n())==null||m.dispatchAction({type:"showTip",seriesIndex:0,dataIndex:c}),p+1>=4*f&&(r&&clearInterval(r),setTimeout(()=>{var g;(g=n())==null||g.dispatchAction({type:"hideTip"})},i),o(!1)),s++},i)}function $(){const s=v();let i=0,c=0;const p=3e3;r&&clearInterval(r),r=setInterval(()=>{var f,m;c=i%l.length,c==0&&l.forEach((g,N)=>{var C;(C=n())==null||C.dispatchAction({type:"legendUnSelect",name:l[N]})}),(f=n())==null||f.setOption({series:[s.series[c]]}),(m=n())==null||m.dispatchAction({type:"legendSelect",name:l[c]}),c==l.length-1&&(r&&clearInterval(r),setTimeout(()=>{y()},p)),i++},p)}return O(()=>{o(),t.on("interval:auto",()=>{})}),U(()=>{var s,i;(i=(s=n())==null?void 0:s.getZr())==null||i.on("click",()=>{t.emit("leftModel:click","DXCY")})}),q(()=>{r&&clearInterval(r)}),S(()=>u.getYear,()=>o()),S(()=>u.getPlay,()=>{r&&clearInterval(r),o()}),E(b({isChart:a,changeChart:x},G(e)),{chartRef:d})}}),re={class:"h-full flex flex-col"},ie={class:"flex-1",ref:"chartRef"};function ne(t,e,a,x,d,u){const h=B("Circle"),n=B("Box");return Z(),H(n,{title:"\u7A3B\u867E\u4EA7\u4E1A"},{right:L(()=>[_("div",{class:"text-[#76E9F0] text-13px cursor-pointer",onClick:e[0]||(e[0]=(...o)=>t.changeChart&&t.changeChart(...o))},"\u5207\u6362")]),default:L(()=>[_("div",re,[k(_("div",ie,null,512),[[T,t.isChart]]),k(J(h,{class:"flex-1",axis:t.x_axis,data:t.series},null,8,["axis","data"]),[[T,!t.isChart]])])]),_:1})}var ge=K(oe,[["render",ne],["__scopeId","data-v-69ddabd2"]]);export{ge as default};
|