(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-202eb28a"],{"4bb5":function(e,t,a){"use strict";a.r(t);var n=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",{directives:[{name:"loading",rawName:"v-loading",value:e.infoLoading,expression:"infoLoading"}],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)},r=[],c=(a("a434"),a("2909")),o=a("5530"),i=a("d00f"),s=a("2963"),l=a("d4c4"),u=a("fe3b"),d=a("55d5"),f=a("c34c"),h=a("9cf2"),m=a("7e72"),b=a("8c28"),p={data:function(){return{infoLoading:!0,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(){this.fetchInfo();var e=[Object(o["a"])({},s["a"]),Object(o["a"])({},l["a"]),Object(o["a"])({},u["a"]),Object(o["a"])({},d["a"]),Object(o["a"])({},f["a"]),Object(o["a"])({},h["a"]),Object(o["a"])({},m["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,n=0;n<t.length;n++){var r=Object(o["a"])({},t[n]);void 0!==r.hidden&&!0===r.hidden?(t.splice(n,1),n--):r.children&&r.children.length>0&&(r.children=a.routeTree(r.children),t[n]=r)}return t},fetchInfo:function(){var e=this;this.infoLoading=!0;var t={id:this.$route.query.id};Object(i["c"])(t,"get").then((function(t){e.form=Object(o["a"])({},t.data),e.checkKeys=Object(c["a"])(e.form.access.checkedKeys),e.infoLoading=!1})).catch((function(){}))},handleCheckChange:function(e,t,a){var n=Object(c["a"])(this.$refs.tree.getHalfCheckedKeys()),r=Object(c["a"])(this.$refs.tree.getCheckedKeys());this.form.access={harfCheckedKeys:n,checkedKeys:r}},onSubmit:function(e){var t=this,a=this,n=Object(o["a"])({},this.form);this.$refs[e].validate((function(e){if(!e)return!1;Object(i["c"])(n).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,v=a("2877"),j=Object(v["a"])(g,n,r,!1,null,null,null);t["default"]=j.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 i})),a.d(t,"b",(function(){return s}));var n=a("b775"),r=a("d722");function c(e){return Object(n["a"])({url:r["a"].adminRoleList,method:"get",params:e})}function o(e){return Object(n["a"])({url:r["a"].adminRoleAdd,method:"post",data:e})}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"post";return"post"==t?Object(n["a"])({url:r["a"].adminRoleEdit,method:t,data:e}):Object(n["a"])({url:r["a"].adminRoleEdit,method:t,params:e})}function s(e){return Object(n["a"])({url:r["a"].adminRoleDelete,method:"post",data:e})}}}]);