16.8091f00470354888c27f.js 11 KB

1
  1. webpackJsonp([16],{"K+Mi":function(e,t,r){var i=r("jLMP");"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);r("rjj0")("1e0d0630",i,!1,{})},"VmR/":function(e,t,r){(t=r("yGwj")(!0)).push([e.i,"\n.el-input-group__append[data-v-15c7453c]{border-radius:0 !important\n}\n.page-form-item[data-v-15c7453c]{display:inline-block\n}\n","",{version:3,sources:["NProvinceCity.vue"],names:[],mappings:";AACA,yCAAyC;AACzC;AACA,iCAAiC;AACjC",file:"NProvinceCity.vue",sourcesContent:["\n.el-input-group__append[data-v-15c7453c]{border-radius:0 !important\n}\n.page-form-item[data-v-15c7453c]{display:inline-block\n}\n"]}]),e.exports=t},e3qi:function(e,t,r){var i=r("VmR/");"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);r("rjj0")("ab4d5740",i,!1,{})},"g/QW":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r("SQ4B"),o=r("b9vf"),a=r("qI5z"),n=r("vGYV"),s=r("BO1k"),c=r.n(s),l=r("atWu"),p=r.n(l),u={name:"nProvinceCity",props:{provinceCode:{type:String,default:""},cityCode:{type:String,default:""},isModifyMode:{type:Boolean,default:!1}},created:function(){this.provinces=p.a.provinces},mounted:function(){this.province=this.provinceCode,this.provinceChanged(this.provinceCode)},data:function(){return{loadingCity:!1,province:"",city:"",provinces:[],cities:[]}},methods:{provinceChanged:function(e){if(""!==e){this.loadingCity=!0;var t=!0,r=!1,i=void 0;try{for(var o,a=c()(this.provinces);!(t=(o=a.next()).done);t=!0){var n=o.value;if(n.code===e){this.cities=n.cities,this.city="",this.loadingCity=!1;break}}}catch(e){r=!0,i=e}finally{try{!t&&a.return&&a.return()}finally{if(r)throw i}}}else this.cities=[],this.city="";this.$emit("selectChange",this.province,this.city)},cityChanged:function(e){this.$emit("selectChange",this.province,this.city)},buildCityArr:function(e){this.loadingCity=!0;var t=(this.provinces||[]).find(function(t){return t.code===e});this.cities=t&&t.cities||[],this.loadingCity=!1}},watch:{provinceCode:function(e){this.province=e,this.buildCityArr(e)},cityCode:function(e){this.city=e}}},d=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"province-city"},[r("el-form-item",{staticClass:"page-form-item",staticStyle:{width:"calc(30% - 20px)","margin-right":"5%"},attrs:{"label-width":"0%",label:"",prop:"status"}},[r("el-select",{attrs:{placeholder:"请选择",disabled:e.isModifyMode},on:{change:e.provinceChanged},model:{value:e.province,callback:function(t){e.province=t},expression:"province"}},e._l(e.provinces,function(e){return r("el-option",{key:e.code,attrs:{label:e.name,value:e.code}})}),1)],1),e._v(" "),r("el-form-item",{staticClass:"page-form-item",staticStyle:{width:"calc(30% - 20px)","margin-right":"0px"},attrs:{"label-width":"0%",label:"",prop:"status"}},[r("el-select",{attrs:{loading:e.loadingCity,placeholder:"请选择",disabled:e.isModifyMode},on:{change:e.cityChanged},model:{value:e.city,callback:function(t){e.city=t},expression:"city"}},e._l(e.cities,function(e){return r("el-option",{key:e.code,attrs:{label:e.name,value:e.code}})}),1)],1)],1)};d._withStripped=!0;var m={render:d,staticRenderFns:[]},h=m;var A=!1;var v=r("VU/8")(u,h,!1,function(e){A||r("e3qi")},"data-v-15c7453c",null);v.options.__file="src/components/commons/NProvinceCity.vue";var f={name:"Mine",data:function(){return{user:{},isModifyMode:!1,serviceType:[],userForm:{gender:"",birthday:new Date,photoUrl:"",userName:"",unit:"",personalCompetence:[],province:"",city:"",location:{}},pickerOptions:{disabledDate:function(e){return e.getTime()>Date.now()}},rules:{photoUrl:[{required:!0,message:"请上传头像",trigger:"blur"}],userName:[{required:!0,message:"请设置用户名",trigger:"change"}],gender:[{required:!0,message:"请选择性别",trigger:"blur"}]}}},components:{provincecity:v.exports},methods:{submitUserInfo:function(){var e=this;this.$refs.userForm.validate(function(t){if(t){var r=Object(n.B)(e.userForm.province,e.userForm.city);console.log(r),void 0!==r&&(e.userForm.province=r.provinceCode,e.userForm.city=r.cityCode);var o=e.userForm;delete o.location,console.log(o),i.a.put("/api/personal/update/"+e.user.id,o).then(function(t){e.isModifyMode=!1,Object(a.a)("success","修改成功 "),r.reload()})}})},locationChange:function(e,t){(e||t)&&(this.userForm.province=e,this.userForm.city=t)},beforeFileUpload:function(e){if(e.size>5e6)return Object(a.a)("error","单个文件大小不能超过5M"),!1;var t=e.name,r=t.lastIndexOf(".");if(r<=0)return Object(a.a)("error","只能上传png/jpg/jpeg格式的文件"),!1;var i=t.substr(r);return".jpg"!==i&&".png"!==i&&".jpeg"!==i?(Object(a.a)("error","只能上传png/jpg/jpeg格式的文件"),!1):void 0},uploadFile:function(e){var t=this,r=new FormData;r.append("file",e.file),i.a.upload(o.a.FILE.UPLOAD_IMAGE.replace("{userId}",this.user.id),r,{headers:{"Content-Type":"multipart/form-data"}}).then(function(e){t.userForm.photoUrl=e.data,Object(a.a)("success","上传成功")}).catch(function(e){Object(a.a)("error",e.data)})},loadData:function(){var e=this;i.a.get("/api/personal/display/"+this.user.id).then(function(t){e.userForm.gender=t.userVO.gender?t.userVO.gender:"",e.userForm.photoUrl=t.userVO.photoUrl?t.userVO.photoUrl:"",e.userForm.birthday=t.userVO.birthday?t.userVO.birthday:new Date,e.userForm.userName=t.userVO.userName?t.userVO.userName:"",e.userForm.unit=t.userVO.unit?t.userVO.unit:"",e.userForm.province=t.userVO.province?t.userVO.province:"",e.userForm.city=t.userVO.city?t.userVO.city:"",e.userForm.personalCompetence=t.userVO.personalCompetence?t.userVO.personalCompetence:[],e.userForm.location=Object(n.A)(e.userForm.province,e.userForm.city),e.userForm.province=e.userForm.location&&e.userForm.location.provinceCode,e.userForm.city=e.userForm.location&&e.userForm.location.cityCode})},setUserInfo:function(){this.user=Object(n.M)("user")&&Object(n.M)("user").userVO},setServiceType:function(){var e=this;Object(n.s)().then(function(t){e.serviceType=t})}},mounted:function(){var e=this;this.$nextTick(function(){e.setUserInfo(),e.setServiceType(),e.loadData()})}},C=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"right-mine"},[e._m(0),e._v(" "),r("div",{staticStyle:{"margin-bottom":"15px",width:"550px"}},[r("el-form",{ref:"userForm",staticClass:"demo-ruleForm",attrs:{model:e.userForm,rules:e.rules,"status-icon":"","label-width":"100px"}},[r("el-form-item",{attrs:{label:"头像",prop:"photoUrl"}},[r("el-upload",{staticClass:"avatar-uploader",staticStyle:{border:"lightgrey 1px solid"},attrs:{action:"https://jsonplaceholder.typicode.com/posts/","before-upload":e.beforeFileUpload,"http-request":e.uploadFile}},[e.userForm.photoUrl?r("img",{staticClass:"avatar",attrs:{src:e.userForm.photoUrl}}):r("i",{staticClass:"el-icon-plus avatar-uploader-icon"})])],1),e._v(" "),r("el-form-item",{attrs:{label:"用户名",prop:"userName"}},[r("el-input",{attrs:{autocomplete:"off",disabled:!0},model:{value:e.userForm.userName,callback:function(t){e.$set(e.userForm,"userName",t)},expression:"userForm.userName"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"单位",prop:"unit"}},[r("el-input",{attrs:{autocomplete:"off"},model:{value:e.userForm.unit,callback:function(t){e.$set(e.userForm,"unit",t)},expression:"userForm.unit"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"性别",prop:"gender"}},[r("el-radio-group",{model:{value:e.userForm.gender,callback:function(t){e.$set(e.userForm,"gender",t)},expression:"userForm.gender"}},[r("el-radio",{attrs:{label:"男"}}),e._v(" "),r("el-radio",{attrs:{label:"女"}})],1)],1),e._v(" "),r("el-form-item",{attrs:{label:"生日",prop:"birthday"}},[r("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"date",placeholder:"选择日期","picker-options":e.pickerOptions},model:{value:e.userForm.birthday,callback:function(t){e.$set(e.userForm,"birthday",t)},expression:"userForm.birthday"}})],1),e._v(" "),r("el-form-item",{staticStyle:{width:"160%"},attrs:{label:"省市",prop:"address"}},[null!==e.userForm.location?r("provincecity",{ref:"addFormProvince",attrs:{provinceCode:null!==e.userForm.location?e.userForm.location&&e.userForm.location.provinceCode:"3200",cityCode:null!==e.userForm.location?e.userForm.location&&e.userForm.location.cityCode:"3201"},on:{selectChange:e.locationChange}}):e._e()],1),e._v(" "),r("el-form-item",{staticStyle:{width:"160%"},attrs:{label:"个人能力"}},[r("el-checkbox-group",{model:{value:e.userForm.personalCompetence,callback:function(t){e.$set(e.userForm,"personalCompetence",t)},expression:"userForm.personalCompetence"}},e._l(e.serviceType,function(t){return r("el-checkbox",{key:t.code,attrs:{label:t.code,name:t.code}},[e._v(e._s(t.name))])}),1)],1),e._v(" "),r("el-form-item",[r("el-button",{staticClass:"pull-left",attrs:{type:"primary",size:"small"},on:{click:e.submitUserInfo}},[e._v("提交修改")])],1)],1)],1)])};C._withStripped=!0;var g={render:C,staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"right-mine-title"},[t("span",{staticStyle:{"font-size":"18px","font-weight":"bold"}},[this._v("基本设置")])])}]},y=g;var b=!1;var x=r("VU/8")(f,y,!1,function(e){b||r("K+Mi")},"data-v-791c4f2e",null);x.options.__file="src/pages/UserCenter/Mine.vue";t.default=x.exports},jLMP:function(e,t,r){(t=r("yGwj")(!0)).push([e.i,"\n.el-input-group__append[data-v-791c4f2e]{border-radius:0 !important\n}\n.avatar-uploader[data-v-791c4f2e]{border-radius:6px;cursor:pointer;position:relative;overflow:hidden;margin-right:30px;width:178px;height:178px\n}\n.avatar-uploader .el-upload[data-v-791c4f2e]:hover{border-color:#409EFF\n}\n.avatar-uploader-icon[data-v-791c4f2e]{font-size:28px;color:#8c939d;width:178px;height:178px;line-height:178px;text-align:center\n}\n.avatar[data-v-791c4f2e]{width:178px;height:178px;display:block\n}\n.right-mine[data-v-791c4f2e]{padding:20px;background-color:#fff;-webkit-box-shadow:0px 1px 6px 0px rgba(8,6,6,0.13);box-shadow:0px 1px 6px 0px rgba(8,6,6,0.13)\n}\n.right-mine .right-mine-title[data-v-791c4f2e]{padding:10px;border-bottom:1px solid #ccc;margin-bottom:20px\n}\n.right-mine .avator-wrapper[data-v-791c4f2e]{height:70px;width:70px;line-height:70px;vertical-align:middle\n}\n","",{version:3,sources:["Mine.vue"],names:[],mappings:";AACA,yCAAyC;AACzC;AACA,kCAAkC,iBAAiB,CAAC,cAAc,CAAC,iBAAiB,CAAC,eAAe,CAAC,iBAAiB,CAAC,WAAW,CAAC;AACnI;AACA,mDAAmD;AACnD;AACA,uCAAuC,cAAc,CAAC,aAAa,CAAC,WAAW,CAAC,YAAY,CAAC,iBAAiB,CAAC;AAC/G;AACA,yBAAyB,WAAW,CAAC,YAAY,CAAC;AAClD;AACA,6BAA6B,YAAY,CAAC,qBAAqB,CAAC,mDAAmD,CAAC;AACpH;AACA,+CAA+C,YAAY,CAAC,4BAA4B,CAAC;AACzF;AACA,6CAA6C,WAAW,CAAC,UAAU,CAAC,gBAAgB,CAAC;AACrF",file:"Mine.vue",sourcesContent:["\n.el-input-group__append[data-v-791c4f2e]{border-radius:0 !important\n}\n.avatar-uploader[data-v-791c4f2e]{border-radius:6px;cursor:pointer;position:relative;overflow:hidden;margin-right:30px;width:178px;height:178px\n}\n.avatar-uploader .el-upload[data-v-791c4f2e]:hover{border-color:#409EFF\n}\n.avatar-uploader-icon[data-v-791c4f2e]{font-size:28px;color:#8c939d;width:178px;height:178px;line-height:178px;text-align:center\n}\n.avatar[data-v-791c4f2e]{width:178px;height:178px;display:block\n}\n.right-mine[data-v-791c4f2e]{padding:20px;background-color:#fff;-webkit-box-shadow:0px 1px 6px 0px rgba(8,6,6,0.13);box-shadow:0px 1px 6px 0px rgba(8,6,6,0.13)\n}\n.right-mine .right-mine-title[data-v-791c4f2e]{padding:10px;border-bottom:1px solid #ccc;margin-bottom:20px\n}\n.right-mine .avator-wrapper[data-v-791c4f2e]{height:70px;width:70px;line-height:70px;vertical-align:middle\n}\n"]}]),e.exports=t}});