import{t as f}from"./debounce-Xd493GvO.js";import{r as V}from"./request-CEvu378m.js";import{d as _}from"./index-M_JNBppB.js";import{ar as $}from"./echarts-DB130vfq.js";import{s as j,r as g,ax as K,c as v,w as d,j as h,X as b,n as O,B as z,z as B}from"./vue-BJk78QHK.js";import"./element-3_pOinej.js";import"./utils-YI6ye1sf.js";import"./threejs-BafxXW5-.js";import"./vxe-Dx3zSILm.js";const A=Object.assign({name:"Charts3D"},{__name:"Charts3D",props:{propValue:{type:Object,default:()=>({})},request:{type:Object,default:()=>({})},element:{type:Object,default:()=>({})}},setup(y){const e=y,s=j(null),i=g(null),o=g(null),n=K(),w=v(()=>e.propValue.option),q=v(()=>{const a=e.element.style.width,t=e.element.style.height;return{width:a,height:t}});function c(){const a=_(w.value);a.tooltip.formatter=t=>{let u=t.map(r=>r.seriesType!=="pictorialBar"?`<div>${r.seriesName}: ${r.seriesType!=="line"?r.value:`${r.value}%`}</div>`:"").join("");return`
            <div>${t[0].axisValue}</div>
            ${u}
        `},a.legend.data=e.propValue.data.legend||[],a.xAxis.data=e.propValue.data.xdata||[],a.series[0].data=e.propValue.data.bar1||[],a.series[0].name=e.propValue.data.legend[0]||[],a.series[1].data=e.propValue.data.bar1||[],a.series[1].name=e.propValue.data.legend[0]||[],a.series[2].data=e.propValue.data.bar2||[],a.series[2].name=e.propValue.data.legend[1]||[],a.series[3].data=e.propValue.data.bar2||[],a.series[3].name=e.propValue.data.legend[1]||[],a.series[4].data=e.propValue.data.bar3||[],a.series[4].name=e.propValue.data.legend[2]||[],a.series[5].data=e.propValue.data.bar3||[],a.series[5].name=e.propValue.data.legend[2]||[],a.series[6].data=e.propValue.data.line1||[],a.series[6].label.formatter=t=>`${t.value}%`,a.series[6].name=e.propValue.data.legend[3]||[],a.series[7].data=e.propValue.data.line2||[],a.series[7].label.formatter=t=>`${t.value}%`,a.series[7].name=e.propValue.data.legend[4]||[],s.value.setOption(a,!0)}function p(){s.value.resize()}return d(q,f(a=>{p()},500),{deep:!0}),d(()=>e.propValue,f(a=>{c()},500),{deep:!0}),h(()=>{var a,t;e.request&&(o.value=V(e.request,e.propValue,"data")),((t=(a=e.request)==null?void 0:a.global)==null?void 0:t.length)>0&&d(()=>n.state.globalKey,()=>{e.request.global.forEach(u=>{const r=n.state.globalKey.findIndex(l=>l.globalKey===u);if(r>-1){const l=[n.state.globalKey[r].globalKey,n.state.globalKey[r].globalValue],m=e.request.data.findIndex(x=>x[0]===l[0]);m>-1?e.request.data[m][1]=l[1]:e.request.data.push(l)}}),o.value(),o.value=V(e.request,e.propValue,"data")},{deep:!0})}),b(()=>{e.request&&o.value()}),h(()=>{s.value=$(i.value,"vintage"),O(()=>{c()}),window.addEventListener("resize",p)}),b(()=>{window.removeEventListener("resize",p),s.value.clear(),s.value=null}),(a,t)=>(B(),z("div",{ref_key:"chartRef",ref:i,style:{width:"100%",height:"100%"}},null,512))}});export{A as default};
