webpackJsonp([22],{"/MZh":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a("P9l9"),r={name:"roleManage",data:function(){return{requestProject:"gic-authcenter",searchInput:"",tableData:[],currentPage:1,pageSize:10,totalCount:0}},mounted:function(){this.init()},methods:{init:function(){var t=this.$route.query.tabId;this.$emit("showTab",t),this.getRoleList()},getRoleList:function(){var t=this,e={requestProject:this.requestProject,currentPage:this.currentPage,pageSize:this.pageSize,listAll:!1,search:this.searchInput};Object(n.b)("/gic-authcenter/role",e).then(function(e){var a=e.data;0==a.errorCode?(t.tableData=a.result?a.result:[],t.totalCount=a.totalCount):t.$message.error(a.message)})},handleCurrentChange:function(t){this.currentPage=t,this.getRoleList()},handleSizeChange:function(t){this.pageSize=t,this.getRoleList()},searchRole:function(){this.pageSize=1,this.getRoleList()},delRole:function(t,e){var a=this;this.$confirm("是否要删除选中的角色?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){var r={requestProject:a.requestProject};Object(n.a)("/gic-authcenter/role/"+t.id,r).then(function(t){var n=t.data;0==n.errorCode?(a.totalCount--,a.tableData.splice(e,1),0==a.tableData.length&&(a.currentPage>1?(a.currentPage--,a.getRoleList()):a.totalCount>0&&a.getRoleList()),a.$message.success("删除成功")):a.$message.error(n.message)})}).catch(function(){})},addRoleBtn:function(t,e){"add"==t?this.$router.push({path:"/addRole",query:{tabId:this.$route.query.tabId}}):"edit"==t&&this.$router.push({path:"/addRole",query:{roleId:e.id,tabId:this.$route.query.tabId}})}},components:{}},o={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"my-right-content"},[n("div",{staticClass:"search-wrap clearfix"},[n("el-input",{staticClass:"fl",attrs:{"prefix-icon":"el-icon-search",placeholder:"请输入内容",clearable:""},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.searchRole(e)}},model:{value:t.searchInput,callback:function(e){t.searchInput=e},expression:"searchInput"}}),t._v(" "),n("el-button",{staticClass:"fr",attrs:{type:"primary"},on:{click:function(e){return t.addRoleBtn("add")}}},[t._v("创建角色")])],1),t._v(" "),n("el-table",{staticClass:"table-no-line-wrap",attrs:{data:t.tableData,"max-height":"550"}},[n("el-table-column",{attrs:{prop:"roleName",label:"名称"}}),t._v(" "),n("el-table-column",{attrs:{prop:"systemCount",label:"关联系统"}}),t._v(" "),n("el-table-column",{attrs:{prop:"menuCount",label:"关联菜单"}}),t._v(" "),n("el-table-column",{attrs:{prop:"permissionCount",label:"权限"}}),t._v(" "),n("el-table-column",{attrs:{prop:"remark",label:"说明","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n        "+t._s(e.row.remark?e.row.remark:"--")+"\n      ")]}}])}),t._v(" "),n("el-table-column",{attrs:{prop:"opr",label:"操作",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-button",{attrs:{type:"text"},on:{click:function(a){return t.addRoleBtn("edit",e.row)}}},[t._v("编辑")]),t._v(" "),n("el-button",{attrs:{type:"text"},on:{click:function(a){return t.delRole(e.row,e.$index)}}},[t._v("删除")])]}}])}),t._v(" "),n("template",{slot:"empty"},[n("div",{staticClass:"no-data-wrap"},[n("div",{staticClass:"no-data-icon"},[n("img",{attrs:{src:a("8Td+"),alt:""}})]),t._v(" "),n("p",[t._v("暂无数据")])])])],2),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.totalCount>0,expression:"totalCount > 0"}],staticClass:"pagination"},[n("el-pagination",{attrs:{background:"","current-page":t.currentPage,"page-sizes":[10,20,30,40],"page-size":t.pageSize,layout:"total, sizes, prev, pager, next",total:t.totalCount},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1)],1)},staticRenderFns:[]};var s=a("VU/8")(r,o,!1,function(t){a("GxFT")},"data-v-0a7696e4",null);e.default=s.exports},GxFT:function(t,e){}});
//# sourceMappingURL=22.8fa7151b31b97a62cc60.1558087223141.js.map