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.
wkcrm/static/js/chunk-ad71.029499f6.js

1 line
11 KiB

4 years ago
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-ad71"],{"+H+P":function(e,t,i){"use strict";var a={name:"EditImage",components:{VueCropper:i("fnnb").VueCropper},props:{width:{type:String,default:"450px"},title:{type:String,default:"编辑头像"},saveButtonTitle:{type:String,default:"开始上传"},show:{type:Boolean,default:!1},fixedNumber:{type:Array,default:function(){return[1,1]}},previewWidth:{type:String,default:"70px"},previewHeight:{type:String,default:"70px"},previewRadius:{type:String,default:"35px"},file:[File],image:String},data:function(){return{loading:!1,showDialog:!1,cropperImg:"",previewImg:""}},computed:{},watch:{show:{handler:function(e){this.showDialog=e},deep:!0,immediate:!0},image:function(e){this.cropperImg=e}},mounted:function(){this.cropperImg=this.image},methods:{realTime:function(e){var t=this;this.$refs.cropper.getCropData(function(e){t.previewImg=e})},submiteImage:function(){var e=this;this.$refs.cropper.getCropBlob(function(t){e.$emit("save",{blob:t,file:e.file,image:e.previewImg}),e.hiddenView()})},hiddenView:function(){this.$emit("close")}}},n=(i("0H2c"),i("KHd+")),r=Object(n.a)(a,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{title:e.title,width:e.width,"append-to-body":!0,"close-on-click-modal":!1,visible:e.showDialog},on:{"update:visible":function(t){e.showDialog=t},close:e.hiddenView}},[i("flexbox",{staticClass:"content"},[i("div",{staticClass:"cropper-box"},[i("vueCropper",{ref:"cropper",attrs:{"can-move":!0,"auto-crop":!0,fixed:!0,"fixed-number":e.fixedNumber,img:e.cropperImg,"output-type":"png"},on:{realTime:e.realTime}})],1),e._v(" "),i("div",{staticClass:"preview"},[i("div",{staticClass:"preview-name"},[e._v("预览")]),e._v(" "),i("img",{staticClass:"preview-img",style:{width:e.previewWidth,height:e.previewHeight,"border-radius":e.previewRadius},attrs:{src:e.previewImg}})])]),e._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"primary"},on:{click:function(t){e.submiteImage()}}},[e._v(e._s(e.saveButtonTitle))])],1)],1)},[],!1,null,"923b6484",null);r.options.__file="EditImage.vue";t.a=r.exports},"0H2c":function(e,t,i){"use strict";var a=i("T45K");i.n(a).a},"44Km":function(e,t,i){"use strict";i.r(t);var a=i("QbLZ"),n=i.n(a),r=i("L2JU"),s=i("EJiy"),l=i.n(s),o=i("P2sY"),d=i.n(o),c=i("ef+5"),u=i("7Qib"),f={name:"EditUserInfo",components:{EditImage:i("+H+P").a},data:function(){return{fieldList:[{label:"姓名",field:"realname"},{label:"手机号(登录名)",field:"mobile",disabled:!0},{label:"直属上级",field:"parent_name",disabled:!0},{label:"性别",field:"sex",type:"select",setting:[{label:"请选择",value:0},{label:"男",value:1},{label:"女",value:2}]},{label:"邮箱",field:"email"},{label:"部门",field:"structure_name",disabled:!0},{label:"岗位",field:"post"}],rules:{realname:[{required:!0,message:"请填写姓名",trigger:"blur"}],email:[{validator:function(e,t,i){!t||""==t||Object(u.u)(t)?i():i(new Error("邮箱格式有误"))},trigger:"change"}],username:[{required:!0,message:"请填写姓名",trigger:"blur"},{validator:function(e,t,i){!t||""==t||Object(u.v)(t)?i():i(new Error("手机格式有误"))},trigger:"change"}]},form:{},loading:!1,showEditImage:!1,editFile:null,editImage:null}},computed:n()({},Object(r.b)(["userInfo"])),watch:{userInfo:{handler:function(){this.initData()},deep:!0,immediate:!0}},methods:{initData:function(){this.form=d()({},this.userInfo)},handleChangeAvatar:function(){document.getElementById("inputFile").click()},uploadFile:function(e){var t=e.target.files[0],i=new FileReader,a=this;i.onload=function(e){var i=void 0;i="object"===l()(e.target.result)?window.URL.createObjectURL(new Blob([e.target.result])):e.target.result,a.editImage=i,a.editFile=t,a.showEditImage=!0,e.target.value=""},i.readAsDataURL(t)},submitImage:function(e){var t=this;this.loading=!0;var i=new FormData;i.append("id",this.form.id),i.append("file",e.blob,e.file.name),Object(c.d)(i).