(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-c21bcb84"],{9429:function(t,e,o){"use strict";o.r(e);var i=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("div",{staticClass:"user-info-head",on:{click:function(e){return t.editCropper()}}},[o("img",{staticClass:"img-circle img-lg",attrs:{src:t.options.img,title:"点击上传头像"}})]),o("el-dialog",{attrs:{title:t.title,visible:t.open,width:"800px","append-to-body":""},on:{"update:visible":function(e){t.open=e},opened:t.modalOpened,close:function(e){return t.closeDialog()}}},[o("el-row",[o("el-col",{style:{height:"350px"},attrs:{xs:24,md:12}},[t.visible?o("vue-cropper",{ref:"cropper",attrs:{img:t.options.img,info:!0,autoCrop:t.options.autoCrop,autoCropWidth:t.options.autoCropWidth,autoCropHeight:t.options.autoCropHeight,fixedBox:t.options.fixedBox},on:{realTime:t.realTime}}):t._e()],1),o("el-col",{style:{height:"350px"},attrs:{xs:24,md:12}},[o("div",{staticClass:"avatar-upload-preview"},[o("img",{style:t.previews.img,attrs:{src:t.previews.url}})])])],1),o("br"),o("el-row",[o("el-col",{attrs:{lg:2,md:2}},[o("el-upload",{attrs:{action:"#","http-request":t.requestUpload,"show-file-list":!1,"before-upload":t.beforeUpload}},[o("el-button",{attrs:{size:"small"}},[t._v(" 选择 "),o("i",{staticClass:"el-icon-upload el-icon--right"})])],1)],1),o("el-col",{attrs:{lg:{span:1,offset:2},md:2}},[o("el-button",{attrs:{icon:"el-icon-plus",size:"small"},on:{click:function(e){return t.changeScale(1)}}})],1),o("el-col",{attrs:{lg:{span:1,offset:1},md:2}},[o("el-button",{attrs:{icon:"el-icon-minus",size:"small"},on:{click:function(e){return t.changeScale(-1)}}})],1),o("el-col",{attrs:{lg:{span:1,offset:1},md:2}},[o("el-button",{attrs:{icon:"el-icon-refresh-left",size:"small"},on:{click:function(e){return t.rotateLeft()}}})],1),o("el-col",{attrs:{lg:{span:1,offset:1},md:2}},[o("el-button",{attrs:{icon:"el-icon-refresh-right",size:"small"},on:{click:function(e){return t.rotateRight()}}})],1),o("el-col",{attrs:{lg:{span:2,offset:6},md:2}},[o("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){return t.uploadImg()}}},[t._v("提 交")])],1)],1)],1)],1)},r=[],n=o("4360"),s=o("7e79"),a=o("c0c77"),l={components:{VueCropper:s["VueCropper"]},props:{user:{type:Object}},data:function(){return{open:!1,visible:!1,title:"修改头像",options:{img:n["a"].getters.avatar,autoCrop:!0,autoCropWidth:200,autoCropHeight:200,fixedBox:!0},previews:{}}},methods:{editCropper:function(){this.open=!0},modalOpened:function(){this.visible=!0},requestUpload:function(){},rotateLeft:function(){this.$refs.cropper.rotateLeft()},rotateRight:function(){this.$refs.cropper.rotateRight()},changeScale:function(t){t=t||1,this.$refs.cropper.changeScale(t)},beforeUpload:function(t){var e=this;if(-1==t.type.indexOf("image/"))this.$modal.msgError("文件格式错误，请上传图片类型,如：JPG，PNG后缀的文件。");else{var o=new FileReader;o.readAsDataURL(t),o.onload=function(){e.options.img=o.result}}},uploadImg:function(){var t=this;this.$refs.cropper.getCropBlob((function(e){var o=new FormData;o.append("avatarfile",e),Object(a["o"])(o).then((function(e){t.open=!1,t.options.img="/prod-api"+e.imgUrl,n["a"].commit("SET_AVATAR",t.options.img),t.$modal.msgSuccess("修改成功"),t.visible=!1}))}))},realTime:function(t){this.previews=t},closeDialog:function(){this.options.img=n["a"].getters.avatar,this.visible=!1}}},c=l,p=(o("c070"),o("2877")),u=Object(p["a"])(c,i,r,!1,null,"298615a8",null);e["default"]=u.exports},b1d2:function(t,e,o){},c070:function(t,e,o){"use strict";o("b1d2")}}]);