(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-113e23e2"],{1140:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",[e._v("添加角色")]),a("el-button",{staticStyle:{float:"right",padding:"0","margin-left":"14px"},attrs:{type:"text"},on:{click:function(t){return e.goto("/sys/admin/role")}}},[e._v(" 返回 ")]),a("el-button",{staticStyle:{float:"right",padding:"0"},attrs:{type:"text"},on:{click:function(t){return e.onSubmit("form")}}},[e._v(" 保存 ")])],1),a("el-form",{ref:"form",staticClass:"common-form",attrs:{model:e.form,"label-width":"100px",rules:e.rules,"inline-message":!0}},[a("el-form-item",{attrs:{label:"角色名称",prop:"name"}},[a("el-input",{staticClass:"middle",model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),a("el-form-item",{attrs:{label:"权限"}},[a("el-tree",{ref:"tree",attrs:{"node-key":"name",data:e.accessData,props:e.props,"show-checkbox":"","default-checked-keys":e.checkKeys},on:{"check-change":e.handleCheckChange}})],1),a("el-form-item",{attrs:{label:""}},[a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.onSubmit("form")}}},[e._v("保存")]),a("el-button",{on:{click:function(t){return e.goto("/sys/admin/role")}}},[e._v("返回")])],1)],1)],1)],1)},n=[],c=(a("a434"),a("2909")),o=a("5530"),s=a("d00f"),i=a("2963"),l=a("d4c4"),u=a("fe3b"),d=a("55d5"),f=a("c34c"),m=a("9cf2"),h=a("7e72"),b=a("8c28"),p={data:function(){return{checkKeys:[],form:{name:"",access:[]},accessData:[],props:{label:function(e,t){return e.meta.title},children:"children"},count:1,rules:{name:[{required:!0,message:"请输入角色名",trigger:"blur"},{max:15,message:"长度在 1 到 15 个字符",trigger:"blur"}]}}},created:function(){var e=[Object(o["a"])({},i["a"]),Object(o["a"])({},l["a"]),Object(o["a"])({},u["a"]),Object(o["a"])({},d["a"]),Object(o["a"])({},f["a"]),Object(o["a"])({},m["a"]),Object(o["a"])({},h["a"]),Object(o["a"])({},b["a"])];e=this.routeTree(e),this.accessData=Object(c["a"])(e)},methods:{routeTree:function(e){for(var t=Object(c["a"])(e),a=this,r=0;r<t.length;r++){var n=Object(o["a"])({},t[r]);void 0!==n.hidden&&!0===n.hidden?(t.splice(r,1),r--):n.children&&n.children.length>0&&(n.children=a.routeTree(n.children),t[r]=n)}return t},handleCheckChange:function(e,t,a){var r=Object(c["a"])(this.$refs.tree.getHalfCheckedKeys()),n=Object(c["a"])(this.$refs.tree.getCheckedKeys());this.form.access={harfCheckedKeys:r,checkedKeys:n}},onSubmit:function(e){var t=this,a=this,r=Object(o["a"])({},this.form);this.$refs[e].validate((function(e){if(!e)return!1;Object(s["a"])(r).then((function(e){return t.$message.success(e.message),setTimeout((function(){a.$router.push("/sys/admin/role")}),1500),!0})).catch((function(){}))}))},goto:function(e){this.$router.push(e)}}},g=p,j=a("2877"),k=Object(j["a"])(g,r,n,!1,null,null,null);t["default"]=k.exports},d00f:function(e,t,a){"use strict";a.d(t,"d",(function(){return c})),a.d(t,"a",(function(){return o})),a.d(t,"c",(function(){return s})),a.d(t,"b",(function(){return i}));var r=a("b775"),n=a("d722");function c(e){return Object(r["a"])({url:n["a"].adminRoleList,method:"get",params:e})}function o(e){return Object(r["a"])({url:n["a"].adminRoleAdd,method:"post",data:e})}function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"post";return"post"==t?Object(r["a"])({url:n["a"].adminRoleEdit,method:t,data:e}):Object(r["a"])({url:n["a"].adminRoleEdit,method:t,params:e})}function i(e){return Object(r["a"])({url:n["a"].adminRoleDelete,method:"post",data:e})}}}]);