2 lines
1.8 KiB
JavaScript
2 lines
1.8 KiB
JavaScript
var f=(o,r,s)=>new Promise((l,a)=>{var c=t=>{try{i(s.next(t))}catch(n){a(n)}},e=t=>{try{i(s.throw(t))}catch(n){a(n)}},i=t=>t.done?l(t.value):Promise.resolve(t.value).then(c,e);i((s=s.apply(o,r)).next())});import x from"./Box.72b5130d.js";import{u as d}from"./useECharts.6e74a9a1.js";import{h}from"./other.96563ff1.js";import{u as m}from"./visualization.376d5571.js";import{c as p}from"./colors.28a3398e.js";import{a as y,w as g,v,bq as b,K as w,L as B,aG as C,o as D,j as E,z as L,i as u}from"./index.867f48c0.js";const S=y({components:{Box:x},setup(){const o=g({x_axis:[],series:[]}),r=v(null),s=m(),{setOptions:l}=d(r);function a(){return f(this,null,function*(){const e=yield h({year:s.getYear});o.x_axis=e.x_axis,o.series=e.series,c()})}const c=()=>{const e={legendData:[],series:[]};o.series.forEach(({name:i,data:t},n)=>{const _=p[n%p.length];e.legendData.push(i),e.series.push({name:i,data:t,smooth:!0,type:"line",symbol:"none",itemStyle:{color:_.itemColor}})}),l({grid:{left:"2%",right:"2%",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:o.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:e.series})};return b(()=>{a()}),w(()=>s.getYear,()=>a()),{chartRef:r}}}),A={class:"h-full flex flex-col"},$={class:"flex-1",ref:"chartRef"};function k(o,r,s,l,a,c){const e=C("Box");return D(),E(e,{title:"\u7A3B\u867E\u4EA7\u4E1A"},{default:L(()=>[u("div",A,[u("div",$,null,512)])]),_:1})}var T=B(S,[["render",k],["__scopeId","data-v-9f25af2a"]]);export{T as default};
|