Browse Source

TODO handle data

Unknown 7 years ago
parent
commit
4f896272f8
3 changed files with 101 additions and 54 deletions
  1. 13 1
      src/router/index.js
  2. 72 0
      src/views/gambleGameBucket/detail/index.vue
  3. 16 53
      src/views/gambleGameBucket/index.vue

+ 13 - 1
src/router/index.js

@@ -71,7 +71,19 @@ export const constantRouterMap = [
71 71
           title: '每局紀錄',
72 72
           icon: 'form'
73 73
           // role: ['dd']
74
-        }
74
+        },
75
+        children: [
76
+          {
77
+            path: '/gambleGameBucket/index/detail',
78
+            name: 'GambleGameBucketDetail',
79
+            component: _import('gambleGameBucket/detail/index'),
80
+            hidden: true,
81
+            meta: {
82
+              title: '詳細紀錄'
83
+              // role: ['dd']
84
+            }
85
+          }
86
+        ]
75 87
       }
76 88
     ]
77 89
   },

+ 72 - 0
src/views/gambleGameBucket/detail/index.vue

@@ -0,0 +1,72 @@
1
+<template>
2
+<div class="app-container calendar-list-container">
3
+  <div class="app-container">
4
+    <el-table :data="tableData6" :span-method="objectSpanMethod" border style="width: 100% margin-top: 20px">
5
+      <el-table-column prop="id" label="玩家" width="180">
6
+      </el-table-column>
7
+      <el-table-column prop="name" label="押">
8
+      </el-table-column>
9
+      <el-table-column prop="amount1" label="點數">
10
+      </el-table-column>
11
+      <el-table-column prop="amount2" label="輸贏">
12
+      </el-table-column>
13
+      <el-table-column prop="amount3" label="抽水">
14
+      </el-table-column>
15
+      <el-table-column prop="amount3" label="輸贏合計">
16
+      </el-table-column>
17
+      <el-table-column prop="amount3" label="福利">
18
+      </el-table-column>
19
+      <el-table-column prop="amount3" label="最終積分">
20
+      </el-table-column>
21
+    </el-table>
22
+  </div>
23
+</div>
24
+</template>
25
+
26
+<script>
27
+import { fetchList, fetchMemberRecords, fetchDealingRecords } from '@/api/gambleGameBucket'
28
+
29
+export default {
30
+  data() {
31
+    return {
32
+      list: null,
33
+      listLoading: true,
34
+      total: null,
35
+      memberRecords: '',
36
+      dealingRecords: ''
37
+    }
38
+  },
39
+  props: [ 'bucket' ],
40
+  created() {
41
+    this.getList()
42
+  },
43
+  methods: {
44
+    getList() {
45
+      this.listLoading = true
46
+      fetchMemberRecords(this.bucket).then(response => {
47
+        this.memberRecords = response.data
48
+        console.log(response.data)
49
+      })
50
+      fetchDealingRecords(this.bucket).then(response => {
51
+        this.dealingRecords = response.data
52
+        console.log(response.data)
53
+      })
54
+    },
55
+    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
56
+      if (columnIndex === 0) {
57
+        if (rowIndex % 3 === 0) {
58
+          return {
59
+            rowspan: 3,
60
+            colspan: 1
61
+          }
62
+        } else {
63
+          return {
64
+            rowspan: 0,
65
+            colspan: 0
66
+          }
67
+        }
68
+      }
69
+    }
70
+  }
71
+}
72
+</script>

+ 16 - 53
src/views/gambleGameBucket/index.vue

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
 <div class="app-container calendar-list-container">
3
-  <div class="app-container">
3
+  <div class="app-container" v-show="listVisble">
4 4
     <el-table :data="list" v-loading.body="listLoading" element-loading-text="Loading" border fit highlight-current-row
5 5
       style="width: 100%">
6 6
       <el-table-column label="ID">
@@ -20,7 +20,9 @@
20 20
       </el-table-column>
