lcny-vue3-antd-admin/dist/assets/DXJG.8295ca5d.js

2 lines
3.0 KiB
JavaScript

var C=(i,h,l)=>new Promise((c,f)=>{var p=a=>{try{m(l.next(a))}catch(s){f(s)}},d=a=>{try{m(l.throw(a))}catch(s){f(s)}},m=a=>a.done?c(a.value):Promise.resolve(a.value).then(p,d);m((l=l.apply(i,h)).next())});import L from"./Box.27ab6fa0.js";import{u as F}from"./useECharts.7006c662.js";import{h as k}from"./other.e9daf971.js";import{c as D}from"./colors.69d1b0cd.js";import{u as $}from"./visualization.d970f6d6.js";import{u as j}from"./useVContext.fbae636e.js";import{a as P,s as A,r as E,bp as G,af as J,H as S,J as N,aA as R,o as V,j as z,x as O,i as B}from"./index.af4276fc.js";const U=P({components:{Box:L},setup(){const i=$(),{rootEmitter:h}=j(),l=A([{key:"0",value:"\u5168\u90E8"},{key:"1",value:"\u9C7C"},{key:"2",value:"\u867E"}]),c=A({x_axis:[],series:[]}),f=E("0"),p=E(null),d=e=>{f.value!=e&&(f.value=e,v())},{setOptions:m,getInstance:a}=F(p);let s=[];function y(){const e={legendData:[],series:[]};return c.series.forEach(({name:o,data:r},u)=>{const n=D[u%D.length];e.legendData.push(o+""),e.series.push({name:o,data:r,type:"line",smooth:!1,itemStyle:{color:n.itemColor},areaStyle:{color:n.areaColor}})}),s=e.legendData,e}const v=()=>{const e=y();m({grid:{left:"2%",right:"20px",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:c.x_axis,boundaryGap:!1,axisTick:{show:!1},axisLine:{show:!1},axisLabel:{color:"#fff"}},yAxis:[{type:"value",axisTick:{show:!1},nameTextStyle:{color:"#fff"},splitLine:{lineStyle:{type:"solid",color:"#8EEEFF",opacity:.3}},axisLabel:{color:"#fff",formatter:o=>o}}],series:e.series,animationDuration:2e3}),i.getPlay&&b()};let t=null;function b(){let e=0;const o=3e3;t&&clearInterval(t);let r=0,u=0;const n=2;t=setInterval(()=>{var x;r=e%4,u=e%(4*n),(x=a())==null||x.dispatchAction({type:"showTip",seriesIndex:0,dataIndex:r}),u+1>=4*n&&(t&&clearInterval(t),setTimeout(()=>{var g;(g=a())==null||g.dispatchAction({type:"hideTip"})},o),_(!1)),e++},o)}function T(){const e=y();let o=0,r=0;const u=3e3;t&&clearInterval(t),t=setInterval(()=>{var n,x;r=o%s.length,r==0&&s.forEach((g,w)=>{var I;(I=a())==null||I.dispatchAction({type:"legendUnSelect",name:s[w]})}),(n=a())==null||n.setOption({series:[e.series[r]]}),(x=a())==null||x.dispatchAction({type:"legendSelect",name:s[r]}),r==s.length-1&&(t&&clearInterval(t),setTimeout(()=>{b()},u)),o++},u)}function _(e=!0){return C(this,null,function*(){const o=yield k({year:i.getYear});c.x_axis=o.x_axis,c.series=o.series,e?v():T()})}return G(()=>{_(),h.on("interval:auto",()=>{})}),J(()=>{t&&clearInterval(t)}),S(()=>i.getYear,()=>_()),S(()=>i.getPlay,()=>{t&&clearInterval(t),_()}),{tabList:l,currentTab:f,chartRef:p,changeTab:d}}}),X={class:"h-full flex flex-col"},Y={class:"flex-1",ref:"chartRef"};function H(i,h,l,c,f,p){const d=R("Box");return V(),z(d,{title:"\u7A3B\u867E\u4EF7\u683C\uFF08\u5143/\u65A4\uFF09"},{default:O(()=>[B("div",X,[B("div",Y,null,512)])]),_:1})}var ae=N(U,[["render",H],["__scopeId","data-v-f9cd1bc8"]]);export{ae as default};