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