123456 |
- /*!
- * build: Hopaheal
- * copyright: Mead
- * time: 2022-7-23 18:51:45
- */
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-58a54aa0"],{1842:function(e,t,s){"use strict";s("5a7c")},"5a7c":function(e,t,s){},"84d8":function(e,t,s){"use strict";s.r(t),s.d(t,"getStuList",(function(){return a})),s.d(t,"getTeaList",(function(){return i})),s.d(t,"getUser",(function(){return u})),s.d(t,"doEdit",(function(){return o}));var r=s("b775");function a(e){return Object(r["default"])({url:"/mentor/student",method:"get",params:e})}function i(e){return Object(r["default"])({url:"/mentor/teacher",method:"get",params:e})}function u(e){return Object(r["default"])({url:"/admin/auth/me",method:"get",params:e})}function o(e){return Object(r["default"])({url:"/admin/auth/me",method:"put",data:e})}},a965:function(e,t,s){"use strict";s.r(t);var r=function(){var e=this,t=e._self._c;return t("div",{staticClass:"container"},[t("el-form",{ref:"current_user",attrs:{"label-width":"120px",model:e.current_user,rules:e.rules}},[t("el-form-item",{attrs:{label:"账号",prop:"username"}},[t("el-input",{attrs:{disabled:!0},model:{value:e.current_user.username,callback:function(t){e.$set(e.current_user,"username",t)},expression:"current_user.username"}})],1),t("el-form-item",{attrs:{label:"密码",prop:"password"}},[t("el-input",{attrs:{"show-password":"",type:"password"},model:{value:e.current_user.password,callback:function(t){e.$set(e.current_user,"password",t)},expression:"current_user.password"}})],1),t("el-form-item",{attrs:{label:"确认密码",prop:"password_confirmation"}},[t("el-input",{attrs:{"show-password":"",type:"password"},model:{value:e.current_user.password_confirmation,callback:function(t){e.$set(e.current_user,"password_confirmation",t)},expression:"current_user.password_confirmation"}})],1),t("el-form-item",{attrs:{label:"姓名",prop:"name"}},[t("el-input",{model:{value:e.current_user.name,callback:function(t){e.$set(e.current_user,"name",t)},expression:"current_user.name"}})],1),e.head_url?t("el-form-item",{attrs:{label:""}},[t("img",{staticClass:"head_img",attrs:{alt:"",src:e.head_url}})]):e._e(),t("el-form-item",{attrs:{label:"头像",prop:"headimg"}},[t("el-upload",{staticClass:"upload-demo",attrs:{action:e.action,data:e.uploadData,"file-list":e.fileList,limit:e.limit,"list-type":"picture",multiple:"","on-success":e.uploadSuccess}},[t("el-button",{attrs:{size:"small",type:"primary"},on:{click:e.clearFile}},[e._v(" "+e._s(e.head_url?"重新上传":"上传照片")+" ")]),t("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v(" 只能上传jpg/png文件,且不超过500kb(建议尺寸:150*150) ")])],1)],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{type:"primary"},on:{click:e.do_reset}},[e._v("保存信息")])],1)],1)},a=[],i=s("2f62"),u=s("84d8"),o=s("f121"),n={data(){return{current_user:{},rules:{name:[{required:!0,trigger:"blur",message:"请输入姓名"}],username:[{required:!0,trigger:"blur",message:"请输入账号"}],headimg:[{required:!0,trigger:"blur",message:"请上传本人照片"}]},action:"",uploadData:{file_type:"img",type:"user_headimg"},limit:1,head_url:"",tea_type:0}},computed:{...Object(i["c"])({role_id:"user/role_id",type:"user/type"})},async created(){this.type.type&&(this.tea_type=this.type.type),this.action=o["baseURL"]+"/admin/common/upload",this.fileList=[],console.log(this.role_id),await this.getUser()},methods:{...Object(i["b"])({setAvatar:"user/setAvatar"}),uploadSuccess(e){console.log(e,"图片上传成功"),this.current_user.headimg=e.data.path},clearFile(){console.log("上传之前"),this.head_url=""},async getUser(){this.listLoading=!0;const{data:e}=await Object(u["getUser"])();console.log(e,"user"),this.userList=e,this.head_url=e.headimg,this.userList.type_model?this.current_user=this.userList.type_model:this.current_user=this.userList,console.log(this.current_user,"this.current_user"),this.listLoading=!1},do_reset(){this.current_user.password===this.current_user.password_confirmation?(this.current_user.department_id=0,this.$refs["current_user"].validate(async e=>{if(e){this.current_user.type_id=this.userList.type_id;const{message:e}=await Object(u["doEdit"])(this.current_user);this.$baseMessage(e,"success",!1,"vab-hey-message-success"),this.setAvatar(this.current_user.headimg),this.info_visiable=!1,this.close()}})):this.$message.warning("您两次输入的密码不一致!")},close(e){this.$nextTick(()=>{void 0!==this.$refs[e]&&this.$refs[e].resetFields()}),this.form=this.$options.data().form,this.fileList=[],this.dialogFormVisible=!1}}},l=n,c=(s("1842"),s("2877")),d=Object(c["a"])(l,r,a,!1,null,"0215c072",null);t["default"]=d.exports}}]);
|