瀏覽代碼

refactor & lint --fix

Unknown 7 年之前
父節點
當前提交
c379dd9182
共有 2 個文件被更改,包括 32 次插入32 次删除
  1. 28 28
      src/views/gambleGameBucket/detail/index.vue
  2. 4 4
      src/views/gambleGameBucket/index.vue

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

53
       func: '',
53
       func: '',
54
       rowIndex: 0,
54
       rowIndex: 0,
55
       colIndex: 0,
55
       colIndex: 0,
56
-      roundOptions: [],
56
+      roundOptions: []
57
     }
57
     }
58
   },
58
   },
59
-  props: [ 'bucket' ],
59
+  props: ['bucket'],
60
   created() {
60
   created() {
61
-    fetchRoundCount(this.bucket).then((response)=>{
62
-      for(let i = 1 ; i<=response.data; i++){
61
+    fetchRoundCount(this.bucket).then((response) => {
62
+      for (let i = 1; i <= response.data; i++) {
63
         this.roundOptions.push({ label: `第 ${i} 輪`, key: i })
63
         this.roundOptions.push({ label: `第 ${i} 輪`, key: i })
64
       }
64
       }
65
     })
65
     })
66
-    this.SetListVisble(false)    
66
+    this.SetListVisble(false)
67
     this.getList()
67
     this.getList()
68
   },
68
   },
69
   computed: {
69
   computed: {
70
     ...mapGetters([
70
     ...mapGetters([
71
-      'listVisble',
71
+      'listVisble'
72
     ])
72
     ])
73
   },
73
   },
