mirror of
https://gitee.com/myxzgzs/boyuehasfj-vue3.git
synced 2025-08-08 15:12:41 +08:00
2 lines
33 KiB
JavaScript
2 lines
33 KiB
JavaScript
![]() |
import{C as t,c as e,o as i,i as s,f as h,F as o,R as r,aE as a,a5 as c,B as n,_ as p,b as l,d as u,r as d,O as g,j as f,e as m,k as w,w as v,h as C,m as x,P as y}from"./index-C-c3zR6K.js";import{b}from"./user-DdZ7lTRu.js";const O={};O.getData=t=>new Promise(((e,i)=>{let s={};(function(t){let e=null;return new Promise(((i,s)=>{if(t.src)if(/^data\:/i.test(t.src))e=function(t,e){e=e||t.match(/^data\:([^\;]+)\;base64,/im)[1]||"",t=t.replace(/^data\:([^\;]+)\;base64,/gim,"");for(var i=atob(t),s=i.length%2==0?i.length:i.length+1,h=new ArrayBuffer(s),o=new Uint16Array(h),r=0;r<s;r++)o[r]=i.charCodeAt(r);return h}(t.src),i(e);else if(/^blob\:/i.test(t.src)){var h=new FileReader;h.onload=function(t){e=t.target.result,i(e)},function(t,e){var i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType="blob",i.onload=function(t){(200==this.status||0===this.status)&&e(this.response)},i.send()}(t.src,(function(t){h.readAsArrayBuffer(t)}))}else{var o=new XMLHttpRequest;o.onload=function(){if(200!=this.status&&0!==this.status)throw"Could not load image";e=o.response,i(e),o=null},o.open("GET",t.src,!0),o.responseType="arraybuffer",o.send(null)}else s("img error")}))})(t).then((t=>{s.arrayBuffer=t;try{s.orientation=function(t){var e,i,s,h,o,r,a,c,n,p,l=new DataView(t),u=l.byteLength;if(255===l.getUint8(0)&&216===l.getUint8(1))for(n=2;n<u;){if(255===l.getUint8(n)&&225===l.getUint8(n+1)){a=n;break}n++}if(a&&(i=a+4,s=a+10,"Exif"===function(t,e,i){var s,h="";for(s=e,i+=e;s<i;s++)h+=String.fromCharCode(t.getUint8(s));return h}(l,i,4)&&(r=l.getUint16(s),((o=18761===r)||19789===r)&&42===l.getUint16(s+2,o)&&(h=l.getUint32(s+4,o),h>=8&&(c=s+h)))),c)for(u=l.getUint16(c,o),p=0;p<u;p++)if(n=c+12*p+2,274===l.getUint16(n,o)){n+=8,e=l.getUint16(n,o);break}return e}(t)}catch(i){s.orientation=-1}e(s)})).catch((t=>{i(t)}))}));const X=(t,e)=>{const i=t.__vccOpts||t;for(const[s,h]of e)i[s]=h;return i},H=t({data:function(){return{w:0,h:0,scale:1,x:0,y:0,loading:!0,trueWidth:0,trueHeight:0,move:!0,moveX:0,moveY:0,crop:!1,cropping:!1,cropW:0,cropH:0,cropOldW:0,cropOldH:0,canChangeX:!1,canChangeY:!1,changeCropTypeX:1,changeCropTypeY:1,cropX:0,cropY:0,cropChangeX:0,cropChangeY:0,cropOffsertX:0,cropOffsertY:0,support:"",touches:[],touchNow:!1,rotate:0,isIos:!1,orientation:0,imgs:"",coe:.2,scaling:!1,scalingSet:"",coeStatus:"",isCanShow:!0}},props:{img:{type:[String,Blob,null,File],default:""},outputSize:{type:Number,default:1},outputType:{type:String,default:"jpeg"},info:{type:Boolean,default:!0},canScale:{type:Boolean,default:!0},autoCrop:{type:Boolean,default:!1},autoCropWidth:{type:[Number,String],default:0},autoCropHeight:{type:[Number,String],default:0},fixed:{type:Boolean,default:!1},fixedNumber:{type:Array,default:()=>[1,1]},fixedBox:{type:Boolean,default:!1},full:{type:Boolean,default:!1},canMove:{type:Boolean,default:!0},canMoveBox:{type:Boolean,default:!0},original:{type:Boolean,default:!1},centerBox:{type:Boolean,default:!1},high:{type:Boolean,default:!0},infoTrue:{type:Boolean,default:!1},maxImgSize:{type:[Number,String],default:2e3},enlarge:{type:[Number,String],default:1},preW:{type:[Number,String],default:0},mode:{type:String,default:"contain"},limitMinSize:{type:[Number,Array,String],default:()=>10,validator:function(t){return Array.isArray(t)?Number(t[0])>=0&&Number(t[1])>=0:Number(t)>=0}},fillColor:{type:String,default:""}},computed:{cropInfo(){let t={};if(t.top=this.cropOffsertY>21?"-21px":"0px",t.width=this.cropW>0?this.cropW:0,t.height=this.cropH>0?this.cropH:0,this.infoTrue){let e=1;this.high&&!this.full&&(e=window.devicePixelRatio),1!==this.enlarge&!this.full&&(e=Math.abs(Number(this.enlarge))),t.width=t.width*e,t.height=t.height*e,this.full&&(t.width=t.width/this.scale,t.height=t.height/this.scale)}return t.width=t.width.toFixed(0),t.height=t.height.toFixed(0),t},isIE:()=>!!window.ActiveXObject||"ActiveXObject"in window,passive(){return this.isIE?null:{passive:!1}}},watch:{img(){this.checkedImg()},imgs(t){""!==t&&this.reload()},cropW(){this.showPreview()},cropH(){this.showPreview()},cropOffsertX(){this.showPreview()},cropOffsertY(){this.showP
|