Procházet zdrojové kódy

romove Gamrbucket presistence

Unknown %!s(int64=6) %!d(string=před) roky
rodič
revize
e04a605660

+ 13 - 10
src/views/gambleGameBucket/detail/index.vue

@@ -5,7 +5,7 @@
5 5
       <el-row :gutter="20">
6 6
         <el-col :span="6">
7 7
           <span class="demonstration">關數</span>
8
-          <el-select @change='handleFilter' style="width: 120px" class="filter-item" v-model="query.secondLayer.round" placeholder="關">
8
+          <el-select @change='handleFilter' style="width: 120px" class="filter-item" v-model="listQuery.round" placeholder="關">
9 9
           <el-option v-for="item in roundOptions" :key="item.label" :label="item.label" :value="item.key">
10 10
           </el-option>
11 11
         </el-select>
@@ -166,6 +166,9 @@ export default {
166 166
     return {
167 167
       list: null,
168 168
       listLoading: true,
169
+      listQuery: { 
170
+        round: 1 
171
+      }, 
169 172
       detail: [],
170 173
       group: [],
171 174
       statement: '',
@@ -186,7 +189,7 @@ export default {
186 189
     }
187 190
   },
188 191
   created() {
189
-    fetchRoundRecord(this.data.secondLayer, this.query.secondLayer).then(response => {
192
+    fetchRoundRecord(this.data.secondLayer, this.listQuery).then(response => {
190 193
       this.door = response.data.initialDoor
191 194
     })
192 195
     // fetchGameBid(this.data.secondLayer).then(response => {
@@ -204,23 +207,23 @@ export default {
204 207
     ...mapGetters([
205 208
       'visible',
206 209
       'data',
207
-      'query'
210
+      // 'query'
208 211
     ])
209 212
   },
210 213
   methods: {
211 214
     ...mapActions([
212 215
       'SetVisible',
213 216
       'SetData',
214
-      'SetQuery'
217
+      // 'SetQuery'
215 218
     ]),
216 219
     getList() {
217 220
       this.listLoading = true
218 221
       let detailTemp, dealingTemp, memberRecordTemp
219 222
       this.detail = []
220
-      fetchWagerRecord(this.data.secondLayer, this.query.secondLayer).then(response => {
223
+      fetchWagerRecord(this.data.secondLayer, this.listQuery).then(response => {
221 224
         this.wagerRecord = response.data
222 225
       })
223
-      fetchDealingRecords(this.data.secondLayer, this.query.secondLayer).then(response => {
226
+      fetchDealingRecords(this.data.secondLayer, this.listQuery).then(response => {
224 227
         dealingTemp = response.data.rows.filter(record => {
225 228
           return record.door !== -1
226 229
         })
@@ -239,14 +242,14 @@ export default {
239 242
           }
240 243
         })
241 244
       })
242
-      fetchMemberRecords(this.data.secondLayer, this.query.secondLayer).then(response => {
245
+      fetchMemberRecords(this.data.secondLayer, this.listQuery).then(response => {
243 246
         this.memberRecordTemp = response.data.rows
244 247
         let memberRecordTemp = _.groupBy(response.data.rows, record => {
245 248
           return record.door
246 249
         })
247 250
         this.memberRecord = Object.values(memberRecordTemp )
248 251
       })
249
-      fetchDetails(this.data.secondLayer, this.query.secondLayer).then(response => {
252
+      fetchDetails(this.data.secondLayer, this.listQuery).then(response => {
250 253
         detailTemp = response.data.rows.filter(record => {
251 254
           return record.DealingRecord.door !== -1 &&
252 255
             record.MemberRecord.door !== -1 &&
@@ -372,10 +375,10 @@ export default {
372 375
       return sums
373 376
     },
374 377
     handleFilter() {
375
-      fetchRoundRecord(this.data.secondLayer, this.query.secondLayer).then(response => {
378
+      fetchRoundRecord(this.data.secondLayer, this.listQuery).then(response => {
376 379
         this.door = response.data.initialDoor
377 380
       })
378
-      this.SetQuery({layer:2, query: {round: this.query.secondLayer.round}})      
381
+      // this.SetQuery({layer:2, query: {round: this.query.secondLayer.round}})      
379 382
       this.dealing = []
380 383
       this.getList()
381 384
     },

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

@@ -2,7 +2,7 @@
2 2
 <div class="app-container calendar-list-container">
3 3
   <div class="app-container" v-show="visible.firstLayer">
4 4
     <div class="app-container">
5
-      <el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="莊家" v-model="query.firstLayer.bookie">
5
+      <el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="莊家" v-model="listQuery.bookie">
6 6
       </el-input>
7 7
       <el-date-picker
8 8
         v-model="date"
@@ -42,8 +42,8 @@
42 42
     </el-table>
43 43
 
44 44
     <div v-show="!listLoading" class="pagination-container">
45
-      <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="query.firstLayer.page"
46
-        :page-sizes="[10,20,30, 50]" :page-size="query.firstLayer.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
45
+      <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="listQuery.page"
46
+        :page-sizes="[10,20,30, 50]" :page-size="listQuery.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
47 47
       </el-pagination>
48 48
     </div>
49 49
   </div>
@@ -68,13 +68,13 @@ export default {
68 68
       listLoading: true,
69 69
       total: null,
70 70
       // bucket: '',
71
-      // listQuery: {
72
-      //   page: 1,
73
-      //   limit: 20,
74
-      //   startAt: null,
75
-      //   endAt: null,
76
-      //   bookie: null
77
-      // },
71
+      listQuery: {
72
+        page: 1,
73
+        limit: 20,
74
+        startAt: null,
75
+        endAt: null,
76
+        bookie: null
77
+      },
78 78
       // temp: {},
79 79
       pickerOptions: {
80 80
         shortcuts: [{
@@ -104,21 +104,21 @@ export default {
104 104
   computed: {
105 105
     ...mapGetters([
106 106
       'visible',
107
-      'query',
107
+      // 'query',
108 108
       'data',
109
-      'p_date'
109
+      // 'p_date'
110 110
     ])
111 111
   },
112 112
   methods: {
113 113
     ...mapActions([
114 114
       'SetVisible',
115 115
       'SetData',
116
-      'SetQuery',
117
-      'SetDate'
116
+      // 'SetQuery',
117
+      // 'SetDate'
118 118
     ]),
119 119
     getList() {
120 120
       this.listLoading = true
121
-      fetchList(this.query.firstLayer).then(response => {
121
+      fetchList(this.listQuery).then(response => {
122 122
         this.list = response.data.rows
123 123
         this.total = response.data.count
124 124
         this.listLoading = false
@@ -137,37 +137,32 @@ export default {
137 137
       this.SetData({layer:2, data: temp})
138 138
     },
139 139
     handleFilter() {
140
-      if (this.p_date) {
141
-        this.SetQuery({layer:1, query: {page: 1, bookie: this.query.firstLayer.bookie, startAt: moment.utc(this.p_date[0]).format(), endAt: moment.utc(this.p_date[1]).format()}})      
140
+      this.listQuery.page = 1 
141
+      if (this.date) { 
142
+        this.listQuery.startAt = moment.utc(this.date[0]).format() 
143
+        this.listQuery.endAt = moment.utc(this.date[1]).format()     
142 144
       } else {
143
-         this.SetQuery({layer:1, query: {page: 1, bookie: this.query.firstLayer.bookie,startAt: null, endAt: null}})  
145
+        this.listQuery.startAt = null 
146
+        this.listQuery.endAt = null 
144 147
       }
145 148
       this.getList()
146 149
     },
147 150
     handleSizeChange(val) {
148
-      if (this.p_date) {
149
-        this.SetQuery({layer:1, query: {limit: val, bookie: this.query.firstLayer.bookie, startAt: moment.utc(this.p_date[0]).format(), endAt: moment.utc(this.p_date[1]).format()}})      
150
-      } else {
151
-        this.SetQuery({layer:1, query: {limit: val, bookie: this.query.firstLayer.bookie,startAt: null, endAt: null}})  
152
-      }
151
+      this.listQuery.limit = val 
153 152
       this.getList()
154 153
     },
155 154
     handleCurrentChange(val) {
156
-      if (this.p_date) {
157
-        this.SetQuery({layer:1, query: {page: val, bookie: this.query.firstLayer.bookie, startAt: moment.utc(this.p_date[0]).format(), endAt: moment.utc(this.p_date[1]).format()}})      
158
-      } else {
159
-        this.SetQuery({layer:1, query: {page: val, bookie: this.query.firstLayer.bookie,startAt: null, endAt: null}})  
160
-      }
155
+      this.listQuery.page = val 
161 156
       this.getList()
162 157
     },
163 158
     moment(time) {
164 159
       return moment(time).tz('Asia/Taipei').format('YYYY-MM-DD HH:mm:ss')
165 160
     }
166 161
   },
167
-  watch: {
168
-    'date': function(val) {
169
-     this.SetDate(val)
170
-    }
171
-  }
162
+  // watch: {
163
+  //   'date': function(val) {
164
+  //    this.SetDate(val)
165
+  //   }
166
+  // }
172 167
 }
173 168
 </script>