import{d}from"./debounce-Xd493GvO.js";import{a as j}from"./echarts_auto_tooltip-BNPm6hqZ.js";import{r as w}from"./request-CEvu378m.js";import{_ as B,d as C}from"./index-M_JNBppB.js";import{ar as L,as as O}from"./echarts-DB130vfq.js";import{s as k,r as h,ax as E,c as r,w as f,j as I,n as S,X as T,B as W,z as P,D as u,W as X}from"./vue-BJk78QHK.js";import"./element-3_pOinej.js";import"./utils-YI6ye1sf.js";import"./threejs-BafxXW5-.js";import"./vxe-Dx3zSILm.js";const $=Object.assign({name:"RotateColorful"},{__name:"RotateColorful",props:{propValue:{type:Object,default:()=>({})},request:{type:Object,default:()=>({})},element:{type:Object,default:()=>({})}},setup(b){const e=b,o=k(null),i=h(null),c=h(null),v=h(null),s=E(),V=r(()=>e.propValue.option),q=r(()=>{const a=e.element.style.width,l=e.element.style.height;return{width:a,height:l}}),_=r(()=>e.element.style.width),x=r(()=>e.element.style.height),R=r(()=>e.element.style.width/250),z=r(()=>e.element.style.height/250);f(_,d(a=>{s.state.mode==="edit"&&(e.element.style.height=e.element.style.width)},500)),f(x,d(a=>{s.state.mode==="edit"&&(e.element.style.width=e.element.style.height)},500)),f(q,d(a=>{m()},1e3),{deep:!0}),f(()=>e.propValue,d(a=>{y()},1e3),{deep:!0}),I(()=>{var a,l;e.request&&(i.value=w(e.request,e.propValue,"data")),((l=(a=e.request)==null?void 0:a.global)==null?void 0:l.length)>0&&s.watch(()=>s.state.globalKey,()=>{e.request.global.forEach(p=>{const n=s.state.globalKey.findIndex(t=>t.globalKey===p);if(n>-1){const t=[s.state.globalKey[n].globalKey,s.state.globalKey[n].globalValue],g=e.request.data.findIndex(K=>K[0]===t[0]);g>-1?e.request.data[g][1]=t[1]:e.request.data.push(t)}}),i.value(),i.value=w(e.request,e.propValue,"data")},{deep:!0}),o.value=L(v.value,"vintage"),S(()=>{y()}),window.addEventListener("resize",m)}),T(()=>{window.removeEventListener("resize",m),o.value&&(o.value.clear(),o.value=null),e.propValue.request&&i.value&&i.value()});function y(){var p;(p=o.value)==null||p.clear();const a=e.propValue.data,l=C(V.value);l.series[0].data=[],l.legend.data=[];for(let n=0;n<a.length;n++){const t=a[n];l.legend.data.push(t.name),l.series[0].data.push({value:t.value,name:t.name,itemStyle:{normal:{color:new O(0,0,0,1,[{offset:0,color:(t==null?void 0:t.color[0])||"#387ed3"},{offset:1,color:(t==null?void 0:t.color[1])||"#bc8b68"}])}}})}o.value.setOption(l,!0),c.value&&(c.value.clearLoop(),c.value=null),e.propValue.autoPlay&&(c.value=j(o.value,l,{interval:e.propValue.autoPlayTime*1e3,loopSeries:!1,seriesIndex:0}))}function m(){o.value&&o.value.resize()}return(a,l)=>(P(),W("div",null,[u("div",{class:"pie",style:X({transform:`scale(${R.value},${z.value})`})},l[0]||(l[0]=[u("div",{class:"pies pie1"},null,-1),u("div",{class:"pies pie2"},null,-1),u("div",{class:"pies pie3"},null,-1),u("div",{class:"pie4"},null,-1)]),4),u("div",{ref_key:"chartRef",ref:v,style:{width:"100%",height:"100%"}},null,512)]))}}),Q=B($,[["__scopeId","data-v-8d3a3688"]]);export{Q as default};
