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0t3BqeMNaiCMIWwOs9i/eZswE/weoJR/PTX95wFbPZTw9tXFMfpbzS65Y1LtmlJrGhS1VvONN10C0bfY/KsPf8kra5w8AAAAASUVORK5CYII="},SHNa:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=i("mvHQ"),r=i.n(o),n=i("woOf"),a=i.n(n),s=i("YDP2"),c=i.n(s),h=i("YZ0n"),p={components:{VueCropper:h.VueCropper},data:function(){return{isIscDevice:!1,previewImage2:!1,previewImages2:[],radio:"",imgListDialog:!1,httpUrl:"",userData:{},token:"",form:{fieldAcquisitionUrl:"",personType:1,phoneNumber:"",departmentId:"",teamId:"",enterDate:"",enterpriseId:"",idCardBigPhotoUrl:"",jobType:"",jobName:"",personSerial:""},fileList:[],fileList2:[],showPicker:!1,columns:[],columns2:[],pickerList2:[],pickerList:[],checkedIndex:"",checkedIndex2:"",showCalendar:!1,currentDate:new Date,minDate:"",companyList:[],showPicker2:!1,showLoading:!1,repetitionRender:!0,showJob:!1,showJobType:!1,jobList:[],jobList2:[],jobTypeList:[],jobTypeList2:[],checkedJobIndex:"",checkedJobTypeIndex:"",previewImage:!1,previewImages:[c.a],needAudit:0,imgClipDialog:!1,cropperOption:{outputType:"jpeg",size:1,img:"",fixedBox:!0,centerBox:!0,autoCrop:!0,autoCropWidth:100,autoCropHeight:100},isSzProject:"",imgLibraryList:[]}},created:function(){this.httpUrl=rootURL;var e=JSON.parse(localStorage.getItem("infoData"));a()(this.form,e),this.userData=JSON.parse(localStorage.getItem("userData"));var t=new Date(1950,1,1);this.minDate=t,this.getToken(),this.showLoading=!0,this.form.enterDate=this.GetDateStr(0,"-")},methods:{priviewImg:function(e){var t=[e];this.previewImage2=!0,this.previewImages2=t},removeImg:function(){return this.form.fieldAcquisitionUrl="",this.form.personSerial="",!0},checkImg:function(){var e=this;console.log(this.radio),this.imgLibraryList.forEach(function(t){e.radio==t.personSerial&&(e.form.fieldAcquisitionUrl=t.imageUrl,e.form.personSerial=t.personSerial)})},getClipImgFn:function(e){var t=this;this.$refs.cropper.startCrop(),this.$refs.cropper.getCropBlob(function(e){console.log(e);var i=Number(e.size/1024);if(console.log("经过vueCropper裁剪后",i),i<=10||i>=200)return t.$toast("图片裁剪后大小不能超过200kb小于10kb,请重新裁剪或重新上传图片!"),t.fileList=[],void(t.form.fieldAcquisitionUrl="");t.afterRead({file:e},1,"clip")})},getProjectSetting:function(){var e=this,t=this.httpUrl+"xmgl/projectConfig/getProjectConfigList",i={projectSn:this.userData.projectSn};this.$axios.post(t,i,{headers:{Authorization:this.token}}).then(function(t){if(e.showLoading=!1,200==t.data.code){var i=t.data.result;if(console.log(t.data.result[0]),e.isSzProject=t.data.result[0].isSzProject,i&&0!=i.length){var o=i[0].workerAuditType;e.needAudit=o}else e.needAudit=0}else e.$toast(t.data.message)})},GetDateStr:function(e,t,i){var o=i?stringToDate(i,t):new Date;return o.setDate(o.getDate()+e),o.getFullYear()+t+(o.getMonth()+1<10?"0"+(o.getMonth()+1):o.getMonth()+1)+t+(o.getDate()<10?"0"+o.getDate():o.getDate())},goback:function(){this.$router.back()},beforeRead:function(e){console.log(e,777888);return"image/jpeg"!=e.type?(this.$toast("文件类型必须是jpg格式的图片"),!1):e.size<10240?(this.$toast("文件大小不能低于10kb"),!1):!(e.size>204800)||(this.$toast("文件大小不能超过200kb"),!1)},afterRead:function(e,t,i){var o=this;console.log(e),e.status="uploading",e.message="上传中...";var r=new FormData;r.append("files",e.file,"image.jpg");var n=this.httpUrl+"upload/image";this.$axios.post(n,r).then(function(r){if("SUCCESS"==r.data.status)if(e.status="success",1==t)if(1==o.isSzProject)console.log(r.data.data[0].imageUrl),o.$axios.post(o.httpUrl+"xmgl/workerImage/list",{fileUrl:r.data.data[0].imageUrl,projectSn:o.userData.projectSn},{headers:{Authorization:o.token}}).then(function(e){if(console.log(e),200==e.data.code&&e.data.result)o.imgLibraryList=e.data.result,o.imgListDialog=!0;else{var t=r.data.data[0].imageUrl;o.form.fieldAcquisitionUrl=t,o.imgClipDialog="clip"!=i,o.cropperOption.img=o.httpUrl+"image/"+o.form.fieldAcquisitionUrl,o.fileList=[{url:o.cropperOption.img,isImage:!0}]}});else if(o.isIscDevice)o.showLoading=!0,o.$axios.post(o.httpUrl+"xmgl/recognition/checkfaceHikvision",{fileUrl:r.data.data[0].imageUrl},{headers:{Authorization:o.token}}).then(function(e){if(o.showLoading=!1,200==e.data.code||0==e.data.code)if(1==e.data.result.checkType){var t=r.data.data[0].imageUrl;o.form.fieldAcquisitionUrl=t,o.imgClipDialog="clip"!=i,o.cropperOption.img=o.httpUrl+"image/"+o.form.fieldAcquisitionUrl,o.fileList=[{url:o.cropperOption.img,isImage:!0}]}else if("0"==e.data.result.checkType)o.fileList=[],o.$toast(e.data.result.message),o.form.fieldAcquisitionUrl="";else{t=r.data.data[0].imageUrl;o.form.fieldAcquisitionUrl=t,o.imgClipDialog="clip"!=i,o.cropperOption.img=o.httpUrl+"image/"+o.form.fieldAcquisitionUrl,o.fileList=[{url:o.cropperOption.img,isImage:!0}]}else o.$toast(e.data.message)});else{var n=r.data.data[0].imageUrl;o.form.fieldAcquisitionUrl=n,o.imgClipDialog="clip"!=i,o.cropperOption.img=o.httpUrl+"image/"+o.form.fieldAcquisitionUrl,o.fileList=[{url:o.cropperOption.img,isImage:!0}]}else o.form.idCardBigPhotoUrl=r.data.data[0].imageUrl;else e.status="failed",e.message="上传失败"})},getConfig:function(){var e=this,t=this.httpUrl+"xmgl/projectUfaceConfig/getProjectUfaceConfigInfo",i={projectSn:this.userData.projectSn};this.$axios.post(t,i,{headers:{Authorization:this.token}}).then(function(t){t.data.success&&t.data.result&&(e.isIscDevice=9==t.data.result.supplierType)})},getToken:function(){var e=this,t=this.httpUrl+"xmgl/base/getToken",i={userId:this.userData.userId};this.$axios.post(t,i).then(function(t){e.showLoading=!1,200==t.data.code?(e.token="Bearer "+t.data.result.token,e.getCompanyList(),e.getSelectList(1),e.getProjectSetting(),e.getConfig()):e.$toast(t.message)})},getCompanyList:function(){var e=this,t=this.httpUrl+"xmgl/enterpriseInfo/list",i={projectSn:this.userData.projectSn};this.$axios.post(t,i,{headers:{Authorization:this.token}}).then(function(t){(e.showLoading=!1,200==t.data.code)?t.data.result.forEach(function(t){e.columns2.push(t.enterpriseName),e.pickerList2.push(t)}):e.$toast(t.data.message)})},getDutuiesList:function(){var e=this,t=this.httpUrl+"xmgl/dictionariesRecord/selectJobList?lang=zh_CN";this.$axios.get(t,{headers:{Authorization:e.token}}).then(function(t){if(console.log(t),200==t.data.code){var i=JSON.parse(r()(t.data.result.jobTypeList)),o=JSON.parse(r()(t.data.result.jobNameList));i.forEach(function(t){t.options.forEach(function(t){e.jobTypeList.push(t.remarks+"-"+t.dictionaryName),e.jobTypeList2.push(t)})}),e.jobList2=o,o.forEach(function(t){e.jobList.push(t.dictionaryName)})}})},getSelectList:function(e){var t=this,i="",o={projectSn:this.userData.projectSn,enterpriseId:""!==this.checkedIndex2?this.pickerList2[this.checkedIndex2].id:""};i=1==e?this.httpUrl+"xmgl/teamInfo/getProjectTeamList":this.httpUrl+"xmgl/departmentInfo/getDepartmentInfoList",this.$axios.post(i,o,{headers:{Authorization:this.token}}).then(function(i){(t.showLoading=!1,200==i.data.code)?(t.repetitionRender=!1,t.columns=[],t.pickerList=[],1==e?i.data.result.forEach(function(e){t.columns.push(e.teamName),t.pickerList.push(e)}):i.data.result.list.forEach(function(e){t.columns.push(e.departmentName),t.pickerList.push(e)})):t.$toast(i.data.message)})},changePersonType:function(e){this.form.personType=e,this.pickerList=[],1==this.form.personType?(this.form.departmentId="",this.form.jobType="",this.form.jobName=""):this.form.teamId="",this.showLoading=!0,1==e?this.getSelectList(1):(this.getSelectList(2),this.getDutuiesList())},onConfirm:function(e,t){this.checkedIndex=t,1==this.form.personType?this.form.teamId=e:this.form.departmentId=e,this.showPicker=!1},onConfirm2:function(e,t){this.form.enterpriseId=e,this.checkedIndex2=t,this.showPicker2=!1,1==this.form.personType?(this.showLoading=!0,this.getSelectList(1)):this.getSelectList(2),this.form.teamId="",this.form.departmentId=""},onConfirmJob:function(e,t){this.showJob=!1,this.form.jobName=e,this.checkedJobIndex=t},onConfirmJobType:function(e,t){this.showJobType=!1,this.form.jobType=e,this.checkedJobTypeIndex=t},onDateConfirm:function(e){var t=e.getFullYear(),i=e.getMonth()+1<10?"0"+(e.getMonth()+1):e.getMonth()+1,o=e.getDate()<10?"0"+e.getDate():e.getDate();this.form.enterDate=t+"-"+i+"-"+o,this.currentDate=t+"-"+i+"-"+o,this.showCalendar=!1},onCancel:function(e){this.showCalendar=!1},onSubmit:function(e){var t=this,i=JSON.parse(r()(this.form));if(""!=i.fieldAcquisitionUrl)if(""==i.idCardBigPhotoUrl&&(i.idCardBigPhotoUrl=i.fieldAcquisitionUrl),this.checkPhone(i.phoneNumber)){i.longTerm.length>0?i.longTerm=1:i.longTerm=0,i.jobType=2==this.form.personType?this.jobTypeList2[this.checkedJobTypeIndex].id:"",i.jobName=2==this.form.personType?this.jobList2[this.checkedJobIndex].id:"",3!=e.personType&&(i.enterpriseId=this.pickerList2[this.checkedIndex2].id),1==e.personType?(i.teamId=this.pickerList[this.checkedIndex].id,delete i.departmentId,delete i.jobType,delete i.jobName):3!=e.personType?(i.departmentId=this.pickerList[this.checkedIndex].id,delete i.teamId):(delete i.teamId,delete i.departmentId);var o="";o=1==this.needAudit?this.httpUrl+"xmgl/xzWorkerInfoAuditRecord/add?lang=zh_CN":this.httpUrl+"xmgl/workerInfo/add?lang=zh_CN",i.projectSn=this.userData.projectSn,i.registerType=2,this.$axios.post(o,i,{headers:{Authorization:this.token}}).then(function(e){200==e.data.code?t.$router.push({path:"/finish"}):t.$toast(e.data.message)})}else this.$toast("请输入正确的手机号");else this.$toast("请上传现场采集照片")},checkPhone:function(e){return!!/^1(3|4|5|6|7|8|9)\d{9}$/.test(e)}}},l={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"submitPage"},[i("div",{staticClass:"title flex2"},[i("van-icon",{staticStyle:{margin:"3px 5px","font-size":"18px"},attrs:{name:"arrow-left"},on:{click:e.goback}}),e._v(" "),i("span",{staticStyle:{"margin-left":"-26px"}},[e._v(" 人员录入 ")]),e._v(" "),i("span")],1),e._v(" "),i("div",{staticClass:"upload_wrap"},[e._m(0),e._v(" "),i("div",{staticClass:"flex",staticStyle:{margin:"15px 0"}},[i("div",{staticClass:"uploader"},[i("van-uploader",{attrs:{"after-read":function(t){return e.afterRead(t,1)},"before-read":e.beforeRead,"before-delete":e.removeImg,"max-count":1},model:{value:e.fileList,callback:function(t){e.fileList=t},expression:"fileList"}}),e._v(" "),i("div",{staticStyle:{"padding-right":"8px"}},[e._v("现场采集照")]),e._v(" "),i("van-icon",{staticClass:"question",attrs:{name:"question-o"},on:{click:function(t){e.previewImage=!0}}})],1),e._v(" "),i("div",{staticClass:"uploader"},[i("van-uploader",{attrs:{"after-read":function(t){return e.afterRead(t,2)},"max-count":1},model:{value:e.fileList2,callback:function(t){e.fileList2=t},expression:"fileList2"}}),e._v(" "),i("div",{staticStyle:{"padding-right":"8px"}},[e._v("身份证头像照")])],1)]),e._v(" "),i("p",{staticStyle:{color:"red","font-size":"12px"}},[e._v("注:未上传身份证头像照,系统会默认使用现场采集照")])]),e._v(" "),i("div",{staticClass:"form_center"},[i("div",{staticClass:"flex info_wrap"},[i("van-icon",{staticClass:"icon",attrs:{name:"records"}}),e._v(" "),i("span",[e._v("详细信息")])],1),e._v(" "),i("van-form",{staticStyle:{"padding-bottom":"10px"},on:{submit:e.onSubmit}},[i("van-field",{attrs:{name:"personType",rules:[{required:!0}]},scopedSlots:e._u([{key:"input",fn:function(){return[i("van-radio-group",{attrs:{direction:"horizontal",disabled:e.repetitionRender},on:{change:e.changePersonType},model:{value:e.form.personType,callback:function(t){e.$set(e.form,"personType",t)},expression:"form.personType"}},[i("van-radio",{staticClass:"sex",attrs:{name:1}},[e._v("劳务人员")]),e._v(" "),i("van-radio",{staticClass:"sex",attrs:{name:2}},[e._v("管理人员")])],1)]},proxy:!0}])}),e._v(" "),3!=e.form.personType?i("van-field",{attrs:{readonly:"",clickable:"",name:"teamId",value:e.form.enterpriseId,label:"企业",placeholder:"点击选择企业",rules:[{required:!0}]},on:{click:function(t){e.showPicker2=!0}}}):e._e(),e._v(" "),2==e.form.personType?i("van-field",{attrs:{readonly:"",clickable:"",name:"departmentId",value:e.form.departmentId,label:"部门",placeholder:"点击选择部门",rules:[{required:!0}]},on:{click:function(t){e.showPicker=!0}}}):3!=e.form.personType?i("van-field",{attrs:{readonly:"",clickable:"",name:"teamId",value:e.form.teamId,label:"班组",placeholder:"点击选择班组",rules:[{required:!0}],disabled:""==e.form.enterpriseId},on:{click:function(t){e.showPicker=""!=e.form.enterpriseId}}}):e._e(),e._v(" "),2==e.form.personType?i("van-field",{attrs:{readonly:"",clickable:"",name:"jobType",value:e.form.jobType,label:"职务类型",placeholder:"点击选择职务类型",rules:[{required:!0}]},on:{click:function(t){e.showJobType=!0}}}):e._e(),e._v(" "),2==e.form.personType?i("van-field",{attrs:{readonly:"",clickable:"",name:"jobName",value:e.form.jobName,label:"职务",placeholder:"点击选择职务",rules:[{required:!0}]},on:{click:function(t){e.showJob=!0}}}):e._e(),e._v(" "),i("van-field",{attrs:{name:"phoneNumber",label:"手机号",placeholder:"请输入手机号",rules:[{required:!0}],maxlength:"11"},model:{value:e.form.phoneNumber,callback:function(t){e.$set(e.form,"phoneNumber",t)},expression:"form.phoneNumber"}}),e._v(" "),i("van-field",{attrs:{readonly:"",clickable:"",name:"enterDate",value:e.form.enterDate,label:"进场日期",placeholder:"点击选择进场日期",rules:[{required:!0}]},on:{click:function(t){e.showCalendar=!0}}}),e._v(" "),i("div",{staticStyle:{margin:"36px auto",width:"90%"}},[i("van-button",{attrs:{round:"",block:"",type:"info","native-type":"submit"}},[e._v("提交")])],1)],1)],1),e._v(" "),i("van-popup",{attrs:{position:"bottom"},model:{value:e.showPicker2,callback:function(t){e.showPicker2=t},expression:"showPicker2"}},[i("van-picker",{attrs:{"show-toolbar":"",columns:e.columns2},on:{confirm:e.onConfirm2,cancel:function(t){e.showPicker2=!1}}})],1),e._v(" "),i("van-popup",{attrs:{position:"bottom"},model:{value:e.showPicker,callback:function(t){e.showPicker=t},expression:"showPicker"}},[i("van-picker",{attrs:{"show-toolbar":"",columns:e.columns},on:{confirm:e.onConfirm,cancel:function(t){e.showPicker=!1}}})],1),e._v(" "),i("van-popup",{attrs:{position:"bottom"},model:{value:e.showJob,callback:function(t){e.showJob=t},expression:"showJob"}},[i("van-picker",{attrs:{"show-toolbar":"",columns:e.jobList},on:{confirm:e.onConfirmJob,cancel:function(t){e.showJob=!1}}})],1),e._v(" "),i("van-popup",{attrs:{position:"bottom"},model:{value:e.showJobType,callback:function(t){e.showJobType=t},expression:"showJobType"}},[i("van-picker",{attrs:{"show-toolbar":"",columns:e.jobTypeList},on:{confirm:e.onConfirmJobType,cancel:function(t){e.showJobType=!1}}})],1),e._v(" "),i("van-popup",{style:{height:"50%"},attrs:{position:"bottom"},model:{value:e.showCalendar,callback:function(t){e.showCalendar=t},expression:"showCalendar"}},[i("van-datetime-picker",{attrs:{type:"date",title:"选择进场日期","min-date":e.minDate},on:{confirm:e.onDateConfirm,cancel:e.onCancel},model:{value:e.currentDate,callback:function(t){e.currentDate=t},expression:"currentDate"}})],1),e._v(" "),i("van-popup",{staticStyle:{background:"none"},model:{value:e.showLoading,callback:function(t){e.showLoading=t},expression:"showLoading"}},[i("van-loading",{attrs:{type:"spinner",color:"#1989fa"}})],1),e._v(" "),i("van-image-preview",{attrs:{images:e.previewImages},model:{value:e.previewImage,callback:function(t){e.previewImage=t},expression:"previewImage"}}),e._v(" "),i("van-dialog",{attrs:{title:"图片裁剪"},on:{confirm:e.getClipImgFn},model:{value:e.imgClipDialog,callback:function(t){e.imgClipDialog=t},expression:"imgClipDialog"}},[i("div",{staticStyle:{height:"300px"}},[i("vueCropper",{ref:"cropper",attrs:{img:e.cropperOption.img,outputType:e.cropperOption.outputType,outputSize:.7,maxImgSize:300,mode:"contain",autoCrop:!0}})],1)]),e._v(" "),i("van-dialog",{attrs:{title:"照片比对结果"},on:{confirm:e.checkImg},model:{value:e.imgListDialog,callback:function(t){e.imgListDialog=t},expression:"imgListDialog"}},[i("div",{staticStyle:{height:"300px",overflow:"auto","padding-bottom":"10px"}},[i("van-radio-group",{staticClass:"radio-box",model:{value:e.radio,callback:function(t){e.radio=t},expression:"radio"}},e._l(e.imgLibraryList,function(t){return i("van-radio",{key:t.id,attrs:{name:t.personSerial}},[i("img",{staticStyle:{width:"50px",height:"50px"},attrs:{src:e.httpUrl+"image/"+t.imageUrl},on:{click:function(i){return e.priviewImg(e.httpUrl+"image/"+t.imageUrl)}}})])}),1)],1)]),e._v(" "),i("van-image-preview",{attrs:{images:e.previewImages2},model:{value:e.previewImage2,callback:function(t){e.previewImage2=t},expression:"previewImage2"}})],1)},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"step"},[t("img",{staticStyle:{width:"auto",height:"28px"},attrs:{src:i("2SFc")}})])}]};var u=i("VU/8")(p,l,!1,function(e){i("oswj")},"data-v-e87ebd9c",null);t.default=u.exports},YDP2:function(e,t,i){e.exports=i.p+"static/img/example.247a986.png"},YZ0n:function(e,t,i){var o;window,o=function(){return function(e){var t={};function i(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,o){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(o,r,function(t){return e[t]}.bind(null,r));return o},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=6)}([function(e,t,i){var o=i(2);"string"==typeof o&&(o=[[e.i,o,""]]);i(4)(o,{hmr:!0,transform:void 0,insertInto:void 0}),o.locals&&(e.exports=o.locals)},function(e,t,i){"use strict";var o=i(0);i.n(o).a},function(e,t,i){(e.exports=i(3)(!1)).push([e.i,'\n.vue-cropper[data-v-6dae58fd] {\n position: relative;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n direction: ltr;\n touch-action: none;\n text-align: left;\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC");\n}\n.cropper-box[data-v-6dae58fd],\n.cropper-box-canvas[data-v-6dae58fd],\n.cropper-drag-box[data-v-6dae58fd],\n.cropper-crop-box[data-v-6dae58fd],\n.cropper-face[data-v-6dae58fd] {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n user-select: none;\n}\n.cropper-box-canvas img[data-v-6dae58fd] {\n position: relative;\n text-align: left;\n user-select: none;\n transform: none;\n max-width: none;\n max-height: none;\n}\n.cropper-box[data-v-6dae58fd] {\n overflow: hidden;\n}\n.cropper-move[data-v-6dae58fd] {\n cursor: move;\n}\n.cropper-crop[data-v-6dae58fd] {\n cursor: crosshair;\n}\n.cropper-modal[data-v-6dae58fd] {\n background: rgba(0, 0, 0, 0.5);\n}\n.cropper-crop-box[data-v-6dae58fd] {\n /*border: 2px solid #39f;*/\n}\n.cropper-view-box[data-v-6dae58fd] {\n display: block;\n overflow: hidden;\n width: 100%;\n height: 100%;\n outline: 1px solid #39f;\n outline-color: rgba(51, 153, 255, 0.75);\n user-select: none;\n}\n.cropper-view-box img[data-v-6dae58fd] {\n user-select: none;\n text-align: left;\n max-width: none;\n max-height: none;\n}\n.cropper-face[data-v-6dae58fd] {\n top: 0;\n left: 0;\n background-color: #fff;\n opacity: 0.1;\n}\n.crop-info[data-v-6dae58fd] {\n position: absolute;\n left: 0px;\n min-width: 65px;\n text-align: center;\n color: white;\n line-height: 20px;\n background-color: rgba(0, 0, 0, 0.8);\n font-size: 12px;\n}\n.crop-line[data-v-6dae58fd] {\n position: absolute;\n display: block;\n width: 100%;\n height: 100%;\n opacity: 0.1;\n}\n.line-w[data-v-6dae58fd] {\n top: -3px;\n left: 0;\n height: 5px;\n cursor: n-resize;\n}\n.line-a[data-v-6dae58fd] {\n top: 0;\n left: -3px;\n width: 5px;\n cursor: w-resize;\n}\n.line-s[data-v-6dae58fd] {\n bottom: -3px;\n left: 0;\n height: 5px;\n cursor: s-resize;\n}\n.line-d[data-v-6dae58fd] {\n top: 0;\n right: -3px;\n width: 5px;\n cursor: e-resize;\n}\n.crop-point[data-v-6dae58fd] {\n position: absolute;\n width: 8px;\n height: 8px;\n opacity: 0.75;\n background-color: #39f;\n border-radius: 100%;\n}\n.point1[data-v-6dae58fd] {\n top: -4px;\n left: -4px;\n cursor: nw-resize;\n}\n.point2[data-v-6dae58fd] {\n top: -5px;\n left: 50%;\n margin-left: -3px;\n cursor: n-resize;\n}\n.point3[data-v-6dae58fd] {\n top: -4px;\n right: -4px;\n cursor: ne-resize;\n}\n.point4[data-v-6dae58fd] {\n top: 50%;\n left: -4px;\n margin-top: -3px;\n cursor: w-resize;\n}\n.point5[data-v-6dae58fd] {\n top: 50%;\n right: -4px;\n margin-top: -3px;\n cursor: e-resize;\n}\n.point6[data-v-6dae58fd] {\n bottom: -5px;\n left: -4px;\n cursor: sw-resize;\n}\n.point7[data-v-6dae58fd] {\n bottom: -5px;\n left: 50%;\n margin-left: -3px;\n cursor: s-resize;\n}\n.point8[data-v-6dae58fd] {\n bottom: -5px;\n right: -4px;\n cursor: se-resize;\n}\n@media screen and (max-width: 500px) {\n.crop-point[data-v-6dae58fd] {\n position: absolute;\n width: 20px;\n height: 20px;\n opacity: 0.45;\n background-color: #39f;\n border-radius: 100%;\n}\n.point1[data-v-6dae58fd] {\n top: -10px;\n left: -10px;\n}\n.point2[data-v-6dae58fd],\n .point4[data-v-6dae58fd],\n .point5[data-v-6dae58fd],\n .point7[data-v-6dae58fd] {\n display: none;\n}\n.point3[data-v-6dae58fd] {\n top: -10px;\n right: -10px;\n}\n.point4[data-v-6dae58fd] {\n top: 0;\n left: 0;\n}\n.point6[data-v-6dae58fd] {\n bottom: -10px;\n left: -10px;\n}\n.point8[data-v-6dae58fd] {\n bottom: -10px;\n right: -10px;\n}\n}\n',""])},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var i=function(e,t){var i=e[1]||"",o=e[3];if(!o)return i;if(t&&"function"==typeof btoa){var r=function(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}(o),n=o.sources.map(function(e){return"/*# sourceURL="+o.sourceRoot+e+" */"});return[i].concat(n).concat([r]).join("\n")}return[i].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+i+"}":i}).join("")},t.i=function(e,i){"string"==typeof e&&(e=[[null,e,""]]);for(var o={},r=0;r=0&&c.splice(t,1)}function f(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var o=i.nc;o&&(e.attrs.nonce=o)}return g(t,e.attrs),u(e,t),t}function g(e,t){Object.keys(t).forEach(function(i){e.setAttribute(i,t[i])})}function m(e,t){var i,o,r,n;if(t.transform&&e.css){if(!(n="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=n}if(t.singleton){var c=s++;i=a||(a=f(t)),o=w.bind(null,i,c,!1),r=w.bind(null,i,c,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(i=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",g(t,e.attrs),u(e,t),t}(t),o=function(e,t,i){var o=i.css,r=i.sourceMap,n=void 0===t.convertToAbsoluteUrls&&r;(t.convertToAbsoluteUrls||n)&&(o=h(o)),r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([o],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}.bind(null,i,t),r=function(){d(i),i.href&&URL.revokeObjectURL(i.href)}):(i=f(t),o=function(e,t){var i=t.css,o=t.media;if(o&&e.setAttribute("media",o),e.styleSheet)e.styleSheet.cssText=i;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(i))}}.bind(null,i),r=function(){d(i)});return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else r()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=r()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var i=l(e,t);return p(i,t),function(e){for(var r=[],n=0;n=8&&(s=i+o))),s)for(l=p.getUint16(s,r),h=0;h21?"-21px":"0px",e.width=this.cropW>0?this.cropW:0,e.height=this.cropH>0?this.cropH:0,this.infoTrue){var t=1;this.high&&!this.full&&(t=window.devicePixelRatio),1!==this.enlarge&!this.full&&(t=Math.abs(Number(this.enlarge))),e.width=e.width*t,e.height=e.height*t,this.full&&(e.width=e.width/this.scale,e.height=e.height/this.scale)}return e.width=e.width.toFixed(0),e.height=e.height.toFixed(0),e},isIE:function(){return navigator.userAgent,!!window.ActiveXObject||"ActiveXObject"in window},passive:function(){return this.isIE?null:{passive:!1}}},watch:{img:function(){this.checkedImg()},imgs:function(e){""!==e&&this.reload()},cropW:function(){this.showPreview()},cropH:function(){this.showPreview()},cropOffsertX:function(){this.showPreview()},cropOffsertY:function(){this.showPreview()},scale:function(e,t){this.showPreview()},x:function(){this.showPreview()},y:function(){this.showPreview()},autoCrop:function(e){e&&this.goAutoCrop()},autoCropWidth:function(){this.autoCrop&&this.goAutoCrop()},autoCropHeight:function(){this.autoCrop&&this.goAutoCrop()},mode:function(){this.checkedImg()},rotate:function(){this.showPreview(),this.autoCrop?this.goAutoCrop(this.cropW,this.cropH):(this.cropW>0||this.cropH>0)&&this.goAutoCrop(this.cropW,this.cropH)}},methods:{getVersion:function(e){for(var t=navigator.userAgent.split(" "),i="",o=new RegExp(e,"i"),r=0;r=81)t=-1;else if(this.getVersion("safari")[0]>=605){var n=this.getVersion("version");n[0]>13&&n[1]>1&&(t=-1)}else{var a=navigator.userAgent.toLowerCase().match(/cpu iphone os (.*?) like mac os/);if(a){var s=a[1];((s=s.split("_"))[0]>13||s[0]>=13&&s[1]>=4)&&(t=-1)}}var c=document.createElement("canvas"),h=c.getContext("2d");switch(h.save(),t){case 2:c.width=i,c.height=o,h.translate(i,0),h.scale(-1,1);break;case 3:c.width=i,c.height=o,h.translate(i/2,o/2),h.rotate(180*Math.PI/180),h.translate(-i/2,-o/2);break;case 4:c.width=i,c.height=o,h.translate(0,o),h.scale(1,-1);break;case 5:c.height=i,c.width=o,h.rotate(.5*Math.PI),h.scale(1,-1);break;case 6:c.width=o,c.height=i,h.translate(o/2,i/2),h.rotate(90*Math.PI/180),h.translate(-i/2,-o/2);break;case 7:c.height=i,c.width=o,h.rotate(.5*Math.PI),h.translate(i,-o),h.scale(-1,1);break;case 8:c.height=i,c.width=o,h.translate(o/2,i/2),h.rotate(-90*Math.PI/180),h.translate(-i/2,-o/2);break;default:c.width=i,c.height=o}h.drawImage(e,0,0,i,o),h.restore(),c.toBlob(function(e){var t=URL.createObjectURL(e);URL.revokeObjectURL(r.imgs),r.imgs=t},"image/"+this.outputType,1)},checkedImg:function(){var e=this;if(null===this.img||""===this.img)return this.imgs="",void this.clearCrop();this.loading=!0,this.scale=1,this.rotate=0,this.clearCrop();var t=new Image;if(t.onload=function(){if(""===e.img)return e.$emit("imgLoad","error"),e.$emit("img-load","error"),!1;var i=t.width,o=t.height;n.getData(t).then(function(r){e.orientation=r.orientation||1;var n=Number(e.maxImgSize);!e.orientation&&in&&(o=o/i*n,i=n),o>n&&(i=i/o*n,o=n),e.checkOrientationImage(t,e.orientation,i,o))})},t.onerror=function(){e.$emit("imgLoad","error"),e.$emit("img-load","error")},"data"!==this.img.substr(0,4)&&(t.crossOrigin=""),this.isIE){var i=new XMLHttpRequest;i.onload=function(){var e=URL.createObjectURL(this.response);t.src=e},i.open("GET",this.img,!0),i.responseType="blob",i.send()}else t.src=this.img},startMove:function(e){if(e.preventDefault(),this.move&&!this.crop){if(!this.canMove)return!1;this.moveX=("clientX"in e?e.clientX:e.touches[0].clientX)-this.x,this.moveY=("clientY"in e?e.clientY:e.touches[0].clientY)-this.y,e.touches?(window.addEventListener("touchmove",this.moveImg),window.addEventListener("touchend",this.leaveImg),2==e.touches.length&&(this.touches=e.touches,window.addEventListener("touchmove",this.touchScale),window.addEventListener("touchend",this.cancelTouchScale))):(window.addEventListener("mousemove",this.moveImg),window.addEventListener("mouseup",this.leaveImg)),this.$emit("imgMoving",{moving:!0,axis:this.getImgAxis()}),this.$emit("img-moving",{moving:!0,axis:this.getImgAxis()})}else this.cropping=!0,window.addEventListener("mousemove",this.createCrop),window.addEventListener("mouseup",this.endCrop),window.addEventListener("touchmove",this.createCrop),window.addEventListener("touchend",this.endCrop),this.cropOffsertX=e.offsetX?e.offsetX:e.touches[0].pageX-this.$refs.cropper.offsetLeft,this.cropOffsertY=e.offsetY?e.offsetY:e.touches[0].pageY-this.$refs.cropper.offsetTop,this.cropX="clientX"in e?e.clientX:e.touches[0].clientX,this.cropY="clientY"in e?e.clientY:e.touches[0].clientY,this.cropChangeX=this.cropOffsertX,this.cropChangeY=this.cropOffsertY,this.cropW=0,this.cropH=0},touchScale:function(e){var t=this;e.preventDefault();var i=this.scale,o=this.touches[0].clientX,r=this.touches[0].clientY,n=e.touches[0].clientX,a=e.touches[0].clientY,s=this.touches[1].clientX,c=this.touches[1].clientY,h=e.touches[1].clientX,p=e.touches[1].clientY,l=Math.sqrt(Math.pow(o-s,2)+Math.pow(r-c,2)),u=Math.sqrt(Math.pow(n-h,2)+Math.pow(a-p,2))-l,d=1,f=(d=(d=d/this.trueWidth>d/this.trueHeight?d/this.trueHeight:d/this.trueWidth)>.1?.1:d)*u;if(!this.touchNow){if(this.touchNow=!0,u>0?i+=Math.abs(f):u<0&&i>Math.abs(f)&&(i-=Math.abs(f)),this.touches=e.touches,setTimeout(function(){t.touchNow=!1},8),!this.checkoutImgAxis(this.x,this.y,i))return!1;this.scale=i}},cancelTouchScale:function(e){window.removeEventListener("touchmove",this.touchScale)},moveImg:function(e){var t=this;if(e.preventDefault(),e.touches&&2===e.touches.length)return this.touches=e.touches,window.addEventListener("touchmove",this.touchScale),window.addEventListener("touchend",this.cancelTouchScale),window.removeEventListener("touchmove",this.moveImg),!1;var i,o,r="clientX"in e?e.clientX:e.touches[0].clientX,n="clientY"in e?e.clientY:e.touches[0].clientY;i=r-this.moveX,o=n-this.moveY,this.$nextTick(function(){if(t.centerBox){var e,r,n,a,s=t.getImgAxis(i,o,t.scale),c=t.getCropAxis(),h=t.trueHeight*t.scale,p=t.trueWidth*t.scale;switch(t.rotate){case 1:case-1:case 3:case-3:e=t.cropOffsertX-t.trueWidth*(1-t.scale)/2+(h-p)/2,r=t.cropOffsertY-t.trueHeight*(1-t.scale)/2+(p-h)/2,n=e-h+t.cropW,a=r-p+t.cropH;break;default:e=t.cropOffsertX-t.trueWidth*(1-t.scale)/2,r=t.cropOffsertY-t.trueHeight*(1-t.scale)/2,n=e-p+t.cropW,a=r-h+t.cropH}s.x1>=c.x1&&(i=e),s.y1>=c.y1&&(o=r),s.x2<=c.x2&&(i=n),s.y2<=c.y2&&(o=a)}t.x=i,t.y=o,t.$emit("imgMoving",{moving:!0,axis:t.getImgAxis()}),t.$emit("img-moving",{moving:!0,axis:t.getImgAxis()})})},leaveImg:function(e){window.removeEventListener("mousemove",this.moveImg),window.removeEventListener("touchmove",this.moveImg),window.removeEventListener("mouseup",this.leaveImg),window.removeEventListener("touchend",this.leaveImg),this.$emit("imgMoving",{moving:!1,axis:this.getImgAxis()}),this.$emit("img-moving",{moving:!1,axis:this.getImgAxis()})},scaleImg:function(){this.canScale&&window.addEventListener(this.support,this.changeSize,this.passive)},cancelScale:function(){this.canScale&&window.removeEventListener(this.support,this.changeSize)},changeSize:function(e){var t=this;e.preventDefault();var i=this.scale,o=e.deltaY||e.wheelDelta;o=navigator.userAgent.indexOf("Firefox")>0?30*o:o,this.isIE&&(o=-o);var r=this.coe,n=(r=r/this.trueWidth>r/this.trueHeight?r/this.trueHeight:r/this.trueWidth)*o;n<0?i+=Math.abs(n):i>Math.abs(n)&&(i-=Math.abs(n));var a=n<0?"add":"reduce";if(a!==this.coeStatus&&(this.coeStatus=a,this.coe=.2),this.scaling||(this.scalingSet=setTimeout(function(){t.scaling=!1,t.coe=t.coe+=.01},50)),this.scaling=!0,!this.checkoutImgAxis(this.x,this.y,i))return!1;this.scale=i},changeScale:function(e){var t=this.scale;e=e||1;var i=20;if((e*=i=i/this.trueWidth>i/this.trueHeight?i/this.trueHeight:i/this.trueWidth)>0?t+=Math.abs(e):t>Math.abs(e)&&(t-=Math.abs(e)),!this.checkoutImgAxis(this.x,this.y,t))return!1;this.scale=t},createCrop:function(e){var t=this;e.preventDefault();var i="clientX"in e?e.clientX:e.touches?e.touches[0].clientX:0,o="clientY"in e?e.clientY:e.touches?e.touches[0].clientY:0;this.$nextTick(function(){var e=i-t.cropX,r=o-t.cropY;if(e>0?(t.cropW=e+t.cropChangeX>t.w?t.w-t.cropChangeX:e,t.cropOffsertX=t.cropChangeX):(t.cropW=t.w-t.cropChangeX+Math.abs(e)>t.w?t.cropChangeX:Math.abs(e),t.cropOffsertX=t.cropChangeX+e>0?t.cropChangeX+e:0),t.fixed){var n=t.cropW/t.fixedNumber[0]*t.fixedNumber[1];n+t.cropOffsertY>t.h?(t.cropH=t.h-t.cropOffsertY,t.cropW=t.cropH/t.fixedNumber[1]*t.fixedNumber[0],t.cropOffsertX=e>0?t.cropChangeX:t.cropChangeX-t.cropW):t.cropH=n,t.cropOffsertY=t.cropOffsertY}else r>0?(t.cropH=r+t.cropChangeY>t.h?t.h-t.cropChangeY:r,t.cropOffsertY=t.cropChangeY):(t.cropH=t.h-t.cropChangeY+Math.abs(r)>t.h?t.cropChangeY:Math.abs(r),t.cropOffsertY=t.cropChangeY+r>0?t.cropChangeY+r:0)})},changeCropSize:function(e,t,i,o,r){e.preventDefault(),window.addEventListener("mousemove",this.changeCropNow),window.addEventListener("mouseup",this.changeCropEnd),window.addEventListener("touchmove",this.changeCropNow),window.addEventListener("touchend",this.changeCropEnd),this.canChangeX=t,this.canChangeY=i,this.changeCropTypeX=o,this.changeCropTypeY=r,this.cropX="clientX"in e?e.clientX:e.touches[0].clientX,this.cropY="clientY"in e?e.clientY:e.touches[0].clientY,this.cropOldW=this.cropW,this.cropOldH=this.cropH,this.cropChangeX=this.cropOffsertX,this.cropChangeY=this.cropOffsertY,this.fixed&&this.canChangeX&&this.canChangeY&&(this.canChangeY=0),this.$emit("change-crop-size",{width:this.cropW,height:this.cropH})},changeCropNow:function(e){var t=this;e.preventDefault();var i="clientX"in e?e.clientX:e.touches?e.touches[0].clientX:0,o="clientY"in e?e.clientY:e.touches?e.touches[0].clientY:0,r=this.w,n=this.h,a=0,s=0;if(this.centerBox){var c=this.getImgAxis(),h=c.x2,p=c.y2;a=c.x1>0?c.x1:0,s=c.y1>0?c.y1:0,r>h&&(r=h),n>p&&(n=p)}this.$nextTick(function(){var e=i-t.cropX,c=o-t.cropY;if(t.canChangeX&&(1===t.changeCropTypeX?t.cropOldW-e>0?(t.cropW=r-t.cropChangeX-e<=r-a?t.cropOldW-e:t.cropOldW+t.cropChangeX-a,t.cropOffsertX=r-t.cropChangeX-e<=r-a?t.cropChangeX+e:a):(t.cropW=Math.abs(e)+t.cropChangeX<=r?Math.abs(e)-t.cropOldW:r-t.cropOldW-t.cropChangeX,t.cropOffsertX=t.cropChangeX+t.cropOldW):2===t.changeCropTypeX&&(t.cropOldW+e>0?(t.cropW=t.cropOldW+e+t.cropOffsertX<=r?t.cropOldW+e:r-t.cropOffsertX,t.cropOffsertX=t.cropChangeX):(t.cropW=r-t.cropChangeX+Math.abs(e+t.cropOldW)<=r-a?Math.abs(e+t.cropOldW):t.cropChangeX-a,t.cropOffsertX=r-t.cropChangeX+Math.abs(e+t.cropOldW)<=r-a?t.cropChangeX-Math.abs(e+t.cropOldW):a))),t.canChangeY&&(1===t.changeCropTypeY?t.cropOldH-c>0?(t.cropH=n-t.cropChangeY-c<=n-s?t.cropOldH-c:t.cropOldH+t.cropChangeY-s,t.cropOffsertY=n-t.cropChangeY-c<=n-s?t.cropChangeY+c:s):(t.cropH=Math.abs(c)+t.cropChangeY<=n?Math.abs(c)-t.cropOldH:n-t.cropOldH-t.cropChangeY,t.cropOffsertY=t.cropChangeY+t.cropOldH):2===t.changeCropTypeY&&(t.cropOldH+c>0?(t.cropH=t.cropOldH+c+t.cropOffsertY<=n?t.cropOldH+c:n-t.cropOffsertY,t.cropOffsertY=t.cropChangeY):(t.cropH=n-t.cropChangeY+Math.abs(c+t.cropOldH)<=n-s?Math.abs(c+t.cropOldH):t.cropChangeY-s,t.cropOffsertY=n-t.cropChangeY+Math.abs(c+t.cropOldH)<=n-s?t.cropChangeY-Math.abs(c+t.cropOldH):s))),t.canChangeX&&t.fixed){var h=t.cropW/t.fixedNumber[0]*t.fixedNumber[1];h+t.cropOffsertY>n?(t.cropH=n-t.cropOffsertY,t.cropW=t.cropH/t.fixedNumber[1]*t.fixedNumber[0]):t.cropH=h}if(t.canChangeY&&t.fixed){var p=t.cropH/t.fixedNumber[1]*t.fixedNumber[0];p+t.cropOffsertX>r?(t.cropW=r-t.cropOffsertX,t.cropH=t.cropW/t.fixedNumber[0]*t.fixedNumber[1]):t.cropW=p}})},checkCropLimitSize:function(){this.cropW,this.cropH;var e=this.limitMinSize,t=new Array;return t=Array.isArray[e]?e:[e,e],[parseFloat(t[0]),parseFloat(t[1])]},changeCropEnd:function(e){window.removeEventListener("mousemove",this.changeCropNow),window.removeEventListener("mouseup",this.changeCropEnd),window.removeEventListener("touchmove",this.changeCropNow),window.removeEventListener("touchend",this.changeCropEnd)},endCrop:function(){0===this.cropW&&0===this.cropH&&(this.cropping=!1),window.removeEventListener("mousemove",this.createCrop),window.removeEventListener("mouseup",this.endCrop),window.removeEventListener("touchmove",this.createCrop),window.removeEventListener("touchend",this.endCrop)},startCrop:function(){this.crop=!0},stopCrop:function(){this.crop=!1},clearCrop:function(){this.cropping=!1,this.cropW=0,this.cropH=0},cropMove:function(e){if(e.preventDefault(),!this.canMoveBox)return this.crop=!1,this.startMove(e),!1;if(e.touches&&2===e.touches.length)return this.crop=!1,this.startMove(e),this.leaveCrop(),!1;window.addEventListener("mousemove",this.moveCrop),window.addEventListener("mouseup",this.leaveCrop),window.addEventListener("touchmove",this.moveCrop),window.addEventListener("touchend",this.leaveCrop);var t,i,o="clientX"in e?e.clientX:e.touches[0].clientX,r="clientY"in e?e.clientY:e.touches[0].clientY;t=o-this.cropOffsertX,i=r-this.cropOffsertY,this.cropX=t,this.cropY=i,this.$emit("cropMoving",{moving:!0,axis:this.getCropAxis()}),this.$emit("crop-moving",{moving:!0,axis:this.getCropAxis()})},moveCrop:function(e,t){var i=this,o=0,r=0;e&&(e.preventDefault(),o="clientX"in e?e.clientX:e.touches[0].clientX,r="clientY"in e?e.clientY:e.touches[0].clientY),this.$nextTick(function(){var e,n,a=o-i.cropX,s=r-i.cropY;if(t&&(a=i.cropOffsertX,s=i.cropOffsertY),e=a<=0?0:a+i.cropW>i.w?i.w-i.cropW:a,n=s<=0?0:s+i.cropH>i.h?i.h-i.cropH:s,i.centerBox){var c=i.getImgAxis();e<=c.x1&&(e=c.x1),e+i.cropW>c.x2&&(e=c.x2-i.cropW),n<=c.y1&&(n=c.y1),n+i.cropH>c.y2&&(n=c.y2-i.cropH)}i.cropOffsertX=e,i.cropOffsertY=n,i.$emit("cropMoving",{moving:!0,axis:i.getCropAxis()}),i.$emit("crop-moving",{moving:!0,axis:i.getCropAxis()})})},getImgAxis:function(e,t,i){e=e||this.x,t=t||this.y,i=i||this.scale;var o={x1:0,x2:0,y1:0,y2:0},r=this.trueWidth*i,n=this.trueHeight*i;switch(this.rotate){case 0:o.x1=e+this.trueWidth*(1-i)/2,o.x2=o.x1+this.trueWidth*i,o.y1=t+this.trueHeight*(1-i)/2,o.y2=o.y1+this.trueHeight*i;break;case 1:case-1:case 3:case-3:o.x1=e+this.trueWidth*(1-i)/2+(r-n)/2,o.x2=o.x1+this.trueHeight*i,o.y1=t+this.trueHeight*(1-i)/2+(n-r)/2,o.y2=o.y1+this.trueWidth*i;break;default:o.x1=e+this.trueWidth*(1-i)/2,o.x2=o.x1+this.trueWidth*i,o.y1=t+this.trueHeight*(1-i)/2,o.y2=o.y1+this.trueHeight*i}return o},getCropAxis:function(){var e={x1:0,x2:0,y1:0,y2:0};return e.x1=this.cropOffsertX,e.x2=e.x1+this.cropW,e.y1=this.cropOffsertY,e.y2=e.y1+this.cropH,e},leaveCrop:function(e){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.$emit("cropMoving",{moving:!1,axis:this.getCropAxis()}),this.$emit("crop-moving",{moving:!1,axis:this.getCropAxis()})},getCropChecked:function(e){var t=this,i=document.createElement("canvas"),o=new Image,r=this.rotate,n=this.trueWidth,a=this.trueHeight,s=this.cropOffsertX,c=this.cropOffsertY;function h(e,t){i.width=Math.round(e),i.height=Math.round(t)}o.onload=function(){if(0!==t.cropW){var p=i.getContext("2d"),l=1;t.high&!t.full&&(l=window.devicePixelRatio),1!==t.enlarge&!t.full&&(l=Math.abs(Number(t.enlarge)));var u=t.cropW*l,d=t.cropH*l,f=n*t.scale*l,g=a*t.scale*l,m=(t.x-s+t.trueWidth*(1-t.scale)/2)*l,v=(t.y-c+t.trueHeight*(1-t.scale)/2)*l;switch(h(u,d),p.save(),r){case 0:t.full?(h(u/t.scale,d/t.scale),p.drawImage(o,m/t.scale,v/t.scale,f/t.scale,g/t.scale)):p.drawImage(o,m,v,f,g);break;case 1:case-3:t.full?(h(u/t.scale,d/t.scale),m=m/t.scale+(f/t.scale-g/t.scale)/2,v=v/t.scale+(g/t.scale-f/t.scale)/2,p.rotate(90*r*Math.PI/180),p.drawImage(o,v,-m-g/t.scale,f/t.scale,g/t.scale)):(m+=(f-g)/2,v+=(g-f)/2,p.rotate(90*r*Math.PI/180),p.drawImage(o,v,-m-g,f,g));break;case 2:case-2:t.full?(h(u/t.scale,d/t.scale),p.rotate(90*r*Math.PI/180),m/=t.scale,v/=t.scale,p.drawImage(o,-m-f/t.scale,-v-g/t.scale,f/t.scale,g/t.scale)):(p.rotate(90*r*Math.PI/180),p.drawImage(o,-m-f,-v-g,f,g));break;case 3:case-1:t.full?(h(u/t.scale,d/t.scale),m=m/t.scale+(f/t.scale-g/t.scale)/2,v=v/t.scale+(g/t.scale-f/t.scale)/2,p.rotate(90*r*Math.PI/180),p.drawImage(o,-v-f/t.scale,m,f/t.scale,g/t.scale)):(m+=(f-g)/2,v+=(g-f)/2,p.rotate(90*r*Math.PI/180),p.drawImage(o,-v-f,m,f,g));break;default:t.full?(h(u/t.scale,d/t.scale),p.drawImage(o,m/t.scale,v/t.scale,f/t.scale,g/t.scale)):p.drawImage(o,m,v,f,g)}p.restore()}else{var w=n*t.scale,x=a*t.scale,b=i.getContext("2d");switch(b.save(),r){case 0:h(w,x),b.drawImage(o,0,0,w,x);break;case 1:case-3:h(x,w),b.rotate(90*r*Math.PI/180),b.drawImage(o,0,-x,w,x);break;case 2:case-2:h(w,x),b.rotate(90*r*Math.PI/180),b.drawImage(o,-w,-x,w,x);break;case 3:case-1:h(x,w),b.rotate(90*r*Math.PI/180),b.drawImage(o,-w,0,w,x);break;default:h(w,x),b.drawImage(o,0,0,w,x)}b.restore()}e(i)},"data"!==this.img.substr(0,4)&&(o.crossOrigin="Anonymous"),o.src=this.imgs},getCropData:function(e){var t=this;this.getCropChecked(function(i){e(i.toDataURL("image/"+t.outputType,t.outputSize))})},getCropBlob:function(e){var t=this;this.getCropChecked(function(i){i.toBlob(function(t){return e(t)},"image/"+t.outputType,t.outputSize)})},showPreview:function(){var e=this;if(!this.isCanShow)return!1;this.isCanShow=!1,setTimeout(function(){e.isCanShow=!0},16);var t=this.cropW,i=this.cropH,o=this.scale,r={};r.div={width:"".concat(t,"px"),height:"".concat(i,"px")};var n=(this.x-this.cropOffsertX)/o,a=(this.y-this.cropOffsertY)/o;r.w=t,r.h=i,r.url=this.imgs,r.img={width:"".concat(this.trueWidth,"px"),height:"".concat(this.trueHeight,"px"),transform:"scale(".concat(o,")translate3d(").concat(n,"px, ").concat(a,"px, ").concat(0,"px)rotateZ(").concat(90*this.rotate,"deg)")},r.html='\n
\n
\n \n
\n
'),this.$emit("realTime",r),this.$emit("real-time",r)},reload:function(){var e=this,t=new Image;t.onload=function(){e.w=parseFloat(window.getComputedStyle(e.$refs.cropper).width),e.h=parseFloat(window.getComputedStyle(e.$refs.cropper).height),e.trueWidth=t.width,e.trueHeight=t.height,e.original?e.scale=1:e.scale=e.checkedMode(),e.$nextTick(function(){e.x=-(e.trueWidth-e.trueWidth*e.scale)/2+(e.w-e.trueWidth*e.scale)/2,e.y=-(e.trueHeight-e.trueHeight*e.scale)/2+(e.h-e.trueHeight*e.scale)/2,e.loading=!1,e.autoCrop&&e.goAutoCrop(),e.$emit("img-load","success"),e.$emit("imgLoad","success"),setTimeout(function(){e.showPreview()},20)})},t.onerror=function(){e.$emit("imgLoad","error"),e.$emit("img-load","error")},t.src=this.imgs},checkedMode:function(){var e=1,t=(this.trueWidth,this.trueHeight),i=this.mode.split(" ");switch(i[0]){case"contain":this.trueWidth>this.w&&(e=this.w/this.trueWidth),this.trueHeight*e>this.h&&(e=this.h/this.trueHeight);break;case"cover":(t*=e=this.w/this.trueWidth)0,n=(r?this.trueHeight:this.trueWidth)*this.scale,a=(r?this.trueWidth:this.trueHeight)*this.scale;i=ni?i:s,c=c>o?o:c,this.fixed&&(c=s/this.fixedNumber[0]*this.fixedNumber[1]),c>this.h&&(s=(c=this.h)/this.fixedNumber[1]*this.fixedNumber[0]),this.changeCrop(s,c)}},changeCrop:function(e,t){var i=this;if(this.centerBox){var o=this.getImgAxis();e>o.x2-o.x1&&(t=(e=o.x2-o.x1)/this.fixedNumber[0]*this.fixedNumber[1]),t>o.y2-o.y1&&(e=(t=o.y2-o.y1)/this.fixedNumber[1]*this.fixedNumber[0])}this.cropW=e,this.cropH=t,this.checkCropLimitSize(),this.$nextTick(function(){i.cropOffsertX=(i.w-i.cropW)/2,i.cropOffsertY=(i.h-i.cropH)/2,i.centerBox&&i.moveCrop(null,!0)})},refresh:function(){var e=this;this.img,this.imgs="",this.scale=1,this.crop=!1,this.rotate=0,this.w=0,this.h=0,this.trueWidth=0,this.trueHeight=0,this.clearCrop(),this.$nextTick(function(){e.checkedImg()})},rotateLeft:function(){this.rotate=this.rotate<=-3?0:this.rotate-1},rotateRight:function(){this.rotate=this.rotate>=3?0:this.rotate+1},rotateClear:function(){this.rotate=0},checkoutImgAxis:function(e,t,i){e=e||this.x,t=t||this.y,i=i||this.scale;var o=!0;if(this.centerBox){var r=this.getImgAxis(e,t,i),n=this.getCropAxis();r.x1>=n.x1&&(o=!1),r.x2<=n.x2&&(o=!1),r.y1>=n.y1&&(o=!1),r.y2<=n.y2&&(o=!1)}return o}},mounted:function(){this.support="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll";var e=this,t=navigator.userAgent;this.isIOS=!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(t,i,o){for(var r=atob(this.toDataURL(i,o).split(",")[1]),n=r.length,a=new Uint8Array(n),s=0;s