(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-2ada"],{MSNs:function(t,e,a){"use strict";a.d(e,"a",function(){return r});var o=a("t3Un");function r(){return Object(o.a)({url:"/api/get_token",method:"get"})}},QoC7:function(t,e,a){"use strict";var o=a("r+UL");a.n(o).a},Y5bG:function(t,e,a){"use strict";a.d(e,"a",function(){return r}),Math.easeInOutQuad=function(t,e,a,o){return(t/=o/2)<1?a/2*t*t+e:-a/2*(--t*(t-2)-1)+e};var o=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)};function r(t,e,a){var r=document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop,i=t-r,n=0;e=void 0===e?500:e;!function t(){n+=20,function(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}(Math.easeInOutQuad(n,r,i,e)),n<e?o(t):a&&"function"==typeof a&&a()}()}},Yfch:function(t,e,a){"use strict"},ZySA:function(t,e,a){"use strict";var o=a("P2sY"),r=a.n(o),i=(a("jUE0"),{bind:function(t,e){t.addEventListener("click",function(a){var o=r()({},e.value),i=r()({ele:t,type:"hit",color:"rgba(0, 0, 0, 0.15)"},o),n=i.ele;if(n){n.style.position="relative",n.style.overflow="hidden";var s=n.getBoundingClientRect(),l=n.querySelector(".waves-ripple");switch(l?l.className="waves-ripple":((l=document.createElement("span")).className="waves-ripple",l.style.height=l.style.width=Math.max(s.width,s.height)+"px",n.appendChild(l)),i.type){case"center":l.style.top=s.height/2-l.offsetHeight/2+"px",l.style.left=s.width/2-l.offsetWidth/2+"px";break;default:l.style.top=(a.pageY-s.top-l.offsetHeight/2-document.documentElement.scrollTop||document.body.scrollTop)+"px",l.style.left=(a.pageX-s.left-l.offsetWidth/2-document.documentElement.scrollLeft||document.body.scrollLeft)+"px"}return l.style.backgroundColor=i.color,l.className="waves-ripple z-active",!1}},!1)}}),n=function(t){t.directive("waves",i)};window.Vue&&(window.waves=i,Vue.use(n)),i.install=n;e.a=i},"gDS+":function(t,e,a){t.exports={default:a("oh+g"),__esModule:!0}},gg54:function(t,e,a){"use strict";a.d(e,"i",function(){return r}),a.d(e,"d",function(){return i}),a.d(e,"c",function(){return n}),a.d(e,"f",function(){return s}),a.d(e,"e",function(){return l}),a.d(e,"b",function(){return c}),a.d(e,"a",function(){return p}),a.d(e,"h",function(){return u}),a.d(e,"g",function(){return d});var o=a("t3Un");function r(t){return Object(o.a)({url:"/api/search/user",method:"get",params:{name:t}})}function i(t){return Object(o.a)({url:"/api/search/group",method:"get",params:{name:t}})}function n(t){return Object(o.a)({url:"/api/search/country",method:"get",params:{name:t}})}function s(t){return Object(o.a)({url:"/api/search/tag",method:"get",params:t})}function l(t){return Object(o.a)({url:"/api/search/celebrity",method:"get",params:{name:t}})}function c(t){return Object(o.a)({url:"/api/search/city",method:"get",params:{name:t}})}function p(t){return Object(o.a)({url:"/api/search/celebrity",method:"get",params:{name:t}})}function u(t){return Object(o.a)({url:"/api/search/topic",method:"get",params:{name:t}})}function d(t){return Object(o.a)({url:"api/search/tagtype",method:"get",params:{name:t}})}},ipnt:function(t,e,a){"use strict";var o=a("gDS+"),r=a.n(o),i=a("P2sY"),n=a.n(i),s=a("glbJ"),l=a("fL+G"),c=a("Grqa"),p=a("uARZ"),u=a("ZySA"),d=a("Mz3J"),m=(a("Yfch"),a("wk8/")),f=a("gg54"),b={status:"draft",uploadType:"",is_recommend:0,user_id:"",create_time:"",topic_nums:0,password:"",avatar:"",nick_name:"",gender:"",tags:[],is_puppet:1,city:""},g={name:"UserDetail",components:{Tinymce:s.a,MDinput:c.a,Upload:l.a,Sticky:p.a,Pagination:d.a},directives:{waves:u.a},props:{isEdit:{type:Boolean,default:!1}},data:function(){var t=this,e=function(e,a,o){""===a?(t.$message({message:e.field+"为必传项",type:"error"}),o(new Error(e.field+"为必传项"))):o()};return{postForm:n()({},b),loading:!1,city:"",tags:[],rules:{nick_name:[{validator:e,trigger:"blur"}],avatar:[{validator:e,trigger:"blur"}]},tempRoute:{},GenderTypeOptions:[{key:0,display_name:"男"},{key:1,display_name:"女"}],regionListOptions:[],tagListOptions:[],uploadType:99,isdisabledFn:!1,query:{}}},computed:{lang:function(){return this.$store.getters.language}},created:function(){if(this.isEdit){var t=this.$route.params&&this.$route.params.id;this.fetchData(t)}else this.postForm=n()({},b);this.tempRoute=n()({},this.$route)},methods:{fetchData:function(t){var e=this;Object(m.b)(t).then(function(t){var a=t.data.data;e.postForm=t.data.data,t.data.data.city.id&&t.data.data.city.name?e.city=t.data.data.city.id+":"+t.data.data.city.name:e.city="";for(var o=0;o<a.tag_list.length;o++)e.tags.push(a.tag_list[o].id+":"+a.tag_list[o].name)}).catch(function(t){console.log(t)})},submitForm:function(){var t=this;this.$refs.postForm.validate(function(e){return e?(t.loading=!0,""===t.city?(t.$message.error("城市必填~"),t.loading=!1,!1):(console.log(t.postForm.gender),""===t.postForm.gender?(t.$message.error("性别必填~"),t.loading=!1,!1):(t.isdisabledFn=!0,t.postForm.city=t.city,t.postForm.tags=r()(t.tags),Object(m.d)(t.postForm).then(function(e){t.$notify({title:"成功",message:e.data.data.message,type:"success",duration:2e3}),setTimeout(function(){t.$router.push("/user/list")},1e3)}).catch(function(e){t.$notify({title:"失败",message:"操作失败",type:"danger",duration:2e3})}),t.postForm.status="published",void(t.loading=!1)))):(console.log("error submit!!"),!1)})},getRemoteCityList:function(t){var e=this;Object(f.b)(t).then(function(t){t.data.data.data&&(e.regionListOptions=t.data.data.data)})},getRemoteTagList:function(t){var e=this;this.query.name=t,Object(f.f)(this.query).then(function(t){t.data.data.data&&(e.tagListOptions=t.data.data.data)})}}},h=(a("QoC7"),a("KHd+")),y=Object(h.a)(g,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",disabled:t.isdisabledFn},on:{click:t.submitForm}},[t._v("保存\n ")])],1),t._v(" "),a("div",{staticClass:"createPost-main-container"},[a("el-row",{attrs:{gutter:20}},[a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",[t._v("用户相关")])]),t._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"postInfo-container"},[a("el-row",[a("el-col",{attrs:{span:12}},[t.isEdit?a("el-form-item",{staticStyle:{"margin-bottom":"20px"},attrs:{"label-width":"75px",label:"ID:"}},[a("el-input",{staticStyle:{width:"230px"},attrs:{type:"text",disabled:""},model:{value:t.postForm.user_id,callback:function(e){t.$set(t.postForm,"user_id",e)},expression:"postForm.user_id"}})],1):t._e()],1),t._v(" "),a("el-col",{attrs:{span:12}},[t.isEdit?a("el-form-item",{staticStyle:{"margin-bottom":"20px"},attrs:{"label-width":"75px",label:"注册时间:"}},[a("el-input",{staticStyle:{width:"230px"},attrs:{type:"text",disabled:""},model:{value:t.postForm.create_time,callback:function(e){t.$set(t.postForm,"create_time",e)},expression:"postForm.create_time"}})],1):t._e()],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:12}},[t.isEdit?a("el-form-item",{staticStyle:{"margin-bottom":"20px"},attrs:{"label-width":"75px",label:"帖子:"}},[a("el-input",{staticStyle:{width:"230px"},attrs:{type:"text",disabled:""},model:{value:t.postForm.topic_nums,callback:function(e){t.$set(t.postForm,"topic_nums",e)},expression:"postForm.topic_nums"}})],1):t._e()],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{staticStyle:{"margin-bottom":"20px"},attrs:{"label-width":"75px",label:"*用户名:",prop:"nick_name"}},[a("el-input",{staticStyle:{width:"230px"},attrs:{type:"text"},model:{value:t.postForm.nick_name,callback:function(e){t.$set(t.postForm,"nick_name",e)},expression:"postForm.nick_name"}})],1)],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{staticStyle:{"margin-bottom":"20px"},attrs:{"label-width":"75px",label:"电话:",prop:"phone"}},[a("el-input",{staticStyle:{width:"230px"},attrs:{type:"text"},model:{value:t.postForm.phone,callback:function(e){t.$set(t.postForm,"phone",e)},expression:"postForm.phone"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{staticStyle:{"margin-bottom":"20px"},attrs:{"label-width":"75px",label:"邮箱:",prop:"email"}},[a("el-input",{staticStyle:{width:"230px"},attrs:{type:"text"},model:{value:t.postForm.email,callback:function(e){t.$set(t.postForm,"email",e)},expression:"postForm.email"}})],1)],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{"label-width":"75px",label:"*性别:",prop:"gender"}},[a("el-select",{staticClass:"postInfo-container-item",staticStyle:{width:"230px"},attrs:{placeholder:"性别:",clearable:""},model:{value:t.postForm.gender,callback:function(e){t.$set(t.postForm,"gender",e)},expression:"postForm.gender"}},t._l(t.GenderTypeOptions,function(t){return a("el-option",{key:t.key,attrs:{label:t.display_name,value:t.key}})}))],1)],1),t._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{"label-width":"75px",label:"*城市:"}},[a("el-select",{staticStyle:{width:"230px"},attrs:{"remote-method":t.getRemoteCityList,filterable:"",remote:"",clearable:"","value-key":"id",placeholder:"搜索城市"},model:{value:t.city,callback:function(e){t.city=e},expression:"city"}},t._l(t.regionListOptions,function(t,e){return a("el-option",{key:t+e,attrs:{label:t,value:t}})}))],1)],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{"label-width":"75px",label:"标签:"}},[a("el-select",{staticStyle:{width:"720px"},attrs:{"remote-method":t.getRemoteTagList,filterable:"",remote:"",clearable:"",multiple:"","value-key":"id",placeholder:"搜索标签"},model:{value:t.tags,callback:function(e){t.tags=e},expression:"tags"}},t._l(t.tagListOptions,function(t,e){return a("el-option",{key:t+e,attrs:{label:t,value:t}})}))],1)],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{staticStyle:{"margin-bottom":"20px","margin-left":"10px"},attrs:{"label-width":"75px",label:"马甲号:"}},[a("el-radio-group",{model:{value:t.postForm.is_puppet,callback:function(e){t.$set(t.postForm,"is_puppet",e)},expression:"postForm.is_puppet"}},[a("el-radio",{attrs:{label:1}},[t._v("是")]),t._v(" "),a("el-radio",{attrs:{label:0}},[t._v("否")])],1)],1)],1),t._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{staticStyle:{"margin-bottom":"20px","margin-left":"10px"},attrs:{"label-width":"75px",label:"推荐:"}},[a("el-radio-group",{model:{value:t.postForm.is_recommend,callback:function(e){t.$set(t.postForm,"is_recommend",e)},expression:"postForm.is_recommend"}},[a("el-radio",{attrs:{label:1}},[t._v("是")]),t._v(" "),a("el-radio",{attrs:{label:0}},[t._v("否")])],1)],1)],1)],1)],1)])],1),t._v(" "),a("div",{staticStyle:{"margin-bottom":"20px"}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"85px",label:"*用户头像:",prop:"avatar"}},[a("span",{model:{value:t.uploadType,callback:function(e){t.uploadType=e},expression:"uploadType"}}),t._v(" "),a("Upload",{attrs:{uploadType:t.uploadType},model:{value:t.postForm.avatar,callback:function(e){t.$set(t.postForm,"avatar",e)},expression:"postForm.avatar"}})],1)],1)],1)],1)],1)],1)],1)},[],!1,null,"f6de4cc0",null);y.options.__file="UserDetail.vue";e.a=y.exports},jUE0:function(t,e,a){},"oh+g":function(t,e,a){var o=a("WEpk"),r=o.JSON||(o.JSON={stringify:JSON.stringify});t.exports=function(t){return r.stringify.apply(r,arguments)}},"r+UL":function(t,e,a){},"wk8/":function(t,e,a){"use strict";a.d(e,"c",function(){return r}),a.d(e,"a",function(){return i}),a.d(e,"b",function(){return n}),a.d(e,"d",function(){return s});var o=a("t3Un");function r(t){return Object(o.a)({url:"/api/user/list",method:"get",params:t})}function i(t){return Object(o.a)({url:"/api/user/list/update",method:"post",data:t})}function n(t){return Object(o.a)({url:"/api/user/get",method:"get",params:{id:t}})}function s(t){return Object(o.a)({url:"/api/user/create",method:"post",data:t})}},x10K:function(t,e,a){"use strict";a.r(e);var o={name:"CreateUser",components:{UserDetail:a("ipnt").a}},r=a("KHd+"),i=Object(r.a)(o,function(){var t=this.$createElement;return(this._self._c||t)("user-detail",{attrs:{"is-edit":!1}})},[],!1,null,null,null);i.options.__file="create.vue";e.default=i.exports}}]);
-
Davve authored72945e6b