暫無描述

index.vue 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <div class="app-container">
  3. <el-table :data="list" v-loading.body="listLoading" element-loading-text="Loading" border fit highlight-current-row
  4. style="width: 100%">
  5. <el-table-column label="ID">
  6. <template slot-scope="scope">
  7. {{scope.row.id}}
  8. </template>
  9. </el-table-column>
  10. <el-table-column prop="GambleMember.name" label="莊家" width="200" align="center">
  11. <!-- <template slot-scope="scope">
  12. <span>{{scope.row.GambleMember.id}}</span>
  13. </template> -->
  14. </el-table-column>
  15. <el-table-column align="center" label="時間" width="200">
  16. <template slot-scope="scope">
  17. <span>{{scope.row.createdAt}}</span>
  18. </template>
  19. </el-table-column>
  20. <el-table-column align="center" label="操作">
  21. <template slot-scope="scope">
  22. <router-link to="/gambleGameBucket/index/detail">
  23. <el-button type="primary" size="mini" @click="handlePage(scope.row)">查看</el-button>
  24. </router-link>
  25. </template>
  26. </el-table-column>
  27. </el-table>
  28. <div v-show="!listLoading" class="pagination-container">
  29. <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="listQuery.page"
  30. :page-sizes="[10,20,30, 50]" :page-size="listQuery.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
  31. </el-pagination>
  32. </div>
  33. <!-- <el-dialog title="詳細" :visible.sync="dialogVisible">
  34. <el-table :data="list" v-loading.body="listLoading" element-loading-text="Loading" border fit highlight-current-row
  35. style="width: 100%">
  36. <el-table-column label="ID">
  37. <template slot-scope="scope">
  38. {{scope.row.id}}
  39. </template>
  40. </el-table-column>
  41. <el-table-column prop="GambleMember.name" label="莊家" width="200" align="center">
  42. </el-table-column>
  43. <el-table-column align="center" label="時間" width="200">
  44. <template slot-scope="scope">
  45. <span>{{scope.row.createdAt}}</span>
  46. </template>
  47. </el-table-column>
  48. <el-table-column align="center" label="操作">
  49. <template slot-scope="scope">
  50. <el-button type="primary" size="mini" @click="handleView(scope.row)">查看</el-button>
  51. </template>
  52. </el-table-column>
  53. </el-table>
  54. <div slot="footer" align="center" class="dialog-footer">
  55. <el-button type="primary" @click="closeDialog">確 定</el-button>
  56. </div>
  57. </el-dialog> -->
  58. </div>
  59. </template>
  60. <script>
  61. import { fetchList } from '@/api/gambleGameBucket'
  62. export default {
  63. data() {
  64. return {
  65. list: null,
  66. listLoading: true,
  67. total: null,
  68. listQuery: {
  69. page: 1,
  70. limit: 20,
  71. importance: '',
  72. title: '',
  73. type: '',
  74. chipsSort: '',
  75. updatedSort: ''
  76. },
  77. temp: {
  78. id: '',
  79. importance: 1,
  80. name: '',
  81. chips: '',
  82. depositChips: ''
  83. },
  84. // dialogVisible: false,
  85. // dialogStatus: ''
  86. }
  87. },
  88. created() {
  89. this.getList()
  90. },
  91. methods: {
  92. getList() {
  93. this.listLoading = true
  94. fetchList(this.listQuery).then(response => {
  95. this.list = response.data.rows
  96. this.total = response.data.count
  97. this.listLoading = false
  98. })
  99. },
  100. // closeDialog() {
  101. // this.dialogVisible = false
  102. // },
  103. handlePage(row) {
  104. this.temp = Object.assign({}, row) // copy obj
  105. // router.push({ path: '/gambleGameBucket/index/detail' })
  106. this.dialogVisible = true
  107. },
  108. handleFilter() {
  109. this.listQuery.page = 1
  110. this.getList()
  111. },
  112. handleSizeChange(val) {
  113. this.listQuery.limit = val
  114. this.getList()
  115. },
  116. handleCurrentChange(val) {
  117. this.listQuery.page = val
  118. this.getList()
  119. }
  120. }
  121. }
  122. </script>