Unknown преди 7 години
родител
ревизия
99a60dfc10
променени са 3 файла, в които са добавени 121 реда и са изтрити 0 реда
  1. 15 0
      src/api/gambleGameBucket.js
  2. 17 0
      src/router/index.js
  3. 89 0
      src/views/gambleGameBucket/index.vue

+ 15 - 0
src/api/gambleGameBucket.js

@@ -0,0 +1,15 @@
1
+import request from '@/utils/request'
2
+
3
+export function fetchList(query) {
4
+  return request({
5
+    url: '/gambleGameBuckets',
6
+    method: 'get',
7
+    params: {
8
+      limit: query.limit,
9
+      offset: (query.page - 1) * query.limit
10
+    //   name: query.name,
11
+    //   chipsSort: query.chipsSort,
12
+    //   updatedSort: query.updatedSort
13
+    }
14
+  })
15
+}

+ 17 - 0
src/router/index.js

@@ -57,6 +57,23 @@ export const constantRouterMap = [
57 57
       }
58 58
     ]
59 59
   },
60
+  {
61
+    path: '/gambleGameBucket',
62
+    component: Layout,
63
+    redirect: '/gambleGameBucket/index',
64
+    children: [
65
+      {
66
+        path: 'index',
67
+        name: 'GambleGameBucket',
68
+        component: _import('gambleGameBucket/index'),
69
+        meta: {
70
+          title: '每局莊家',
71
+          icon: 'form'
72
+          // role: ['dd']
73
+        }
74
+      }
75
+    ]
76
+  },
60 77
   // {
61 78
   //   path: '/example',
62 79
   //   component: Layout,

+ 89 - 0
src/views/gambleGameBucket/index.vue

@@ -0,0 +1,89 @@
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
+            <el-button type="primary" size="mini" @click="handleView(scope.row)">查看</el-button>
23
+        </template>
24
+      </el-table-column>
25
+    </el-table>
26
+
27
+    <div v-show="!listLoading" class="pagination-container">
28
+      <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="listQuery.page"
29
+        :page-sizes="[10,20,30, 50]" :page-size="listQuery.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
30
+      </el-pagination>
31
+    </div>
32
+
33
+  </div>
34
+</template>
35
+
36
+<script>
37
+import { fetchList } from '@/api/gambleGameBucket'
38
+
39
+export default {
40
+  data() {
41
+    return {
42
+      list: null,
43
+      listLoading: true,
44
+      total: null,
45
+      listQuery: {
46
+        page: 1,
47
+        limit: 20,
48
+        importance: '',
49
+        title: '',
50
+        type: '',
51
+        chipsSort: '',
52
+        updatedSort: ''
53
+      },
54
+      temp: {
55
+        id: '',
56
+        importance: 1,
57
+        name: '',
58
+        chips: '',
59
+        depositChips: ''
60
+      },
61
+    }
62
+  },
63
+  created() {
64
+    this.getList()
65
+  },
66
+  methods: {
67
+    getList() {
68
+      this.listLoading = true
69
+      fetchList(this.listQuery).then(response => {
70
+        this.list = response.data.rows
71
+        this.total = response.data.count
72
+        this.listLoading = false
73
+      })
74
+    },
75
+    handleFilter() {
76
+      this.listQuery.page = 1
77
+      this.getList()
78
+    },
79
+    handleSizeChange(val) {
80
+      this.listQuery.limit = val
81
+      this.getList()
82
+    },
83
+    handleCurrentChange(val) {
84
+      this.listQuery.page = val
85
+      this.getList()
86
+    }
87
+  }
88
+}
89
+</script>