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

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

1
 <template>
1
 <template>
2
 <div class="app-container calendar-list-container">
2
 <div class="app-container calendar-list-container">
3
   <div class="app-container">
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
       <el-table-column prop="MemberRecord.GambleMember.name" label="玩家" width="180">
11
       <el-table-column prop="MemberRecord.GambleMember.name" label="玩家" width="180">
6
       </el-table-column>
12
       </el-table-column>
7
       <el-table-column prop="MemberRecord.door" label="押">
13
       <el-table-column prop="MemberRecord.door" label="押">
21
       <el-table-column prop="MemberRecord.GambleMember.chips" label="最終積分">
27
       <el-table-column prop="MemberRecord.GambleMember.chips" label="最終積分">
22
       </el-table-column>
28
       </el-table-column>
23
     </el-table>
29
     </el-table>
24
-  </div>
25
 </div>
30
 </div>
26
 </template>
31
 </template>
27
 
32
 
36
     return {
41
     return {
37
       list: null,
42
       list: null,
38
       listLoading: true,
43
       listLoading: true,
39
-      total: null,
44
+      listQuery: {
40
-      memberRecords: [],
45
+        round: 1
41
-      dealingRecords: [],
46
+      },
42
-      groupMember: [],
43
       detail: [],
47
       detail: [],
44
       group: [],
48
       group: [],
45
       statement: '',
49
       statement: '',
47
       col: 0,
51
       col: 0,
48
       func: '',
52
       func: '',
49
       rowIndex: 0,
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
   props: [ 'bucket' ],
59
   props: [ 'bucket' ],
66
     ]),    
72
     ]),    
67
     getList() {
73
     getList() {
68
       this.listLoading = true
74
       this.listLoading = true
69
-      let group ,detailTemp
75
+      let group ,dealingTemp
70
-
76
+      this.detail = []
71
-      fetchDetails(this.bucket).then(reponse => {
77
+      fetchDetails(this.bucket, this.listQuery).then(reponse => {
72
-        let group, dealingTemp
73
         dealingTemp = reponse.data.rows.filter(record => {
78
         dealingTemp = reponse.data.rows.filter(record => {
74
           return  record.DealingRecord.door !== -1 && 
79
           return  record.DealingRecord.door !== -1 && 
75
             record.MemberRecord.door !== -1 &&
80
             record.MemberRecord.door !== -1 &&
133
           colspan: this.col
138
           colspan: this.col
134
         }
139
         }
135
       }
140
       }
136
-    }
141
+    },
142
+    handleFilter() {
143
+      this.getList()
144
+    },
137
   },
145
   },
138
   destroyed() {
146
   destroyed() {
139
     this.SetListVisble(true)
147
     this.SetListVisble(true)