12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1d9e4e87"],{"0100":function(t,e,i){},1282:function(t,e,i){"use strict";var n=i("5a0c"),r=i.n(n);r.a},"2f7e":function(t,e,i){(function(e,i){t.exports=i()})(0,(function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.i=function(t){return t},i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=23)}({23:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={url:{type:String},text:{type:String,default:"Upload Image"},extensions:{type:String,default:"png,jpg,jpeg,gif,svg,webp"},inputOfFile:{type:String,default:"files"},crop:{type:[String,Boolean],default:""},cropBtn:{type:Object,default:function(){return{ok:"Ok",cancel:"Cancel"}}},cropRatio:{type:String,default:"1:1"},resize:{type:[String,Boolean],default:!1},rotate:{type:Boolean,default:!1},ResizeBtn:{type:Object,default:function(){return{ok:"Ok",cancel:"Cancel"}}},maxFileSize:{type:Number,default:104857600},maxWidth:{type:Number},maxHeight:{type:Number},fixedWidth:{type:Number},fixedHeight:{type:Number},inputAccept:{type:String,default:"image/jpg,image/jpeg,image/png,image/gif"},isXhr:{type:Boolean,default:!0},headers:{type:Object,default:function(){return{}}},data:{type:Object,default:function(){return{}}},multiple:{type:Boolean,default:!1},multipleSize:{type:Number,default:0},minWidth:{type:Number,default:50},compress:{type:[Number,String],default:0},credentials:{type:[String,Boolean],default:!0}}}})}))},"34f5":function(t,e,i){"use strict";var n=i("0100"),r=i.n(n);r.a},"3b0f":function(t,e,i){(function(e,i){t.exports=i()})(0,(function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.i=function(t){return t},i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=13)}({0:function(t,e,i){"use strict";t.exports={isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),setCssText:function(t){var e=[];return Object.keys(t).forEach((function(i){var n=t[i];"number"===typeof n&&(n+="px"),e.push(i+": "+n+";")})),e.join("")},isFunction:function(t){return"function"===typeof t}}},13:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=s;var n=i(0),r=o(n);function o(t){return t&&t.__esModule?t:{default:t}}var a=r.default.isMobile;function s(t,e,i){if(e){var n=a?t.changedTouches[0]["clientX"]:t.clientX,r=a?t.changedTouches[0]["clientY"]:t.clientY,o=n-i.x,s=r-i.y;return o<=i.minLeft&&(o=i.minLeft),o>=i.maxLeft&&(o=i.maxLeft),s<=i.minTop&&(s=i.minTop),s>=i.maxTop&&(s=i.maxTop),{left:o,top:s}}}}})}))},4548:function(t,e,i){},"5a0c":function(t,e,i){},"85fc":function(t,e,i){(function(e,i){t.exports=i()})("undefined"!==typeof self&&self,(function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e,i){"use strict";var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},o=function(t){return"number"===typeof t},a=/[./](png|jpeg|jpg|gif|bmp)/,s={ratio:1,compress:80,enableWebWorker:!1};t.exports={setConfig:function(t){this._config=r(s,t)},init:function(t,e){var i=this,n=t.split(";"),r=null,o=this._createImage(t);n.length>1&&(r=n[0].replace("data:","")),o.onload=function(){var t=i._getCanvas(o.naturalWidth,o.naturalHeight),n=t.getContext("2d");n.drawImage(o,0,0);var a=t.toDataURL(r);e(a)}},base64:function(t,e){var i=this._getSrc(t),n=i.src,r=i.type;if("file"===r)return this._readFile(n,e);if("video"===r){var o=t,a=this._getCanvas(o.videoWidth,o.videoHeight),s=a.getContext("2d");s.drawImage(o,0,0);var h=a.toDataURL();e(h,a)}return this.init(n,e)},compress:function(t,e,i){var n=this,r=this._getSrc(t),o=r.src,a=r.type;if("file"===a)return this._readFile(o,(function(r){n._compress(r,t,e,i)}));this._compress(o,t,e,i)},_compress:function(t,e,i,n){var r=this;this._loadImage(t,(function(t){var o=r._getImageType(e),a=r._getCanvas(t.naturalWidth,t.naturalHeight),s=a.getContext("2d");s.drawImage(t,0,0);var h=a.toDataURL(o,i/100);n(h)}))},crop:function(t,e,i){var n=this,r=this._getSrc(t),o=r.src,a=r.type;if("file"===a)return this._readFile(o,(function(r){n._crop(r,t,e,i)}));this._crop(o,t,e,i)},_crop:function(t,e,i,n){var r=this;this._loadImage(t,(function(t){if(!i.w&&i.width&&(i.w=i.width,i.h=i.height),o(i.x)&&o(i.y)&&i.w>0&&i.h>0){var a=i.w,s=i.h;i.maxWidth&&i.maxWidth<a&&(a=i.maxWidth,s=i.h*a/i.w),i.maxHeight&&i.maxHeight<s&&(s=i.maxHeight),i.fixedWidth&&i.fixedHeight&&(a=i.fixedWidth,s=i.fixedHeight);var h=r._getCanvas(a,s);h.getContext("2d").drawImage(t,i.x,i.y,i.w,i.h,0,0,a,s);var c=r._getImageType(e),u=h.toDataURL(c,i.compress/100);n(u)}}))},resize:function(t,e,i){var r=this,o=this._getSrc(t),a=o.src,h=o.type,c={};if("number"!==typeof e&&"string"!==typeof e||(c={ratio:e,compress:s.compress}),"object"===("undefined"===typeof e?"undefined":n(e))&&(c=e),"file"===h)return this._readFile(a,(function(e){r._resize(e,t,c,i)}));this._resize(a,t,c,i)},_resize:function(t,e,i,n){var r=this;function o(t,e,i,n){return t/e===i/n}this._loadImage(t,(function(a){var s=a.naturalWidth,h=a.naturalHeight,c=s/h;if(i.ratio>0)s=Math.floor(a.naturalWidth*i.ratio),h=Math.floor(a.naturalHeight*i.ratio);else if("number"===typeof i.width&&"number"===typeof i.height)if(o(i.width,i.height,s,h)){if(s>i.width||h>i.height)return i.x=(s-i.width)/2,i.y=(h-i.height)/2,r._crop(t,e,i,n);if(s<i.width)return s=i.width,h=s/c,i.x=0,i.y=(h-i.height)/2,r._crop(t,e,i,n);if(h<i.height)return h=i.height,s=h*c,i.y=0,i.x=(s-i.width)/2,r._crop(t,e,i,n)}else s=Math.floor(i.width),h=Math.floor(i.height);var u=r._getCanvas(s,h);u.getContext("2d").drawImage(a,0,0,a.naturalWidth,a.naturalHeight,0,0,s,h);var l=r._getImageType(e),f=u.toDataURL(l,i.compress/100);n(f)}))},rotate:function(t,e,i){var n=this,r=this._getSrc(t),o=r.src,a=r.type;return"file"===a?this._readFile(o,(function(){n._rotate(o,t,e,i)})):e%360===0?i(o):void this._rotate(o,t,e,i)},_rotate:function(t,e,i,n){var r=this;this._loadImage(t,(function(t){var o=t.naturalWidth,a=t.naturalHeight;i%=360,90!==i&&270!==i||(o=t.naturalHeight,a=t.naturalWidth);var s=r._getCanvas(o,a),h=s.getContext("2d");h.clearRect(0,0,o,a),h.fillStyle="white",h.fillRect(0,0,o,a),h.translate(o/2,a/2),h.rotate(i*Math.PI/180),h.drawImage(t,-t.naturalWidth/2,-t.naturalHeight/2);var c=r._getImageType(e),u=s.toDataURL(c,1);n(u,o,a),s=null,h=null}))},_loadImage:function(t,e){var i=this._createImage(t);i.onload=function(){e(i)}},_readFile:function(t,e){var i=new FileReader;i.onload=function(t){var i=t.target.result;e(i)},i.readAsDataURL(t)},_getCanvas:function(t,e){var i=document.createElement("canvas");return i.width=t,i.height=e,i},_createImage:function(t){var e=new Image;return e.src=t,e.crossOrigin="anonymous",e},_getSrc:function(t){var e=t,i="url";if(this._isImageElement(t)){var n=t.src;if(!n)throw new Error("Element must hava src");e=n,i="element"}else this._isVideoElement(t)?(e=t,i="video"):this._isFileObject(t)&&(e=t,i="file");return{src:e,type:i}},_isFileObject:function(t){return"object"===("undefined"===typeof t?"undefined":n(t))&&t.type&&t.size>0},_isImageElement:function(t){return"object"===("undefined"===typeof t?"undefined":n(t))&&"IMG"===t.tagName},_isVideoElement:function(t){return"object"===("undefined"===typeof t?"undefined":n(t))&&"VIDEO"===t.tagName},_getImageType:function(t){var e=this._getSrc(t),i=e.src,n=e.type,r="image/jpeg";if("file"===n){var o=t.type,s=o.match(/(image\/[\w]+)\.*/)[0];"undefined"!==typeof s&&(r=s)}else{var h=a.exec(i);h&&h[1]&&(r="image/"+h[1])}return r}}}])}))},"8de6":function(t,e,i){(function(e,i){t.exports=i()})(0,(function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.i=function(t){return t},i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=22)}({0:function(t,e,i){"use strict";t.exports={isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),setCssText:function(t){var e=[];return Object.keys(t).forEach((function(i){var n=t[i];"number"===typeof n&&(n+="px"),e.push(i+": "+n+";")})),e.join("")},isFunction:function(t){return"function"===typeof t}}},22:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=h;var n=i(0),r=o(n);function o(t){return t&&t.__esModule?t:{default:t}}var a=r.default.isMobile,s=document.body.offsetWidth;function h(t,e,i,n,r){if(!e)return null;var o=document.body.offsetHeight,h=1/r,c=parseFloat(window.getComputedStyle(i).width),u=parseFloat(window.getComputedStyle(i).height),l=document.querySelector(".info-aside"),f=(s-c)/2,d=parseFloat(window.getComputedStyle(l).height),p=(o-u-d)/2,g=a?t.changedTouches[0]["clientX"]:t.clientX,A=a?t.changedTouches[0]["clientY"]:t.clientY,m=e.offsetWidth,v=e.offsetHeight,y={};return r>=1&&g<=f+c?(m>=c&&(y.width=c),y.width=n.w+g-n.x,y.height=m*h,c>u?m>u&&(y.height=u,y.width=u*r):c<u?m>c&&(y.width=c,y.height=c*h):m>=c&&(y.width=c,y.height=c*h)):r<1&&A<p+u+d?(y.height=n.h+A-n.y,y.width=v*r,c>u?v>u&&(y.height=u,y.width=u*r):m>c&&(y.width=c,y.height=c*h)):"auto"===r&&A<=p+u+d&&g<=p+c?(y.height=n.h+A-n.y,y.width=n.w+g-n.x):g<=f+c&&(y.width=n.w+g-n.x,y.height=e.style.width,c>u?v>u&&(y.height=u,y.width=u):c<u?m>c&&(y.width=c,y.height=c):m>c&&(y.width=c,e.style.height=c)),y}}})}))},a606:function(t,e,i){"use strict";var n=i("db19"),r=i.n(n);r.a},bb09:function(t,e,i){(function(e,i){t.exports=i()})(0,(function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.i=function(t){return t},i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=14)}({14:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n="data:image/gif;base64,R0lGODlhGAAYAPQAAP///3FxcePj4/v7++3t7dLS0vHx8b+/v+Dg4MfHx+jo6M7Oztvb2/f397Kysru7u9fX16qqqgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJBwAAACwAAAAAGAAYAAAFriAgjiQAQWVaDgr5POSgkoTDjFE0NoQ8iw8HQZQTDQjDn4jhSABhAAOhoTqSDg7qSUQwxEaEwwFhXHhHgzOA1xshxAnfTzotGRaHglJqkJcaVEqCgyoCBQkJBQKDDXQGDYaIioyOgYSXA36XIgYMBWRzXZoKBQUMmil0lgalLSIClgBpO0g+s26nUWddXyoEDIsACq5SsTMMDIECwUdJPw0Mzsu0qHYkw72bBmozIQAh+QQJBwAAACwAAAAAGAAYAAAFsCAgjiTAMGVaDgR5HKQwqKNxIKPjjFCk0KNXC6ATKSI7oAhxWIhezwhENTCQEoeGCdWIPEgzESGxEIgGBWstEW4QCGGAIJEoxGmGt5ZkgCRQQHkGd2CESoeIIwoMBQUMP4cNeQQGDYuNj4iSb5WJnmeGng0CDGaBlIQEJziHk3sABidDAHBgagButSKvAAoyuHuUYHgCkAZqebw0AgLBQyyzNKO3byNuoSS8x8OfwIchACH5BAkHAAAALAAAAAAYABgAAAW4ICCOJIAgZVoOBJkkpDKoo5EI43GMjNPSokXCINKJCI4HcCRIQEQvqIOhGhBHhUTDhGo4diOZyFAoKEQDxra2mAEgjgh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IDaiMECwcFRgQCCowiCAcHCZIlCgICVgSfCEMMnA0CXaU2YSQFoQAKUQMMqjoyAglcAAyBAAIMRUYLCUkFlybDeAYJryLNk6xGNCTQXY0juHghACH5BAkHAAAALAAAAAAYABgAAAWzICCOJNA0ZVoOAmkY5KCSSgSNBDE2hDyLjohClBMNij8RJHIQvZwEVOpIekRQJyJs5AMoHA+GMbE1lnm9EcPhOHRnhpwUl3AsknHDm5RN+v8qCAkHBwkIfw1xBAYNgoSGiIqMgJQifZUjBhAJYj95ewIJCQV7KYpzBAkLLQADCHOtOpY5PgNlAAykAEUsQ1wzCgWdCIdeArczBQVbDJ0NAqyeBb64nQAGArBTt8R8mLuyPyEAOwAAAAAAAAAAAA==";e.default=n}})}))},d825:function(t,e,i){"use strict";var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};void 0===XMLHttpRequest.prototype.sendAsBinary&&(XMLHttpRequest.prototype.sendAsBinary=function(t){var e=Array.prototype.map.call(t,(function(t){return 255&t.charCodeAt(0)}));this.send(new Uint8Array(e).buffer)}),t.exports=function(t,e,i,r,o,a,s,h){var c=new XMLHttpRequest,u=a||function(){console.error("AJAX ERROR!")},l="webcodeimageupload",f=!1;"blob"===t&&(f=t,t="GET"),t=t.toUpperCase(),c.onload=function(){var e=c.response;try{e=JSON.parse(c.responseText)}catch(n){401===c.status&&(e=u("access_denied",c.statusText))}var i=b(c.getAllResponseHeaders());i.statusCode=c.status,o(e||("GET"===t?u("empty_response","Could not get resource"):{}),i)},c.onerror=function(){var t=c.responseText;try{t=JSON.parse(c.responseText)}catch(e){console.error(e)}o(t||u("access_denied","Could not get resource"))};var d=void 0;if("GET"===t||"DELETE"===t)r=null;else if(s){var p=r,g=r.base64Code.replace("data:"+r.type+";base64,","");r=["--"+l,'Content-Disposition: form-data; name="'+r.filed+'"; filename="'+r.filename+'"',"Content-Type: "+r.type,"",window.atob(g),""].join("\r\n");var A=Object.keys(p);if(A.length>4){var m=!0,v=!1,y=void 0;try{for(var C,x=A[Symbol.iterator]();!(m=(C=x.next()).done);m=!0){var w=C.value;-1==["filed","filename","type","base64Code"].indexOf(w)&&(r+=["--"+l,'Content-Disposition: form-data; name="'+w+'";',"",""].join("\r\n"),r+=["object"===n(p[w])?JSON.stringify(p[w]):encodeURI(p[w]),""].join("\r\n"))}}catch(a){v=!0,y=a}finally{try{!m&&x.return&&x.return()}finally{if(v)throw y}}}r+="--"+l+"--"}if(c.open(t,e,!0),f&&("responseType"in c?c.responseType=f:c.overrideMimeType("text/plain; charset=x-user-defined")),i)for(d in i)c.setRequestHeader(d,i[d]);return c.withCredentials="undefined"===typeof h||h,s?(c.setRequestHeader("Content-Type","multipart/form-data; boundary="+l),c.sendAsBinary(r)):(c.send(r),c);function b(t){var e={},i=/([a-z\-]+):\s?(.*);?/gi,n=void 0;while(n=i.exec(t))e[n[1]]=n[2];return e}}},db19:function(t,e,i){},e7f6:function(t,e,i){"use strict";var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"g-core-image-upload-btn"},[t._t("default",[t._v(t._s(t.text))]),i("form",{directives:[{name:"show",rawName:"v-show",value:!t.hasImage,expression:"!hasImage"}],staticClass:"g-core-image-upload-form",attrs:{method:"post",enctype:"multipart/form-data",action:""}},[i("input",{attrs:{disabled:t.uploading,name:t.name,multiple:t.multiple,type:"file",accept:t.inputAccept},on:{change:t.change,dragover:t.dragover,dragenter:t.dragover,dragleave:t.dragleave,dragend:t.dragleave,drop:t.dragleave}})]),i("div",{directives:[{name:"show",rawName:"v-show",value:t.hasImage,expression:"hasImage"}],staticClass:"g-core-image-corp-container"},[i("crop",{ref:"cropBox",attrs:{"is-resize":t.resize&&!t.crop,ratio:t.cropRatio,"is-rotate":t.rotate}}),i("div",{staticClass:"info-aside"},[i("p",{staticClass:"btn-groups rotate-groups",staticStyle:{display:"none"}},[i("button",{staticClass:"btn btn-rotate",attrs:{type:"button"},on:{click:t.doRotate}},[t._v("↺")]),i("button",{staticClass:"btn btn-reverserotate",attrs:{type:"button"},on:{click:t.doReverseRotate}},[t._v("↻")])]),t.crop?i("p",{staticClass:"btn-groups"},[i("button",{staticClass:"btn btn-upload",attrs:{type:"button"},on:{click:t.doCrop}},[t._v(t._s(t.cropBtn.ok))]),i("button",{staticClass:"btn btn-cancel",attrs:{type:"button"},on:{click:t.cancel}},[t._v(t._s(t.cropBtn.cancel))])]):t._e(),t.resize&&!t.crop?i("p",{staticClass:"btn-groups"},[i("button",{staticClass:"btn btn-upload",attrs:{type:"button"},on:{click:t.doResize}},[t._v(t._s(t.ResizeBtn.ok))]),i("button",{staticClass:"btn btn-cancel",attrs:{type:"button"},on:{click:t.cancel}},[t._v(t._s(t.ResizeBtn.cancel))])]):t._e()])],1)],2)},r=[],o=(i("cc57"),i("6d57"),i("e10e"),i("3bf2")),a=(i("9dd9"),i("9a33"),i("f548"),i("d825")),s=i.n(a),h=i("85fc"),c=i.n(h),u=i("bb09"),l=i.n(u),f=i("2f7e"),d=i.n(f),p=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"image-aside"},[i("div",{staticClass:"g-crop-image-box"},[i("div",{staticClass:"g-crop-image-principal",on:{touchstart:t.drag,":mousedown":t.drag}},[i("div",{staticClass:"image-wrap",style:{width:t.width+"px",height:t.height+"px",left:t.left+"px",top:t.top+"px",backgroundImage:"url("+t.src+")",cursor:t.isResize?"default":"move"}},[i("img",{ref:"crop-image",staticStyle:{width:"0",height:"0"},attrs:{src:t.src}})]),t.isResize?t._e():i("div",{staticClass:"image-mask"},[i("div",{staticClass:"mask top",style:{top:0,height:t.cropCSS.top+"px",left:0,width:"100%"}}),i("div",{staticClass:"mask bottom",style:{bottom:0,top:t.cropCSS.top+t.cropCSS.height+"px",left:0,width:"100%"}}),i("div",{staticClass:"mask left",style:{top:t.cropCSS.top+"px",height:t.cropCSS.height+"px",left:0,width:t.cropCSS.left+"px"}}),i("div",{staticClass:"mask right",style:{top:t.cropCSS.top+"px",height:t.cropCSS.height+"px",left:t.cropCSS.left+t.cropCSS.width+"px",right:0}})]),t.isResize?t._e():i("div",{staticClass:"crop-box",style:{top:t.cropCSS.top+"px",left:t.cropCSS.left+"px",height:t.cropCSS.height+"px",width:t.cropCSS.width+"px"}},[i("div",{staticClass:"reference-line v"}),i("div",{staticClass:"reference-line h"}),i("a",{staticClass:"g-resize",on:{touchstart:function(e){return e.target!==e.currentTarget?null:t.resize(e)},mousedown:function(e){return e.target!==e.currentTarget?null:t.resize(e)}}})])]),t.resize?i("resize-bar",{ref:"resizeBar",on:{resize:t.resizeImage}}):t._e(),t.isRotate?i("rotate-bar",{on:{rotate:t.rotateImage}}):t._e()],1)])},g=[],A=(i("163d"),i("3b0f")),m=i.n(A),v=i("8de6"),y=i.n(v),C=i("eb01"),x=i.n(C),w=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"g-resize-bar"},[i("div",{staticClass:"g-resize-highlight",style:{width:t.left+"%"}}),i("button",{staticClass:"circle-btn",style:{left:t.left+"%"},on:{touchstart:function(e){return e.target!==e.currentTarget?null:t.drag(e)},mousedown:function(e){return e.target!==e.currentTarget?null:t.drag(e)}}})])},b=[],S={props:{minProgress:{type:[Number,String],default:0}},data:function(){return{progress:100,left:100}},methods:{setProgress:function(t){this.left=t},drag:function(t){t.preventDefault(),t.stopPropagation();var e=t.target;this.el=e;var i=this.$el.parentElement,n=this,r=x.a.isMobile,o=200,a={x:(r?t.touches[0]["clientX"]:t.clientX)-e.offsetLeft,y:(r?t.touches[0]["clientY"]:t.clientY)-e.offsetTop,maxLeft:o,maxTop:parseInt(i.style.height)-parseInt(e.style.height),minLeft:0,minTop:0},s=function(t){var e=m()(t,n.el,a);if(e){if(e.left/o<n.minProgress)return;n.progress=(e.left-o/2)/o,n.left=e.left/o*100,n.$emit("resize",n.progress)}},h=function t(e){if(n.el=null,r)return document.removeEventListener("touchmove",s,!1),void document.removeEventListener("touchend",t,!1);document.removeEventListener("mousemove",s,!1),document.removeEventListener("mouseup",t,!1)};if(r)return document.addEventListener("touchmove",s,!1),void document.addEventListener("touchend",h,!1);document.addEventListener("mousemove",s,!1),document.addEventListener("mouseup",h,!1)}}},_=S,I=(i("ffe6"),i("623f")),B=Object(I["a"])(_,w,b,!1,null,"6844435b",null),E=B.exports,M=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"g-rotate-bar"},[i("a",{attrs:{href:"javascript:;"},on:{click:t.rotateLeft}},[i("svg",{staticClass:"svg-icon",attrs:{viewBox:"0 0 481.95 481.95"}},[i("path",{attrs:{d:"M281.7,243.8V138.2c75.9,13.5,135.4,78.6,135.4,159.8s-59.6,146.3-135.4,159.8V512\n c105.7-13.5,189.6-102.9,189.6-214s-84-200.5-189.6-214V0L159.8,121.9L281.7,243.8z M94.8,270.9c2.7-24.4,13.5-46.1,27.1-67.7\n L84,165.2C59.6,197.8,46.1,233,40.6,270.9H94.8z M159.8,430.7l-37.9,37.9c32.5,24.4,67.7,37.9,105.7,43.3v-54.2\n C203.2,455.1,181.5,444.3,159.8,430.7z M94.8,325.1H40.6c2.7,37.9,19,73.1,43.3,105.7l37.9-37.9\n C108.4,371.1,97.5,349.5,94.8,325.1z",fill:"#27ae60"}})])]),i("a",{attrs:{href:"javascript:;"},on:{click:t.rotateRight}},[i("svg",{staticClass:"svg-icon",attrs:{viewBox:"0 0 481.95 481.95"}},[i("path",{attrs:{d:"M331.5,114.75L216.75,0v79.05C117.3,91.8,38.25,175.95,38.25,280.5s79.05,188.7,178.5,201.45v-51 C145.35,418.2,89.25,357,89.25,280.5s56.1-137.7,127.5-150.45v99.45L331.5,114.75z M443.7,255 c-5.101-35.7-17.851-68.85-40.8-99.45l-35.7,35.7c12.75,20.4,22.95,40.8,25.5,63.75H443.7z M267.75,430.95v51 c35.7-5.101,68.85-17.851,99.45-40.8l-35.7-35.7C311.1,418.2,290.7,428.4,267.75,430.95z M367.2,369.75l35.7,35.7 c22.949-30.601,38.25-63.75,40.8-99.45h-51C390.15,328.95,379.95,349.35,367.2,369.75z",fill:"#27ae60"}})])])])},O=[],R={data:function(){return{rotateDegree:0}},methods:{rotateRight:function(){this.rotateDegree+=90,this.$emit("rotate",this.rotateDegree)},rotateLeft:function(){this.rotateDegree-=90,this.$emit("rotate",this.rotateDegree)}}},Q=R,H=(i("a606"),Object(I["a"])(Q,M,O,!1,null,null,null)),L=H.exports,D=75,j=(x.a.isMobile,window.innerWidth-60),k=window.innerHeight-110,W={components:{ResizeBar:E,RotateBar:L},props:{ratio:{type:String,default:"1:1"},minWidth:{type:Number,default:50},minHeight:{type:Number,default:50},isResize:{type:[Boolean],default:!1},isRotate:{type:[Boolean],default:!0}},data:function(){return{src:l.a,width:24,height:24,initWidth:24,initHeight:24,left:0,top:0,cropCSS:{}}},methods:{setImage:function(t,e,i){this.src=t,this.originSrc||this.setOriginalSrc(this.src),this.ratio.indexOf(":")>0?(this.ratioW=this.ratio.split(":")[0],this.ratioH=this.ratio.split(":")[1],this.ratioVal=this.ratioW/this.ratioH):(this.ratioW=1,this.ratioH=1,this.ratioVal=this.ratio),this.natrualWidth=e,this.natrualHeight=i,this.setLayout(e,i);var n=this.$refs.resizeBar;return this.isResize?n.setProgress(100):n.setProgress(50),this.imgChangeRatio},setOriginalSrc:function(t){this.originSrc=t},resizeImage:function(t){var e,i;this.isResize?(e=this.natrualWidth*this.imgChangeRatio*t,i=this.natrualHeight*this.imgChangeRatio*t):(e=this.initWidth+t*(this.natrualWidth-this.initWidth),i=this.initHeight+t*(this.natrualHeight-this.initHeight)),e<=this.minWidth||i<this.minHeight||(this.left+=(this.width-e)/2,this.top+=(this.height-i)/2,this.width=e,this.height=i,this.imgChangeRatio=this.width/this.natrualWidth)},rotateImage:function(t){var e=this;c.a.rotate2(this.originSrc,t,(function(t,i,n){e.setImage(t,i,n)}))},setLayout:function(t,e){var i=k,n=j,r=t,o=e,a=0,s=0,h=r/o,c=n/i;h>c?(o=i,r=i*h,a=(n-i*h)/2):(r=i*h,o=i,a=(n-i*h)/2),this._setStyle(r,o,a,s,h,!0)},_setStyle:function(t,e,i,n,r,o){var a=this.$el.querySelector(".g-crop-image-principal");o||(this.marginLeft=this.marginLeft+(this.width-t)/2,this.marginTop=this.marginTop+(this.height-e)/2),a.style.cssText="width:"+t+"px;height:"+e+"px;margin-left:"+i+"px;margin-top:"+n+"px",this.setCropBox(t,e),this.isResize?(this.width=t,this.height=e):(r>=this.cropCSS.width/this.cropCSS.height?(this.height=this.cropCSS.height,this.width=this.height*r):(this.width=this.cropCSS.width,this.height=this.width/r),this.initWidth=this.width,this.initHeight=this.height,this.left=(t-this.width)/2,this.top=(e-this.height)/2),this.imgChangeRatio=this.width/this.natrualWidth},setCropBox:function(t,e,i){if(!this.isResize){var n=this.__find(".crop-box"),r=(this.$el,t),o=e,a=this.ratioW,s=this.ratioH,h=r;j<t&&(h=j);var c=h/100*D,u={width:c,height:c/a*s};if(u.left=(r-c)/2,u.top=(o-u.height)/2,n.style.cssText=x.a.setCssText(u),u.height>o){var l=o/100*D;u.height=l,u.width=u.height*a/s,u.left=(r-u.width)/2,u.top=(o-u.height)/2,n.style.cssText=x.a.setCssText(u)}this.cropCSS=u}},getCropData:function(){return this.isResize?{imgChangeRatio:this.imgChangeRatio,x:0,y:0,w:this.natrualWidth,h:this.natrualHeight}:{x:(this.cropCSS.left-this.left)/this.imgChangeRatio,y:(this.cropCSS.top-this.top)/this.imgChangeRatio,w:this.cropCSS.width/this.imgChangeRatio,h:this.cropCSS.height/this.imgChangeRatio}},getCropImage:function(){return this.$refs["crop-image"]},__find:function(t){var e=this.$el;return e.querySelector(t)},resize:function(t){if(t.stopPropagation(),this.ratio.indexOf(":")){var e=t.target.parentElement,i=this.__find(".g-crop-image-principal");this._$container&&(this._$container=container);var n=this,r={x:x.a.isMobile?t.touches[0].clientX:t.clientX,y:x.a.isMobile?t.touches[0].clientY:t.clientY,w:e.offsetWidth,h:e.offsetHeight};this.el=e,this.container=i;var o=this._getMaxCropAreaWidth(),a=function(t){var e=y()(t,n.el,i,r,n.ratioVal);e&&(e.width<=o.maxWidth||e.height<=o.maxHeight)&&(n.cropCSS.width=e.width,n.cropCSS.height=e.height)},s=function t(e){this.el=null,x.a.isMobile&&(document.removeEventListener("touchmove",a,!1),document.removeEventListener("touchend",t,!1)),document.removeEventListener("mousemove",a,!1),document.removeEventListener("mouseup",t,!1)};x.a.isMobile&&(document.addEventListener("touchmove",a,!1),document.addEventListener("touchend",s,!1)),document.addEventListener("mousemove",a,!1),document.addEventListener("mouseup",s,!1)}},_getMaxCropAreaWidth:function(){this.__find(".crop-box");return this.width>this.height?{maxWidth:this.height*this.ratioW/this.ratioH,maxHeight:this.height}:{maxWidth:this.width,maxHeight:this.width*this.ratioH/this.ratioW}},drag:function(t){t.preventDefault();var e=this.__find(".image-wrap");this.el=e;var i=this.__find(".crop-box"),n=(t.currentTarget,this),r=x.a.isMobile,o={x:(r?t.touches[0]["clientX"]:t.clientX)-e.offsetLeft,y:(r?t.touches[0]["clientY"]:t.clientY)-e.offsetTop,maxLeft:i.offsetLeft,maxTop:i.offsetTop,minLeft:i.offsetWidth+i.offsetLeft-e.offsetWidth,minTop:i.offsetHeight+i.offsetTop-e.offsetHeight},a=function(t){var e=m()(t,n.el,o);e&&(n.left=e.left,n.top=e.top)},s=function t(e){if(n.el=null,r)return document.removeEventListener("touchmove",a,!1),void document.removeEventListener("touchend",t,!1);document.removeEventListener("mousemove",a,!1),document.removeEventListener("mouseup",t,!1)};if(r)return document.addEventListener("touchmove",a,!1),void document.addEventListener("touchend",s,!1);document.addEventListener("mousemove",a,!1),document.addEventListener("mouseup",s,!1)}}},z=W,T=(i("34f5"),Object(I["a"])(z,p,g,!1,null,"7616bef4",null)),G=T.exports,F="",N={components:{Crop:G,ResizeBar:E},props:d.a,data:function(){return{files:[],hasImage:!1,options:this.props,uploading:!1,image:{src:l.a,width:24,height:24,minProgress:.05}}},computed:{name:function(){return this.multiple?this.inputOfFile+"[]":this.inputOfFile}},methods:{__dispatch:function(t,e,i){this.$emit&&this.$emit(t,e,i)},__find:function(t){return this.$el.querySelector(t)},dragover:function(){this.$el.classList.add("is-dragover")},dragleave:function(){this.$refs.container;this.$el.classList.remove("is-dragover")},change:function(t){var e,i=this,n=t.target.value.replace(/C:\\fakepath\\/i,""),r=n.substring(n.lastIndexOf(".")+1),o=this.extensions.split(",");if(o.length>1){var a=new RegExp("^["+o.join("|")+"]+$","i");if(!a.test(r))return this.__dispatch("errorhandle","TYPE ERROR")}if(t.target.files[0].size>this.maxFileSize)return e=parseInt(this.maxFileSize/1024/1024)>0?(this.maxFileSize/1024/1024).toFixed(2)+"MB":parseInt(this.maxFileSize/1024)>0?(this.maxFileSize/1024).toFixed(2)+"kB":options.maxFileSize.toFixed(2)+"Byte",console.warn("FILE IS TOO LARGER MAX FILE IS "+e),this.__dispatch("errorhandle","FILE IS TOO LARGER MAX FILE IS "+e);if(this.multipleSize>0&&t.target.files.length>this.multipleSize)return console.warn("FILE NUM IS LARGER THAN "+this.multipleSize),this.__dispatch("errorhandle","FILE NUM OVERLOAD");if(this.files=t.target.files,this.crop||this.resize)this.__showImage();else{var s=this.files.length>1?this.files:this.files[0];this.__dispatch("imagechanged",s),this.compress&&"image/png"!==this.files[0]["type"]&&"image/gif"!==this.files[0]["type"]?c.a.compress(s,100-this.compress,(function(t){i.tryAjaxUpload("",!0,t)})):this.tryAjaxUpload()}},__showImage:function(){this.hasImage=!0,this.__readFiles()},__readFiles:function(){var t=new FileReader,e=this;t.onload=function(t){var i=t.target.result;F=document.body.style.overflow,document.body.style.overflow="hidden",e.__initImage(i)},t.readAsDataURL(this.files[0])},__initImage:function(t){var e=new Image,i=this;e.src=t;var n=this.$refs.cropBox;e.onload=function(){i.image.minProgress=i.minWidth/e.naturalWidth,c.a.init(t,(function(t){i.imgChangeRatio=n.setImage(t,e.naturalWidth,e.naturalHeight)}))}},resizeImage:function(t){var e=this.$refs.cropBox;e.resizeImage(t)},doRotate:function(t){var e=this,i=this.$refs.cropBox,n=i.getCropImage();return this.data.compress=100-this.compress,c.a.rotate(n,1,(function(t){e.__initImage(t)}))},doReverseRotate:function(t){var e=this,i=this.$refs.cropBox,n=i.getCropImage();return this.data.compress=100-this.compress,c.a.rotate(n,-1,(function(t){e.__initImage(t)}))},doCrop:function(t){var e=this;this.__setData("crop");var i=this.$refs.cropBox,n=this.__setUpload(t.target);if("local"===this.crop){var r=i.getCropImage();return this.data.compress=100-this.compress,c.a.crop(r,this.data,(function(t){n(t),e.__dispatch("imagechanged",t)}))}n()},doResize:function(t){var e=this;this.__setData("resize");var i=this.$refs.cropBox,n=this.__setUpload(t.target);if("local"===this.resize){var r=i.getCropImage();return this.data.compress=100-this.compress,c.a.resize(r,this.data,(function(t){n(t),e.__dispatch("imagechanged",t)}))}n()},__setData:function(t){"object"!==Object(o["a"])(this.data)&&(this.data={}),this.data["request"]=t;for(var e=this.$refs.cropBox,i=e.getCropData(),n=0,r=Object.keys(i);n<r.length;n++){var a=r[n];this.data[a]=i[a]}this.maxWidth&&(this.data["maxWidth"]=this.maxWidth),this.maxHeight&&(this.data["maxHeight"]=this.maxHeight),this.minWidth&&(this.data["minWidth"]=this.minWidth),this.minHeight&&(this.data["minHeight"]=this.minHeight),this.fixedWidth&&(this.data["fixedWidth"]=this.fixedWidth),this.fixedHeight&&(this.data["fixedHeight"]=this.fixedHeight)},__setUpload:function(t){var e=this;t.value=t.value+"...",t.disabled=!0;var i=function(i){e.tryAjaxUpload((function(){t.value=t.value.replace("...",""),t.disabled=!1}),!!i,i)};return i},cancel:function(){this.hasImage=!1,document.body.style.overflow=F,this.files="";var t=this.$refs.cropBox;t.setOriginalSrc(null),this.$input.value=""},tryAjaxUpload:function(t,e,i){var n=this;this.__dispatch("imageuploading",this.files[0]);var r,a=function(e){"function"===typeof t&&t(),n.uploading=!1,n.cancel(),n.__dispatch("imageuploaded",e,n.data)},h=function(t){n.__dispatch("errorhandle",t)};if(!this.isXhr)return this.crop&&(this.hasImage=!1),console.log(i),a({src:i});if(e)r={type:this.files[0]["type"],filename:this.files[0]["name"],filed:this.inputOfFile,base64Code:i},"object"===Object(o["a"])(this.data)&&(r=Object.assign(this.data,r));else{r=new FormData;for(var c=0;c<this.files.length;c++)r.append(this.name,this.files[c]);if("object"===Object(o["a"])(this.data))for(var u in this.data)void 0!==this.data[u]&&r.append(u,this.data[u])}s()("POST",this.url,this.headers,r,a,h,e,this.credentials)}},mounted:function(){this.$input=this.__find("input")}},P=N,J=(i("1282"),Object(I["a"])(P,n,r,!1,null,null,null));e["a"]=J.exports},eb01:function(t,e,i){(function(e,i){t.exports=i()})(0,(function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.i=function(t){return t},i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e,i){"use strict";t.exports={isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),setCssText:function(t){var e=[];return Object.keys(t).forEach((function(i){var n=t[i];"number"===typeof n&&(n+="px"),e.push(i+": "+n+";")})),e.join("")},isFunction:function(t){return"function"===typeof t}}}])}))},ffe6:function(t,e,i){"use strict";var n=i("4548"),r=i.n(n);r.a}}]);
|