2 lines
2.2 KiB
JavaScript
2 lines
2.2 KiB
JavaScript
var _=(c,a,o)=>new Promise((r,i)=>{var f=e=>{try{n(o.next(e))}catch(l){i(l)}},s=e=>{try{n(o.throw(e))}catch(l){i(l)}},n=e=>e.done?r(e.value):Promise.resolve(e.value).then(f,s);n((o=o.apply(c,a)).next())});import g from"./Box.fcbd33fd.js";import{u as v}from"./useECharts.d100ee71.js";import{i as D}from"./other.ed2ccd93.js";import{u as b}from"./visualization.dd6465e6.js";import{c as m}from"./colors.d19e85ff.js";import{u as w}from"./useVContext.fe0bcac3.js";import{d as B,q as C,r as E,aA as F,E as I,_ as L,P as S,o as A,i as k,s as $,h}from"./index.7edff3d4.js";import"ant-design-vue";const T=B({components:{Box:g},setup(){const{rootEmitter:c}=w(),a=C({x_axis:[],series:[]}),o=E(null),r=b(),{setOptions:i,getInstance:f}=v(o);function s(){return _(this,null,function*(){const t=yield D({year:r.getYear});a.x_axis=t.x_axis,a.series=t.series,n()})}const n=()=>{const t={legendData:[],series:[]};a.series.forEach(({name:p,data:u},y)=>{const d=m[y%m.length];t.legendData.push(p),t.series.push({name:p,data:u.map(x=>x&&Number((x/2e3).toFixed(2))),smooth:!1,type:"line",stack:"Total",itemStyle:{color:d.itemColor},areaStyle:{color:d.areaColor}})}),i({grid:{left:"2%",right:"2%",top:"10%",bottom:"2%",containLabel:!0},legend:{data:t.legendData,top:"0%",right:"0",textStyle:{color:"#ffffff"}},tooltip:{trigger:"axis",axisPointer:{lineStyle:{width:1,color:"#019680"}}},xAxis:{type:"category",data:a.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:t.series,animationDuration:3e3}),l()};let e=null;function l(){let t=0;e&&clearInterval(e),e=setInterval(()=>{var u;const p=t%4;(u=f())==null||u.dispatchAction({type:"showTip",seriesIndex:0,dataIndex:p}),t++},3e3)}return F(()=>{s(),c.on("interval:auto",()=>{s()})}),I(()=>r.getYear,()=>s()),{chartRef:o}}}),X={class:"h-full flex flex-col"},R={class:"flex-1",ref:"chartRef"};function V(c,a,o,r,i,f){const s=S("Box");return A(),k(s,{title:"\u7A3B\u867E\u6D41\u5411\uFF08\u5428\uFF09"},{default:$(()=>[h("div",X,[h("div",R,null,512)])]),_:1})}var H=L(T,[["render",V],["__scopeId","data-v-5b2b8f12"]]);export{H as default};
|