Kaynağa Gözat

presistence gambleGameBucket

Unknown 6 yıl önce
ebeveyn
işleme
d008bcfe92
1 değiştirilmiş dosya ile 42 ekleme ve 31 silme
  1. 42 31
      src/views/gambleGameBucket/index.vue

+ 42 - 31
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="listQuery.bookie">
5
+      <el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="莊家" v-model="query.firstLayer.bookie">
6 6
       </el-input>
7 7
       <el-date-picker
8 8
         v-model="date"
@@ -42,12 +42,12 @@
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="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 47
       </el-pagination>
48 48
     </div>
49 49
   </div>
50
-  <router-view :bucket="bucket"></router-view>
50
+  <router-view></router-view>
51 51
 </div>
52 52
 </template>
53 53
 
@@ -67,14 +67,14 @@ export default {
67 67
       list: null,
68 68
       listLoading: true,
69 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 78
       temp: {},
79 79
       pickerOptions: {
80 80
         shortcuts: [{
@@ -93,25 +93,32 @@ export default {
93 93
           }
94 94
         }]
95 95
       },
96
-      date: null
96
+      date: []
97 97
     }
98 98
   },
99 99
   created() {
100
+    this.date = this.p_date
100 101
     this.getList()
101 102
     this.SetVisible(1)
102 103
   },
103 104
   computed: {
104 105
     ...mapGetters([
105
-      'visible'
106
+      'visible',
107
+      'query',
108
+      'data',
109
+      'p_date'
106 110
     ])
107 111
   },
108 112
   methods: {
109 113
     ...mapActions([
110
-      'SetVisible'
114
+      'SetVisible',
115
+      'SetData',
116
+      'SetQuery',
117
+      'SetDate'
111 118
     ]),
112 119
     getList() {
113 120
       this.listLoading = true
114
-      fetchList(this.listQuery).then(response => {
121
+      fetchList(this.query.firstLayer).then(response => {
115 122
         this.list = response.data.rows
116 123
         this.total = response.data.count
117 124
         this.listLoading = false
@@ -123,36 +130,40 @@ export default {
123 130
         this.temp.bidChips = response.data
124 131
       })
125 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 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 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 141
       this.getList()
144 142
     },
145 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 149
       this.getList()
148 150
     },
149 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 157
       this.getList()
152 158
     },
153 159
     moment(time) {
154 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 169
 </script>