2 lines
3.3 KiB
JavaScript
2 lines
3.3 KiB
JavaScript
var $=Object.defineProperty,R=Object.defineProperties;var T=Object.getOwnPropertyDescriptors;var _=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable;var v=(t,e,a)=>e in t?$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,y=(t,e)=>{for(var a in e||(e={}))V.call(e,a)&&v(t,a,e[a]);if(_)for(var a of _(e))Y.call(e,a)&&v(t,a,e[a]);return t},C=(t,e)=>R(t,T(e));var b=(t,e,a)=>new Promise((m,f)=>{var d=s=>{try{i(a.next(s))}catch(r){f(r)}},h=s=>{try{i(a.throw(s))}catch(r){f(r)}},i=s=>s.done?m(s.value):Promise.resolve(s.value).then(d,h);i((a=a.apply(t,e)).next())});import{a as F,s as j,r as A,bp as z,H as X,bc as G,J as H,aA as I,o as J,j as M,x as w,i as x,w as D,v as E,p as O}from"./index.d70f4f63.js";import P from"./Box.849d0024.js";import{u as U}from"./useECharts.6f772184.js";import{f as q}from"./other.8699d858.js";import{u as K}from"./visualization.ac901141.js";import{c as S}from"./colors.69d1b0cd.js";import Q from"./Circle.97421d58.js";import{u as W}from"./useVContext.1f14c874.js";const Z=F({components:{Box:P,Circle:Q},setup(){const{rootEmitter:t}=W(),e=j({x_axis:[],series:[]}),a=A(!0);function m(){a.value=!a.value}const f=A(null),d=K(),{setOptions:h,getInstance:i}=U(f);function s(){return b(this,null,function*(){const o=yield q({year:d.getYear});e.x_axis=o.x_axis,e.series=o.series,B()})}let r=[];const B=()=>{const o={legendData:[],series:[]};e.series.forEach(({name:n,data:c},u)=>{const l=S[u%S.length];o.legendData.push(n),o.series.push({name:n,data:c,smooth:!1,type:"line",itemStyle:{color:l.itemColor},areaStyle:{color:l.areaColor}})}),r=o.legendData,h({grid:{left:"2%",right:"4%",top:"10%",bottom:"2%",containLabel:!0},legend:{data:o.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:o.series}),L()};let p=null;function L(){let o=0;const n=3e3;let c=1;p&&clearInterval(p),p=setInterval(()=>{var l;const u=o%4;c=o%(4*2),(l=i())==null||l.dispatchAction({type:"showTip",seriesIndex:0,dataIndex:u}),c==7&&k(),o++},n)}function k(){p&&clearInterval(p);let n=r.length,c=6e3/3e3;p=setInterval(()=>{var u,l;(u=i())==null||u.dispatchAction({type:"hideTip"}),n==r.length&&r.forEach((se,N)=>{var g;(g=i())==null||g.dispatchAction({type:"legendUnSelect",name:r[N]})}),n>=0&&((l=i())==null||l.dispatchAction({type:"legendSelect",name:r[n-1]})),n<=0&&(c<=0&&s(),c--),n--},3e3)}return z(()=>{s(),t.on("interval:auto",()=>{})}),X(()=>d.getYear,()=>s()),C(y({isChart:a,changeChart:m},G(e)),{chartRef:f})}}),ee={class:"h-full flex flex-col"},te={class:"flex-1",ref:"chartRef"};function ae(t,e,a,m,f,d){const h=I("Circle"),i=I("Box");return J(),M(i,{title:"\u7A3B\u867E\u4EA7\u4E1A"},{right:w(()=>[x("div",{class:"text-[#76E9F0] text-13px cursor-pointer",onClick:e[0]||(e[0]=(...s)=>t.changeChart&&t.changeChart(...s))},"\u5207\u6362")]),default:w(()=>[x("div",ee,[D(x("div",te,null,512),[[E,t.isChart]]),D(O(h,{class:"flex-1",axis:t.x_axis,data:t.series},null,8,["axis","data"]),[[E,!t.isChart]])])]),_:1})}var de=H(Z,[["render",ae],["__scopeId","data-v-61e4aab0"]]);export{de as default};
|