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