21 21
        <el-table-column align="center" label="操作">
22 22
         <template slot-scope="scope">
23
-            <el-button type="primary" size="mini" @click="handleDialog(scope.row)">查看</el-button>
23
+          <router-link to="/gambleGameBucket/index/detail">
24
+            <el-button type="primary" size="mini" @click="handlePage(scope.row)">查看</el-button>
25
+          </router-link>
24 26
         </template>
25 27
       </el-table-column>
26 28
     </el-table>
@@ -30,30 +32,8 @@
30 32
         :page-sizes="[10,20,30, 50]" :page-size="listQuery.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
31 33
       </el-pagination>
32 34
     </div>
33
-    <el-dialog title="詳細" :visible.sync="dialogVisible">
34
-    <el-table :data="tableData6" :span-method="objectSpanMethod" border style="width: 100% margin-top: 20px">
35
-      <el-table-column prop="id" label="玩家" width="180">
36
-      </el-table-column>
37
-      <el-table-column prop="name" label="押">
38
-      </el-table-column>
39
-      <el-table-column prop="amount1" label="點數">
40
-      </el-table-column>
41
-      <el-table-column prop="amount2" label="輸贏">
42
-      </el-table-column>
43
-      <el-table-column prop="amount3" label="抽水">
44
-      </el-table-column>
45
-      <el-table-column prop="amount3" label="輸贏合計">
46
-      </el-table-column>
47
-      <el-table-column prop="amount3" label="福利">
48
-      </el-table-column>
49
-      <el-table-column prop="amount3" label="最終積分">
50
-      </el-table-column>
51
-    </el-table>
52
-          <div slot="footer" align="center" class="dialog-footer">
53
-        <el-button type="primary" @click="closeDialog">確 定</el-button>
54
-      </div>
55
-    </el-dialog>
56 35
   </div>
36
+  <router-view :bucket="bucket"></router-view>
57 37
 </div>
58 38
 </template>
59 39
 
@@ -66,6 +46,8 @@ export default {
66 46
       list: null,
67 47
       listLoading: true,
68 48
       total: null,
49
+      listVisble: true,
50
+      bucket: '',
69 51
       listQuery: {
70 52
         page: 1,
71 53
         limit: 20,
@@ -82,7 +64,6 @@ export default {
82 64
         chips: '',
83 65
         depositChips: ''
84 66
       },
85
-      dialogVisible: false,
86 67
     }
87 68
   },
88 69
   created() {
@@ -97,35 +78,17 @@ export default {
97 78
         this.listLoading = false
98 79
       })
99 80
     },
100
-    closeDialog() {
101
-      this.dialogVisible = false
102
-    },
103
-    handleDialog(row) {
81
+    handlePage(row) {
104 82
       this.temp = Object.assign({}, row) // copy obj
105
-      fetchMemberRecords(row).then(response => {
106
-        console.log(response.data)
107
-      })
108
-      fetchDealingRecords(row).then(response => {
109
-        console.log(response.data)
110
-      })
111
-      // router.push({ path: '/gambleGameBucket/index/detail' })
112
-      this.dialogVisible = true
83
+      this.listVisble = false
84
+      this.bucket = row
85
+      // fetchMemberRecords(row).then(response => {
86
+      //   console.log(response.data)
87
+      // })
88
+      // fetchDealingRecords(row).then(response => {
89
+      //   console.log(response.data)
90
+      // })
113 91
     },
114
-      objectSpanMethod({ row, column, rowIndex, columnIndex }) {
115
-        if (columnIndex === 0) {
116
-          if (rowIndex % 3 === 0) {
117
-            return {
118
-              rowspan: 3,
119
-              colspan: 1
120
-            };
121
-          } else {
122
-            return {
123
-              rowspan: 0,
124
-              colspan: 0
125
-            };
126
-          }
127
-        }
128
-      },
129 92
     handleFilter() {
130 93
       this.listQuery.page = 1
131 94
       this.getList()