import{d as h}from"./debounce-Xd493GvO.js";import{a as _}from"./echarts_auto_tooltip-BNPm6hqZ.js";import{r as g}from"./request-CEvu378m.js";import{ar as x}from"./echarts-DB130vfq.js";import{r as p,s as K,ax as j,c as y,w as c,j as z,n as O,X as k,S as B,B as E,z as L}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 M=Object.assign({name:"PieY"},{__name:"PieY",props:{propValue:{type:Object,default:()=>({})},request:{type:Object,default:()=>({})},element:{type:Object,default:()=>({})}},setup(b){const e=b,l=p(null),s=p(null),t=K(null),f=p(null),u=j(),d=y(()=>e.propValue),q=y(()=>{const a=e.element.style.width,o=e.element.style.height;return{width:a,height:o}});function v(){t.value&&(t.value.clear(),t.value.setOption(d.value,!0),s.value&&(s.value.clearLoop(),s.value=null),e.propValue.autoPlay&&(s.value=_(t.value,d.value,{interval:e.propValue.autoPlayTime*1e3,loopSeries:!1,seriesIndex:0})))}function n(){t.value&&t.value.resize()}return c(q,h(a=>{n()},1e3),{deep:!0}),c(()=>e.propValue,h(a=>{v()},1e3),{deep:!0}),z(()=>{var a,o;e.request&&(l.value=g(e.request,e.propValue.series[0],"data")),((o=(a=e.request)==null?void 0:a.global)==null?void 0:o.length)>0&&c(()=>u.state.globalKey,()=>{e.request.global.forEach(w=>{const i=u.state.globalKey.findIndex(r=>r.globalKey===w);if(i>-1){const r=[u.state.globalKey[i].globalKey,u.state.globalKey[i].globalValue],m=e.request.data.findIndex(V=>V[0]===r[0]);m>-1?e.request.data[m][1]=r[1]:e.request.data.push(r)}}),l.value&&l.value(),l.value=g(e.request,e.propValue.series[0],"data")},{deep:!0}),t.value=x(f.value,"vintage"),O(()=>{v()}),window.addEventListener("resize",n)}),k(()=>{e.request&&l.value&&l.value()}),B(()=>{window.removeEventListener("resize",n),t.value&&(t.value.clear(),t.value=null)}),(a,o)=>(L(),E("div",{ref_key:"chartRef",ref:f,style:{width:"100%",height:"100%"}},null,512))}});export{M as default};
