"use strict";(self["webpackChunkhxmini"]=self["webpackChunkhxmini"]||[]).push([[4669],{34669:function(e,t,s){s.r(t),s.d(t,{default:function(){return f}});var r=s(20641);const i=e=>((0,r.Qi)("data-v-5a089473"),e=e(),(0,r.jt)(),e),p={class:"sc-cropper"},a={class:"sc-cropper__img"},o=["src"],c={class:"sc-cropper__preview"},n=i(()=>(0,r.Lk)("h4",null,"图像预览",-1)),l={class:"sc-cropper__preview__img",ref:"preview"};function d(e,t,s,i,d,u){return(0,r.uX)(),(0,r.CE)("div",p,[(0,r.Lk)("div",a,[(0,r.Lk)("img",{src:s.src,ref:"img"},null,8,o)]),(0,r.Lk)("div",c,[n,(0,r.Lk)("div",l,null,512)])])}var u=s(65643),h=s.n(u),g={props:{src:{type:String,default:""},compress:{type:Number,default:1},aspectRatio:{type:Number,default:NaN}},data(){return{crop:null}},watch:{aspectRatio(e){this.crop.setAspectRatio(e)}},mounted(){this.init()},methods:{init(){this.crop=new(h())(this.$refs.img,{viewMode:2,dragMode:"move",responsive:!1,aspectRatio:this.aspectRatio,preview:this.$refs.preview})},setAspectRatio(e){this.crop.setAspectRatio(e)},getCropData(e,t="image/jpeg"){e(this.crop.getCroppedCanvas().toDataURL(t,this.compress))},getCropBlob(e,t="image/jpeg"){this.crop.getCroppedCanvas().toBlob(t=>{e(t)},t,this.compress)},getCropFile(e,t="fileName.jpg",s="image/jpeg"){this.crop.getCroppedCanvas().toBlob(r=>{let i=new File([r],t,{type:s});e(i)},s,this.compress)}}},m=s(66262);const v=(0,m.A)(g,[["render",d],["__scopeId","data-v-5a089473"]]);var f=v}}]);