(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6b1d9706"],{"0c0b":function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-drawer",{attrs:{title:"权限设置",visible:e.showStatus,size:"70%","before-close":e.closeFn},on:{"update:visible":function(t){e.showStatus=t}}},[n("div",{staticClass:"role-set-wrap"},e._l(e.permTree,(function(t,r){return n("div",{key:r,staticClass:"role-list"},[n("el-checkbox",{attrs:{indeterminate:e.isIndeterminate[r]},on:{change:function(t){return e.handleCheckAllChange(t,r)}},model:{value:e.checkAll[r],callback:function(t){e.$set(e.checkAll,r,t)},expression:"checkAll[index]"}},[e._v(e._s(t.authName))]),n("div",{staticStyle:{margin:"15px 0"}}),n("el-checkbox-group",{on:{change:function(t){return e.handlecheckedPermChange(t,r)}},model:{value:e.checkedPerm,callback:function(t){e.checkedPerm=t},expression:"checkedPerm"}},e._l(t.children,(function(t,r){return n("el-checkbox",{key:t.id,attrs:{label:t.id}},[e._v(e._s(t.authName))])})),1)],1)})),0),n("div",{staticClass:"button-wrap flex-center"},[n("el-button",{attrs:{size:"mini"},on:{click:e.closeFn}},[e._v("关闭")]),n("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.saveFn}},[e._v("保存")])],1)])},i=[],s=(n("ea51"),n("63ff"),n("e5af")),c={name:"role-set",props:{show:{type:Boolean,default:!1},info:{type:Object,default:function(){}}},data:function(){return{showStatus:!1,data:{},permTree:[],checkAll:[],checkedPerm:[],isIndeterminate:[]}},watch:{show:function(e){this.showStatus=e,e&&this.init()}},methods:{init:function(){var e=this;this._getTreeB().then((function(t){console.log("res",t),"business"==e.$projectName&&e._getAuthB()}))},_getTreeB:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t,n=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t={},e.next=3,this.$service.common.permTree({endId:1}).then((function(e){n.permTree=e,n.permTree.map((function(){n.isIndeterminate.push(!1),n.checkAll.push(!1)})),t=e}));case 3:return e.abrupt("return",t);case 4:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),_getAuthB:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t={},e.next=3,this.$service.auth.authList({roleId:this.info.roleId}).then((function(e){t=e}));case 3:return e.abrupt("return",t);case 4:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),saveFn:function(){var e=this;console.log("this.info",this.info),this.$service.auth.authUpdate({roleId:this.info.roleId,authIdList:this.checkedPerm}).then((function(t){e.closeFn(),e.$message.success("保存成功！")}))},closeFn:function(e){this.$emit("update:show",!1),e&&e()},handleCheckAllChange:function(e,t){var n=this.permTree[t].children?this.permTree[t].children:this.permTree[t];n=n.map((function(e){return e.id})),this.checkedPerm=e?n:[],this.$set(this.isIndeterminate,t,!1)},handlecheckedPermChange:function(e,t){var n=e.length,r=this.permTree[t].children?this.permTree[t].children.length:0,i=n===r;this.$set(this.checkAll,t,i);var s=n>0&&n<r;this.$set(this.isIndeterminate,t,s)}}},a=c,h=(n("b175"),n("5511")),o=Object(h["a"])(a,r,i,!1,null,"2a89cba6",null);t["default"]=o.exports},b175:function(e,t,n){"use strict";var r=n("d641"),i=n.n(r);i.a},d641:function(e,t,n){}}]);