(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6d8cc6a7"],{"110e":function(e,t,a){},c5c4: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:"updataRoleDialog"},[a("el-dialog",{attrs:{width:"636px",center:"",title:"修改角色",visible:e.updateRoleData.dialogVisible},on:{"update:visible":function(t){return e.$set(e.updateRoleData,"dialogVisible",t)}}},[a("el-form",{ref:"ruleForm",attrs:{"label-width":"100px",rules:e.rules,model:e.updateRoleData.data}},[a("el-form-item",{attrs:{label:"角色名称：",prop:"roleName"}},[a("el-input",{model:{value:e.updateRoleData.data.roleName,callback:function(t){e.$set(e.updateRoleData.data,"roleName",t)},expression:"updateRoleData.data.roleName"}})],1),a("el-form-item",{attrs:{label:"权限字符：",prop:"roleKey"}},[a("el-input",{attrs:{disabled:1==e.updateRoleData.data.roleId},model:{value:e.updateRoleData.data.roleKey,callback:function(t){e.$set(e.updateRoleData.data,"roleKey",t)},expression:"updateRoleData.data.roleKey"}})],1),a("el-form-item",{attrs:{label:"显示排序：",prop:"roleSort"}},[a("el-input",{attrs:{type:"text",onkeyup:"this.value=this.value.replace(/\\D/g,'')",onafterpaste:"this.value=this.value.replace(/\\D/g,'')"},model:{value:e.updateRoleData.data.roleSort,callback:function(t){e.$set(e.updateRoleData.data,"roleSort",t)},expression:"updateRoleData.data.roleSort"}})],1),a("el-form-item",{attrs:{label:"状态：",prop:"status"}},[a("el-radio",{attrs:{disabled:1==e.updateRoleData.data.roleId,label:"1"},model:{value:e.updateRoleData.data.status,callback:function(t){e.$set(e.updateRoleData.data,"status",t)},expression:"updateRoleData.data.status"}},[e._v("启用")]),a("el-radio",{attrs:{disabled:1==e.updateRoleData.data.roleId,label:"2"},model:{value:e.updateRoleData.data.status,callback:function(t){e.$set(e.updateRoleData.data,"status",t)},expression:"updateRoleData.data.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:{data:e.meunTreeData,"show-checkbox":!0,"node-key":"id","check-strictly":e.checkStrictly,"default-checked-keys":this.updateRoleData.data.menuIds,"default-expand-all":!0},on:{check:e.getCurrentNode,"check-change":e.handleCheckChange}})],1)])],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("div",{staticClass:"search",on:{click:e.updateRole}},[e._v("保 存")]),a("div",{staticClass:"reset",on:{click:function(t){return e.cancel()}}},[e._v("取 消")])])],1)],1)},o=[],d=(a("14d9"),a("d3b7"),a("159b"),a("f9ac")),s={name:"updateRoleDialog",props:{updateRoleData:{type:Object,default:{}}},created:function(){this.getMenuTree()},data:function(){return{checkAll:!1,checkStrictly:!0,defaultExpanded:[],meunTreeData:[],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.checkStrictly=!1,this.$refs.tree.setCheckedNodes(this.meunTreeData)):(this.checkStrictly=!0,this.$refs.tree.setCheckedKeys([]))},getMenuTree:function(){var e=this;Object(d["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.getCheckedNodes(!1,!0),o=[];l.forEach((function(e){o.push(e.id)})),this.updateRoleData.data.menuIds=o},updateRole:function(){var e=this;this.$refs.ruleForm.validate((function(t){t&&(0!=e.updateRoleData.data.menuIds.length?e.$emit("updateRoleBtn",e.updateRoleData.data):e.$message({type:"warning",message:"请选择菜单权限!"}))}))},cancel:function(){this.updateRoleData.dialogVisible=!1,this.getMenuTree()},closeDialog:function(){this.getMenuTree()},getCurrentNode:function(e){var t=this.$refs.tree.getNode(e);this.childNodes(t),this.parentNodes(t)},childNodes:function(e){for(var t=e.childNodes.length,a=0;a<t;a+=1)e.childNodes[a].checked=e.checked,this.childNodes(e.childNodes[a])},parentNodes:function(e){if(e.parent)for(var t in e)"parent"===t&&(e[t].checked=!0,this.parentNodes(e[t]))}}},r=s,i=(a("d338"),a("2877")),c=Object(i["a"])(r,l,o,!1,null,"1f6e97de",null);t["default"]=c.exports},d338:function(e,t,a){"use strict";a("110e")}}]);