import{d as y,t as I}from"./debounce-Xd493GvO.js";import{a as j}from"./echarts_auto_tooltip-BNPm6hqZ.js";import{r as c}from"./request-CEvu378m.js";import{ar as z}from"./echarts-DB130vfq.js";import{r as b,s as E,ax as L,c as _,w as m,j as O,n as k,X as B,S,B as T,z as C}from"./vue-BJk78QHK.js";import{_ as P}from"./index-M_JNBppB.js";import"./element-3_pOinej.js";import"./utils-YI6ye1sf.js";import"./threejs-BafxXW5-.js";import"./vxe-Dx3zSILm.js";const U=Object.assign({name:"Radar"},{__name:"Radar",props:{propValue:{type:Object,default:()=>{}},request:{type:Object,default:()=>{}},element:{type:Object,default:()=>{}}},setup(x){const e=x,r=b(null),o=E(null),V=b(null),s=L(),d=_(()=>e.propValue),R=_(()=>{const t=e.element.style.width,l=e.element.style.height;return{width:t,height:l}});function g(){o.value.clear(),o.value.setOption(d.value,!0),r.value&&(r.value.clearLoop(),r.value=null),e.propValue.autoPlay&&(r.value=j(o.value,d.value,{interval:e.propValue.autoPlayTime*1e3,loopSeries:e.propValue.loopSeries,seriesIndex:Number.parseInt(e.propValue.seriesIndex)}))}function f(){o.value.resize()}const w=I(()=>{var t,l,h,q;((l=(t=e.propValue.request)==null?void 0:t.global)==null?void 0:l.length)>0&&(e.propValue.request.global.forEach(i=>{const a=s.state.globalKey.findIndex(u=>u.globalKey===i);if(a>-1){const u=[s.state.globalKey[a].globalKey,s.state.globalKey[a].globalValue],p=e.propValue.request.data.findIndex(n=>n[0]===u[0]);p>-1?e.propValue.request.data[p][1]=u[1]:e.propValue.request.data.push(u)}}),e.propValue.cancelRequest(),e.propValue.cancelRequest=c(e.propValue.request,e.element.propValue.radar,"indicator","array"));for(let i=0;i<e.propValue.series[0].data.length;i++){const a=e.propValue.series[0].data[i];a.request&&((q=(h=a.request)==null?void 0:h.global)==null?void 0:q.length)>0&&a.request.global.forEach(u=>{const p=s.state.globalKey.findIndex(n=>n.globalKey===u);if(p>-1){const n=[s.state.globalKey[p].globalKey,s.state.globalKey[p].globalValue],v=a.request.data.findIndex(K=>K[0]===n[0]);v>-1?a.request.data[v][1]=n[1]:a.request.data.push(n)}a.cancelRequest(),a.cancelRequest=c(a.request,a,"value","array")})}},500);return m(R,y(t=>{f()},1e3),{deep:!0}),m(d,y(t=>{g()},1e3),{deep:!0}),m(()=>s.state.globalKey,w,{deep:!0}),O(()=>{e.propValue.request&&(e.propValue.cancelRequest=c(e.propValue.request,e.element.propValue.radar,"indicator","array"));for(let t=0;t<e.propValue.series[0].data.length;t++){const l=e.propValue.series[0].data[t];l.request&&(l.cancelRequest=c(l.request,l,"value","array"))}o.value=z(V.value,"vintage"),k(()=>{g()}),window.addEventListener("resize",f)}),B(()=>{e.propValue.request&&e.propValue.cancelRequest(),r.value&&(r.value.clearLoop(),r.value=null)}),S(()=>{window.removeEventListener("resize",f),o.value.clear(),o.value=null}),(t,l)=>(C(),T("div",{ref_key:"chartRef",ref:V,style:{width:"100%",height:"100%"}},null,512))}}),Q=P(U,[["__scopeId","data-v-b3d2f1d6"]]);export{Q as default};
