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 y=(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,w as z,v as C,bq as F,K as T,bd as j,L as G,aG as w,o as N,j as X,z as D,i as h,x as E,y as I,n as q}from"./index.10d06543.js";import K from"./Box.148249ef.js";import{u as M}from"./useECharts.ce337e2d.js";import{h as O}from"./other.e182adb3.js";import{u as P}from"./visualization.56ba3c43.js";import{c as S}from"./colors.d19e85ff.js";import H from"./Circle.b39c0550.js";import{u as J}from"./useVContext.8eed226c.js";const Q=Y({components:{Box:K,Circle:H},setup(){const{rootEmitter:t}=J(),e=z({x_axis:[],series:[]}),a=C(!0);function f(){a.value=!a.value}const i=C(null),l=P(),{setOptions:c,getInstance:r}=M(i);function s(){return y(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:u,data:p},A)=>{const x=S[A%S.length];o.legendData.push(u),o.series.push({name:u,data:p,smooth:!1,type:"line",itemStyle:{color:x.itemColor},areaStyle:{color:x.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}),B()};let d=null;function B(){let o=0;d&&clearInterval(d),d=setInterval(()=>{var p;const u=o%n.length;(p=r())==null||p.dispatchAction({type:"showTip",seriesIndex:0,dataIndex:u}),o++},3e3)}return F(()=>{s(),t.on("interval:auto",()=>{s()})}),T(()=>l.getYear,()=>s()),v(g({isChart:a,changeChart:f},j(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 N(),X(r,{title:"\u7A3B\u867E\u4EA7\u4E1A"},{right:D(()=>[h("div",{class:"text-[#76E9F0] text-13px cursor-pointer",onClick:e[0]||(e[0]=(...s)=>t.changeChart&&t.changeChart(...s))},"\u5207\u6362")]),default:D(()=>[h("div",U,[E(h("div",W,null,512),[[I,t.isChart]]),E(q(c,{class:"flex-1",axis:t.x_axis,data:t.series},null,8,["axis","data"]),[[I,!t.isChart]])])]),_:1})}var ce=G(Q,[["render",Z],["__scopeId","data-v-c1202958"]]);export{ce as default};
|