Sfoglia il codice sorgente

add config const & add chipHistory operating col

Unknown 7 anni fa
parent
commit
8aa45989d2
2 ha cambiato i file con 23 aggiunte e 1 eliminazioni
  1. 8 0
      config/index.js
  2. 15 1
      src/views/room/chipsHistory/index.vue

+ 8 - 0
config/index.js

@@ -34,5 +34,13 @@ module.exports = {
34 34
     // In our experience, they generally work as expected,
35 35
     // just be aware of this issue when enabling this option.
36 36
     cssSourceMap: false
37
+  },
38
+  const: {
39
+    GambleMemberChipsLog: {
40
+      type: {
41
+        deposit: 0,
42
+        reward: 1,
43
+      },
44
+    },
37 45
   }
38 46
 }

+ 15 - 1
src/views/room/chipsHistory/index.vue

@@ -22,7 +22,12 @@
22 22
             {{scope.row.admin}}
23 23
           </template>
24 24
         </el-table-column>
25
-        <el-table-column label="上下分" align="center">
25
+        <el-table-column label="操作" align="center">
26
+          <template slot-scope="scope">
27
+            {{typeName(scope.row.type)}}
28
+          </template>
29
+        </el-table-column>
30
+        <el-table-column label="點數" align="center">
26 31
           <template slot-scope="scope">
27 32
             <span :style="moneyColor(scope.row.chips)">{{scope.row.chips}}</span>
28 33
           </template>
@@ -55,6 +60,7 @@ import { mapActions, mapGetters } from 'vuex'
55 60
 import { fetchChipsHistory } from '@/api/gambleMember'
56 61
 import waves from '@/directive/waves' // 水波纹指令
57 62
 import moment from 'moment-timezone'
63
+import config from '../../../../config' 
58 64
 
59 65
 export default {
60 66
   directives: {
@@ -166,6 +172,14 @@ export default {
166 172
     },
167 173
     moneyColor(money) {
168 174
       return money >= 0 ? { color: '#67C23A' } : { color: '#FA5555' }
175
+    },
176
+    typeName(type) {
177
+      if(type === config.const.GambleMemberChipsLog.type.deposit) {
178
+        return `上 / 下 分`
179
+      }
180
+      if(type === config.const.GambleMemberChipsLog.type.reward) {
181
+        return `獎勵 / 懲罰`
182
+      }
169 183
     }
170 184
   },
171 185
   destroyed() {