Browse Source

add config const & add chipHistory operating col

Unknown 7 years ago
parent
commit
8aa45989d2
2 changed files with 23 additions and 1 deletions
  1. 8 0
      config/index.js
  2. 15 1
      src/views/room/chipsHistory/index.vue

+ 8 - 0
config/index.js

34
     // In our experience, they generally work as expected,
34
     // In our experience, they generally work as expected,
35
     // just be aware of this issue when enabling this option.
35
     // just be aware of this issue when enabling this option.
36
     cssSourceMap: false
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
             {{scope.row.admin}}
22
             {{scope.row.admin}}
23
           </template>
23
           </template>
24
         </el-table-column>
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
           <template slot-scope="scope">
31
           <template slot-scope="scope">
27
             <span :style="moneyColor(scope.row.chips)">{{scope.row.chips}}</span>
32
             <span :style="moneyColor(scope.row.chips)">{{scope.row.chips}}</span>
28
           </template>
33
           </template>
55
 import { fetchChipsHistory } from '@/api/gambleMember'
60
 import { fetchChipsHistory } from '@/api/gambleMember'
56
 import waves from '@/directive/waves' // 水波纹指令
61
 import waves from '@/directive/waves' // 水波纹指令
57
 import moment from 'moment-timezone'
62
 import moment from 'moment-timezone'
63
+import config from '../../../../config' 
58
 
64
 
59
 export default {
65
 export default {
60
   directives: {
66
   directives: {
166
     },
172
     },
167
     moneyColor(money) {
173
     moneyColor(money) {
168
       return money >= 0 ? { color: '#67C23A' } : { color: '#FA5555' }
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
   destroyed() {
185
   destroyed() {