import{d as h}from"./debounce-Xd493GvO.js";import{r as g}from"./request-CEvu378m.js";import{as as O,ar as V}from"./echarts-DB130vfq.js";import{ax as L,r as b,s as K,c as n,j,w as v,S as k,B as z,z as C}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 G=Object.assign({name:"Pie3"},{__name:"Pie3",props:{propValue:{type:Object,required:!0},request:{type:Object,default:()=>{}},element:{type:Object,default:()=>{}}},setup(_){const e=_,i=L(),m=b(null),a=K(null),r=b(null),u=n(()=>e.propValue.data.data[0]||{value:0,name:""}),o=n(()=>e.propValue.data.color),c=n(()=>u.value.value/100),w=n(()=>{const t=e.element.style.width,l=e.element.style.height;return{width:t,height:l}}),p=n(()=>{const t=JSON.parse(JSON.stringify(e.propValue.option));t.series[0].data=[u.value],t.series[4].data=[u.value],t.series[0].axisLine.lineStyle.color=[[c.value,o.value.main],[1,o.value.main]],t.series[1].axisLine.lineStyle.color=[[c.value,new O(0,1,0,0,[{offset:0,color:o.value.shadow_start},{offset:.5,color:o.value.shadow_mid},{offset:1,color:o.value.shadow_end}])],[1,"rgba(0,0,0,0)"]],t.series[2].axisLine.lineStyle.color=[[c.value,{type:"linear",x:0,y:0,x2:1,y2:1,colorStops:[{offset:0,color:o.value.gradient2_start},{offset:1,color:o.value.gradient2_end}]}],[1,"rgba(0,0,0,0)"]];const l={type:"linear",x:0,y:0,x2:1,y2:1,colorStops:[{offset:0,color:o.value.gradient1_start},{offset:1,color:o.value.gradient1_end}]};return t.series[3].axisTick.lineStyle.color=l,t.series[3].splitLine.lineStyle.color=l,t});function x(){a.value&&a.value.dispose(),a.value=V(m.value),a.value.setOption(p.value)}function d(){a.value&&a.value.resize()}return j(()=>{var t,l;e.request&&(r.value=g(e.request,e.propValue,"data")),((l=(t=e.request)==null?void 0:t.global)==null?void 0:l.length)>0&&v(()=>i.state.globalKey,()=>{e.request.global.forEach(q=>{const f=i.state.globalKey.findIndex(s=>s.globalKey===q);if(f>-1){const s=[i.state.globalKey[f].globalKey,i.state.globalKey[f].globalValue],y=e.request.data.findIndex(S=>S[0]===s[0]);y>-1?e.request.data[y][1]=s[1]:e.request.data.push(s)}}),r.value(),r.value=g(e.request,e.propValue,"data")},{deep:!0}),x(),window.addEventListener("resize",d)}),k(()=>{window.removeEventListener("resize",d),e.propValue.request&&r.value&&r.value(),a.value&&(a.value.dispose(),a.value=null)}),v(()=>p,h(()=>{a.value&&a.value.setOption(p.value,!0)},300),{deep:!0}),v(w,h(()=>{d()},300),{deep:!0}),(t,l)=>(C(),z("div",{ref_key:"chartRef",ref:m,style:{width:"100%",height:"100%"}},null,512))}});export{G as default};
