Browse Source

TODO label display

EthnaYeh 6 years ago
parent
commit
3ce7787eb5
2 changed files with 29 additions and 8 deletions
  1. 7 0
      src/api/gambleGameBucket.js
  2. 22 8
      src/views/gambleGameBucket/detail/index.vue

+ 7 - 0
src/api/gambleGameBucket.js

57
     method: 'get'
57
     method: 'get'
58
   })
58
   })
59
 }
59
 }
60
+
61
+export function fetchRoundRecord(data, query = { round: 1 }) {
62
+  return request({
63
+    url: `/gambleGameBuckets/${data.id}/round/${query.round}/roundRecord`,
64
+    method: 'get'
65
+  })
66
+}

+ 22 - 8
src/views/gambleGameBucket/detail/index.vue

24
             <span>{{scope.$index === 0 ?"點數":"門主"}}</span>
24
             <span>{{scope.$index === 0 ?"點數":"門主"}}</span>
25
           </template>
25
           </template>
26
         </el-table-column>   
26
         </el-table-column>   
27
-        <el-table-column label="第一門">
27
+        <el-table-column label="第一門" :label-class-name="initDoor(1)">
28
           <template slot-scope="scope">
28
           <template slot-scope="scope">
29
             <span>{{doorTableSwitch(scope.$index, 0)}}</span>
29
             <span>{{doorTableSwitch(scope.$index, 0)}}</span>
30
           </template>
30
           </template>
31
         </el-table-column>
31
         </el-table-column>
32
-        <el-table-column label="第二門">
32
+        <el-table-column label="第二門" :label-class-name="initDoor(2)">
33
           <template slot-scope="scope">
33
           <template slot-scope="scope">
34
             <span>{{doorTableSwitch(scope.$index, 1)}}</span>
34
             <span>{{doorTableSwitch(scope.$index, 1)}}</span>
35
           </template>
35
           </template>
36
         </el-table-column>
36
         </el-table-column>
37
-        <el-table-column label="第三門">
37
+        <el-table-column label="第三門" :label-class-name="initDoor(3)">
38
           <template slot-scope="scope">
38
           <template slot-scope="scope">
39
             <span>{{doorTableSwitch(scope.$index, 2)}}</span>
39
             <span>{{doorTableSwitch(scope.$index, 2)}}</span>
40
           </template>
40
           </template>
41
         </el-table-column>
41
         </el-table-column>
42
-        <el-table-column label="第四門">
42
+        <el-table-column label="第四門" :label-class-name="initDoor(4)">
43
           <template slot-scope="scope">
43
           <template slot-scope="scope">
44
             <span>{{doorTableSwitch(scope.$index, 3)}}</span>
44
             <span>{{doorTableSwitch(scope.$index, 3)}}</span>
45
           </template>
45
           </template>
46
         </el-table-column>
46
         </el-table-column>
47
-        <el-table-column label="第五門">
47
+        <el-table-column label="第五門" :label-class-name="initDoor(5)">
48
           <template slot-scope="scope">
48
           <template slot-scope="scope">
49
             <span>{{doorTableSwitch(scope.$index, 4)}}</span>
49
             <span>{{doorTableSwitch(scope.$index, 4)}}</span>
50
           </template>
50
           </template>
51
         </el-table-column>
51
         </el-table-column>
52
-        <el-table-column label="第六門">
52
+        <el-table-column label="第六門" :label-class-name="initDoor(6)">
53
           <template slot-scope="scope">
53
           <template slot-scope="scope">
54
             <span>{{doorTableSwitch(scope.$index, 5)}}</span>
54
             <span>{{doorTableSwitch(scope.$index, 5)}}</span>
55
           </template>
55
           </template>
138
 <script>
138
 <script>
139
 
139
 
140
 import { mapGetters, mapActions } from 'vuex'
140
 import { mapGetters, mapActions } from 'vuex'
141
-import { fetchDetails, fetchRoundCount, fetchDealingRecords, fetchMemberRecords } from '@/api/gambleGameBucket'
141
+import { fetchDetails, fetchRoundCount, fetchDealingRecords, fetchMemberRecords, fetchRoundRecord } from '@/api/gambleGameBucket'
142
 import { fetchGambleMemberList } from '@/api/gambleMember'
142
 import { fetchGambleMemberList } from '@/api/gambleMember'
143
 import { ponitTransform } from '@/utils/point'
143
 import { ponitTransform } from '@/utils/point'
144
 import _ from 'lodash'
144
 import _ from 'lodash'
161
       members: [],
161
       members: [],
162
       dealing: [],
162
       dealing: [],
163
       bookie: [],
163
       bookie: [],
164
-      memberRecord: []
164
+      memberRecord: [],
165
+      initialDoor: 0,
165
     }
166
     }
166
   },
167
   },
167
   created() {
168
   created() {
296
         this.func = eval(`(function() {${this.statement}})`)
297
         this.func = eval(`(function() {${this.statement}})`)
297
       })
298
       })
298
 
299
 
300
+      fetchRoundRecord(this.data.secondLayer, this.query.secondLayer).then(response => {
301
+        this.initialDoor = response.data.initialDoor
302
+      })
303
+
299
       this.listLoading = false
304
       this.listLoading = false
300
     },
305
     },
301
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
306
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
352
     },
357
     },
353
     point(dealingRecord) {
358
     point(dealingRecord) {
354
       return ponitTransform(dealingRecord)
359
       return ponitTransform(dealingRecord)
360
+    },
361
+    initDoor(index) {
362
+      console.log(index===this.initialDoor)
363
+      return this.initialDoor === index ? `init` : ''
355
     }
364
     }
356
   },
365
   },
357
   destroyed() {
366
   destroyed() {
359
   }
368
   }
360
 }
369
 }
361
 </script>
370
 </script>
371
+<style>
372
+  .el-table-column .init {
373
+    color: #F56C6C;
374
+  }
375
+</style>