import{t as v}from"./debounce-Xd493GvO.js";import{r as h}from"./request-CEvu378m.js";import{ar as _}from"./echarts-DB130vfq.js";import{r as g,s as x,ax as V,c as y,w as u,j as K,n as j,X as z,S as O,B as k,z as B}from"./vue-BJk78QHK.js";import"./index-M_JNBppB.js";import"./element-3_pOinej.js";import"./utils-YI6ye1sf.js";import"./threejs-BafxXW5-.js";import"./vxe-Dx3zSILm.js";const H=Object.assign({name:"Panel"},{__name:"Panel",props:{propValue:{type:Object,default:()=>({})},request:{type:Object,default:()=>({})},element:{type:Object,default:()=>({})}},setup(b){var d,f;const e=b,a=g(null),t=x(null),i=g(null),n=V(),c=y(()=>e.propValue),q=y(()=>{const l=e.element.style.width,s=e.element.style.height;return{width:l,height:s}});function p(){t.value&&(t.value.clear(),t.value.setOption(c.value,!0))}function o(){t.value&&t.value.resize()}return u(q,v(l=>{o()},500),{deep:!0}),u(c,v(l=>{p()},500),{deep:!0}),K(()=>{t.value=_(i.value,"vintage"),j(()=>{p()}),window.addEventListener("resize",o)}),z(()=>{e.request&&a.value&&a.value()}),O(()=>{window.removeEventListener("resize",o),t.value&&(t.value.clear(),t.value.dispose(),t.value=null)}),e.request&&(a.value=h(e.request,e.propValue.series[0],"data")),((f=(d=e.request)==null?void 0:d.global)==null?void 0:f.length)>0&&u(()=>n.state.globalKey,()=>{e.request.global.forEach(l=>{const s=n.state.globalKey.findIndex(r=>r.globalKey===l);if(s>-1){const r=[n.state.globalKey[s].globalKey,n.state.globalKey[s].globalValue],m=e.request.data.findIndex(w=>w[0]===r[0]);m>-1?e.request.data[m][1]=r[1]:e.request.data.push(r)}}),a.value&&a.value(),a.value=h(e.request,e.propValue.series[0],"data")},{deep:!0}),(l,s)=>(B(),k("div",{ref_key:"chartRef",ref:i,style:{width:"100%",height:"100%"}},null,512))}});export{H as default};
