webpackJsonp([67],{yxLS:function(e,a,t){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var n=t("Dd8w"),l=t.n(n),i=t("Pfph"),o={name:"roleManage",data:function(){return{loading:!1,params:{page_no:1,page_size:10},tableData:""}},mounted:function(){this.GET_RoleList()},methods:{handlePageSizeChange:function(e){this.params.page_size=e,this.GET_RoleList()},handlePageCurrentChange:function(e){this.params.page_no=e,this.GET_RoleList()},handleAddRole:function(){this.$router.push({name:"roleManageAdd",params:{id:0,callback:this.GET_RoleList}})},handleEditRole:function(e){this.$router.push({name:"roleManageEdit",params:{id:e.role_id,callback:this.GET_RoleList}})},handleDeleteRole:function(e){var a=this;this.$confirm("确定要删除这个角色吗？","提示",{type:"warning"}).then(function(){i.d(e.role_id).then(function(){a.$message.success("删除成功！"),a.GET_RoleList()})}).catch(function(){})},searchEvent:function(e){this.params=l()({},this.params,{keyword:e}),this.params.page_no=1,this.GET_RoleList()},GET_RoleList:function(){var e=this;this.loading=!0,i.j(this.params).then(function(a){e.loading=!1,e.tableData=a}).catch(function(){e.loading=!1})}}},s=t("XyMi"),r=Object(s.a)(o,function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("en-table-layout",{attrs:{tableData:e.tableData.data,loading:e.loading}},[t("div",{staticClass:"inner-toolbar",attrs:{slot:"toolbar"},slot:"toolbar"},[t("div",{staticClass:"toolbar-btns"},[e.checkPermission(["roleManage:add"])?t("el-button",{attrs:{size:"mini",type:"primary",icon:"el-icon-circle-plus-outline"},on:{click:e.handleAddRole}},[e._v("添加")]):e._e()],1),e._v(" "),t("div",{staticClass:"toolbar-search"},[t("en-table-search",{attrs:{placeholder:"请输入关键字"},on:{search:e.searchEvent}})],1)]),e._v(" "),t("template",{slot:"table-columns"},[t("el-table-column",{attrs:{prop:"role_name",label:"角色名称"}}),e._v(" "),t("el-table-column",{attrs:{prop:"role_describe",label:"角色描述"}}),e._v(" "),t("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(a){return[e.checkPermission(["roleManage:edit"])?t("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(t){return e.handleEditRole(a.row)}}},[e._v("编辑")]):e._e(),e._v(" "),e.checkPermission(["roleManage:del"])?t("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(t){return e.handleDeleteRole(a.row)}}},[e._v("删除")]):e._e()]}}])})],1),e._v(" "),e.tableData?t("el-pagination",{attrs:{slot:"pagination","current-page":e.tableData.page_no,"page-sizes":[10,20,50,100],"page-size":e.tableData.page_size,layout:"total, sizes, prev, pager, next, jumper",total:e.tableData.data_total},on:{"size-change":e.handlePageSizeChange,"current-change":e.handlePageCurrentChange},slot:"pagination"}):e._e()],2)},[],!1,null,null,null);a.default=r.exports}});