|
@@ -21,37 +21,37 @@
|
21
|
21
|
<el-table-column label="本期開獎" align="center">
|
22
|
22
|
<el-table-column label="名稱">
|
23
|
23
|
<template slot-scope="scope">
|
24
|
|
- <span>{{scope.$index=== 0 ?"點數":"ddd"}}</span>
|
|
24
|
+ <span>{{scope.$index === 0 ?"點數":"門主"}}</span>
|
25
|
25
|
</template>
|
26
|
26
|
</el-table-column>
|
27
|
27
|
<el-table-column label="第一門">
|
28
|
28
|
<template slot-scope="scope">
|
29
|
|
- <span>{{doorTableSwitch(scope.$index, 1)}}</span>
|
|
29
|
+ <span>{{doorTableSwitch(scope.$index, 0)}}</span>
|
30
|
30
|
</template>
|
31
|
31
|
</el-table-column>
|
32
|
32
|
<el-table-column label="第二門">
|
33
|
33
|
<template slot-scope="scope">
|
34
|
|
- <span>{{`${scope.row.point1_1} | ${scope.row.point2_1} / ${scope.row.totalPoints_1}`}}</span>
|
|
34
|
+ <span>{{doorTableSwitch(scope.$index, 1)}}</span>
|
35
|
35
|
</template>
|
36
|
36
|
</el-table-column>
|
37
|
37
|
<el-table-column label="第三門">
|
38
|
38
|
<template slot-scope="scope">
|
39
|
|
- <span>{{`${scope.row.point1_2} | ${scope.row.point2_2} / ${scope.row.totalPoints_2}`}}</span>
|
|
39
|
+ <span>{{doorTableSwitch(scope.$index, 2)}}</span>
|
40
|
40
|
</template>
|
41
|
41
|
</el-table-column>
|
42
|
42
|
<el-table-column label="第四門">
|
43
|
43
|
<template slot-scope="scope">
|
44
|
|
- <span>{{`${scope.row.point1_3} | ${scope.row.point2_3} / ${scope.row.totalPoints_3}`}}</span>
|
|
44
|
+ <span>{{doorTableSwitch(scope.$index, 3)}}</span>
|
45
|
45
|
</template>
|
46
|
46
|
</el-table-column>
|
47
|
47
|
<el-table-column label="第五門">
|
48
|
48
|
<template slot-scope="scope">
|
49
|
|
- <span>{{`${scope.row.point1_4} | ${scope.row.point2_4} / ${scope.row.totalPoints_4}`}}</span>
|
|
49
|
+ <span>{{doorTableSwitch(scope.$index, 4)}}</span>
|
50
|
50
|
</template>
|
51
|
51
|
</el-table-column>
|
52
|
52
|
<el-table-column label="第六門">
|
53
|
53
|
<template slot-scope="scope">
|
54
|
|
- <span>{{`${scope.row.point1_5} | ${scope.row.point2_5} / ${scope.row.totalPoints_5}`}}</span>
|
|
54
|
+ <span>{{doorTableSwitch(scope.$index, 5)}}</span>
|
55
|
55
|
</template>
|
56
|
56
|
</el-table-column>
|
57
|
57
|
</el-table-column>
|
|
@@ -216,13 +216,17 @@ export default {
|
216
|
216
|
})
|
217
|
217
|
|
218
|
218
|
const deal = {}
|
|
219
|
+ const member = {}
|
219
|
220
|
dealingTemp.map((record, index) => {
|
220
|
221
|
deal[`door_${index % 6}`] = record.door
|
221
|
222
|
deal[`point1_${index % 6}`] = record.point1
|
222
|
223
|
deal[`point2_${index % 6}`] = record.point2
|
223
|
224
|
deal[`totalPoints_${index % 6}`] = record.totalPoints
|
224
|
|
- record.GambleMember ? deal[`member_${index % 6}`] = record.GambleMember.name : false
|
225
|
|
- index % 6 === 5 ? this.dealing.push(deal) : false
|
|
225
|
+ record.GambleMember ? member[`member_${index % 6}`] = record.GambleMember.name : false
|
|
226
|
+ if( index % 6 === 5) {
|
|
227
|
+ this.dealing.push(deal)
|
|
228
|
+ this.dealing.push(member)
|
|
229
|
+ }
|
226
|
230
|
})
|
227
|
231
|
})
|
228
|
232
|
fetchMemberRecords(this.bucket, this.listQuery).then(response => {
|
|
@@ -307,7 +311,7 @@ export default {
|
307
|
311
|
getSummaries() {
|
308
|
312
|
const sums = []
|
309
|
313
|
this.memberRecord.map((group, index) => {
|
310
|
|
- if (index === 0) sums[index] = '每門總押注'
|
|
314
|
+ if (index === 0) sums[index] = '總押注'
|
311
|
315
|
let doorTotal = 0
|
312
|
316
|
group.map((door) => {
|
313
|
317
|
doorTotal += door.wager
|
|
@@ -326,14 +330,15 @@ export default {
|
326
|
330
|
moneyColor(money) {
|
327
|
331
|
return money >= 0 ? { color: '#67C23A' } : { color: '#FA5555' }
|
328
|
332
|
},
|
|
333
|
+ // TODO refactor
|
329
|
334
|
doorTableSwitch(rowIndex, colIndex) {
|
330
|
335
|
console.log('sss',this.dealing)
|
331
|
336
|
console.log(this.dealing[0][`point1_${colIndex}`])
|
332
|
337
|
if(rowIndex === 0){
|
333
|
|
- return this.dealing[`point1_${colIndex}`] + '|' + this.dealing[`point2_${colIndex}`] + '/' + this.dealing[`totalPoints_${colIndex}`]
|
|
338
|
+ return `${this.dealing[0][`point1_${colIndex}`]} | ${this.dealing[0][`point2_${colIndex}`]} / ${this.dealing[0][`totalPoints_${colIndex}`]}`
|
334
|
339
|
}
|
335
|
340
|
if(rowIndex === 1){
|
336
|
|
- return
|
|
341
|
+ return this.dealing[1][`member_${colIndex}`] ? `${this.dealing[1][`member_${colIndex}`]}` : 'N/A'
|
337
|
342
|
}
|
338
|
343
|
},
|
339
|
344
|
_sum(i) {
|