lcny-vue3-antd-admin/dist/assets/DXCY.0fc82a36.js

2 lines
3.6 KiB
JavaScript

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