import{i as e}from"./echarts-DC1YXnQ7.js";import{B as t,e as o,m as s,n as a,t as i,H as r,L as l,Q as n,d,s as p,M as f,u as c}from"./vue-vendor-DZekML78.js";import{d as u}from"./index-mv7arXuk.js";import{g as m}from"./time-DpZ222L_.js";const h=u(t({__name:"index",props:{width:{default:"100%"},height:{default:"100%"},options:{default:()=>({})},theme:{default:""},autoResize:{type:Boolean,default:!0},immediate:{type:Boolean,default:!0}},emits:["ready","click","rendered"],setup(t,{expose:p,emit:f}){const c=t,u=f,m=d();let h=null,y=null;const v=()=>{h&&(h.setOption(c.options,{notMerge:!1,lazyUpdate:!1}),u("rendered"))},g=()=>{h&&h.resize()};return o(()=>c.options,v,{deep:!0}),s(()=>{a(()=>{m.value&&(h&&(h.dispose(),h=null),h=e(m.value,c.theme),h.setOption(c.options),u("ready",h),u("rendered"),h.on("click",e=>{u("click",e)}))}),c.autoResize&&m.value&&(y=new ResizeObserver(g),y.observe(m.value))}),s(()=>{window.addEventListener("resize",g)}),i(()=>{window.removeEventListener("resize",g),y?.disconnect(),h?.dispose(),h=null}),p({resizeChart:g,updateChart:v,getInstance:()=>h,exportAsImage:(e="png")=>h?.getDataURL({type:e,pixelRatio:2,backgroundColor:"#fff"})||""}),(e,o)=>(r(),l("div",{ref_key:"chartRef",ref:m,class:"echarts-container",style:n({width:t.width,height:t.height})},null,4))}}),[["__scopeId","data-v-190f9796"]]),y={class:"w-full h-full"},v=t({name:"repairEcharts"}),g=t({...v,setup(e){const t=p({grid:{left:"1%",right:"1%",top:"10%",bottom:"1%",containLabel:!0},xAxis:{data:m()},yAxis:{type:"value"},tooltip:{trigger:"axis"},series:[{data:[100,140,230,100,130,180,173],type:"line",smooth:!0,name:"维修单数",areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"#e2edff"},{offset:1,color:"#f2f9ff"}]}},lineStyle:{color:"#1a75ff"},itemStyle:{color:"#1a75ff"},label:{show:!0,color:"#3f8afc",position:"top"}}]});return(e,o)=>(r(),l("div",y,[f(h,{options:c(t)},null,8,["options"])]))}});export{g as _,h as a};
