webpackJsonp([52],{A9ZW:function(n,e,t){(n.exports=t("uszS")(!1)).push([n.i,"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",""])},ak3h:function(n,e,t){var i=t("A9ZW");"string"==typeof i&&(i=[[n.i,i,""]]),i.locals&&(n.exports=i.locals);t("Xatw")("a34d79a0",i,!0)},gA7R:function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=t("s/F+"),s=t.n(i),l=t("yrbl"),r=t.n(l),a=t("EwHo"),c={data:function(){return{checkAll:!1,id:"",ruleForm:{},configRule:[],checkList:[],isIndeterminate:!1,privilegeIds:[],countPrivilegeIds:[]}},mounted:function(){var n=this;return r()(s.a.mark(function e(){var t,i;return s.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=n,i=n.$route.params.id,n.id=i,e.next=5,a.a.getRolePrivileges(i).then(function(n){t.boolPrivileges(n),t.configRule=n});case 5:case"end":return e.stop()}},e,n)}))()},methods:{submitForm:function(n){var e=this.$route.params.id,t=this;this.$refs[n].validate(function(n){if(!n)return console.log("error submit!!"),!1;a.a.postRolePrivileges(e,t.privilegeIds),t.$notify({title:"成功",message:"配置权限成功",type:"success",duration:2e3}),t.$router.push("../role-manager")})},handleCheckAllChange:function(){this.isIndeterminate=!1,this.boolPrivileges(this.configRule,this.checkAll)},handleCancel:function(){this.$router.push("../role-manager")},statusCheck:function(){0==this.privilegeIds.length&&(this.isIndeterminate=!1),this.privilegeIds.length>0&&(this.isIndeterminate=!0,this.privilegeIds.length==this.countPrivilegeIds.length?(this.checkAll=!0,this.isIndeterminate=!1):(this.checkAll=!1,this.isIndeterminate=!0))},handleCheckedChange:function(n){if(n.checked)this.privilegeIds.push(n.id);else for(var e=0;e<this.privilegeIds.length;e++)this.privilegeIds[e]==n.id&&this.privilegeIds.splice(e,1);this.statusCheck()},boolPrivileges:function(n,e){for(var t in n)void 0===e?void 0!==n[t].own&&(this.countPrivilegeIds.push(n[t].id),1===n[t].own?(n[t].checked=!0,this.privilegeIds.push(n[t].id)):n[t].checked=!1,this.statusCheck()):e?void 0!==n[t].own&&(n[t].checked=!0,this.privilegeIds.push(n[t].id)):e||(n[t].checked=!1,this.privilegeIds=[]),this.boolPrivileges(n[t].privileges,e)}}},o={render:function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("div",{staticClass:"config-main"},[t("el-checkbox",{attrs:{indeterminate:n.isIndeterminate},on:{change:n.handleCheckAllChange},model:{value:n.checkAll,callback:function(e){n.checkAll=e},expression:"checkAll"}},[n._v("全选")]),n._v(" "),t("el-form",{ref:"ruleForm",attrs:{model:n.ruleForm}},[n._l(n.configRule,function(e){return t("el-form-item",{key:e.id,staticClass:"par-name",attrs:{label:e.name}},[e.childs.length>0?n._l(e.childs,function(e){return t("el-form-item",{key:e.id,staticClass:"par-name",attrs:{label:e.name}},[e.childs.length>0?n._l(e.childs,function(e){return t("el-form-item",{key:e.id,staticClass:"par-name",attrs:{label:e.name}},[e.privileges.length>0?n._l(e.privileges,function(e){return t("el-checkbox",{key:e.id,attrs:{label:e.description},on:{change:function(t){n.handleCheckedChange(e)}},model:{value:e.checked,callback:function(t){n.$set(e,"checked",t)},expression:"child.checked"}})}):n._e()],2)}):n._e()],2)}):n._e()],2)}),n._v(" "),t("el-row",{staticClass:"operation-container",attrs:{type:"flex",justify:"flex-start"}},[t("el-col",{attrs:{span:3}},[t("el-button",{attrs:{type:"primary"},on:{click:function(e){n.submitForm("ruleForm")}}},[n._v("确定")])],1),n._v(" "),t("el-col",{attrs:{span:3}},[t("el-button",{attrs:{type:"danger"},on:{click:n.handleCancel}},[n._v("返回")])],1)],1)],2)],1)},staticRenderFns:[]};var h=t("rCDr")(c,o,!1,function(n){t("ak3h")},"data-v-64840e84",null);e.default=h.exports}});