import{W as g}from"./vue-cropper.es.389d4055.js";import{e as l}from"./emitter.ca07dcc1.js";import{_ as C}from"./lodash.c4b32342.js";import{r as i,p as x,a9 as _,o as B,c as w,a as u,A as M,M as d,u as h,G as W,K as y,F as H}from"./vue.65d9dadc.js";import"./index.373e4c1e.js";import"./elementPlus.c5b0e04f.js";import"./echarts.72dc8373.js";const S={style:{"padding-top":"8px"}},z=["src"],I={__name:"CropperImg-628",setup(k){const p=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"}),s=i();let t;l.on("img-src",o=>{e.value.img=o}),l.on("img-data",o=>{e.value.autoCropWidth=628,e.value.autoCropHeight=628,t=Math.min(s.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 m(o){const n=parseInt((o.axis.x1/t).toFixed(0)),a=parseInt((o.axis.y1/t).toFixed(0));l.emit("send-img628-leftTop",{left:n,top:a,width:628,height:628}),p.value.getCropData(f=>{c.value=f})}const v=C.debounce(m,100);return x(()=>{l.all.clear()}),(o,n)=>{const a=_("el-text");return B(),w(H,null,[u("div",{ref_key:"outContianer",ref:s,style:{width:"100%"}},[u("div",{style:M({width:r.value.width+"px",height:r.value.height+"px"})},[d(h(g),{ref_key:"cropper",ref:p,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(v)},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:W(()=>[y("预览:")]),_:1}),u("img",{src:c.value,style:{width:"30%"}},null,8,z)])],64)}}},E=I;export{E as default};
