1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-951a59b6"],{"13e4":function(e,o,r){"use strict";var t=r("acda"),i=r.n(t);i.a},"1654e":function(e,o,r){"use strict";var t=r("5c16"),i=r.n(t);i.a},"3df8":function(e,o,r){"use strict";r.r(o);var t=function(){var e=this,o=e.$createElement,r=e._self._c||o;return r("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"user",attrs:{"element-loading-text":"Loading","element-loading-spinner":"el-icon-loading","element-loading-background":"rgba(0, 0, 0, 0.8)"}},[r("el-form",{ref:"userForm",staticClass:"user-form",attrs:{"label-width":"120px",model:e.userForm,rules:e.userRules,"hide-required-asterisk":""}},[r("el-form-item",{attrs:{prop:"name",label:"昵称:"}},[r("el-input",{ref:"name",staticStyle:{width:"250px"},attrs:{type:"text",size:"small",name:"name",placeholder:"请输入昵称"},model:{value:e.userForm.name,callback:function(o){e.$set(e.userForm,"name",o)},expression:"userForm.name"}})],1),e._v(" "),r("el-form-item",{attrs:{prop:"personWords",label:"简介:"}},[r("el-input",{ref:"personWords",staticStyle:{width:"250px"},attrs:{type:"textarea",size:"small",name:"personWords",rows:"3",resize:"none",placeholder:"请输入简介"},model:{value:e.userForm.personWords,callback:function(o){e.$set(e.userForm,"personWords",o)},expression:"userForm.personWords"}})],1),e._v(" "),r("el-form-item",{attrs:{prop:"imageUrl",label:"头像:"}},[e.userForm.imageUrl?r("div",{staticClass:"image"},[r("el-image",{staticClass:"img",attrs:{fit:"contain",src:e.userForm.imageUrl,"preview-src-list":[e.userForm.imageUrl]}}),e._v(" "),r("div",{staticClass:"operation"},[r("i",{staticClass:"el-icon-circle-close",on:{click:e.fileRemove}})])],1):r("el-upload",{ref:"upload",staticClass:"image",attrs:{action:"string",accept:"image/jpeg, image/png, image/jpg",multiple:!1,limit:1,"before-upload":e.onBeforeUploadImage,"http-request":e.UploadImage,"on-remove":e.fileRemove,"show-file-list":!1}},[r("i",{staticClass:"el-icon-circle-plus upload-icon"}),e._v(" "),r("p",[e._v("上传头像")])]),e._v(" "),r("div",{staticClass:"el-upload__tip"},[e._v("\n 只能上传jpg/png文件,大小不能超过 500KB\n ")])],1),e._v(" "),r("el-form-item",[r("el-button",{staticClass:"next-btn",attrs:{type:"primary",size:"small"},nativeOn:{click:function(o){return o.preventDefault(),e.Save(o)}}},[e._v("保存")])],1)],1),e._v(" "),r("el-form",{ref:"mobileForm",staticClass:"user-form",attrs:{"label-width":"120px",model:e.mobileForm,rules:e.mobileRules,"hide-required-asterisk":""}},[r("el-form-item",{attrs:{prop:"mobile",label:"手机号码:"}},[r("el-input",{ref:"mobile",staticStyle:{width:"220px"},attrs:{type:"text",size:"small",name:"mobile",placeholder:"请输入手机号码"},model:{value:e.mobileForm.mobile,callback:function(o){e.$set(e.mobileForm,"mobile",o)},expression:"mobileForm.mobile"}}),e._v(" "),r("el-button",{directives:[{name:"show",rawName:"v-show",value:e.loginMobile!==e.mobileForm.mobile,expression:"loginMobile!==mobileForm.mobile"}],staticClass:"code",attrs:{type:"danger",size:"small",disabled:e.countDown>0,plain:""},nativeOn:{click:function(o){return o.preventDefault(),e.getCode(o)}}},[e._v(e._s(e.countDown>0?e.countDown+"s":"获取验证码"))])],1),e._v(" "),r("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.loginMobile!==e.mobileForm.mobile,expression:"loginMobile!==mobileForm.mobile"}],attrs:{prop:"code",label:"验证码:"}},[r("el-input",{ref:"code",staticStyle:{width:"220px"},attrs:{type:"text",size:"small",name:"code",placeholder:"请输入验证码"},model:{value:e.mobileForm.code,callback:function(o){e.$set(e.mobileForm,"code",o)},expression:"mobileForm.code"}})],1),e._v(" "),"1"==e.userType||"2"==e.userType?r("el-form-item",{attrs:{prop:"userName",label:"管理员名称:"}},[r("el-input",{ref:"userName",staticStyle:{width:"220px"},attrs:{type:"text",size:"small",name:"code",placeholder:"请输入管理员名称"},model:{value:e.mobileForm.userName,callback:function(o){e.$set(e.mobileForm,"userName",o)},expression:"mobileForm.userName"}})],1):e._e()],1)],1)},i=[],l=(r("7f7f"),r("b775")),a=r("61f7"),s={name:"Real",data:function(){var e=function(e,o,r){o&&(Object(a["d"])(o)?r():r(new Error("请输入正确的手机号码")))},o=function(e,o,r){o&&(Object(a["b"])(o)?r():r(new Error("验证码为6位数字")))};return{loading:!1,mobileFlog:"",userType:this.$store.getters.userType,countDown:"00",userForm:{name:"",personWords:"",imageUrl:""},userRules:{},mobileRules:{mobile:[{required:!0,trigger:"blur",validator:e}],code:[{required:!0,trigger:"blur",validator:o}]},mobileForm:{mobile:"",code:"",userName:""},file:"",starLevel:0,loginMobile:""}},computed:{},created:function(){this.getUserInfo()},methods:{getUserInfo:function(){var e=this,o={transCode:"B00001"};Object(l["c"])(o).then((function(o){console.log(o),e.$store.dispatch("user/changeState",{key:"name",value:o.nickName}),e.userForm.name=o.nickName,e.userForm.personWords=o.personWords,e.userForm.imageUrl=Object(l["b"])(o.headProfile),e.mobileForm.mobile=o.mobileNo,e.loginMobile=o.mobileNo,e.mobileForm.userName=o.adminName,e.mobileForm.mobile=o.mobileNo})).catch((function(e){}))},onBeforeUploadImage:function(e){var o="image/jpeg"===e.type||"image/jpg"===e.type||"image/png"===e.type;o||this.$message.error("上传文件只能是图片格式!");var r=e.size/1024/1024<.5;return r||this.$message.error("上传文件大小不能超过 500KB!"),o&&r},UploadImage:function(e){this.userForm.imageUrl=URL.createObjectURL(e.file),this.file=e.file,this.$refs.upload.clearFiles()},fileRemove:function(){this.userForm.imageUrl="",this.file=""},theLast:function(){var e=this;this.countDown=60;var o=setInterval((function(){e.countDown>0?(e.countDown--,e.countDown<10&&(e.countDown="0"+e.countDown)):clearInterval(o)}),1e3)},getCode:function(){var e=this;if(this.mobileFlog=1,this.countDown>0)return this.$message.error("请不要频繁点击!");if(!this.mobileForm.mobile)return this.$message.error("请输入手机号码!");if(!Object(a["d"])(this.mobileForm.mobile))return this.$message.error("请输入正确的手机号码!");var o={transCode:"A00001",mailOrPhone:this.mobileForm.mobile,type:"4",channel:"1"};Object(l["c"])(o).then((function(o){e.$message.success("验证码已发送至手机号码: ".concat(e.mobileForm.mobile," ,请注意查收!")),e.theLast()})).catch((function(e){}))},Save:function(){var e=this;this.$refs.userForm.validate((function(o){if(!o)return!1;e.loading=!0;var r=new FormData;r.append("transCode","B00002"),r.append("nickName",e.userForm.name),r.append("mobnub",e.mobileForm.mobile),1===e.mobileFlog?r.append("mobnub",e.mobileForm.mobile):r.append("mobnub",""),1===e.mobileFlog?r.append("verificationCode",e.mobileForm.code):r.append("verificationCode",""),r.append("adminName",e.mobileForm.userName),r.append("personWords",e.userForm.personWords),r.append("headProfile",e.file),Object(l["d"])(r,"service",(function(e){console.log("progress: "+e+"%")})).then((function(o){e.$message.success("保存成功!"),e.loading=!1})).catch((function(o){e.loading=!1}))}))},getImage:function(e){return Object(l["b"])(e)}}},n=s,m=(r("13e4"),r("1654e"),r("2877")),c=Object(m["a"])(n,t,i,!1,null,"fe055846",null);o["default"]=c.exports},"5c16":function(e,o,r){e.exports={color_0:"#000",color_3:"#333",color_6:"#666",color_9:"#999",color_b:"#bbb",color_d:"#ddd",color_e:"#eee",color_f2:"#f2f2f2",color_f5:"#f5f5f5",color_fa:"#fafafa",color_fc:"#fcfcfc",color_f:"#fff",color_on:"#FD5A57",pad:"120px"}},acda:function(e,o,r){}}]);
|