74
   methods: {
74
   methods: {
75
     ...mapActions([
75
     ...mapActions([
76
-      'SetListVisble',
77
-    ]),    
76
+      'SetListVisble'
77
+    ]),
78
     getList() {
78
     getList() {
79
       this.listLoading = true
79
       this.listLoading = true
80
-      let group ,dealingTemp
80
+      let detailTemp
81
       this.detail = []
81
       this.detail = []
82
       fetchDetails(this.bucket, this.listQuery).then(reponse => {
82
       fetchDetails(this.bucket, this.listQuery).then(reponse => {
83
-        dealingTemp = reponse.data.rows.filter(record => {
84
-          return  record.DealingRecord.door !== -1 && 
83
+        detailTemp = reponse.data.rows.filter(record => {
84
+          return record.DealingRecord.door !== -1 &&
85
             record.MemberRecord.door !== -1 &&
85
             record.MemberRecord.door !== -1 &&
86
             record.MemberRecord.door === record.DealingRecord.door
86
             record.MemberRecord.door === record.DealingRecord.door
87
         })
87
         })
88
 
88
 
89
-        group = _.groupBy(dealingTemp, record => {
90
-          return record.MemberRecord.GambleMember.name;
91
-        });
89
+        this.group = _.groupBy(detailTemp, record => {
90
+          return record.MemberRecord.GambleMember.name
91
+        })
92
 
92
 
93
-        this.group = _.values(group)
93
+        this.group = _.values(this.group)
94
         const sum = (i) => {
94
         const sum = (i) => {
95
           let count = 0
95
           let count = 0
96
-          for(let j=0 ;j<i ;j++){
96
+          for (let j = 0; j < i; j++) {
97
             count += this.group[j].length
97
             count += this.group[j].length
98
           }
98
           }
99
           return count
99
           return count
100
         }
100
         }
101
-        for(let i = 0 ;i < this.group.length ;i++){
102
-          if(i === 0) {
103
-            this.statement = 
101
+        for (let i = 0; i < this.group.length; i++) {
102
+          if (i === 0) {
103
+            this.statement =
104
             `if(this.rowIndex === ${i}){
104
             `if(this.rowIndex === ${i}){
105
               this.row = ${this.group[i].length},
105
               this.row = ${this.group[i].length},
106
               this.col = 1
106
               this.col = 1
107
             }`
107
             }`
108
-          }else if(i === this.group.length-1){
109
-            this.statement += 
108
+          } else if (i === this.group.length - 1) {
109
+            this.statement +=
110
             `else if(this.rowIndex === ${sum(i)}){
110
             `else if(this.rowIndex === ${sum(i)}){
111
               this.row = ${this.group[i].length},
111
               this.row = ${this.group[i].length},
112
               this.col = 1
112
               this.col = 1
114
               this.row = 0,
114
               this.row = 0,
115
               this.col = 0
115
               this.col = 0
116
             }`
116
             }`
117
-          }else {
118
-            this.statement += 
117
+          } else {
118
+            this.statement +=
119
             `else if(this.rowIndex === ${sum(i)}){
119
             `else if(this.rowIndex === ${sum(i)}){
120
               this.row = ${this.group[i].length},
120
               this.row = ${this.group[i].length},
121
               this.col = 1 
121
               this.col = 1 
123
           }
123
           }
124
         }
124
         }
125
         this.func = eval(`(function() {${this.statement}})`)
125
         this.func = eval(`(function() {${this.statement}})`)
126
-        dealingTemp.map(record => {
126
+        detailTemp.map(record => {
127
           this.detail.push(record)
127
           this.detail.push(record)
128
         })
128
         })
129
-        this.detail =  _.sortBy(this.detail, 'MemberRecord.GambleMember.name');
129
+        this.detail = _.sortBy(this.detail, 'MemberRecord.GambleMember.name')
130
       })
130
       })
131
 
131
 
132
       this.listLoading = false
132
       this.listLoading = false
133
     },
133
     },
134
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
134
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
135
-      if (columnIndex === 0 || columnIndex === 5|| columnIndex === 6|| columnIndex === 7|| columnIndex === 8) {
135
+      if (columnIndex === 0 || columnIndex === 5 || columnIndex === 6 || columnIndex === 7 || columnIndex === 8) {
136
         this.rowIndex = rowIndex
136
         this.rowIndex = rowIndex
137
         this.columnIndex = columnIndex
137
         this.columnIndex = columnIndex
138
         const that = this
138
         const that = this
139
 
139
 
140
-        this.func()      
140
+        this.func()
141
         return {
141
         return {
142
           rowspan: this.row,
142
           rowspan: this.row,
143
           colspan: this.col
143
           colspan: this.col
146
     },
146
     },
147
     handleFilter() {
147
     handleFilter() {
148
       this.getList()
148
       this.getList()
149
-    },
149
+    }
150
   },
150
   },
151
   destroyed() {
151
   destroyed() {
152
     this.SetListVisble(true)
152
     this.SetListVisble(true)

+ 4 - 4
src/views/gambleGameBucket/index.vue

40
 <script>
40
 <script>
41
 
41
 
42
 import { mapGetters, mapActions } from 'vuex'
42
 import { mapGetters, mapActions } from 'vuex'
43
-import { fetchList, fetchMemberRecords, fetchDealingRecords } from '@/api/gambleGameBucket'
43
+import { fetchList } from '@/api/gambleGameBucket'
44
 
44
 
45
 export default {
45
 export default {
46
   data() {
46
   data() {
64
         name: '',
64
         name: '',
65
         chips: '',
65
         chips: '',
66
         depositChips: ''
66
         depositChips: ''
67
-      },
67
+      }
68
     }
68
     }
69
   },
69
   },
70
   created() {
70
   created() {
72
   },
72
   },
73
   computed: {
73
   computed: {
74
     ...mapGetters([
74
     ...mapGetters([
75
-      'listVisble',
75
+      'listVisble'
76
     ])
76
     ])
77
   },
77
   },
78
   methods: {
78
   methods: {
79
     ...mapActions([
79
     ...mapActions([
80
-      'SetListVisble',
80
+      'SetListVisble'
81
     ]),
81
     ]),
82
     getList() {
82
     getList() {
83
       this.listLoading = true
83
       this.listLoading = true