Browse Source

romove Gamrbucket presistence

Unknown 6 years ago
parent
commit
e04a605660
2 changed files with 41 additions and 43 deletions
  1. 13 10
      src/views/gambleGameBucket/detail/index.vue
  2. 28 33
      src/views/gambleGameBucket/index.vue

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

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

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

2
 <div class="app-container calendar-list-container">
2
 <div class="app-container calendar-list-container">
3
   <div class="app-container" v-show="visible.firstLayer">
3
   <div class="app-container" v-show="visible.firstLayer">
4
     <div class="app-container">
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
       </el-input>
6
       </el-input>
7
       <el-date-picker
7
       <el-date-picker
8
         v-model="date"
8
         v-model="date"
42
     </el-table>
42
     </el-table>
43
 
43
 
44
     <div v-show="!listLoading" class="pagination-container">
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
       </el-pagination>
47
       </el-pagination>
48
     </div>
48
     </div>
49
   </div>
49
   </div>
68
       listLoading: true,
68
       listLoading: true,
69
       total: null,
69
       total: null,
70
       // bucket: '',
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
       // temp: {},
78
       // temp: {},
79
       pickerOptions: {
79
       pickerOptions: {
80
         shortcuts: [{
80
         shortcuts: [{
104
   computed: {
104
   computed: {
105
     ...mapGetters([
105
     ...mapGetters([
106
       'visible',
106
       'visible',
107
-      'query',
107
+      // 'query',
108
       'data',
108
       'data',
109
-      'p_date'
109
+      // 'p_date'
110
     ])
110
     ])
111
   },
111
   },
112
   methods: {
112
   methods: {
113
     ...mapActions([
113
     ...mapActions([
114
       'SetVisible',
114
       'SetVisible',
115
       'SetData',
115
       'SetData',
116
-      'SetQuery',
117
-      'SetDate'
116
+      // 'SetQuery',
117
+      // 'SetDate'
118
     ]),
118
     ]),
119
     getList() {
119
     getList() {
120
       this.listLoading = true
120
       this.listLoading = true
121
-      fetchList(this.query.firstLayer).then(response => {
121
+      fetchList(this.listQuery).then(response => {
122
         this.list = response.data.rows
122
         this.list = response.data.rows
123
         this.total = response.data.count
123
         this.total = response.data.count
124
         this.listLoading = false
124
         this.listLoading = false
137
       this.SetData({layer:2, data: temp})
137
       this.SetData({layer:2, data: temp})
138
     },
138
     },
139
     handleFilter() {
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
       } else {
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
       this.getList()
148
       this.getList()
146
     },
149
     },
147
     handleSizeChange(val) {
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
       this.getList()
152
       this.getList()
154
     },
153
     },
155
     handleCurrentChange(val) {
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
       this.getList()
156
       this.getList()
162
     },
157
     },
163
     moment(time) {
158
     moment(time) {
164
       return moment(time).tz('Asia/Taipei').format('YYYY-MM-DD HH:mm:ss')
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
 </script>
168
 </script>