Browse Source

presistence gambleGameBucket

Unknown 6 years ago
parent
commit
d008bcfe92
1 changed files with 42 additions and 31 deletions
  1. 42 31
      src/views/gambleGameBucket/index.vue

+ 42 - 31
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="listQuery.bookie">
5
+      <el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="莊家" v-model="query.firstLayer.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="listQuery.page"
46
-        :page-sizes="[10,20,30, 50]" :page-size="listQuery.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
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">
47
       </el-pagination>
47
       </el-pagination>
48
     </div>
48
     </div>
49
   </div>
49
   </div>
50
-  <router-view :bucket="bucket"></router-view>
50
+  <router-view></router-view>
51
 </div>
51
 </div>
52
 </template>
52
 </template>
53
 
53
 
67
       list: null,
67
       list: null,
68
       listLoading: true,
68
       listLoading: true,
69
       total: null,
69
       total: null,
70
-      bucket: '',
71
-      listQuery: {
72
-        page: 1,
73
-        limit: 20,
74
-        startAt: null,
75
-        endAt: null,
76
-        bookie: null
77
-      },
70
+      // bucket: '',
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: [{
93
           }
93
           }
94
         }]
94
         }]
95
       },
95
       },
96
-      date: null
96
+      date: []
97
     }
97
     }
98
   },
98
   },
99
   created() {
99
   created() {
100
+    this.date = this.p_date
100
     this.getList()
101
     this.getList()
101
     this.SetVisible(1)
102
     this.SetVisible(1)
102
   },
103
   },
103
   computed: {
104
   computed: {
104
     ...mapGetters([
105
     ...mapGetters([
105
-      'visible'
106
+      'visible',
107
+      'query',
108
+      'data',
109
+      'p_date'
106
     ])
110
     ])
107
   },
111
   },
108
   methods: {
112
   methods: {
109
     ...mapActions([
113
     ...mapActions([
110
-      'SetVisible'
114
+      'SetVisible',
115
+      'SetData',
116
+      'SetQuery',
117
+      'SetDate'
111
     ]),
118
     ]),
112
     getList() {
119
     getList() {
113
       this.listLoading = true
120
       this.listLoading = true
114
-      fetchList(this.listQuery).then(response => {
121
+      fetchList(this.query.firstLayer).then(response => {
115
         this.list = response.data.rows
122
         this.list = response.data.rows
116
         this.total = response.data.count
123
         this.total = response.data.count
117
         this.listLoading = false
124
         this.listLoading = false
123
         this.temp.bidChips = response.data
130
         this.temp.bidChips = response.data
124
       })
131
       })
125
       this.SetVisible(2)
132
       this.SetVisible(2)
126
-      this.bucket = this.temp
127
-      // fetchMemberRecords(row).then(response => {
128
-      //   console.log(response.data)
129
-      // })
130
-      // fetchDealingRecords(row).then(response => {
131
-      //   console.log(response.data)
132
-      // })
133
+      this.SetData({layer:2, data: this.temp})
133
     },
134
     },
134
     handleFilter() {
135
     handleFilter() {
135
-      this.listQuery.page = 1
136
-      if (this.date) {
137
-        this.listQuery.startAt = moment.utc(this.date[0]).format()
138
-        this.listQuery.endAt = moment.utc(this.date[1]).format()
136
+      if (this.p_date) {
137
+        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()}})      
139
       } else {
138
       } else {
140
-        this.listQuery.startAt = null
141
-        this.listQuery.endAt = null
139
+         this.SetQuery({layer:1, query: {page: 1, bookie: this.query.firstLayer.bookie,startAt: null, endAt: null}})  
142
       }
140
       }
143
       this.getList()
141
       this.getList()
144
     },
142
     },
145
     handleSizeChange(val) {
143
     handleSizeChange(val) {
146
-      this.listQuery.limit = val
144
+      if (this.p_date) {
145
+        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()}})      
146
+      } else {
147
+        this.SetQuery({layer:1, query: {limit: val, bookie: this.query.firstLayer.bookie,startAt: null, endAt: null}})  
148
+      }
147
       this.getList()
149
       this.getList()
148
     },
150
     },
149
     handleCurrentChange(val) {
151
     handleCurrentChange(val) {
150
-      this.listQuery.page = val
152
+      if (this.p_date) {
153
+        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()}})      
154
+      } else {
155
+        this.SetQuery({layer:1, query: {page: val, bookie: this.query.firstLayer.bookie,startAt: null, endAt: null}})  
156
+      }
151
       this.getList()
157
       this.getList()
152
     },
158
     },
153
     moment(time) {
159
     moment(time) {
154
       return moment(time).tz('Asia/Taipei').format('YYYY-MM-DD HH:mm:ss')
160
       return moment(time).tz('Asia/Taipei').format('YYYY-MM-DD HH:mm:ss')
155
     }
161
     }
162
+  },
163
+  watch: {
164
+    'date': function(val) {
165
+     this.SetDate(val)
166
+    }
156
   }
167
   }
157
 }
168
 }
158
 </script>
169
 </script>