Browse Source

add search round

Unknown 7 years ago
parent
commit
a422d9907c
2 changed files with 23 additions and 15 deletions
  1. 3 3
      src/api/gambleGameBucket.js
  2. 20 12
      src/views/gambleGameBucket/detail/index.vue

+ 3 - 3
src/api/gambleGameBucket.js

@@ -30,10 +30,10 @@ export function fetchDealingRecords(data) {
30 30
   })
31 31
 }
32 32
 
33
-export function fetchDetails(data) {
34
-  const round = 1
33
+export function fetchDetails(data, query = { round: 1 }) {
34
+  console.log('round', query.round)
35 35
   return request({
36
-    url: `/gambleGameBuckets/${data.id}/round/${round}/detail`,
36
+    url: `/gambleGameBuckets/${data.id}/round/${query.round}/detail`,
37 37
     method: 'get'
38 38
   })
39 39
 }

+ 20 - 12
src/views/gambleGameBucket/detail/index.vue

@@ -1,7 +1,13 @@
1 1
 <template>
2 2
 <div class="app-container calendar-list-container">
3 3
   <div class="app-container">
4
-    <el-table :data="detail" :span-method="objectSpanMethod" border style="width: 100% margin-top: 20px">
4
+      <el-select clearable @change='handleFilter' style="width: 120px" class="filter-item" v-model="listQuery.round" placeholder="輪">
5
+        <el-option v-for="item in roundOptions" :key="item.label" :label="item.label" :value="item.key">
6
+        </el-option>
7
+      </el-select>
8
+  </div>
9
+    <el-table :data="detail" :span-method="objectSpanMethod"  v-loading.body="listLoading" element-loading-text="Loading" border fit highlight-current-row
10
+      style="width: 100%">
5 11
       <el-table-column prop="MemberRecord.GambleMember.name" label="玩家" width="180">
6 12
       </el-table-column>
7 13
       <el-table-column prop="MemberRecord.door" label="押">
@@ -21,7 +27,6 @@
21 27
       <el-table-column prop="MemberRecord.GambleMember.chips" label="最終積分">
22 28
       </el-table-column>
23 29
     </el-table>
24
-  </div>
25 30
 </div>
26 31
 </template>
27 32
 
@@ -36,10 +41,9 @@ export default {
36 41
     return {
37 42
       list: null,
38 43
       listLoading: true,
39
-      total: null,
40
-      memberRecords: [],
41
-      dealingRecords: [],
42
-      groupMember: [],
44
+      listQuery: {
45
+        round: 1
46
+      },
43 47
       detail: [],
44 48
       group: [],
45 49
       statement: '',
@@ -47,7 +51,9 @@ export default {
47 51
       col: 0,
48 52
       func: '',
49 53
       rowIndex: 0,
50
-      colIndex: 0
54
+      colIndex: 0,
55
+      roundOptions: [{ label: '第 1 輪', key: 1 }, { label: '第 2 輪', key: 2 },
56
+                      { label: '第 3 輪', key: 3 }, { label: '第 4 輪', key: 4 }],
51 57
     }
52 58
   },
53 59
   props: [ 'bucket' ],
@@ -66,10 +72,9 @@ export default {
66 72
     ]),    
67 73
     getList() {
68 74
       this.listLoading = true
69
-      let group ,detailTemp
70
-
71
-      fetchDetails(this.bucket).then(reponse => {
72
-        let group, dealingTemp
75
+      let group ,dealingTemp
76
+      this.detail = []
77
+      fetchDetails(this.bucket, this.listQuery).then(reponse => {
73 78
         dealingTemp = reponse.data.rows.filter(record => {
74 79
           return  record.DealingRecord.door !== -1 && 
75 80
             record.MemberRecord.door !== -1 &&
@@ -133,7 +138,10 @@ export default {
133 138
           colspan: this.col
134 139
         }
135 140
       }
136
-    }
141
+    },
142
+    handleFilter() {
143
+      this.getList()
144
+    },
137 145
   },
138 146
   destroyed() {
139 147
     this.SetListVisble(true)