Commit 17698120 authored by zhanglu's avatar zhanglu

Merge branch 'hotfix/uneditable_account' into 'master'

Hotfix/uneditable account

See merge request !32
parents 62f313f5 511d2979
This diff is collapsed.
.createPost-container[data-v-935f1c50]{position:relative}.createPost-container .createPost-main-container[data-v-935f1c50]{padding:40px 45px 20px 50px}.createPost-container .createPost-main-container .postInfo-container[data-v-935f1c50]{position:relative;margin-bottom:10px}.createPost-container .createPost-main-container .postInfo-container[data-v-935f1c50]:after{content:"";display:table;clear:both}.createPost-container .createPost-main-container .postInfo-container .postInfo-container-item[data-v-935f1c50]{float:left}.createPost-container .createPost-main-container .editor-container[data-v-935f1c50]{min-height:500px;margin:0 0 30px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container[data-v-935f1c50]{text-align:right;margin-right:10px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container .editor-upload-btn[data-v-935f1c50]{display:inline-block}.createPost-container .word-counter[data-v-935f1c50]{width:40px;position:absolute;right:-10px;top:0}
\ No newline at end of file
.createPost-container[data-v-2504740e]{position:relative}.createPost-container .createPost-main-container[data-v-2504740e]{padding:40px 45px 20px 50px}.createPost-container .createPost-main-container .postInfo-container[data-v-2504740e]{position:relative;margin-bottom:10px}.createPost-container .createPost-main-container .postInfo-container[data-v-2504740e]:after{content:"";display:table;clear:both}.createPost-container .createPost-main-container .postInfo-container .postInfo-container-item[data-v-2504740e]{float:left}.createPost-container .createPost-main-container .editor-container[data-v-2504740e]{min-height:500px;margin:0 0 30px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container[data-v-2504740e]{text-align:right;margin-right:10px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container .editor-upload-btn[data-v-2504740e]{display:inline-block}.createPost-container .word-counter[data-v-2504740e]{width:40px;position:absolute;right:-10px;top:0}
\ No newline at end of file
.createPost-container[data-v-935f1c50]{position:relative}.createPost-container .createPost-main-container[data-v-935f1c50]{padding:40px 45px 20px 50px}.createPost-container .createPost-main-container .postInfo-container[data-v-935f1c50]{position:relative;margin-bottom:10px}.createPost-container .createPost-main-container .postInfo-container[data-v-935f1c50]:after{content:"";display:table;clear:both}.createPost-container .createPost-main-container .postInfo-container .postInfo-container-item[data-v-935f1c50]{float:left}.createPost-container .createPost-main-container .editor-container[data-v-935f1c50]{min-height:500px;margin:0 0 30px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container[data-v-935f1c50]{text-align:right;margin-right:10px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container .editor-upload-btn[data-v-935f1c50]{display:inline-block}.createPost-container .word-counter[data-v-935f1c50]{width:40px;position:absolute;right:-10px;top:0}
\ No newline at end of file
.createPost-container[data-v-2504740e]{position:relative}.createPost-container .createPost-main-container[data-v-2504740e]{padding:40px 45px 20px 50px}.createPost-container .createPost-main-container .postInfo-container[data-v-2504740e]{position:relative;margin-bottom:10px}.createPost-container .createPost-main-container .postInfo-container[data-v-2504740e]:after{content:"";display:table;clear:both}.createPost-container .createPost-main-container .postInfo-container .postInfo-container-item[data-v-2504740e]{float:left}.createPost-container .createPost-main-container .editor-container[data-v-2504740e]{min-height:500px;margin:0 0 30px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container[data-v-2504740e]{text-align:right;margin-right:10px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container .editor-upload-btn[data-v-2504740e]{display:inline-block}.createPost-container .word-counter[data-v-2504740e]{width:40px;position:absolute;right:-10px;top:0}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-0618"],{"4NrL":function(t,e,a){"use strict";a.r(e);var r={name:"EditAccount",components:{AccountDetail:a("Ytwa").a}},n=a("KHd+"),o=Object(n.a)(r,function(){var t=this.$createElement;return(this._self._c||t)("account-detail",{attrs:{"is-edit":!0}})},[],!1,null,null,null);o.options.__file="edit.vue";e.default=o.exports},VyMG:function(t,e,a){"use strict";a.d(e,"d",function(){return n}),a.d(e,"b",function(){return o}),a.d(e,"a",function(){return s}),a.d(e,"c",function(){return i}),a.d(e,"e",function(){return u});var r=a("t3Un");function n(t){return Object(r.a)({url:"/api/account/list",method:"get",params:t})}function o(t){return Object(r.a)({url:"/api/account/list/update",method:"post",data:t})}function s(t){return Object(r.a)({url:"/api/account/create",method:"post",data:t})}function i(t){return Object(r.a)({url:"/api/account/detail",method:"get",params:{id:t}})}function u(t){return Object(r.a)({url:"/api/account/reset_password",method:"post",data:t})}},WBRP:function(t,e,a){},Yfch:function(t,e,a){"use strict"},Ytwa:function(t,e,a){"use strict";var r=a("P2sY"),n=a.n(r),o=a("Grqa"),s=a("uARZ"),i=(a("Yfch"),a("VyMG")),u=a("gg54"),c={status:"draft",username:"",password:"",email:"",phone:"",nick_name:""},m={name:"GroupDetail",components:{MDinput:o.a,Sticky:s.a},props:{isEdit:{type:Boolean,default:!1}},data:function(){var t=this,e=function(e,a,r){""===(a=a.trim())?(t.$message({message:e.field+"为必传项",type:"error"}),r(new Error(e.field+"为必传项"))):r()};return{postForm:n()({},c),loading:!1,userListOptions:[],rules:{username:[{validator:e,trigger:"blur"}],nick_name:[{validator:e,trigger:"blur"}],email:[{validator:e,trigger:"blur"}],password:[{validator:function(e,a,r){""===(a=a.trim())?(t.$message({message:e.field+"为必传项",type:"error"}),r(new Error(e.field+"为必传项"))):a.length<6?(t.$message({message:"密码不得少于6位",type:"error"}),r(new Error("密码不得少于6位"))):r()},trigger:"blur"}],phone:[{validator:e,trigger:"blur"}]},isShow:!1}},created:function(){if(this.isEdit){var t=this.$route.params&&this.$route.params.id;this.fetchData(t)}else this.postForm=n()({},c);this.tempRoute=n()({},this.$route)},methods:{fetchData:function(t){var e=this;Object(i.c)(t).then(function(t){e.postForm=t.data.data.data,e.isShow=!0}).catch(function(t){console.log(t)})},submitForm:function(){var t=this;this.$refs.postForm.validate(function(e){if(!e)return console.log("error submit!!"),!1;t.loading=!0,Object(i.a)(t.postForm).then(function(e){if(500==e.data.data.code)return t.$notify({title:"失败",message:e.data.data.message,type:"error",duration:2e3}),t.loading=!1,!1;t.$notify({title:"成功",message:e.data.data.message,type:"success",duration:2e3}),setTimeout(function(){t.$router.push("/account/list")},1e3)}).catch(function(e){t.$notify({title:"失败",message:"操作失败",type:"danger",duration:2e3})}),t.postForm.status="published",t.loading=!1})},getRemoteUserList:function(t){var e=this;Object(u.g)(t).then(function(t){t.data.items&&(e.userListOptions=t.data.items.map(function(t){return t.name}))})}}},l=(a("iCGk"),a("KHd+")),p=Object(l.a)(m,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"createPost-container"},[a("el-form",{ref:"postForm",staticClass:"form-container",attrs:{model:t.postForm,rules:t.rules}},[a("sticky",{attrs:{"class-name":"sub-navbar "+t.postForm.status}},[a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{"margin-left":"10px"},attrs:{type:"success"},on:{click:t.submitForm}},[t._v("保存")])],1),t._v(" "),a("div",{staticClass:"createPost-main-container"},[a("el-row",[a("el-col",{attrs:{span:24}},[t.isShow?a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"username"}},[a("MDinput",{attrs:{maxlength:100,name:"username",required:"",disabled:"disabled"},model:{value:t.postForm.username,callback:function(e){t.$set(t.postForm,"username",e)},expression:"postForm.username"}},[t._v("\n 账号\n ")])],1):a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"username"}},[a("MDinput",{attrs:{maxlength:100,name:"username",required:""},model:{value:t.postForm.username,callback:function(e){t.$set(t.postForm,"username",e)},expression:"postForm.username"}},[t._v("\n 账号\n ")])],1)],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{directives:[{name:"show",rawName:"v-show",value:t.is_show,expression:"is_show"}],staticStyle:{"margin-bottom":"40px"},attrs:{prop:"password"}},[a("MDinput",{attrs:{maxlength:100,name:"password",required:""},model:{value:t.postForm.password,callback:function(e){t.$set(t.postForm,"password",e)},expression:"postForm.password"}},[t._v("\n 密码\n ")])],1)],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"email"}},[a("MDinput",{attrs:{maxlength:100,name:"email",required:""},model:{value:t.postForm.email,callback:function(e){t.$set(t.postForm,"email",e)},expression:"postForm.email"}},[t._v("\n 邮箱\n ")])],1)],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"nick_name"}},[a("MDinput",{attrs:{maxlength:100,name:"nick_name",required:""},model:{value:t.postForm.nick_name,callback:function(e){t.$set(t.postForm,"nick_name",e)},expression:"postForm.nick_name"}},[t._v("\n 姓名\n ")])],1)],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"phone"}},[a("MDinput",{attrs:{maxlength:100,name:"phone",required:""},model:{value:t.postForm.phone,callback:function(e){t.$set(t.postForm,"phone",e)},expression:"postForm.phone"}},[t._v("\n 电话\n ")])],1)],1)],1)],1)],1)],1)},[],!1,null,"2504740e",null);p.options.__file="AccountDetail.vue";e.a=p.exports},gg54:function(t,e,a){"use strict";a.d(e,"g",function(){return n}),a.d(e,"c",function(){return o}),a.d(e,"e",function(){return s}),a.d(e,"d",function(){return i}),a.d(e,"b",function(){return u}),a.d(e,"a",function(){return c}),a.d(e,"f",function(){return m});var r=a("t3Un");function n(t){return Object(r.a)({url:"/api/search/user",method:"get",params:{name:t}})}function o(t){return Object(r.a)({url:"/api/search/group",method:"get",params:{name:t}})}function s(t){return Object(r.a)({url:"/api/search/tag",method:"get",params:{name:t}})}function i(t){return Object(r.a)({url:"/api/search/celebrity",method:"get",params:{name:t}})}function u(t){return Object(r.a)({url:"/api/search/city",method:"get",params:{name:t}})}function c(t){return Object(r.a)({url:"/api/search/celebrity",method:"get",params:{name:t}})}function m(t){return Object(r.a)({url:"/api/search/topic",method:"get",params:{name:t}})}},iCGk:function(t,e,a){"use strict";var r=a("WBRP");a.n(r).a}}]);
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-3926"],{"/Avx":function(t,e,a){"use strict";var r=a("pI06");a.n(r).a},"4NrL":function(t,e,a){"use strict";a.r(e);var r={name:"EditAccount",components:{AccountDetail:a("Ytwa").a}},n=a("KHd+"),o=Object(n.a)(r,function(){var t=this.$createElement;return(this._self._c||t)("account-detail",{attrs:{"is-edit":!0}})},[],!1,null,null,null);o.options.__file="edit.vue";e.default=o.exports},VyMG:function(t,e,a){"use strict";a.d(e,"d",function(){return n}),a.d(e,"b",function(){return o}),a.d(e,"a",function(){return s}),a.d(e,"c",function(){return i}),a.d(e,"e",function(){return u});var r=a("t3Un");function n(t){return Object(r.a)({url:"/api/account/list",method:"get",params:t})}function o(t){return Object(r.a)({url:"/api/account/list/update",method:"post",data:t})}function s(t){return Object(r.a)({url:"/api/account/create",method:"post",data:t})}function i(t){return Object(r.a)({url:"/api/account/detail",method:"get",params:{id:t}})}function u(t){return Object(r.a)({url:"/api/account/reset_password",method:"post",data:t})}},Yfch:function(t,e,a){"use strict"},Ytwa:function(t,e,a){"use strict";var r=a("P2sY"),n=a.n(r),o=a("Grqa"),s=a("uARZ"),i=(a("Yfch"),a("VyMG")),u=a("gg54"),c={status:"draft",username:"",password:"",email:"",phone:"",nick_name:""},m={name:"GroupDetail",components:{MDinput:o.a,Sticky:s.a},props:{isEdit:{type:Boolean,default:!1}},data:function(){var t=this,e=function(e,a,r){""===(a=a.trim())?(t.$message({message:e.field+"为必传项",type:"error"}),r(new Error(e.field+"为必传项"))):r()};return{postForm:n()({},c),loading:!1,userListOptions:[],rules:{username:[{validator:e,trigger:"blur"}],nick_name:[{validator:e,trigger:"blur"}],email:[{validator:e,trigger:"blur"}],password:[{validator:function(e,a,r){""===(a=a.trim())?(t.$message({message:e.field+"为必传项",type:"error"}),r(new Error(e.field+"为必传项"))):a.length<6?(t.$message({message:"密码不得少于6位",type:"error"}),r(new Error("密码不得少于6位"))):r()},trigger:"blur"}],phone:[{validator:e,trigger:"blur"}]},is_show:!0}},created:function(){if(this.isEdit){var t=this.$route.params&&this.$route.params.id;this.fetchData(t)}else this.postForm=n()({},c);this.tempRoute=n()({},this.$route)},methods:{fetchData:function(t){var e=this;Object(i.c)(t).then(function(t){e.postForm=t.data.data.data,e.is_show=!1}).catch(function(t){console.log(t)})},submitForm:function(){var t=this;this.$refs.postForm.validate(function(e){if(!e)return console.log("error submit!!"),!1;t.loading=!0,Object(i.a)(t.postForm).then(function(e){if(500==e.data.data.code)return t.$notify({title:"失败",message:e.data.data.message,type:"error",duration:2e3}),t.loading=!1,!1;t.$notify({title:"成功",message:e.data.data.message,type:"success",duration:2e3}),setTimeout(function(){t.$router.push("/account/list")},1e3)}).catch(function(e){t.$notify({title:"失败",message:"操作失败",type:"danger",duration:2e3})}),t.postForm.status="published",t.loading=!1})},getRemoteUserList:function(t){var e=this;Object(u.g)(t).then(function(t){t.data.items&&(e.userListOptions=t.data.items.map(function(t){return t.name}))})}}},l=(a("/Avx"),a("KHd+")),p=Object(l.a)(m,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"createPost-container"},[a("el-form",{ref:"postForm",staticClass:"form-container",attrs:{model:t.postForm,rules:t.rules}},[a("sticky",{attrs:{"class-name":"sub-navbar "+t.postForm.status}},[a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{"margin-left":"10px"},attrs:{type:"success"},on:{click:t.submitForm}},[t._v("保存")])],1),t._v(" "),a("div",{staticClass:"createPost-main-container"},[a("el-row",[a("el-col",{attrs:{span:24}},[t.isShow?a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"username"}},[a("MDinput",{attrs:{maxlength:100,name:"username",required:"",disabled:"disabled"},model:{value:t.postForm.username,callback:function(e){t.$set(t.postForm,"username",e)},expression:"postForm.username"}},[t._v("\n 账号\n ")])],1):a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"username"}},[a("MDinput",{attrs:{maxlength:100,name:"username",required:""},model:{value:t.postForm.username,callback:function(e){t.$set(t.postForm,"username",e)},expression:"postForm.username"}},[t._v("\n 账号\n ")])],1)],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{directives:[{name:"show",rawName:"v-show",value:t.is_show,expression:"is_show"}],staticStyle:{"margin-bottom":"40px"},attrs:{prop:"password"}},[a("MDinput",{attrs:{maxlength:100,name:"password",required:""},model:{value:t.postForm.password,callback:function(e){t.$set(t.postForm,"password",e)},expression:"postForm.password"}},[t._v("\n 密码\n ")])],1)],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"email"}},[a("MDinput",{attrs:{maxlength:100,name:"email",required:""},model:{value:t.postForm.email,callback:function(e){t.$set(t.postForm,"email",e)},expression:"postForm.email"}},[t._v("\n 邮箱\n ")])],1)],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"nick_name"}},[a("MDinput",{attrs:{maxlength:100,name:"nick_name",required:""},model:{value:t.postForm.nick_name,callback:function(e){t.$set(t.postForm,"nick_name",e)},expression:"postForm.nick_name"}},[t._v("\n 姓名\n ")])],1)],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"phone"}},[a("MDinput",{attrs:{maxlength:100,name:"phone",required:""},model:{value:t.postForm.phone,callback:function(e){t.$set(t.postForm,"phone",e)},expression:"postForm.phone"}},[t._v("\n 电话\n ")])],1)],1)],1)],1)],1)],1)},[],!1,null,"935f1c50",null);p.options.__file="AccountDetail.vue";e.a=p.exports},gg54:function(t,e,a){"use strict";a.d(e,"g",function(){return n}),a.d(e,"c",function(){return o}),a.d(e,"e",function(){return s}),a.d(e,"d",function(){return i}),a.d(e,"b",function(){return u}),a.d(e,"a",function(){return c}),a.d(e,"f",function(){return m});var r=a("t3Un");function n(t){return Object(r.a)({url:"/api/search/user",method:"get",params:{name:t}})}function o(t){return Object(r.a)({url:"/api/search/group",method:"get",params:{name:t}})}function s(t){return Object(r.a)({url:"/api/search/tag",method:"get",params:{name:t}})}function i(t){return Object(r.a)({url:"/api/search/celebrity",method:"get",params:{name:t}})}function u(t){return Object(r.a)({url:"/api/search/city",method:"get",params:{name:t}})}function c(t){return Object(r.a)({url:"/api/search/celebrity",method:"get",params:{name:t}})}function m(t){return Object(r.a)({url:"/api/search/topic",method:"get",params:{name:t}})}},pI06:function(t,e,a){}}]);
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-b5f3"],{Htjz:function(t,e,a){"use strict";a.r(e);var r={name:"CreateAccount",components:{AccountDetail:a("Ytwa").a}},n=a("KHd+"),o=Object(n.a)(r,function(){var t=this.$createElement;return(this._self._c||t)("account-detail",{attrs:{"is-edit":!1}})},[],!1,null,null,null);o.options.__file="create.vue";e.default=o.exports},VyMG:function(t,e,a){"use strict";a.d(e,"d",function(){return n}),a.d(e,"b",function(){return o}),a.d(e,"a",function(){return s}),a.d(e,"c",function(){return i}),a.d(e,"e",function(){return u});var r=a("t3Un");function n(t){return Object(r.a)({url:"/api/account/list",method:"get",params:t})}function o(t){return Object(r.a)({url:"/api/account/list/update",method:"post",data:t})}function s(t){return Object(r.a)({url:"/api/account/create",method:"post",data:t})}function i(t){return Object(r.a)({url:"/api/account/detail",method:"get",params:{id:t}})}function u(t){return Object(r.a)({url:"/api/account/reset_password",method:"post",data:t})}},WBRP:function(t,e,a){},Yfch:function(t,e,a){"use strict"},Ytwa:function(t,e,a){"use strict";var r=a("P2sY"),n=a.n(r),o=a("Grqa"),s=a("uARZ"),i=(a("Yfch"),a("VyMG")),u=a("gg54"),c={status:"draft",username:"",password:"",email:"",phone:"",nick_name:""},m={name:"GroupDetail",components:{MDinput:o.a,Sticky:s.a},props:{isEdit:{type:Boolean,default:!1}},data:function(){var t=this,e=function(e,a,r){""===(a=a.trim())?(t.$message({message:e.field+"为必传项",type:"error"}),r(new Error(e.field+"为必传项"))):r()};return{postForm:n()({},c),loading:!1,userListOptions:[],rules:{username:[{validator:e,trigger:"blur"}],nick_name:[{validator:e,trigger:"blur"}],email:[{validator:e,trigger:"blur"}],password:[{validator:function(e,a,r){""===(a=a.trim())?(t.$message({message:e.field+"为必传项",type:"error"}),r(new Error(e.field+"为必传项"))):a.length<6?(t.$message({message:"密码不得少于6位",type:"error"}),r(new Error("密码不得少于6位"))):r()},trigger:"blur"}],phone:[{validator:e,trigger:"blur"}]},isShow:!1}},created:function(){if(this.isEdit){var t=this.$route.params&&this.$route.params.id;this.fetchData(t)}else this.postForm=n()({},c);this.tempRoute=n()({},this.$route)},methods:{fetchData:function(t){var e=this;Object(i.c)(t).then(function(t){e.postForm=t.data.data.data,e.isShow=!0}).catch(function(t){console.log(t)})},submitForm:function(){var t=this;this.$refs.postForm.validate(function(e){if(!e)return console.log("error submit!!"),!1;t.loading=!0,Object(i.a)(t.postForm).then(function(e){if(500==e.data.data.code)return t.$notify({title:"失败",message:e.data.data.message,type:"error",duration:2e3}),t.loading=!1,!1;t.$notify({title:"成功",message:e.data.data.message,type:"success",duration:2e3}),setTimeout(function(){t.$router.push("/account/list")},1e3)}).catch(function(e){t.$notify({title:"失败",message:"操作失败",type:"danger",duration:2e3})}),t.postForm.status="published",t.loading=!1})},getRemoteUserList:function(t){var e=this;Object(u.g)(t).then(function(t){t.data.items&&(e.userListOptions=t.data.items.map(function(t){return t.name}))})}}},l=(a("iCGk"),a("KHd+")),p=Object(l.a)(m,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"createPost-container"},[a("el-form",{ref:"postForm",staticClass:"form-container",attrs:{model:t.postForm,rules:t.rules}},[a("sticky",{attrs:{"class-name":"sub-navbar "+t.postForm.status}},[a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{"margin-left":"10px"},attrs:{type:"success"},on:{click:t.submitForm}},[t._v("保存")])],1),t._v(" "),a("div",{staticClass:"createPost-main-container"},[a("el-row",[a("el-col",{attrs:{span:24}},[t.isShow?a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"username"}},[a("MDinput",{attrs:{maxlength:100,name:"username",required:"",disabled:"disabled"},model:{value:t.postForm.username,callback:function(e){t.$set(t.postForm,"username",e)},expression:"postForm.username"}},[t._v("\n 账号\n ")])],1):a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"username"}},[a("MDinput",{attrs:{maxlength:100,name:"username",required:""},model:{value:t.postForm.username,callback:function(e){t.$set(t.postForm,"username",e)},expression:"postForm.username"}},[t._v("\n 账号\n ")])],1)],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{directives:[{name:"show",rawName:"v-show",value:t.is_show,expression:"is_show"}],staticStyle:{"margin-bottom":"40px"},attrs:{prop:"password"}},[a("MDinput",{attrs:{maxlength:100,name:"password",required:""},model:{value:t.postForm.password,callback:function(e){t.$set(t.postForm,"password",e)},expression:"postForm.password"}},[t._v("\n 密码\n ")])],1)],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"email"}},[a("MDinput",{attrs:{maxlength:100,name:"email",required:""},model:{value:t.postForm.email,callback:function(e){t.$set(t.postForm,"email",e)},expression:"postForm.email"}},[t._v("\n 邮箱\n ")])],1)],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"nick_name"}},[a("MDinput",{attrs:{maxlength:100,name:"nick_name",required:""},model:{value:t.postForm.nick_name,callback:function(e){t.$set(t.postForm,"nick_name",e)},expression:"postForm.nick_name"}},[t._v("\n 姓名\n ")])],1)],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"phone"}},[a("MDinput",{attrs:{maxlength:100,name:"phone",required:""},model:{value:t.postForm.phone,callback:function(e){t.$set(t.postForm,"phone",e)},expression:"postForm.phone"}},[t._v("\n 电话\n ")])],1)],1)],1)],1)],1)],1)},[],!1,null,"2504740e",null);p.options.__file="AccountDetail.vue";e.a=p.exports},gg54:function(t,e,a){"use strict";a.d(e,"g",function(){return n}),a.d(e,"c",function(){return o}),a.d(e,"e",function(){return s}),a.d(e,"d",function(){return i}),a.d(e,"b",function(){return u}),a.d(e,"a",function(){return c}),a.d(e,"f",function(){return m});var r=a("t3Un");function n(t){return Object(r.a)({url:"/api/search/user",method:"get",params:{name:t}})}function o(t){return Object(r.a)({url:"/api/search/group",method:"get",params:{name:t}})}function s(t){return Object(r.a)({url:"/api/search/tag",method:"get",params:{name:t}})}function i(t){return Object(r.a)({url:"/api/search/celebrity",method:"get",params:{name:t}})}function u(t){return Object(r.a)({url:"/api/search/city",method:"get",params:{name:t}})}function c(t){return Object(r.a)({url:"/api/search/celebrity",method:"get",params:{name:t}})}function m(t){return Object(r.a)({url:"/api/search/topic",method:"get",params:{name:t}})}},iCGk:function(t,e,a){"use strict";var r=a("WBRP");a.n(r).a}}]);
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-e901"],{"/Avx":function(t,e,a){"use strict";var r=a("pI06");a.n(r).a},Htjz:function(t,e,a){"use strict";a.r(e);var r={name:"CreateAccount",components:{AccountDetail:a("Ytwa").a}},n=a("KHd+"),o=Object(n.a)(r,function(){var t=this.$createElement;return(this._self._c||t)("account-detail",{attrs:{"is-edit":!1}})},[],!1,null,null,null);o.options.__file="create.vue";e.default=o.exports},VyMG:function(t,e,a){"use strict";a.d(e,"d",function(){return n}),a.d(e,"b",function(){return o}),a.d(e,"a",function(){return s}),a.d(e,"c",function(){return i}),a.d(e,"e",function(){return u});var r=a("t3Un");function n(t){return Object(r.a)({url:"/api/account/list",method:"get",params:t})}function o(t){return Object(r.a)({url:"/api/account/list/update",method:"post",data:t})}function s(t){return Object(r.a)({url:"/api/account/create",method:"post",data:t})}function i(t){return Object(r.a)({url:"/api/account/detail",method:"get",params:{id:t}})}function u(t){return Object(r.a)({url:"/api/account/reset_password",method:"post",data:t})}},Yfch:function(t,e,a){"use strict"},Ytwa:function(t,e,a){"use strict";var r=a("P2sY"),n=a.n(r),o=a("Grqa"),s=a("uARZ"),i=(a("Yfch"),a("VyMG")),u=a("gg54"),c={status:"draft",username:"",password:"",email:"",phone:"",nick_name:""},m={name:"GroupDetail",components:{MDinput:o.a,Sticky:s.a},props:{isEdit:{type:Boolean,default:!1}},data:function(){var t=this,e=function(e,a,r){""===(a=a.trim())?(t.$message({message:e.field+"为必传项",type:"error"}),r(new Error(e.field+"为必传项"))):r()};return{postForm:n()({},c),loading:!1,userListOptions:[],rules:{username:[{validator:e,trigger:"blur"}],nick_name:[{validator:e,trigger:"blur"}],email:[{validator:e,trigger:"blur"}],password:[{validator:function(e,a,r){""===(a=a.trim())?(t.$message({message:e.field+"为必传项",type:"error"}),r(new Error(e.field+"为必传项"))):a.length<6?(t.$message({message:"密码不得少于6位",type:"error"}),r(new Error("密码不得少于6位"))):r()},trigger:"blur"}],phone:[{validator:e,trigger:"blur"}]},is_show:!0}},created:function(){if(this.isEdit){var t=this.$route.params&&this.$route.params.id;this.fetchData(t)}else this.postForm=n()({},c);this.tempRoute=n()({},this.$route)},methods:{fetchData:function(t){var e=this;Object(i.c)(t).then(function(t){e.postForm=t.data.data.data,e.is_show=!1}).catch(function(t){console.log(t)})},submitForm:function(){var t=this;this.$refs.postForm.validate(function(e){if(!e)return console.log("error submit!!"),!1;t.loading=!0,Object(i.a)(t.postForm).then(function(e){if(500==e.data.data.code)return t.$notify({title:"失败",message:e.data.data.message,type:"error",duration:2e3}),t.loading=!1,!1;t.$notify({title:"成功",message:e.data.data.message,type:"success",duration:2e3}),setTimeout(function(){t.$router.push("/account/list")},1e3)}).catch(function(e){t.$notify({title:"失败",message:"操作失败",type:"danger",duration:2e3})}),t.postForm.status="published",t.loading=!1})},getRemoteUserList:function(t){var e=this;Object(u.g)(t).then(function(t){t.data.items&&(e.userListOptions=t.data.items.map(function(t){return t.name}))})}}},l=(a("/Avx"),a("KHd+")),p=Object(l.a)(m,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"createPost-container"},[a("el-form",{ref:"postForm",staticClass:"form-container",attrs:{model:t.postForm,rules:t.rules}},[a("sticky",{attrs:{"class-name":"sub-navbar "+t.postForm.status}},[a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{"margin-left":"10px"},attrs:{type:"success"},on:{click:t.submitForm}},[t._v("保存")])],1),t._v(" "),a("div",{staticClass:"createPost-main-container"},[a("el-row",[a("el-col",{attrs:{span:24}},[t.isShow?a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"username"}},[a("MDinput",{attrs:{maxlength:100,name:"username",required:"",disabled:"disabled"},model:{value:t.postForm.username,callback:function(e){t.$set(t.postForm,"username",e)},expression:"postForm.username"}},[t._v("\n 账号\n ")])],1):a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"username"}},[a("MDinput",{attrs:{maxlength:100,name:"username",required:""},model:{value:t.postForm.username,callback:function(e){t.$set(t.postForm,"username",e)},expression:"postForm.username"}},[t._v("\n 账号\n ")])],1)],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{directives:[{name:"show",rawName:"v-show",value:t.is_show,expression:"is_show"}],staticStyle:{"margin-bottom":"40px"},attrs:{prop:"password"}},[a("MDinput",{attrs:{maxlength:100,name:"password",required:""},model:{value:t.postForm.password,callback:function(e){t.$set(t.postForm,"password",e)},expression:"postForm.password"}},[t._v("\n 密码\n ")])],1)],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"email"}},[a("MDinput",{attrs:{maxlength:100,name:"email",required:""},model:{value:t.postForm.email,callback:function(e){t.$set(t.postForm,"email",e)},expression:"postForm.email"}},[t._v("\n 邮箱\n ")])],1)],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"nick_name"}},[a("MDinput",{attrs:{maxlength:100,name:"nick_name",required:""},model:{value:t.postForm.nick_name,callback:function(e){t.$set(t.postForm,"nick_name",e)},expression:"postForm.nick_name"}},[t._v("\n 姓名\n ")])],1)],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"phone"}},[a("MDinput",{attrs:{maxlength:100,name:"phone",required:""},model:{value:t.postForm.phone,callback:function(e){t.$set(t.postForm,"phone",e)},expression:"postForm.phone"}},[t._v("\n 电话\n ")])],1)],1)],1)],1)],1)],1)},[],!1,null,"935f1c50",null);p.options.__file="AccountDetail.vue";e.a=p.exports},gg54:function(t,e,a){"use strict";a.d(e,"g",function(){return n}),a.d(e,"c",function(){return o}),a.d(e,"e",function(){return s}),a.d(e,"d",function(){return i}),a.d(e,"b",function(){return u}),a.d(e,"a",function(){return c}),a.d(e,"f",function(){return m});var r=a("t3Un");function n(t){return Object(r.a)({url:"/api/search/user",method:"get",params:{name:t}})}function o(t){return Object(r.a)({url:"/api/search/group",method:"get",params:{name:t}})}function s(t){return Object(r.a)({url:"/api/search/tag",method:"get",params:{name:t}})}function i(t){return Object(r.a)({url:"/api/search/celebrity",method:"get",params:{name:t}})}function u(t){return Object(r.a)({url:"/api/search/city",method:"get",params:{name:t}})}function c(t){return Object(r.a)({url:"/api/search/celebrity",method:"get",params:{name:t}})}function m(t){return Object(r.a)({url:"/api/search/topic",method:"get",params:{name:t}})}},pI06:function(t,e,a){}}]);
\ No newline at end of file
......@@ -10,13 +10,13 @@
<el-row>
<el-col :span="24">
<el-form-item style="margin-bottom: 40px;" prop="username" v-if="isShow">
<el-form-item v-if="isShow" style="margin-bottom: 40px;" prop="username">
<MDinput v-model="postForm.username" :maxlength="100" name="username" required disabled="disabled">
账号
</MDinput>
</el-form-item>
<el-form-item style="margin-bottom: 40px;" prop="username" v-else>
<el-form-item v-else style="margin-bottom: 40px;" prop="username">
<MDinput v-model="postForm.username" :maxlength="100" name="username" required>
账号
</MDinput>
......@@ -27,7 +27,7 @@
<el-row>
<el-col :span="24">
<el-form-item style="margin-bottom: 40px;" prop="password" v-show="is_show">
<el-form-item v-show="is_show" style="margin-bottom: 40px;" prop="password">
<MDinput v-model="postForm.password" :maxlength="100" name="password" required>
密码
</MDinput>
......@@ -76,145 +76,144 @@
</template>
<script>
import MDinput from '@/components/MDinput'
import Sticky from '@/components/Sticky' // 粘性header组件
import {validateURL} from '@/utils/validate'
import {CreateAccount, fetchAccountDetail,} from '@/api/account'
import {userSearch} from '@/api/remoteSearch'
const defaultForm = {
status: 'draft',
username: '',
password: '',
email: '',
phone: '',
nick_name: ''
}
export default {
name: 'GroupDetail',
components: {MDinput, Sticky},
props: {
isEdit: {
type: Boolean,
default: false
}
},
data() {
const validateRequire = (rule, value, callback) => {
value = value.trim()
if (value === '') {
this.$message({
message: rule.field + '为必传项',
type: 'error'
})
callback(new Error(rule.field + '为必传项'))
} else {
callback()
}
}
const validatePasswordLength = (rule, value, callback) => {
value = value.trim()
if (value === '') {
this.$message({
message: rule.field + '为必传项',
type: 'error'
})
callback(new Error(rule.field + '为必传项'))
} else if ( value.length < 6) {
this.$message({
message: '密码不得少于6位',
type: 'error'
})
callback(new Error('密码不得少于6位'))
} else {
callback()
}
}
return {
postForm: Object.assign({}, defaultForm),
loading: false,
userListOptions: [],
rules: {
username: [{validator: validateRequire, trigger: 'blur'}],
nick_name: [{validator: validateRequire, trigger: 'blur'}],
email: [{validator: validateRequire, trigger: 'blur'}],
password: [{validator: validatePasswordLength, trigger: 'blur'}],
phone: [{validator: validateRequire, trigger: 'blur'}],
},
is_show: true
}
},
created() {
if (this.isEdit) {
const id = this.$route.params && this.$route.params.id
this.fetchData(id)
import MDinput from '@/components/MDinput'
import Sticky from '@/components/Sticky' // 粘性header组件
import { validateURL } from '@/utils/validate'
import { CreateAccount, fetchAccountDetail } from '@/api/account'
import { userSearch } from '@/api/remoteSearch'
const defaultForm = {
status: 'draft',
username: '',
password: '',
email: '',
phone: '',
nick_name: ''
}
export default {
name: 'GroupDetail',
components: { MDinput, Sticky },
props: {
isEdit: {
type: Boolean,
default: false
}
},
data() {
const validateRequire = (rule, value, callback) => {
value = value.trim()
if (value === '') {
this.$message({
message: rule.field + '为必传项',
type: 'error'
})
callback(new Error(rule.field + '为必传项'))
} else {
this.postForm = Object.assign({}, defaultForm)
callback()
}
}
this.tempRoute = Object.assign({}, this.$route)
},
methods: {
fetchData(id) {
fetchAccountDetail(id).then(response => {
this.postForm = response.data.data.data
this.is_show = false
}).catch(err => {
console.log(err)
const validatePasswordLength = (rule, value, callback) => {
value = value.trim()
if (value === '') {
this.$message({
message: rule.field + '为必传项',
type: 'error'
})
callback(new Error(rule.field + '为必传项'))
} else if (value.length < 6) {
this.$message({
message: '密码不得少于6位',
type: 'error'
})
callback(new Error('密码不得少于6位'))
} else {
callback()
}
}
return {
postForm: Object.assign({}, defaultForm),
loading: false,
userListOptions: [],
rules: {
username: [{ validator: validateRequire, trigger: 'blur' }],
nick_name: [{ validator: validateRequire, trigger: 'blur' }],
email: [{ validator: validateRequire, trigger: 'blur' }],
password: [{ validator: validatePasswordLength, trigger: 'blur' }],
phone: [{ validator: validateRequire, trigger: 'blur' }]
},
submitForm() {
this.$refs.postForm.validate(valid => {
if (valid) {
this.loading = true
CreateAccount(this.postForm).then(response => {
if (response.data.data.code == 500) {
this.$notify({
title: '失败',
message: response.data.data.message,
type: 'error',
duration: 2000
})
this.loading = false;
return false;
}
this.$notify({
title: '成功',
message: response.data.data.message,
type: 'success',
duration: 2000
})
setTimeout(() => {
this.$router.push('/account/list')
}, 1000)
isShow: false
}
},
created() {
if (this.isEdit) {
const id = this.$route.params && this.$route.params.id
this.fetchData(id)
} else {
this.postForm = Object.assign({}, defaultForm)
}
}).catch(err => {
this.tempRoute = Object.assign({}, this.$route)
},
methods: {
fetchData(id) {
fetchAccountDetail(id).then(response => {
this.postForm = response.data.data.data
this.isShow = true
}).catch(err => {
console.log(err)
})
},
submitForm() {
this.$refs.postForm.validate(valid => {
if (valid) {
this.loading = true
CreateAccount(this.postForm).then(response => {
if (response.data.data.code == 500) {
this.$notify({
title: '失败',
message: '操作失败',
type: 'danger',
message: response.data.data.message,
type: 'error',
duration: 2000
})
});
this.loading = false
return false
}
this.$notify({
title: '成功',
message: response.data.data.message,
type: 'success',
duration: 2000
})
setTimeout(() => {
this.$router.push('/account/list')
}, 1000)
}).catch(err => {
this.$notify({
title: '失败',
message: '操作失败',
type: 'danger',
duration: 2000
})
})
this.postForm.status = 'published'
this.loading = false
} else {
console.log('error submit!!')
return false
}
})
},
getRemoteUserList(query) {
userSearch(query).then(response => {
if (!response.data.items) return
this.userListOptions = response.data.items.map(v => v.name)
})
}
this.postForm.status = 'published'
this.loading = false
} else {
console.log('error submit!!')
return false
}
})
},
getRemoteUserList(query) {
userSearch(query).then(response => {
if (!response.data.items) return
this.userListOptions = response.data.items.map(v => v.name)
})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment