lcny-vue3-antd-admin/dist/assets/DXCY.249d76fd.js

2 lines
3.7 KiB
JavaScript

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