You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
49 KiB
1 line
49 KiB
1 year ago
|
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-76a0ddeb"],{"25fd":function(t,e,o){"use strict";o("8ba7")},"265f":function(t,e,o){"use strict";o.r(e);var r=o("5530"),i=o("c24f"),n=o("2f62"),a=(o("c7cd"),o("53ca")),s=(o("ac1f"),o("00b4"),o("d3b7"),o("3ca3"),o("ddb0"),o("2b3d"),o("9861"),o("88a7"),o("271a"),o("5494"),o("466d"),o("81b2"),o("0eb6"),o("b7ef"),o("8bd4"),o("ace4"),o("5cc6"),o("907a"),o("9a8c"),o("a975"),o("735e"),o("c1ac"),o("d139"),o("3a7b"),o("986a"),o("1d02"),o("d5d6"),o("82f8"),o("e91f"),o("60bd"),o("5f96"),o("3280"),o("3fcc"),o("ca91"),o("25a1"),o("cd26"),o("3c5d"),o("2954"),o("649e"),o("219c"),o("170b"),o("b39a9"),o("6ce5"),o("2834"),o("72f7"),o("4ea1"),o("99af"),o("7e79")),c=o("90e7"),h=(s={name:"CropperImage",components:{VueCropper:s.VueCropper},data:function(){return{name:"",resImg:"",previews:{},option:{img:"",outputSize:1,outputType:"png",info:!0,canScale:!0,autoCrop:!0,autoCropWidth:200,autoCropHeight:200,fixed:!0,fixedNumber:[1,1],full:!1,fixedBox:!1,canMove:!0,canMoveBox:!0,original:!1,centerBox:!0,height:!1,infoTrue:!1,maxImgSize:3e3,enlarge:1,mode:"300px 300px"}}},methods:{imgLoad:function(t){},changeScale:function(t){this.$refs.cropper.changeScale(t=t||1)},rotateLeft:function(){this.$refs.cropper.rotateLeft()},rotateRight:function(){this.$refs.cropper.rotateRight()},realTime:function(t){var e=this,o=this;o.previews=t,this.$refs.cropper.getCropBlob((function(t){e.blobToDataURI(t,(function(t){o.previewImg=t}))}))},blobToDataURI:function(t,e){var o=new FileReader;o.readAsDataURL(t),o.onload=function(t){e(t.target.result)}},selectImg:function(t){var e=this,o=t.target.files[0];if(!/\.(jpg|jpeg|png|JPG|PNG)$/.test(t.target.value))return this.$message({message:"图片类型要求:jpeg、jpg、png",type:"error"}),!1;t=new FileReader,t.onload=function(t){t="object"===Object(a.a)(t.target.result)?window.URL.createObjectURL(new Blob([t.target.result])):t.target.result,e.option.img=t},t.readAsDataURL(o)},base64ImgtoFile:function(t){for(var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"file",o=(t=t.split(","),t[0].match(/:(.*?);/)[1]),r=o.split("/")[1],i=atob(t[1]),n=i.length,a=new Uint8Array(n);n--;)a[n]=i.charCodeAt(n);return new File([a],"".concat(e,".").concat(r),{type:o})},uploadFile:function(t){var e=this,o=new FormData;o.append("file",t),Object(c.o)(o).then((function(t){200==t.status?e.$emit("uploadImgSuccess",t.data):e.$message({message:"上传失败",type:"error",duration:1e3})}))},uploadImg:function(){var t=this;this.$refs.cropper.getCropData((function(e){t.resImg=t.base64ImgtoFile(e),t.uploadFile(t.resImg)}))}}},o("25fd"),o("2877"));s={name:"setting_user",components:{CropperImg:Object(h.a)(s,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"cropper-content"},[e("div",{staticClass:"cropper-box"},[e("div",{staticClass:"cropper"},[e("vue-cropper",{ref:"cropper",attrs:{img:t.option.img,outputSize:t.option.outputSize,outputType:t.option.outputType,info:t.option.info,canScale:t.option.canScale,autoCrop:t.option.autoCrop,autoCropWidth:t.option.autoCropWidth,autoCropHeight:t.option.autoCropHeight,fixed:t.option.fixed,fixedNumber:t.option.fixedNumber,full:t.option.full,fixedBox:t.option.fixedBox,canMove:t.option.canMove,canMoveBox:t.option.canMoveBox,original:t.option.original,centerBox:t.option.centerBox,height:t.option.height,infoTrue:t.option.infoTrue,maxImgSize:t.option.maxImgSize,enlarge:t.option.enlarge,mode:t.option.mode},on:{realTime:t.realTime,imgLoad:t.imgLoad}})],1),e("div",{staticClass:"footer-btn"},[e("div",{staticClass:"scope-btn"},[e("input",{staticStyle:{position:"absolute",clip:"rect(0 0 0 0)"},attrs:{type:"file",id:"uploads",accept:"image/png, image/jpeg, image/gif, image/jpg"},on:{change:function(e){return t.selectImg(e)}}}),e("el-button",{attrs:{size:"mini",type:"danger",plain:"",icon:"el-icon-zoom-in"},on:{click:function(e){return t.changeScale(1)}}},[t._v("放大")]),e("el-button",{attrs:{size:"mini",type:"danger",plain:"",icon:"el-icon-zoom-out"},on:{click:function(e){return t.changeScale(-1)}}},[t._v("缩小")]),e("el-button",{attrs:{size:"
|