12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6db62d8c"],{bdc5:function(e,t,r){"use strict";r.r(t);var o=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-card",{scopedSlots:e._u([{key:"header",fn:function(){return[r("content-header")]},proxy:!0}])},[r("el-row",{attrs:{type:"flex",justify:"center"}},[r("lz-form",{ref:"form",attrs:{"get-data":e.getData,submit:e.onSubmit,errors:e.errors,form:e.form,"disable-redirect":"","disable-stay":"","edit-mode":""},on:{"update:errors":function(t){e.errors=t},"update:form":function(t){e.form=t}}},[r("el-form-item",{attrs:{label:"账号"}},[r("el-input",{attrs:{value:e.getInfo("account"),readonly:""}})],1),r("el-form-item",{attrs:{label:"姓名",required:"",prop:"name"}},[r("el-input",{model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),r("el-form-item",{attrs:{label:"头像",prop:"avatar"}},[r("file-picker",{attrs:{ext:"jpg,gif,png,jpeg"},model:{value:e.form.avatar,callback:function(t){e.$set(e.form,"avatar",t)},expression:"form.avatar"}})],1),r("el-form-item",{attrs:{label:"密码",prop:"password"}},[r("el-input",{attrs:{type:"password",autocomplete:"new-password"},model:{value:e.form.password,callback:function(t){e.$set(e.form,"password",t)},expression:"form.password"}})],1),r("el-form-item",{attrs:{label:"确认密码",prop:"password_confirmation"}},[r("el-input",{attrs:{type:"password",autocomplete:"new-password"},model:{value:e.form.password_confirmation,callback:function(t){e.$set(e.form,"password_confirmation",t)},expression:"form.password_confirmation"}})],1),r("el-form-item",{attrs:{label:"角色"}},e._l(e.getInfo("roles",[]),function(t){return r("el-tag",{key:t.id,staticClass:"mr-1"},[e._v("\n "+e._s(t.name)+"\n ")])}),1)],1)],1)],1)},a=[],n=(r("96cf"),r("3b8d")),i=r("ada3"),s=r("fe06"),c=r("22a6"),f=r("8e5b"),u={name:"EditProfile",components:{LzForm:i["a"],FilePicker:f["a"]},mixins:[s["a"]],data:function(){return{form:{name:"",avatar:"",password:"",password_confirmation:""},profile:null,errors:{}}},methods:{getInfo:function(e,t){return this.profile?this.profile[e]:t},getData:function(){var e=Object(n["a"])(regeneratorRuntime.mark(function e(){var t,r;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(c["b"])();case 2:t=e.sent,r=t.data,this.profile=r,this.fillForm(r);case 6:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),onSubmit:function(){var e=Object(n["a"])(regeneratorRuntime.mark(function e(){var t,r;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(c["h"])(this.form);case 2:t=e.sent,r=t.data,this.$store.commit("SET_USER",r),this.form=Object.assign({},this.form,{password:"",password_confirmation:""});case 6:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}()}},l=u,m=r("2877"),d=Object(m["a"])(l,o,a,!1,null,null,null);t["default"]=d.exports},fe06:function(e,t,r){"use strict";var o=r("873a");t["a"]={provide:function(){return{view:this}},data:function(){return{formField:"form",idField:"id"}},computed:{editMode:function(){return!!this.resourceId},resourceId:function(){return this.$route.params[this.idField]}},created:function(){this.backupForm()},methods:{getResourceId:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";return this.$route.params[e]},backupForm:function(){this.formBak=JSON.parse(JSON.stringify(this.$data[this.formField]))},fillForm:function(e){this.$data[this.formField]=Object(o["b"])(this.$data[this.formField],e)}}}}}]);
- //# sourceMappingURL=chunk-6db62d8c.0936f194.js.map
|