(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-057329c8"],{"484f":function(t,e,r){"use strict";r.r(e);var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"app-container"},[r("el-card",{staticClass:"box-card"},[r("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[r("span",[t._v("添加管理员")]),r("el-button",{staticStyle:{float:"right",padding:"0","margin-left":"14px"},attrs:{type:"text"},on:{click:function(e){return t.goto("/sys/admin/list")}}},[t._v(" 返回 ")]),r("el-button",{staticStyle:{float:"right",padding:"0"},attrs:{type:"text"},on:{click:function(e){return t.onSubmit("form")}}},[t._v(" 保存 ")])],1),r("el-form",{ref:"form",staticClass:"common-form",attrs:{model:t.form,"label-width":"100px",rules:t.rules,"inline-message":!0}},[r("el-form-item",{attrs:{label:"角色",prop:"role_id"}},[r("el-select",{attrs:{placeholder:"请选择角色"},model:{value:t.form.role_id,callback:function(e){t.$set(t.form,"role_id",e)},expression:"form.role_id"}},t._l(t.rolelist,(function(t,e){return r("el-option",{key:e,attrs:{label:t.name,value:t.id}})})),1)],1),r("el-form-item",{attrs:{label:"登录名",prop:"username"}},[r("el-input",{staticClass:"middle",model:{value:t.form.username,callback:function(e){t.$set(t.form,"username",e)},expression:"form.username"}})],1),r("el-form-item",{attrs:{label:"密码",prop:"password"}},[r("el-input",{staticClass:"middle",attrs:{"show-password":""},model:{value:t.form.password,callback:function(e){t.$set(t.form,"password",e)},expression:"form.password"}})],1),r("el-form-item",{attrs:{label:""}},[r("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.onSubmit("form")}}},[t._v("保存")]),r("el-button",{on:{click:function(e){return t.goto("/sys/admin/list")}}},[t._v("返回")])],1)],1)],1)],1)},a=[],o=r("5530"),s=r("50fc3"),i={data:function(){return{rolelist:[],form:{username:"",password:"",role_id:""},rules:{role_id:[{required:!0,message:"请选择角色",trigger:"change"}],username:[{required:!0,message:"请输入登录名",trigger:"blur"},{max:15,message:"长度在 1 到 15 个字符",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"},{max:15,message:"长度在 1 到 15 个字符",trigger:"blur"}]}}},computed:{},mounted:function(){},created:function(){this.fetchRoleData()},methods:{fetchRoleData:function(){var t=this,e={};Object(s["f"])(e).then((function(e){t.rolelist=e.data})).catch((function(){}))},onSubmit:function(t){var e=this,r=this,n=Object(o["a"])({},this.form);this.$refs[t].validate((function(t){if(!t)return!1;Object(s["b"])(n).then((function(t){return e.$message.success(t.message),setTimeout((function(){r.$router.push("/sys/admin/list")}),1500),!0})).catch((function(){}))}))},goto:function(t){this.$router.push(t)}}},l=i,u=r("2877"),c=Object(u["a"])(l,n,a,!1,null,null,null);e["default"]=c.exports},"50fc3":function(t,e,r){"use strict";r.d(e,"e",(function(){return o})),r.d(e,"b",(function(){return s})),r.d(e,"d",(function(){return i})),r.d(e,"c",(function(){return l})),r.d(e,"f",(function(){return u})),r.d(e,"a",(function(){return c}));var n=r("b775"),a=r("d722");function o(t){return Object(n["a"])({url:a["a"].adminList,method:"get",params:t})}function s(t){return Object(n["a"])({url:a["a"].adminAdd,method:"post",data:t})}function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"post";return"post"==e?Object(n["a"])({url:a["a"].adminEdit,method:e,data:t}):Object(n["a"])({url:a["a"].adminEdit,method:e,params:t})}function l(t){return Object(n["a"])({url:a["a"].adminDelete,method:"post",data:t})}function u(t){return Object(n["a"])({url:a["a"].adminRoleOptions,method:"get",params:t})}function c(t){return Object(n["a"])({url:a["a"].adminLogList,method:"get",params:t})}}}]);