adminManager.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <div class='m-container'>
  3. <h2><div class="squrt"></div>系统角色权限管理</h2>
  4. <div class="m-core">
  5. <div @click="onAdminOperation('create')" class='newBand'>添加</div>
  6. <!-- 列表 -->
  7. <div class="tableWrap">
  8. <el-table :data='tableList' header-cell-class-name="headerName">
  9. <el-table-column align='center' prop="roleName"
  10. label="角色类型">
  11. </el-table-column>
  12. <el-table-column align='center' prop="roleDesc"
  13. label="角色描述">
  14. </el-table-column>
  15. <el-table-column align='center'
  16. label="操作">
  17. <template slot-scope="scope">
  18. <el-button @click="onAdminOperation('update', scope.row)" type="text">修改</el-button>
  19. </template>
  20. </el-table-column>
  21. </el-table>
  22. <pagination :total="pageInfo.total"
  23. :page.sync="pageInfo.page"
  24. :limit.sync="pageInfo.limit"
  25. :page-sizes="pageInfo.page_size"
  26. @pagination="getList" />
  27. </div>
  28. </div>
  29. </div>
  30. </template>
  31. <script>
  32. import pagination from '@/components/Pagination/index'
  33. import { roleQueryPage } from '@/api/systemManage'
  34. import store from '@/store'
  35. export default {
  36. components: { pagination },
  37. name: 'adminManager',
  38. data () {
  39. return {
  40. tableList: [],
  41. pageInfo: {
  42. // 分页规则
  43. limit: 10, // 限制显示条数
  44. page: 1, // 当前页
  45. total: 0, // 总条数
  46. page_size: [10, 20, 40, 50] // 选择限制显示条数
  47. },
  48. organId: store.getters.organ
  49. }
  50. },
  51. mounted() {
  52. // console.log(store.getters.permission)
  53. this.getList()
  54. },
  55. methods: {
  56. getList () {
  57. roleQueryPage({
  58. organId: this.organId,
  59. rows: this.pageInfo.limit,
  60. page: this.pageInfo.page
  61. }).then(res => {
  62. if(res.code == 200 && res.data) {
  63. this.tableList = res.data.rows
  64. this.pageInfo.total = res.data.total
  65. }
  66. })
  67. },
  68. onAdminOperation(type, row) {
  69. let params = {
  70. path: '/specialSetup/adminoperation',
  71. query: {
  72. type: type
  73. }
  74. }
  75. if(row) {
  76. params.query.id = row.id
  77. }
  78. this.$router.push(params)
  79. }
  80. }
  81. }
  82. </script>
  83. <style lang="scss">
  84. .headerName {
  85. background-color: #EDEEF0 !important;
  86. color: #444444;
  87. }
  88. </style>