import{W as m}from"./vue-cropper.es.c79321c5.js";import{e as l}from"./emitter.233282e9.js";import{_ as C}from"./lodash.d9f7faa7.js";import{r as i,A as x,ai as _,o as w,c as B,a as u,J as W,U as d,u as h,O as y,S as M,F as H}from"./vue.adf17aba.js";import"./index.34b03be2.js";import"./elementPlus.4833989a.js";import"./echarts.72dc8373.js";const S={style:{"padding-top":"8px"}},z=["src"],k={__name:"CropperLogo",setup(F){const s=i(),r=i({width:100,height:100}),e=i({img:"",size:1,info:!1,autoCrop:!0,autoCropWidth:600,autoCropHeight:100,canScale:!1,full:!1,fixedBox:!0,centerBox:!0,canMove:!1,enlarge:1,mode:"contain",original:!1,outputType:"png"}),p=i();let t=1;l.on("logo-src",o=>{e.value.img=o}),l.on("logo-data",o=>{e.value.autoCropWidth=600,e.value.autoCropHeight=100,o.width==600&&o.height==100?t=1:t=Math.min(p.value.offsetWidth/o.width,1);const n=o.width*t,a=o.height*t;r.value.width=n,r.value.height=a,e.value.autoCropWidth=e.value.autoCropWidth*t,e.value.autoCropHeight=e.value.autoCropHeight*t});const c=i("");function f(o){const n=parseInt((o.axis.x1/t).toFixed(0)),a=parseInt((o.axis.y1/t).toFixed(0));l.emit("send-logo-leftTop",{left:n,top:a,width:600,height:100}),s.value.getCropData(v=>{c.value=v})}const g=C.debounce(f,100);return x(()=>{l.all.clear()}),(o,n)=>{const a=_("el-text");return w(),B(H,null,[u("div",{ref_key:"outContianer",ref:p,style:{width:"100%"}},[u("div",{style:W({width:r.value.width+"px",height:r.value.height+"px"})},[d(h(m),{ref_key:"cropper",ref:s,img:e.value.img,canScale:e.value.canScale,full:e.value.full,outputSize:e.value.size,centerBox:e.value.centerBox,autoCrop:e.value.autoCrop,autoCropWidth:e.value.autoCropWidth,autoCropHeight:e.value.autoCropHeight,fixedBox:e.value.fixedBox,canMove:e.value.canMove,mode:e.value.mode,info:e.value.info,onCropMoving:h(g)},null,8,["img","canScale","full","outputSize","centerBox","autoCrop","autoCropWidth","autoCropHeight","fixedBox","canMove","mode","info","onCropMoving"])],4)],512),u("div",S,[d(a,{class:"mx-1"},{default:y(()=>[M("预览:")]),_:1}),u("img",{src:c.value,style:{width:"40%"}},null,8,z)])],64)}}},U=k;export{U as default};