zhgdyun/public/doc/h5Entry/static/js/3.a707ad46b51e79db8932.js
2024-05-30 13:57:28 +08:00

2 lines
59 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

webpackJsonp([3],{"2SFc":function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIoAAAAcCAYAAAHJvxesAAAAAXNSR0IArs4c6QAACX9JREFUaAXtWwtwlNUVPvsnJOS9m0QQhsHBB4V2OiV2aEULCGUsQUgJEK3aohGmUMBGsFYQdQrM0GqFACEiZUhDxxchDZVAoA8gBdu0ZYqAFgFhRAlMisk+k002m+Tv+e7m7v67m31kWeLW2TOTve/zvP+959x7Q9QL0zc2H5H5cNMj5xwvyr4KMtM3NKuk0hSVQTaEStH3lQO2tWIsd1ae22OtCDUoUPvYYYmiiXEukRkQCJsbiVgM0o7L39B8Xjb2Jz181lGD/orASDRayhkuEvRvuOgoxHjllYOt4Y7z6/fex50kxudvNE0W3PCPX68gFXLMc1VqlujGFRZULqwwqS/X2UR7YWnz2CA4Im5i5IkgADqgB5i71dgJhLrSP7Ue/k+jc2qjqduLwMEVOaRj8KqMQgHE8ze2UN7IQXT6ipN6WI8jDAm0o1hfIYjJDlpaN5uZoLSYoVH8d4n/xJeq7Rzt/Owt5jtWVVtaHtlmXOSFG1o5dt6hFpa1qF3dqvrRNWe/JqAXshAFngqCBmiBJgBDxCSC7QDTvppMMze10IsFGXTN1L1ruCHhcdEQpZ+6Mx01nzZ30cIKGy26P5XW77cJzFeZOS8zLJ6SKhrW7bPRML0yP0r03WhY0ELgBmyvt1PBuMEiP1yvkBcjovYm/nzS7PlCX2Kt7zvV4aamPPOOleaNTxEV88pNIsVXw+BSj6iJzs+zu01Te3HT2l7NSNqCgpgxmp+icuP16JD2x7LtSNtFDSn1wOkO/w/j2AXHr5ss/Nn0Aat/b0Vt1Bc6f1ajXzOrzIylqU/48KpTvdziXKulKoSctanlvX0l2fdBTTN6v2ZtJ+RhzgUTU8nJUy4pMfq7gC+9aJVrT3WoM7+RTDuP26n6RHufaOuws3HL6mrbnvVFmQ/pXqhpnb6uMO3g8Qud7mUGI6uWGChR0dGcrUYvRJj7+Pi+n5cS87MG6/fE0Ukkl20IUluSTbM2G+m2nAQayX+QG/D8zAxC3xmlxrVK3sgE4UqyfyAa5c9Dr5l4z/b/xNCe/3XX0ij9NKTaPPrEQh2E9AUohG1NWx7LcisEfdzyq+py3SOb/jv0rZIhTd09JDY/LZLqpQaSKy/qh+sTaOeTelq8y0Lbn9DH/ExptnWrOekKLagw0zWza6upXKinl/a69r7Wjh4ytrkMv//pHErgzW9GmfluIVhVlZowZy51ofLvFztJbphSQVIZKBfvNDVVLsweJttiPeXV9V/M43jwqVWO5Bse0L13JglPdna55fbap/SfyDZ3+th20/umth7V0t6jOpyuBXtRpRkZ16bt7vn/lckvbZkHIU5+2olENdt7VPiPJW9aGkJKAm8XgTA8XgR7fl5vSAyx24F1MQqBL6eXcEDAaXBvsb97eeyK7s9ZRP4XaywRUwmAkAfhK0IShLAyLEGbDGX9ycZuDbMtwn/wD1kgE2SDjJAVgBBPeyQgFtpIHJzYVYOHs0idUgVxIjw+7Dpajw/aGmHwfHLS0106La3IQza2c/DSwaHkHflJ7LsgHpYAmSH7oAQScTjqlfRkXSEy2m248O7B9OiEFPrKsEFocgO8P8Sy7CGucVfGaAaeOliTHivyBXmD6UyjU8TmMipFvZT9xOVOcSag3HOHv9e392QHvdngHyf87m924KC65dkjRCaGf3LS6VmwJ3lGPjVJR2a7y1kztrK36gPyEEPBtAkXWtpciHg6FsWCG68NLbR5yJObpkxFKnlG/p1/ugxd/J1U2nrYO6xBO4JdgO58U5c6emiCV9DkaiL6Lp97sa8iizRlbDL9PD8d5aV8XPqauyEGM7ge+NW8jGIcZR/9yCPD7p8Y2Cs3k73TO66TnxPOgZWcNLEBibgmlGzPfE8oBPFBaC8wFLKb3P7Z1fZVICF5Rv75mem0co+VcjMUESGjDoAwBoCYDqAr2Pz5lHd/mnsEBW2IjbIW5HkK6qBNbVus5le8bVE3/CAz6FkKeJezhLOpLFq7sq/klqNcOCEbpdZQloCgCQdMOP4v2Gq5XdbHenpPQmYion/wDhl8AbJKhSDQhUK8+vieV7p8Pc8vzi/dt0ReI2O7oL0Z80jjnQt6DnxDkWRs64aiFv3vfV/Vz9rccnbZG+LoQHVyrPA5H9wgBbRzFP7vy50idkB5fa3tKBQb4/r5UrM3YDYrKrfcyXFUc/05150dJkAk8GGj8/SDG40Tv9RWiRHhBsJmbm8DR0wPjBn0l2XTUr02XMSPO4/Z3ce+gXSDzW3BpFRx2in7XLf10JAMBZv9t3mz83YgZad4GrEGBtJmYqLwipFisqt2Q6p73oR0AYNJp3V90W8F31RfaHLOPbA8V7zuCTY23haeBgbaZrr8Laa8kVm6k6/Pdz1ngkv840rPxZEv21l8U/r0A+mEM5hXD7V6RdDavlhhfvOEXlwuyfo1lZTyi2Kd57GDbIin/dJAuDbDLeia2Rl0W67ravgWDoLHj0qiU585ac27rstALeFgNlPqntJPkJMEgzb8sTXgNnP/mCRKTtQJIm0O11mTlpA2jxtK4JIA5s60GffKcjyNXAPh2mz93Ew+zCCav8NMO/5q57cTrVRYZqQhmQo9yfGxLwSzmcJRystdGpv/45LrUYIvEpTrz3US/I5wQYtrHL87LHvUMCbcsfF+gTUQrs1WVlvphRrvlePhb6XQUJ4ofzjpfT4iqQWymXJweU5Voudeh3LSNAU5OsJUi6vVodLqGqs5QlTxYRoN9NdmufwO5dWHM+m3C/Ri28G7Gvn2RINWZAPZTOFnTI1vaO525t/nvyT5Igu3rMV13dpDSyan/DDcsfF+gTUQrs2wxdQsy6bCbw6mn+22itsLvrUJjJhbAtlMRj07HPzaONn1TxB9PmLyxY4XX9uO2gM6s/JhEMbhbmldre34usLMSb544uXINMBRT0ibvb3YQPrUvneIQx900OY/t3kRD2Yzdzw8p6y5/vXHDZPhGQNw6FER5MWp6NTHD0JjOEoS8f7TDjr0gaO2/EdZBX10j1fdgAYG0mbSnoLdpbusORZH97WVD6YnfW147/LCLQiZcfDWwI7ux7x0yZtq7Gd33ZpIEzhUxrNCPKmUwCsUR0hkLW2gW1fc63OzJDvF0xvWwBdqM17WdPy3im8K1TNXet+KckUowN0PgGP0t3BqeMNaiCMIWwOs9i/eZswE/weoJR/PTX95wFbPZTw9tXFMfpbzS65Y1LtmlJrGhS1VvONN10C0bfY/KsPf8kra5w8AAAAASUVORK5CYII="},"3Ecj":function(e,t){},SHNa:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=o("mvHQ"),r=o.n(i),n=o("woOf"),a=o.n(n),s=o("YDP2"),c=o.n(s),h=o("YZ0n"),p={components:{VueCropper:h.VueCropper},data:function(){return{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:"jpg",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),t.afterRead({file:e},1,"clip")})},getProjectSetting:function(){var e=this,t=this.httpUrl+"xmgl/projectConfig/getProjectConfigList",o={projectSn:this.userData.projectSn};this.$axios.post(t,o,{headers:{Authorization:this.token}}).then(function(t){if(e.showLoading=!1,200==t.data.code){var o=t.data.result;if(console.log(t.data.result[0]),e.isSzProject=t.data.result[0].isSzProject,o&&0!=o.length){var i=o[0].workerAuditType;e.needAudit=i}else e.needAudit=0}else e.$toast(t.data.message)})},GetDateStr:function(e,t,o){var i=o?stringToDate(o,t):new Date;return i.setDate(i.getDate()+e),i.getFullYear()+t+(i.getMonth()+1<10?"0"+(i.getMonth()+1):i.getMonth()+1)+t+(i.getDate()<10?"0"+i.getDate():i.getDate())},goback:function(){this.$router.back()},beforeRead:function(e){return e.size<10240?(this.$toast("文件大小不能低于10kb"),!1):!(e.size>204800)||(this.$toast("文件大小不能超过200kb"),!1)},afterRead:function(e,t,o){var i=this;console.log(e),e.status="uploading",e.message="上传中...";var r=new FormData;r.append("files",e.file,"image.png");var n=this.httpUrl+"upload/image";this.$axios.post(n,r).then(function(r){"SUCCESS"==r.data.status?(e.status="success",1==t?1==i.isSzProject?(console.log(r.data.data[0].imageUrl),i.$axios.post(i.httpUrl+"xmgl/workerImage/list",{fileUrl:r.data.data[0].imageUrl,projectSn:i.userData.projectSn},{headers:{Authorization:i.token}}).then(function(e){if(console.log(e),200==e.data.code&&e.data.result)i.imgLibraryList=e.data.result,i.imgListDialog=!0;else{var t=r.data.data[0].imageUrl;i.form.fieldAcquisitionUrl=t,i.imgClipDialog="clip"!=o,i.cropperOption.img=i.httpUrl+"image/"+i.form.fieldAcquisitionUrl,i.fileList=[{url:i.cropperOption.img,isImage:!0}]}})):(i.showLoading=!0,i.$axios.post(i.httpUrl+"xmgl/recognition/checkfaceHikvision",{fileUrl:r.data.data[0].imageUrl},{headers:{Authorization:i.token}}).then(function(e){if(i.showLoading=!1,200==e.data.code||0==e.data.code)if(1==e.data.result.checkType){var t=r.data.data[0].imageUrl;i.form.fieldAcquisitionUrl=t,i.imgClipDialog="clip"!=o,i.cropperOption.img=i.httpUrl+"image/"+i.form.fieldAcquisitionUrl,i.fileList=[{url:i.cropperOption.img,isImage:!0}]}else if("0"==e.data.result.checkType)i.fileList=[],i.$toast(e.data.result.message),i.form.fieldAcquisitionUrl="";else{t=r.data.data[0].imageUrl;i.form.fieldAcquisitionUrl=t,i.imgClipDialog="clip"!=o,i.cropperOption.img=i.httpUrl+"image/"+i.form.fieldAcquisitionUrl,i.fileList=[{url:i.cropperOption.img,isImage:!0}]}else i.$toast(e.data.message)})):i.form.idCardBigPhotoUrl=r.data.data[0].imageUrl):(e.status="failed",e.message="上传失败")})},getToken:function(){var e=this,t=this.httpUrl+"xmgl/base/getToken",o={userId:this.userData.userId};this.$axios.post(t,o).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.$toast(t.message)})},getCompanyList:function(){var e=this,t=this.httpUrl+"xmgl/enterpriseInfo/list",o={projectSn:this.userData.projectSn};this.$axios.post(t,o,{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 o=JSON.parse(r()(t.data.result.jobTypeList)),i=JSON.parse(r()(t.data.result.jobNameList));o.forEach(function(t){t.options.forEach(function(t){e.jobTypeList.push(t.remarks+"-"+t.dictionaryName),e.jobTypeList2.push(t)})}),e.jobList2=i,i.forEach(function(t){e.jobList.push(t.dictionaryName)})}})},getSelectList:function(e){var t=this,o="",i={projectSn:this.userData.projectSn,enterpriseId:""!==this.checkedIndex2?this.pickerList2[this.checkedIndex2].id:""};o=1==e?this.httpUrl+"xmgl/teamInfo/getProjectTeamList":this.httpUrl+"xmgl/departmentInfo/getDepartmentInfoList",this.$axios.post(o,i,{headers:{Authorization:this.token}}).then(function(o){(t.showLoading=!1,200==o.data.code)?(t.repetitionRender=!1,t.columns=[],t.pickerList=[],1==e?o.data.result.forEach(function(e){t.columns.push(e.teamName),t.pickerList.push(e)}):o.data.result.list.forEach(function(e){t.columns.push(e.departmentName),t.pickerList.push(e)})):t.$toast(o.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(),o=e.getMonth()+1<10?"0"+(e.getMonth()+1):e.getMonth()+1,i=e.getDate()<10?"0"+e.getDate():e.getDate();this.form.enterDate=t+"-"+o+"-"+i,this.currentDate=t+"-"+o+"-"+i,this.showCalendar=!1},onCancel:function(e){this.showCalendar=!1},onSubmit:function(e){var t=this,o=JSON.parse(r()(this.form));if(""!=o.fieldAcquisitionUrl)if(""==o.idCardBigPhotoUrl&&(o.idCardBigPhotoUrl=o.fieldAcquisitionUrl),this.checkPhone(o.phoneNumber)){o.longTerm.length>0?o.longTerm=1:o.longTerm=0,o.jobType=2==this.form.personType?this.jobTypeList2[this.checkedJobTypeIndex].id:"",o.jobName=2==this.form.personType?this.jobList2[this.checkedJobIndex].id:"",3!=e.personType&&(o.enterpriseId=this.pickerList2[this.checkedIndex2].id),1==e.personType?(o.teamId=this.pickerList[this.checkedIndex].id,delete o.departmentId,delete o.jobType,delete o.jobName):3!=e.personType?(o.departmentId=this.pickerList[this.checkedIndex].id,delete o.teamId):(delete o.teamId,delete o.departmentId);var i="";i=1==this.needAudit?this.httpUrl+"xmgl/xzWorkerInfoAuditRecord/add?lang=zh_CN":this.httpUrl+"xmgl/workerInfo/add?lang=zh_CN",o.projectSn=this.userData.projectSn,o.registerType=2,this.$axios.post(i,o,{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,o=e._self._c||t;return o("div",{staticClass:"submitPage"},[o("div",{staticClass:"title flex2"},[o("van-icon",{staticStyle:{margin:"3px 5px","font-size":"18px"},attrs:{name:"arrow-left"},on:{click:e.goback}}),e._v(" "),o("span",{staticStyle:{"margin-left":"-26px"}},[e._v(" 人员录入 ")]),e._v(" "),o("span")],1),e._v(" "),o("div",{staticClass:"upload_wrap"},[e._m(0),e._v(" "),o("div",{staticClass:"flex",staticStyle:{margin:"15px 0"}},[o("div",{staticClass:"uploader"},[o("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(" "),o("div",{staticStyle:{"padding-right":"8px"}},[e._v("现场采集照")]),e._v(" "),o("van-icon",{staticClass:"question",attrs:{name:"question-o"},on:{click:function(t){e.previewImage=!0}}})],1),e._v(" "),o("div",{staticClass:"uploader"},[o("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(" "),o("div",{staticStyle:{"padding-right":"8px"}},[e._v("身份证头像照")])],1)]),e._v(" "),o("p",{staticStyle:{color:"red","font-size":"12px"}},[e._v("注:未上传身份证头像照,系统会默认使用现场采集照")])]),e._v(" "),o("div",{staticClass:"form_center"},[o("div",{staticClass:"flex info_wrap"},[o("van-icon",{staticClass:"icon",attrs:{name:"records"}}),e._v(" "),o("span",[e._v("详细信息")])],1),e._v(" "),o("van-form",{staticStyle:{"padding-bottom":"10px"},on:{submit:e.onSubmit}},[o("van-field",{attrs:{name:"personType",rules:[{required:!0}]},scopedSlots:e._u([{key:"input",fn:function(){return[o("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"}},[o("van-radio",{staticClass:"sex",attrs:{name:1}},[e._v("劳务人员")]),e._v(" "),o("van-radio",{staticClass:"sex",attrs:{name:2}},[e._v("管理人员")])],1)]},proxy:!0}])}),e._v(" "),3!=e.form.personType?o("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?o("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?o("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?o("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?o("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(" "),o("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(" "),o("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(" "),o("div",{staticStyle:{margin:"36px auto",width:"90%"}},[o("van-button",{attrs:{round:"",block:"",type:"info","native-type":"submit"}},[e._v("提交")])],1)],1)],1),e._v(" "),o("van-popup",{attrs:{position:"bottom"},model:{value:e.showPicker2,callback:function(t){e.showPicker2=t},expression:"showPicker2"}},[o("van-picker",{attrs:{"show-toolbar":"",columns:e.columns2},on:{confirm:e.onConfirm2,cancel:function(t){e.showPicker2=!1}}})],1),e._v(" "),o("van-popup",{attrs:{position:"bottom"},model:{value:e.showPicker,callback:function(t){e.showPicker=t},expression:"showPicker"}},[o("van-picker",{attrs:{"show-toolbar":"",columns:e.columns},on:{confirm:e.onConfirm,cancel:function(t){e.showPicker=!1}}})],1),e._v(" "),o("van-popup",{attrs:{position:"bottom"},model:{value:e.showJob,callback:function(t){e.showJob=t},expression:"showJob"}},[o("van-picker",{attrs:{"show-toolbar":"",columns:e.jobList},on:{confirm:e.onConfirmJob,cancel:function(t){e.showJob=!1}}})],1),e._v(" "),o("van-popup",{attrs:{position:"bottom"},model:{value:e.showJobType,callback:function(t){e.showJobType=t},expression:"showJobType"}},[o("van-picker",{attrs:{"show-toolbar":"",columns:e.jobTypeList},on:{confirm:e.onConfirmJobType,cancel:function(t){e.showJobType=!1}}})],1),e._v(" "),o("van-popup",{style:{height:"50%"},attrs:{position:"bottom"},model:{value:e.showCalendar,callback:function(t){e.showCalendar=t},expression:"showCalendar"}},[o("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(" "),o("van-popup",{staticStyle:{background:"none"},model:{value:e.showLoading,callback:function(t){e.showLoading=t},expression:"showLoading"}},[o("van-loading",{attrs:{type:"spinner",color:"#1989fa"}})],1),e._v(" "),o("van-image-preview",{attrs:{images:e.previewImages},model:{value:e.previewImage,callback:function(t){e.previewImage=t},expression:"previewImage"}}),e._v(" "),o("van-dialog",{attrs:{title:"图片裁剪"},on:{confirm:e.getClipImgFn},model:{value:e.imgClipDialog,callback:function(t){e.imgClipDialog=t},expression:"imgClipDialog"}},[o("div",{staticStyle:{height:"300px"}},[o("vueCropper",{ref:"cropper",attrs:{img:e.cropperOption.img,outputType:e.cropperOption.outputType,autoCrop:!0}})],1)]),e._v(" "),o("van-dialog",{attrs:{title:"照片比对结果"},on:{confirm:e.checkImg},model:{value:e.imgListDialog,callback:function(t){e.imgListDialog=t},expression:"imgListDialog"}},[o("div",{staticStyle:{height:"300px",overflow:"auto","padding-bottom":"10px"}},[o("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 o("van-radio",{key:t.id,attrs:{name:t.personSerial}},[o("img",{staticStyle:{width:"50px",height:"50px"},attrs:{src:e.httpUrl+"image/"+t.imageUrl},on:{click:function(o){return e.priviewImg(e.httpUrl+"image/"+t.imageUrl)}}})])}),1)],1)]),e._v(" "),o("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:o("2SFc")}})])}]};var u=o("VU/8")(p,l,!1,function(e){o("3Ecj")},"data-v-283e00f8",null);t.default=u.exports},YDP2:function(e,t,o){e.exports=o.p+"static/img/example.f5cda02.png"},YZ0n:function(e,t,o){var i;window,i=function(){return function(e){var t={};function o(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=t,o.d=function(e,t,i){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(i,r,function(t){return e[t]}.bind(null,r));return i},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=6)}([function(e,t,o){var i=o(2);"string"==typeof i&&(i=[[e.i,i,""]]);o(4)(i,{hmr:!0,transform:void 0,insertInto:void 0}),i.locals&&(e.exports=i.locals)},function(e,t,o){"use strict";var i=o(0);o.n(i).a},function(e,t,o){(e.exports=o(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 o=function(e,t){var o=e[1]||"",i=e[3];if(!i)return o;if(t&&"function"==typeof btoa){var r=function(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}(i),n=i.sources.map(function(e){return"/*# sourceURL="+i.sourceRoot+e+" */"});return[o].concat(n).concat([r]).join("\n")}return[o].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+o+"}":o}).join("")},t.i=function(e,o){"string"==typeof e&&(e=[[null,e,""]]);for(var i={},r=0;r<this.length;r++){var n=this[r][0];"number"==typeof n&&(i[n]=!0)}for(r=0;r<e.length;r++){var a=e[r];"number"==typeof a[0]&&i[a[0]]||(o&&!a[2]?a[2]=o:o&&(a[2]="("+a[2]+") and ("+o+")"),t.push(a))}},t}},function(e,t,o){var i={},r=function(e){var t;return function(){return void 0===t&&(t=function(){return window&&document&&document.all&&!window.atob}.apply(this,arguments)),t}}(),n=function(e){var t={};return function(e,o){if("function"==typeof e)return e();if(void 0===t[e]){var i=function(e,t){return t?t.querySelector(e):document.querySelector(e)}.call(this,e,o);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(e){i=null}t[e]=i}return t[e]}}(),a=null,s=0,c=[],h=o(5);function p(e,t){for(var o=0;o<e.length;o++){var r=e[o],n=i[r.id];if(n){n.refs++;for(var a=0;a<n.parts.length;a++)n.parts[a](r.parts[a]);for(;a<r.parts.length;a++)n.parts.push(m(r.parts[a],t))}else{var s=[];for(a=0;a<r.parts.length;a++)s.push(m(r.parts[a],t));i[r.id]={id:r.id,refs:1,parts:s}}}}function l(e,t){for(var o=[],i={},r=0;r<e.length;r++){var n=e[r],a=t.base?n[0]+t.base:n[0],s={css:n[1],media:n[2],sourceMap:n[3]};i[a]?i[a].parts.push(s):o.push(i[a]={id:a,parts:[s]})}return o}function u(e,t){var o=n(e.insertInto);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var i=c[c.length-1];if("top"===e.insertAt)i?i.nextSibling?o.insertBefore(t,i.nextSibling):o.appendChild(t):o.insertBefore(t,o.firstChild),c.push(t);else if("bottom"===e.insertAt)o.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var r=n(e.insertAt.before,o);o.insertBefore(t,r)}}function d(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=c.indexOf(e);t>=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 i=o.nc;i&&(e.attrs.nonce=i)}return g(t,e.attrs),u(e,t),t}function g(e,t){Object.keys(t).forEach(function(o){e.setAttribute(o,t[o])})}function m(e,t){var o,i,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++;o=a||(a=f(t)),i=w.bind(null,o,c,!1),r=w.bind(null,o,c,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(o=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),i=function(e,t,o){var i=o.css,r=o.sourceMap,n=void 0===t.convertToAbsoluteUrls&&r;(t.convertToAbsoluteUrls||n)&&(i=h(i)),r&&(i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([i],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}.bind(null,o,t),r=function(){d(o),o.href&&URL.revokeObjectURL(o.href)}):(o=f(t),i=function(e,t){var o=t.css,i=t.media;if(i&&e.setAttribute("media",i),e.styleSheet)e.styleSheet.cssText=o;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(o))}}.bind(null,o),r=function(){d(o)});return i(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;i(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 o=l(e,t);return p(o,t),function(e){for(var r=[],n=0;n<o.length;n++){var a=o[n];(s=i[a.id]).refs--,r.push(s)}for(e&&p(l(e,t),t),n=0;n<r.length;n++){var s;if(0===(s=r[n]).refs){for(var c=0;c<s.parts.length;c++)s.parts[c]();delete i[s.id]}}}};var v=function(){var e=[];return function(t,o){return e[t]=o,e.filter(Boolean).join("\n")}}();function w(e,t,o,i){var r=o?"":i.css;if(e.styleSheet)e.styleSheet.cssText=v(t,r);else{var n=document.createTextNode(r),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(n,a[t]):e.appendChild(n)}}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var o=t.protocol+"//"+t.host,i=o+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var r,n=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(n)?e:(r=0===n.indexOf("//")?n:0===n.indexOf("/")?o+n:i+n.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")})}},function(e,t,o){"use strict";o.r(t);var i=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{ref:"cropper",staticClass:"vue-cropper",on:{mouseover:e.scaleImg,mouseout:e.cancelScale}},[e.imgs?o("div",{staticClass:"cropper-box"},[o("div",{directives:[{name:"show",rawName:"v-show",value:!e.loading,expression:"!loading"}],staticClass:"cropper-box-canvas",style:{width:e.trueWidth+"px",height:e.trueHeight+"px",transform:"scale("+e.scale+","+e.scale+") translate3d("+e.x/e.scale+"px,"+e.y/e.scale+"px,0)rotateZ("+90*e.rotate+"deg)"}},[o("img",{ref:"cropperImg",attrs:{src:e.imgs,alt:"cropper-img"}})])]):e._e(),e._v(" "),o("div",{staticClass:"cropper-drag-box",class:{"cropper-move":e.move&&!e.crop,"cropper-crop":e.crop,"cropper-modal":e.cropping},on:{mousedown:e.startMove,touchstart:e.startMove}}),e._v(" "),o("div",{directives:[{name:"show",rawName:"v-show",value:e.cropping,expression:"cropping"}],staticClass:"cropper-crop-box",style:{width:e.cropW+"px",height:e.cropH+"px",transform:"translate3d("+e.cropOffsertX+"px,"+e.cropOffsertY+"px,0)"}},[o("span",{staticClass:"cropper-view-box"},[o("img",{style:{width:e.trueWidth+"px",height:e.trueHeight+"px",transform:"scale("+e.scale+","+e.scale+") translate3d("+(e.x-e.cropOffsertX)/e.scale+"px,"+(e.y-e.cropOffsertY)/e.scale+"px,0)rotateZ("+90*e.rotate+"deg)"},attrs:{src:e.imgs,alt:"cropper-img"}})]),e._v(" "),o("span",{staticClass:"cropper-face cropper-move",on:{mousedown:e.cropMove,touchstart:e.cropMove}}),e._v(" "),e.info?o("span",{staticClass:"crop-info",style:{top:e.cropInfo.top}},[e._v(e._s(this.cropInfo.width)+" × "+e._s(this.cropInfo.height))]):e._e(),e._v(" "),e.fixedBox?e._e():o("span",[o("span",{staticClass:"crop-line line-w",on:{mousedown:function(t){e.changeCropSize(t,!1,!0,0,1)},touchstart:function(t){e.changeCropSize(t,!1,!0,0,1)}}}),e._v(" "),o("span",{staticClass:"crop-line line-a",on:{mousedown:function(t){e.changeCropSize(t,!0,!1,1,0)},touchstart:function(t){e.changeCropSize(t,!0,!1,1,0)}}}),e._v(" "),o("span",{staticClass:"crop-line line-s",on:{mousedown:function(t){e.changeCropSize(t,!1,!0,0,2)},touchstart:function(t){e.changeCropSize(t,!1,!0,0,2)}}}),e._v(" "),o("span",{staticClass:"crop-line line-d",on:{mousedown:function(t){e.changeCropSize(t,!0,!1,2,0)},touchstart:function(t){e.changeCropSize(t,!0,!1,2,0)}}}),e._v(" "),o("span",{staticClass:"crop-point point1",on:{mousedown:function(t){e.changeCropSize(t,!0,!0,1,1)},touchstart:function(t){e.changeCropSize(t,!0,!0,1,1)}}}),e._v(" "),o("span",{staticClass:"crop-point point2",on:{mousedown:function(t){e.changeCropSize(t,!1,!0,0,1)},touchstart:function(t){e.changeCropSize(t,!1,!0,0,1)}}}),e._v(" "),o("span",{staticClass:"crop-point point3",on:{mousedown:function(t){e.changeCropSize(t,!0,!0,2,1)},touchstart:function(t){e.changeCropSize(t,!0,!0,2,1)}}}),e._v(" "),o("span",{staticClass:"crop-point point4",on:{mousedown:function(t){e.changeCropSize(t,!0,!1,1,0)},touchstart:function(t){e.changeCropSize(t,!0,!1,1,0)}}}),e._v(" "),o("span",{staticClass:"crop-point point5",on:{mousedown:function(t){e.changeCropSize(t,!0,!1,2,0)},touchstart:function(t){e.changeCropSize(t,!0,!1,2,0)}}}),e._v(" "),o("span",{staticClass:"crop-point point6",on:{mousedown:function(t){e.changeCropSize(t,!0,!0,1,2)},touchstart:function(t){e.changeCropSize(t,!0,!0,1,2)}}}),e._v(" "),o("span",{staticClass:"crop-point point7",on:{mousedown:function(t){e.changeCropSize(t,!1,!0,0,2)},touchstart:function(t){e.changeCropSize(t,!1,!0,0,2)}}}),e._v(" "),o("span",{staticClass:"crop-point point8",on:{mousedown:function(t){e.changeCropSize(t,!0,!0,2,2)},touchstart:function(t){e.changeCropSize(t,!0,!0,2,2)}}})])])])};i._withStripped=!0;var r={};r.getData=function(e){return new Promise(function(t,o){var i={};(function(e){var t=null;return new Promise(function(o,i){if(e.src)if(/^data\:/i.test(e.src))t=function(e){e=e.replace(/^data\:([^\;]+)\;base64,/gim,"");for(var t=atob(e),o=t.length,i=new ArrayBuffer(o),r=new Uint8Array(i),n=0;n<o;n++)r[n]=t.charCodeAt(n);return i}(e.src),o(t);else if(/^blob\:/i.test(e.src)){var r=new FileReader;r.onload=function(e){t=e.target.result,o(t)},function(e,t){var o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="blob",o.onload=function(e){200!=this.status&&0!==this.status||function(e){r.readAsArrayBuffer(e)}(this.response)},o.send()}(e.src)}else{var n=new XMLHttpRequest;n.onload=function(){if(200!=this.status&&0!==this.status)throw"Could not load image";t=n.response,o(t),n=null},n.open("GET",e.src,!0),n.responseType="arraybuffer",n.send(null)}else i("img error")})})(e).then(function(e){i.arrayBuffer=e,i.orientation=function(e){var t,o,i,r,n,a,s,c,h,p=new DataView(e),l=p.byteLength;if(255===p.getUint8(0)&&216===p.getUint8(1))for(c=2;c<l;){if(255===p.getUint8(c)&&225===p.getUint8(c+1)){a=c;break}c++}if(a&&(o=a+10,"Exif"===function(e,t,o){var i,r="";for(i=t,o+=t;i<o;i++)r+=String.fromCharCode(e.getUint8(i));return r}(p,a+4,4)&&(((r=18761===(n=p.getUint16(o)))||19789===n)&&42===p.getUint16(o+2,r)&&(i=p.getUint32(o+4,r))>=8&&(s=o+i))),s)for(l=p.getUint16(s,r),h=0;h<l;h++)if(c=s+12*h+2,274===p.getUint16(c,r)){c+=8,t=p.getUint16(c,r);break}return t}(e),t(i)}).catch(function(e){o(e)})})};var n=r,a={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:function(){return[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:function(){return 10}}},computed:{cropInfo:function(){var e={};if(e.top=this.cropOffsertY>21?"-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(" "),o="",i=new RegExp(e,"i"),r=0;r<t.length;r++)i.test(t[r])&&(o=t[r]);return o?o.split("/")[1].split("."):["0","0","0"]},checkOrientationImage:function(e,t,o,i){var r=this;if(this.getVersion("chrome")[0]>=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=o,c.height=i,h.translate(o,0),h.scale(-1,1);break;case 3:c.width=o,c.height=i,h.translate(o/2,i/2),h.rotate(180*Math.PI/180),h.translate(-o/2,-i/2);break;case 4:c.width=o,c.height=i,h.translate(0,i),h.scale(1,-1);break;case 5:c.height=o,c.width=i,h.rotate(.5*Math.PI),h.scale(1,-1);break;case 6:c.width=i,c.height=o,h.translate(i/2,o/2),h.rotate(90*Math.PI/180),h.translate(-o/2,-i/2);break;case 7:c.height=o,c.width=i,h.rotate(.5*Math.PI),h.translate(o,-i),h.scale(-1,1);break;case 8:c.height=o,c.width=i,h.translate(i/2,o/2),h.rotate(-90*Math.PI/180),h.translate(-o/2,-i/2);break;default:c.width=o,c.height=i}h.drawImage(e,0,0,o,i),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 o=t.width,i=t.height;n.getData(t).then(function(r){e.orientation=r.orientation||1;var n=Number(e.maxImgSize);!e.orientation&&o<n&i<n?e.imgs=e.img:(o>n&&(i=i/o*n,o=n),i>n&&(o=o/i*n,i=n),e.checkOrientationImage(t,e.orientation,o,i))})},t.onerror=function(){e.$emit("imgLoad","error"),e.$emit("img-load","error")},"data"!==this.img.substr(0,4)&&(t.crossOrigin=""),this.isIE){var o=new XMLHttpRequest;o.onload=function(){var e=URL.createObjectURL(this.response);t.src=e},o.open("GET",this.img,!0),o.responseType="blob",o.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 o=this.scale,i=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(i-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?o+=Math.abs(f):u<0&&o>Math.abs(f)&&(o-=Math.abs(f)),this.touches=e.touches,setTimeout(function(){t.touchNow=!1},8),!this.checkoutImgAxis(this.x,this.y,o))return!1;this.scale=o}},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 o,i,r="clientX"in e?e.clientX:e.touches[0].clientX,n="clientY"in e?e.clientY:e.touches[0].clientY;o=r-this.moveX,i=n-this.moveY,this.$nextTick(function(){if(t.centerBox){var e,r,n,a,s=t.getImgAxis(o,i,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&&(o=e),s.y1>=c.y1&&(i=r),s.x2<=c.x2&&(o=n),s.y2<=c.y2&&(i=a)}t.x=o,t.y=i,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 o=this.scale,i=e.deltaY||e.wheelDelta;i=navigator.userAgent.indexOf("Firefox")>0?30*i:i,this.isIE&&(i=-i);var r=this.coe,n=(r=r/this.trueWidth>r/this.trueHeight?r/this.trueHeight:r/this.trueWidth)*i;n<0?o+=Math.abs(n):o>Math.abs(n)&&(o-=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,o))return!1;this.scale=o},changeScale:function(e){var t=this.scale;e=e||1;var o=20;if((e*=o=o/this.trueWidth>o/this.trueHeight?o/this.trueHeight:o/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 o="clientX"in e?e.clientX:e.touches?e.touches[0].clientX:0,i="clientY"in e?e.clientY:e.touches?e.touches[0].clientY:0;this.$nextTick(function(){var e=o-t.cropX,r=i-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,o,i,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=o,this.changeCropTypeX=i,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 o="clientX"in e?e.clientX:e.touches?e.touches[0].clientX:0,i="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=o-t.cropX,c=i-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,o,i="clientX"in e?e.clientX:e.touches[0].clientX,r="clientY"in e?e.clientY:e.touches[0].clientY;t=i-this.cropOffsertX,o=r-this.cropOffsertY,this.cropX=t,this.cropY=o,this.$emit("cropMoving",{moving:!0,axis:this.getCropAxis()}),this.$emit("crop-moving",{moving:!0,axis:this.getCropAxis()})},moveCrop:function(e,t){var o=this,i=0,r=0;e&&(e.preventDefault(),i="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=i-o.cropX,s=r-o.cropY;if(t&&(a=o.cropOffsertX,s=o.cropOffsertY),e=a<=0?0:a+o.cropW>o.w?o.w-o.cropW:a,n=s<=0?0:s+o.cropH>o.h?o.h-o.cropH:s,o.centerBox){var c=o.getImgAxis();e<=c.x1&&(e=c.x1),e+o.cropW>c.x2&&(e=c.x2-o.cropW),n<=c.y1&&(n=c.y1),n+o.cropH>c.y2&&(n=c.y2-o.cropH)}o.cropOffsertX=e,o.cropOffsertY=n,o.$emit("cropMoving",{moving:!0,axis:o.getCropAxis()}),o.$emit("crop-moving",{moving:!0,axis:o.getCropAxis()})})},getImgAxis:function(e,t,o){e=e||this.x,t=t||this.y,o=o||this.scale;var i={x1:0,x2:0,y1:0,y2:0},r=this.trueWidth*o,n=this.trueHeight*o;switch(this.rotate){case 0:i.x1=e+this.trueWidth*(1-o)/2,i.x2=i.x1+this.trueWidth*o,i.y1=t+this.trueHeight*(1-o)/2,i.y2=i.y1+this.trueHeight*o;break;case 1:case-1:case 3:case-3:i.x1=e+this.trueWidth*(1-o)/2+(r-n)/2,i.x2=i.x1+this.trueHeight*o,i.y1=t+this.trueHeight*(1-o)/2+(n-r)/2,i.y2=i.y1+this.trueWidth*o;break;default:i.x1=e+this.trueWidth*(1-o)/2,i.x2=i.x1+this.trueWidth*o,i.y1=t+this.trueHeight*(1-o)/2,i.y2=i.y1+this.trueHeight*o}return i},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,o=document.createElement("canvas"),i=new Image,r=this.rotate,n=this.trueWidth,a=this.trueHeight,s=this.cropOffsertX,c=this.cropOffsertY;function h(e,t){o.width=Math.round(e),o.height=Math.round(t)}i.onload=function(){if(0!==t.cropW){var p=o.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(i,m/t.scale,v/t.scale,f/t.scale,g/t.scale)):p.drawImage(i,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(i,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(i,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(i,-m-f/t.scale,-v-g/t.scale,f/t.scale,g/t.scale)):(p.rotate(90*r*Math.PI/180),p.drawImage(i,-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(i,-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(i,-v-f,m,f,g));break;default:t.full?(h(u/t.scale,d/t.scale),p.drawImage(i,m/t.scale,v/t.scale,f/t.scale,g/t.scale)):p.drawImage(i,m,v,f,g)}p.restore()}else{var w=n*t.scale,x=a*t.scale,b=o.getContext("2d");switch(b.save(),r){case 0:h(w,x),b.drawImage(i,0,0,w,x);break;case 1:case-3:h(x,w),b.rotate(90*r*Math.PI/180),b.drawImage(i,0,-x,w,x);break;case 2:case-2:h(w,x),b.rotate(90*r*Math.PI/180),b.drawImage(i,-w,-x,w,x);break;case 3:case-1:h(x,w),b.rotate(90*r*Math.PI/180),b.drawImage(i,-w,0,w,x);break;default:h(w,x),b.drawImage(i,0,0,w,x)}b.restore()}e(o)},"data"!==this.img.substr(0,4)&&(i.crossOrigin="Anonymous"),i.src=this.imgs},getCropData:function(e){var t=this;this.getCropChecked(function(o){e(o.toDataURL("image/"+t.outputType,t.outputSize))})},getCropBlob:function(e){var t=this;this.getCropChecked(function(o){o.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,o=this.cropH,i=this.scale,r={};r.div={width:"".concat(t,"px"),height:"".concat(o,"px")};var n=(this.x-this.cropOffsertX)/i,a=(this.y-this.cropOffsertY)/i;r.w=t,r.h=o,r.url=this.imgs,r.img={width:"".concat(this.trueWidth,"px"),height:"".concat(this.trueHeight,"px"),transform:"scale(".concat(i,")translate3d(").concat(n,"px, ").concat(a,"px, ").concat(0,"px)rotateZ(").concat(90*this.rotate,"deg)")},r.html='\n <div class="show-preview" style="width: '.concat(r.w,"px; height: ").concat(r.h,'px,; overflow: hidden">\n <div style="width: ').concat(t,"px; height: ").concat(o,'px">\n <img src=').concat(r.url,' style="width: ').concat(this.trueWidth,"px; height: ").concat(this.trueHeight,"px; transform:\n scale(").concat(i,")translate3d(").concat(n,"px, ").concat(a,"px, ").concat(0,"px)rotateZ(").concat(90*this.rotate,'deg)">\n </div>\n </div>'),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),o=this.mode.split(" ");switch(o[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)<this.h&&(e=(t=this.h)/this.trueHeight);break;default:try{var i=o[0];if(-1!==i.search("px")){i=i.replace("px","");var r=parseFloat(i)/this.trueWidth,n=1,a=o[1];-1!==a.search("px")&&(a=a.replace("px",""),n=(t=parseFloat(a))/this.trueHeight),e=Math.min(r,n)}if(-1!==i.search("%")&&(i=i.replace("%",""),e=parseFloat(i)/100*this.w/this.trueWidth),2===o.length&&"auto"===i){var s=o[1];-1!==s.search("px")&&(s=s.replace("px",""),e=(t=parseFloat(s))/this.trueHeight),-1!==s.search("%")&&(s=s.replace("%",""),e=(t=parseFloat(s)/100*this.h)/this.trueHeight)}}catch(t){e=1}}return e},goAutoCrop:function(e,t){if(""!==this.imgs&&null!==this.imgs){this.clearCrop(),this.cropping=!0;var o=this.w,i=this.h;if(this.centerBox){var r=Math.abs(this.rotate)%2>0,n=(r?this.trueHeight:this.trueWidth)*this.scale,a=(r?this.trueWidth:this.trueHeight)*this.scale;o=n<o?n:o,i=a<i?a:i}var s=e||parseFloat(this.autoCropWidth),c=t||parseFloat(this.autoCropHeight);0!==s&&0!==c||(s=.8*o,c=.8*i),s=s>o?o:s,c=c>i?i: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 o=this;if(this.centerBox){var i=this.getImgAxis();e>i.x2-i.x1&&(t=(e=i.x2-i.x1)/this.fixedNumber[0]*this.fixedNumber[1]),t>i.y2-i.y1&&(e=(t=i.y2-i.y1)/this.fixedNumber[1]*this.fixedNumber[0])}this.cropW=e,this.cropH=t,this.checkCropLimitSize(),this.$nextTick(function(){o.cropOffsertX=(o.w-o.cropW)/2,o.cropOffsertY=(o.h-o.cropH)/2,o.centerBox&&o.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,o){e=e||this.x,t=t||this.y,o=o||this.scale;var i=!0;if(this.centerBox){var r=this.getImgAxis(e,t,o),n=this.getCropAxis();r.x1>=n.x1&&(i=!1),r.x2<=n.x2&&(i=!1),r.y1>=n.y1&&(i=!1),r.y2<=n.y2&&(i=!1)}return i}},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,o,i){for(var r=atob(this.toDataURL(o,i).split(",")[1]),n=r.length,a=new Uint8Array(n),s=0;s<n;s++)a[s]=r.charCodeAt(s);t(new Blob([a],{type:e.type||"image/png"}))}}),this.showPreview(),this.checkedImg()},destroyed:function(){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.cancelScale()}};o(1);var s=function(e,t,o,i,r,n,a,s){var c,h="function"==typeof e?e.options:e;if(t&&(h.render=t,h.staticRenderFns=[],h._compiled=!0),h._scopeId="data-v-"+n,c)if(h.functional){h._injectStyles=c;var p=h.render;h.render=function(e,t){return c.call(t),p(e,t)}}else{var l=h.beforeCreate;h.beforeCreate=l?[].concat(l,c):[c]}return{exports:e,options:h}}(a,i,0,0,0,"6dae58fd");s.options.__file="src/vue-cropper.vue";var c=s.exports;o.d(t,"VueCropper",function(){return c});var h=function(e){e.component("VueCropper",c)};"undefined"!=typeof window&&window.Vue&&h(window.Vue),t.default={version:"0.5.6",install:h,VueCropper:c,vueCropper:c}}])},e.exports=i()}});
//# sourceMappingURL=3.a707ad46b51e79db8932.js.map