(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-57d670f0"],{"162c":function(e,t,a){"use strict";a("c061")},c061:function(e,t,a){},d612:function(e,t,a){"use strict";a.r(t);var l=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"addRoleDialog"},[e.addRoleData.dialogVisible?a("el-dialog",{attrs:{width:"636px",center:"",title:"新增角色",visible:e.addRoleData.dialogVisible},on:{close:function(t){return e.closeDialog()},"update:visible":function(t){return e.$set(e.addRoleData,"dialogVisible",t)}}},[a("el-form",{ref:"ruleForm",attrs:{"label-width":"100px",rules:e.rules,model:e.addRoleForm}},[a("el-form-item",{attrs:{label:"角色名称：",prop:"roleName"}},[a("el-input",{attrs:{placeholder:"请输入角色名称"},model:{value:e.addRoleForm.roleName,callback:function(t){e.$set(e.addRoleForm,"roleName",t)},expression:"addRoleForm.roleName"}})],1),a("el-form-item",{attrs:{label:"权限字符：",prop:"roleKey"}},[a("el-input",{attrs:{placeholder:"请输入权限字符"},model:{value:e.addRoleForm.roleKey,callback:function(t){e.$set(e.addRoleForm,"roleKey",t)},expression:"addRoleForm.roleKey"}})],1),a("el-form-item",{attrs:{label:"显示排序：",prop:"roleSort"}},[a("el-input",{attrs:{placeholder:"请输入显示排序",type:"text",onkeyup:"this.value=this.value.replace(/\\D/g,'')",onafterpaste:"this.value=this.value.replace(/\\D/g,'')"},model:{value:e.addRoleForm.roleSort,callback:function(t){e.$set(e.addRoleForm,"roleSort",t)},expression:"addRoleForm.roleSort"}})],1),a("el-form-item",{attrs:{label:"状态：",prop:"status"}},[a("el-radio",{attrs:{label:"1"},model:{value:e.addRoleForm.status,callback:function(t){e.$set(e.addRoleForm,"status",t)},expression:"addRoleForm.status"}},[e._v("启用")]),a("el-radio",{attrs:{label:"2"},model:{value:e.addRoleForm.status,callback:function(t){e.$set(e.addRoleForm,"status",t)},expression:"addRoleForm.status"}},[e._v("停用")])],1),a("el-form-item",{attrs:{label:"菜单权限："}},[a("div",{staticStyle:{height:"400px",overflow:"auto"}},[a("el-checkbox",{on:{change:e.handleCheckAllChange},model:{value:e.checkAll,callback:function(t){e.checkAll=t},expression:"checkAll"}},[e._v("全选")]),a("el-tree",{ref:"tree",attrs:{placeholder:"请选择菜单权限","default-expanded-keys":e.defaultExpanded,data:e.meunTreeData,"show-checkbox":"","node-key":"id"},on:{"check-change":e.handleCheckChange}})],1)]),a("div")],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("div",{staticClass:"search",on:{click:function(t){return e.addRole()}}},[e._v("保 存")]),a("div",{staticClass:"reset",on:{click:function(t){return e.cancel()}}},[e._v("取 消")])])],1):e._e()],1)},o=[],r=(a("99af"),a("14d9"),a("d3b7"),a("159b"),a("f9ac")),s={name:"addRoleDialog",props:{addRoleData:{type:Object,default:{}}},created:function(){this.getMenuTree()},data:function(){return{checkAll:!1,defaultExpanded:[],meunTreeData:[],addRoleForm:{roleName:"",roleKey:"",roleSort:"",status:"1",menuIds:[]},rules:{roleName:[{required:!0,message:"请输入角色名称",trigger:"blur"}],roleKey:[{required:!0,message:"请输入权限字符",trigger:"blur"}],roleSort:[{required:!0,message:"请输入显示排序",trigger:"blur"}],status:[{required:!0,message:"请选择状态",trigger:"blur"}]},menuIds:[]}},methods:{handleCheckAllChange:function(e){this.checkAll?this.$refs.tree.setCheckedNodes(this.meunTreeData):this.$refs.tree.setCheckedKeys([])},getMenuTree:function(){var e=this;Object(r["A"])().then((function(t){200==t.code&&(e.defaultExpanded=[],t.data.forEach((function(t){e.defaultExpanded.push(t.id)})),e.meunTreeData=t.data)}))},handleCheckChange:function(e,t,a){var l=this.$refs.tree.getCheckedKeys(),o=this.$refs.tree.getHalfCheckedKeys(),r=l.concat(o);this.menuIds=r},addRole:function(){var e=this;this.$refs.ruleForm.validate((function(t){t&&(0!=e.menuIds.length?(e.addRoleForm.menuIds=e.menuIds,e.$emit("addRoleBtn1",e.addRoleForm)):e.$message({type:"warning",message:"请选择菜单权限!"}))}))},cancel:function(){this.addRoleData.dialogVisible=!1,this.addRoleForm={roleName:"",roleKey:"",roleSort:"",status:"1",menuIds:null},this.getMenuTree()},closeDialog:function(){this.addRoleData.dialogVisible=!1,this.getMenuTree(),this.addRoleForm={roleName:"",roleKey:"",roleSort:"",status:"0",menuIds:null}}}},d=s,n=(a("162c"),a("2877")),i=Object(n["a"])(d,l,o,!1,null,"6e50149e",null);t["default"]=i.exports}}]);