(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-79005b4c"],{"06c5":function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));n("fb6a"),n("d3b7"),n("b0c0"),n("a630"),n("3ca3"),n("ac1f"),n("00b4");var o=n("6b75");function a(e,t){if(e){if("string"===typeof e)return Object(o["a"])(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(o["a"])(e,t):void 0}}},"0f33":function(e,t,n){"use strict";n.r(t);var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"role-container"},[n("el-form",{staticClass:"header-buttons",attrs:{"label-width":"80px",inline:!0}},[n("el-button",{attrs:{type:"primary"},on:{click:e.showAddRoleDialog}},[e._v("添 加")]),n("el-button",{attrs:{type:"danger",disabled:0===e.selectedRoles.length},on:{click:e.deleteRolesInBatches}},[e._v("批量删除")])],1),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loadingOfGetRoleList,expression:"loadingOfGetRoleList"}],staticStyle:{width:"100%"},attrs:{data:e.roles,stripe:"",border:""},on:{"selection-change":e.handleSelectionChange}},[n("el-table-column",{attrs:{type:"selection",width:"55"}}),n("el-table-column",{attrs:{type:"index",label:"序号",width:"80",align:"center"}}),n("el-table-column",{attrs:{"header-align":"center",align:"center",prop:"name",label:"角色名称"}}),n("el-table-column",{attrs:{label:"操作",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var o=t.row;return[n("el-button",{attrs:{type:"edit",icon:"el-icon-edit",size:"mini",title:"修改角色"},on:{click:function(t){return e.updateRole(o)}}}),n("el-button",{attrs:{type:"danger",icon:"el-icon-delete",size:"mini",title:"删除角色"},on:{click:function(t){return e.deleteRole(o)}}})]}}])})],1),n("el-dialog",{attrs:{title:e.role.id?"修改角色":"添加角色",visible:e.dialogRoleVisible},on:{"update:visible":function(t){e.dialogRoleVisible=t},close:function(t){return e.cancelButtonOfAddOrUpdateDialog()}}},[n("div",[n("el-form",{attrs:{model:e.role,"label-width":"80px"}},[n("el-form-item",{attrs:{label:"角色名称"}},[n("el-input",{model:{value:e.role.name,callback:function(t){e.$set(e.role,"name",t)},expression:"role.name"}})],1),n("el-form-item",{attrs:{label:"角色权限"}},[n("el-tree",{ref:"tree",staticStyle:{margin:"20px 0"},attrs:{data:e.allPermissions,"node-key":"id","show-checkbox":"",props:e.defaultProps},on:{"node-click":e.handleRowClick}})],1)],1)],1),n("div",{attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"primary",loading:e.loadingOfSaveRoleButton},on:{click:function(t){return e.saveButtonOfAddEditDialog()}}},[e._v("保 存")]),n("el-button",{on:{click:function(t){return e.cancelButtonOfAddOrUpdateDialog()}}},[e._v("取 消")])],1)])],1)},a=[],i=n("5530"),l=n("2909"),r=n("c7eb"),s=n("1da1"),c=(n("99af"),n("d3b7"),n("159b"),n("d81d"),{name:"RoleList",data:function(){return{loadingOfSaveRoleButton:!1,dialogRoleVisible:!1,loadingOfGetRoleList:!1,loadingInstanceOfRoleDialog:!1,role:{},roles:[],allPermissions:[],allPermissionsLeafIds:[],defaultProps:{children:"children",label:"name"},selectedRoles:[]}},mounted:function(){this.fetchRoleList(),this.fetchMenuList()},methods:{fetchRoleList:function(){var e=this;return Object(s["a"])(Object(r["a"])().mark((function t(){var n;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loadingOfGetRoleList=!0,t.next=3,e.$API.role.reqGetRoleList();case 3:n=t.sent,0==n.code&&(e.roles=n.data,console.log("获取的角色列表为",e.roles)),e.loadingOfGetRoleList=!1;case 6:case"end":return t.stop()}}),t)})))()},fetchMenuList:function(){var e=this;return Object(s["a"])(Object(r["a"])().mark((function t(){var n;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$API.permission.getPermissionList();case 2:n=t.sent,0==n.code&&(e.allPermissions=n.data);case 4:case"end":return t.stop()}}),t)})))()},showAddRoleDialog:function(){this.dialogRoleVisible=!0,this.$refs.tree.setCheckedKeys([])},saveButtonOfAddEditDialog:function(){var e=this;return Object(s["a"])(Object(r["a"])().mark((function t(){var n,o;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=[].concat(Object(l["a"])(e.$refs.tree.getCheckedKeys()),Object(l["a"])(e.$refs.tree.getHalfCheckedKeys())),e.role.menuIdList=n,e.loadingOfSaveRoleButton=!0,t.next=5,e.$API.role[e.role.id?"reqUpdateRole":"reqAddRole"](e.role);case 5:o=t.sent,0==o.code&&(e.$message({type:"success",message:"".concat(e.role.id?"修改":"添加","角色成功!}")}),e.role={},e.loadingOfSaveRoleButton=!1,e.dialogRoleVisible=!1,e.fetchRoleList()),e.allPermissionsLeafIds=[];case 8:case"end":return t.stop()}}),t)})))()},updateRole:function(e){var t=this;this.dialogRoleVisible=!0,this.loadingInstanceOfRoleDialog=this.$loading({visible:!0,text:"加载中...",spinner:"el-icon-loading",target:document.querySelector(".el-dialog")}),this.$nextTick((function(){t.role=Object(i["a"])({},e);for(var n=0;n0)for(var a=0;ae.length)&&(t=e.length);for(var n=0,o=new Array(t);n