index.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <div class="quota">
  3. <div class="quota-list">
  4. <el-table :data="data_list">
  5. <el-table-column prop="org_name" label="机构" width="500" />
  6. <el-table-column prop="quota_lave" label="剩余配额" width="160" />
  7. <el-table-column prop="quota_used" label="累计已用" width="160" />
  8. <el-table-column prop="quota_status" label="状态" width="160" />
  9. <el-table-column label="操作">
  10. <template slot-scope="{ row }">
  11. <span>设置配额</span>
  12. <span>{{ row.quota_status ? '停用' : '启用' }}</span>
  13. </template>
  14. </el-table-column>
  15. </el-table>
  16. </div>
  17. <el-pagination
  18. background
  19. :page-sizes="[10, 20, 30, 40, 50]"
  20. :page-size="page_capacity"
  21. layout="prev, pager, next, total, sizes, jumper"
  22. :total="total_count"
  23. :current-page="cur_page"
  24. @prev-click="changePage"
  25. @next-click="changePage"
  26. @current-change="changePage"
  27. @size-change="changePageSize"
  28. />
  29. </div>
  30. </template>
  31. <script>
  32. import { PageQueryOrgQuotaList } from '@/api/list';
  33. export default {
  34. name: 'QuotaList',
  35. data() {
  36. return {
  37. data_list: [],
  38. page_capacity: 10,
  39. total_count: 0,
  40. cur_page: 1
  41. };
  42. },
  43. created() {
  44. this.pageQueryOrgQuotaList();
  45. },
  46. methods: {
  47. pageQueryOrgQuotaList() {
  48. PageQueryOrgQuotaList({}).then(({ data_list, total_count, cur_page }) => {
  49. this.data_list = data_list;
  50. this.total_count = total_count;
  51. this.cur_page = cur_page;
  52. });
  53. },
  54. changePage(newPage) {
  55. this.cur_page = newPage;
  56. this.pageQueryOrgQuotaList();
  57. },
  58. changePageSize(pageSize) {
  59. this.page_capacity = pageSize;
  60. this.pageQueryOrgQuotaList();
  61. }
  62. }
  63. };
  64. </script>
  65. <style lang="scss" scoped>
  66. @import '~@/styles/mixin';
  67. .quota {
  68. @include container;
  69. @include pagination;
  70. padding: 24px 0 46px;
  71. &-list {
  72. @include list;
  73. padding: 0 32px;
  74. ::v-deep .el-table th.el-table__cell {
  75. color: #000;
  76. }
  77. }
  78. }
  79. </style>