Parcourir la Source

GameBucket add bookie search & date time search

EthnaYeh il y a 7 ans
Parent
commit
d0cd24d9d0
2 fichiers modifiés avec 12 ajouts et 3 suppressions
  1. 4 2
      src/api/gambleGameBucket.js
  2. 8 1
      src/views/gambleGameBucket/index.vue

+ 4 - 2
src/api/gambleGameBucket.js

@@ -6,8 +6,10 @@ export function fetchList(query) {
6 6
     method: 'get',
7 7
     params: {
8 8
       limit: query.limit,
9
-      offset: (query.page - 1) * query.limit
10
-    //   name: query.name,
9
+      offset: (query.page - 1) * query.limit,
10
+      bookie: query.bookie,
11
+      startAt: query.startAt,
12
+      endAt: query.endAt
11 13
     //   chipsSort: query.chipsSort,
12 14
     //   updatedSort: query.updatedSort
13 15
     }

+ 8 - 1
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">
4 4
     <div class="app-container">
5
-      <el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="莊家" v-model="listQuery.name">
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"
@@ -159,6 +159,13 @@ export default {
159 159
     },
160 160
     handleFilter() {
161 161
       this.listQuery.page = 1
162
+      if (this.date) {
163
+        this.listQuery.startAt = moment.utc(this.date[0]).format()
164
+        this.listQuery.endAt = moment.utc(this.date[1]).format()
165
+      } else {
166
+        this.listQuery.startAt = null
167
+        this.listQuery.endAt = null
168
+      }
162 169
       this.getList()
163 170
     },
164 171
     handleSizeChange(val) {