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