Browse Source

persistence gambleGameBucket detail

Unknown 6 years ago
parent
commit
c0de0c938e
1 changed files with 13 additions and 13 deletions
  1. 13 13
      src/views/gambleGameBucket/detail/index.vue

+ 13 - 13
src/views/gambleGameBucket/detail/index.vue

5
       <el-row :gutter="20">
5
       <el-row :gutter="20">
6
         <el-col :span="6">
6
         <el-col :span="6">
7
           <span class="demonstration">關數選擇</span>
7
           <span class="demonstration">關數選擇</span>
8
-          <el-select @change='handleFilter' style="width: 120px" class="filter-item" v-model="listQuery.round" placeholder="關">
8
+          <el-select @change='handleFilter' style="width: 120px" class="filter-item" v-model="query.secondLayer.round" placeholder="關">
9
           <el-option v-for="item in roundOptions" :key="item.label" :label="item.label" :value="item.key">
9
           <el-option v-for="item in roundOptions" :key="item.label" :label="item.label" :value="item.key">
10
           </el-option>
10
           </el-option>
11
         </el-select>
11
         </el-select>
12
         </el-col >
12
         </el-col >
13
         <el-col :offset="10" :span="8">
13
         <el-col :offset="10" :span="8">
14
-            <span class="demonstration">時間 : {{moment(this.bucket.createdAt)}}</span>
14
+            <span class="demonstration">時間 : {{moment(this.data.secondLayer.createdAt)}}</span>
15
         </el-col>
15
         </el-col>
16
       </el-row>
16
       </el-row>
17
     </div>
17
     </div>
148
     return {
148
     return {
149
       list: null,
149
       list: null,
150
       listLoading: true,
150
       listLoading: true,
151
-      listQuery: {
152
-        round: 1
153
-      },
154
       detail: [],
151
       detail: [],
155
       group: [],
152
       group: [],
156
       statement: '',
153
       statement: '',
166
       memberRecord: []
163
       memberRecord: []
167
     }
164
     }
168
   },
165
   },
169
-  props: ['bucket'],
170
   created() {
166
   created() {
171
-    fetchRoundCount(this.bucket).then((response) => {
167
+    fetchRoundCount(this.data.secondLayer).then((response) => {
172
       for (let i = 1; i <= response.data; i++) {
168
       for (let i = 1; i <= response.data; i++) {
173
         this.roundOptions.push({ label: `第 ${i} 關`, key: i })
169
         this.roundOptions.push({ label: `第 ${i} 關`, key: i })
174
       }
170
       }
203
   },
199
   },
204
   computed: {
200
   computed: {
205
     ...mapGetters([
201
     ...mapGetters([
206
-      'visible'
202
+      'visible',
203
+      'data',
204
+      'query'
207
     ])
205
     ])
208
   },
206
   },
209
   methods: {
207
   methods: {
210
     ...mapActions([
208
     ...mapActions([
211
-      'SetVisible'
209
+      'SetVisible',
210
+      'SetData',
211
+      'SetQuery'
212
     ]),
212
     ]),
213
     getList() {
213
     getList() {
214
       this.listLoading = true
214
       this.listLoading = true
215
       let detailTemp, dealingTemp, memberRecordTemp
215
       let detailTemp, dealingTemp, memberRecordTemp
216
       this.detail = []
216
       this.detail = []
217
-      fetchDealingRecords(this.bucket, this.listQuery).then(response => {
217
+      fetchDealingRecords(this.data.secondLayer, this.query.secondLayer).then(response => {
218
         dealingTemp = response.data.rows.filter(record => {
218
         dealingTemp = response.data.rows.filter(record => {
219
           return record.door !== -1
219
           return record.door !== -1
220
         })
220
         })
233
           }
233
           }
234
         })
234
         })
235
       })
235
       })
236
-      fetchMemberRecords(this.bucket, this.listQuery).then(response => {
236
+      fetchMemberRecords(this.data.secondLayer, this.query.secondLayer).then(response => {
237
         memberRecordTemp = _.groupBy(response.data.rows, record => {
237
         memberRecordTemp = _.groupBy(response.data.rows, record => {
238
           return record.door
238
           return record.door
239
         })
239
         })
240
         this.memberRecord = Object.values(memberRecordTemp)
240
         this.memberRecord = Object.values(memberRecordTemp)
241
       })
241
       })
242
-      fetchDetails(this.bucket, this.listQuery).then(response => {
242
+      fetchDetails(this.data.secondLayer, this.query.secondLayer).then(response => {
243
         detailTemp = response.data.rows.filter(record => {
243
         detailTemp = response.data.rows.filter(record => {
244
           return record.DealingRecord.door !== -1 &&
244
           return record.DealingRecord.door !== -1 &&
245
             record.MemberRecord.door !== -1 &&
245
             record.MemberRecord.door !== -1 &&
251
             record.MemberRecord.door === -1 &&
251
             record.MemberRecord.door === -1 &&
252
             record.MemberRecord.door === record.DealingRecord.door
252
             record.MemberRecord.door === record.DealingRecord.door
253
         })
253
         })
254
-        this.bucket.bidChips ? this.bookie[0].bidChips = this.bucket.bidChips : false
254
+        this.data.secondLayer.bidChips ? this.bookie[0].bidChips = this.data.secondLayer.bidChips : false
255
         this.group = _.groupBy(detailTemp, record => {
255
         this.group = _.groupBy(detailTemp, record => {
256
           return record.MemberRecord.GambleMember.name
256
           return record.MemberRecord.GambleMember.name
257
         })
257
         })