Browse Source

Persistence

Unknown 7 years ago
parent
commit
f21c0f9bd1

+ 2 - 1
src/store/getters.js

5
   username: state => state.user.username,
5
   username: state => state.user.username,
6
   roles: state => state.user.roles,
6
   roles: state => state.user.roles,
7
   visible: state => state.breadcrumb.visible,
7
   visible: state => state.breadcrumb.visible,
8
-  data: state => state.breadcrumb.data
8
+  data: state => state.breadcrumb.data,
9
+  query: state => state.breadcrumb.query
9
 }
10
 }
10
 export default getters
11
 export default getters

+ 58 - 8
src/store/modules/breadcrumb.js

9
       fourLayer: false
9
       fourLayer: false
10
     },
10
     },
11
     data: {
11
     data: {
12
-      firstLayer: JSON.parse(localStorage.getItem('firstLayer')),
13
-      secondLayer: JSON.parse(localStorage.getItem('secondLayer')),
14
-      thirdLayer: JSON.parse(localStorage.getItem('thirdLayer')),
15
-      fourLayer: JSON.parse(localStorage.getItem('fourLayer'))
12
+      firstLayer: JSON.parse(localStorage.getItem('data_1st')),
13
+      secondLayer: JSON.parse(localStorage.getItem('data_2nd')),
14
+      thirdLayer: JSON.parse(localStorage.getItem('data_3rd')),
15
+      fourLayer: JSON.parse(localStorage.getItem('data_4th'))
16
+    },
17
+    query: {
18
+      firstLayer: {
19
+        limit: 20,
20
+        page: 1,
21
+        ...JSON.parse(localStorage.getItem('query_1st'))
22
+      },
23
+      secondLayer: {
24
+        limit: 20,
25
+        page: 1,
26
+        ...JSON.parse(localStorage.getItem('query_2nd'))
27
+      },
28
+      thirdLayer: {
29
+        limit: 20,
30
+        page: 1,
31
+        ...JSON.parse(localStorage.getItem('query_3rd'))
32
+      },
33
+      fourLayer: {
34
+        limit: 20,
35
+        page: 1,
36
+        ...JSON.parse(localStorage.getItem('query_4th'))
37
+      }
16
     }
38
     }
17
   },
39
   },
18
   mutations: {
40
   mutations: {
55
     SET_DATA: (state, option) => {
77
     SET_DATA: (state, option) => {
56
       switch (option.layer) {
78
       switch (option.layer) {
57
         case 1:
79
         case 1:
58
-          localStorage.setItem('firstLayer', JSON.stringify(option.data))
80
+          localStorage.setItem('data_1st', JSON.stringify(option.data))
81
+          state.data.firstLayer = option.data
59
           break
82
           break
60
         case 2:
83
         case 2:
61
-          localStorage.setItem('secondLayer', JSON.stringify(option.data))
84
+          localStorage.setItem('data_2nd', JSON.stringify(option.data))
85
+          state.data.secondLayer = option.data
62
           break
86
           break
63
         case 3:
87
         case 3:
64
-          localStorage.setItem('thirdLayer', JSON.stringify(option.data))
88
+          localStorage.setItem('data_3rd', JSON.stringify(option.data))
89
+          state.data.thirdLayer = option.data
65
           break
90
           break
66
         case 4:
91
         case 4:
67
-          localStorage.setItem('fourLayer', JSON.stringify(option.data))
92
+          localStorage.setItem('data_4th', JSON.stringify(option.data))
93
+          state.data.fourLayer = option.data
94
+          break
95
+      }
96
+    },
97
+    SET_QUERY: (state, option) => {
98
+      switch (option.layer) {
99
+        case 1:
100
+          localStorage.setItem('query_1st', JSON.stringify(option.query))
101
+          state.query.firstLayer = { limit: 20, page: 1, ...option.query }
102
+          break
103
+        case 2:
104
+          localStorage.setItem('query_2nd', JSON.stringify(option.query))
105
+          state.query.secondLayer = { limit: 20, page: 1, ...option.query }
106
+          break
107
+        case 3:
108
+          localStorage.setItem('query_3rd', JSON.stringify(option.query))
109
+          state.query.thirdLayer = { limit: 20, page: 1, ...option.query }
110
+          break
111
+        case 4:
112
+          localStorage.setItem('query_4th', JSON.stringify(option.query))
113
+          state.query.fourLayer = { limit: 20, page: 1, ...option.query }
68
           break
114
           break
69
       }
115
       }
70
     }
116
     }
71
   },
117
   },
118
+
72
   actions: {
119
   actions: {
73
     SetVisible({ commit }, layer) {
120
     SetVisible({ commit }, layer) {
74
       commit('SET_VISIBLE', layer)
121
       commit('SET_VISIBLE', layer)
75
     },
122
     },
76
     SetData({ commit }, option) {
123
     SetData({ commit }, option) {
77
       commit('SET_DATA', option)
124
       commit('SET_DATA', option)
125
+    },
126
+    SetQuery({ commit }, option) {
127
+      commit('SET_QUERY', option)
78
     }
128
     }
79
   }
129
   }
80
 }
130
 }

+ 43 - 32
src/views/room/gameHistory/index.vue

5
           <div class="block">
5
           <div class="block">
6
               <!-- <span class="demonstration">時間篩選</span> -->
6
               <!-- <span class="demonstration">時間篩選</span> -->
7
               <el-date-picker
7
               <el-date-picker
8
-              v-model="date"
8
+              v-model="query.thirdLayer.date"
9
               type="datetimerange"
9
               type="datetimerange"
10
               :picker-options="pickerOptions"
10
               :picker-options="pickerOptions"
11
               range-separator="至"
11
               range-separator="至"
17
           </div>
17
           </div>
18
       </div>
18
       </div>
19
       <el-table :data="list" v-loading.body="listLoading" element-loading-text="Loading" border fit highlight-current-row>
19
       <el-table :data="list" v-loading.body="listLoading" element-loading-text="Loading" border fit highlight-current-row>
20
-        <el-table-column :label="member.name" align="center">
20
+        <el-table-column :label="data.thirdLayer.name" align="center">
21
           <el-table-column label="時間" align="center">
21
           <el-table-column label="時間" align="center">
22
             <template slot-scope="scope">
22
             <template slot-scope="scope">
23
               <span>{{moment(scope.row.createdAt)}}</span>
23
               <span>{{moment(scope.row.createdAt)}}</span>
53
       </el-table>
53
       </el-table>
54
 
54
 
55
       <div v-show="!listLoading" class="pagination-container">
55
       <div v-show="!listLoading" class="pagination-container">
56
-        <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="listQuery.page"
57
-          :page-sizes="[10,20,30, 50]" :page-size="listQuery.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
56
+        <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="query.thirdLayer.page"
57
+          :page-sizes="[10,20,30, 50]" :page-size="query.thirdLayer.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
58
         </el-pagination>
58
         </el-pagination>
59
       </div>
59
       </div>
60
 
60
 
116
       dialogList: null,
116
       dialogList: null,
117
       total: null,
117
       total: null,
118
       listLoading: true,
118
       listLoading: true,
119
-      listQuery: {
120
-        page: 1,
121
-        limit: 20,
122
-        startAt: null,
123
-        endAt: null
124
-      },
125
       pickerOptions: {
119
       pickerOptions: {
126
         shortcuts: [{
120
         shortcuts: [{
127
           text: '本週',
121
           text: '本週',
128
           onClick(picker) {
122
           onClick(picker) {
129
-            const end = moment().day(7).hour(11).minute(59).second(59)
130
-            const start = moment().subtract(1, 'weeks').day(7).hour(16).minute(0).second(0)
131
-            picker.$emit('pick', [start, end])
123
+            const endAt = moment().day(7).hour(11).minute(59).second(59)
124
+            const startAt = moment().subtract(1, 'weeks').day(7).hour(16).minute(0).second(0)
125
+            picker.$emit('pick', [startAt, endAt])
132
           }
126
           }
133
         }, {
127
         }, {
134
           text: '上週',
128
           text: '上週',
135
           onClick(picker) {
129
           onClick(picker) {
136
-            const end = moment().subtract(1, 'weeks').day(7).hour(11).minute(59).second(59)
137
-            const start = moment().subtract(2, 'weeks').day(7).hour(16).minute(0).second(0)
138
-            picker.$emit('pick', [start, end])
130
+            const endAt = moment().subtract(1, 'weeks').day(7).hour(11).minute(59).second(59)
131
+            const startAt = moment().subtract(2, 'weeks').day(7).hour(16).minute(0).second(0)
132
+            picker.$emit('pick', [startAt, endAt])
139
           }
133
           }
140
         }]
134
         }]
141
       },
135
       },
142
-      date: null,
136
+      // date: null,
143
       dialogFormVisible: false
137
       dialogFormVisible: false
144
 
138
 
145
     }
139
     }
150
   },
144
   },
151
   computed: {
145
   computed: {
152
     ...mapGetters([
146
     ...mapGetters([
153
-      'visible'
147
+      'visible',
148
+      'data',
149
+      'query'
154
     ])
150
     ])
155
   },
151
   },
156
-  props: ['member'],
157
   methods: {
152
   methods: {
158
     ...mapActions([
153
     ...mapActions([
159
-      'SetVisible'
154
+      'SetVisible',
155
+      'SetData',
156
+      'SetQuery'
160
     ]),
157
     ]),
161
     getList() {
158
     getList() {
162
       this.listLoading = true
159
       this.listLoading = true
163
-      fetchGameHistory(this.member, this.listQuery).then(response => {
160
+      this.list = []
161
+      fetchGameHistory(this.data.thirdLayer, this.query.thirdLayer).then(response => {
164
         this.chipLogList = response.data
162
         this.chipLogList = response.data
165
         this.chipLogList.map((item) => {
163
         this.chipLogList.map((item) => {
166
           this.list.push({
164
           this.list.push({
173
         })
171
         })
174
         this.listLoading = false
172
         this.listLoading = false
175
       })
173
       })
176
-      fetchChipsHistory(this.member, this.listQuery).then(response => {
174
+      fetchChipsHistory(this.data.thirdLayer, this.query.thirdLayer).then(response => {
177
         this.gameRecordList = response.data
175
         this.gameRecordList = response.data
178
         this.gameRecordList.map((item) => {
176
         this.gameRecordList.map((item) => {
179
           if(item.type === config.const.GambleMemberChipsLog.type.deposit) item.type =  '上 / 下 分';
177
           if(item.type === config.const.GambleMemberChipsLog.type.deposit) item.type =  '上 / 下 分';
193
           const dateB = new Date(b.createdAt);
191
           const dateB = new Date(b.createdAt);
194
           return  dateB - dateA;
192
           return  dateB - dateA;
195
         });
193
         });
196
-
194
+        this.total = this.list.length
197
         this.listLoading = false
195
         this.listLoading = false
198
       })
196
       })
199
       
197
       
201
     handlePersonDetail(row) {
199
     handlePersonDetail(row) {
202
       this.listLoading = true
200
       this.listLoading = true
203
       this.dialogFormVisible = true
201
       this.dialogFormVisible = true
204
-      fetchPersonGameDetail(this.member.id, row.id).then(response => {
202
+      fetchPersonGameDetail(this.data.thirdLayer.id, row.id).then(response => {
205
         this.dialogList = response.data.rows
203
         this.dialogList = response.data.rows
206
         this.listLoading = false
204
         this.listLoading = false
207
       })
205
       })
210
       console.log('Game detail')
208
       console.log('Game detail')
211
     },
209
     },
212
     handleFilter() {
210
     handleFilter() {
213
-      this.listQuery.page = 1
214
-      if (this.date) {
215
-        this.listQuery.startAt = moment.utc(this.date[0]).format()
216
-        this.listQuery.endAt = moment.utc(this.date[1]).format()
211
+      if (this.query.thirdLayer.date) {
212
+        this.SetQuery({layer:3, query: {page: 1,startAt: moment.utc(this.query.thirdLayer.date[0]).format(), endAt: moment.utc(this.query.thirdLayer.date[1]).format()}})      
217
       } else {
213
       } else {
218
-        this.listQuery.startAt = null
219
-        this.listQuery.endAt = null
214
+         this.SetQuery({layer:3, query: {page: 1,startAt: null, endAt: null}})  
220
       }
215
       }
221
       this.getList()
216
       this.getList()
222
     },
217
     },
223
     handleSizeChange(val) {
218
     handleSizeChange(val) {
224
-      this.listQuery.limit = val
219
+      if (this.query.thirdLayer.date) {
220
+        this.SetQuery({layer:3, query: {limit: val, startAt: moment.utc(this.query.thirdLayer.date[0]).format(), endAt: moment.utc(this.query.thirdLayer.date[1]).format()}})      
221
+      } else {
222
+         this.SetQuery({layer:3, query: {limit: val,startAt: null, endAt: null}})  
223
+      }
225
       this.getList()
224
       this.getList()
226
     },
225
     },
227
     handleCurrentChange(val) {
226
     handleCurrentChange(val) {
228
-      this.listQuery.page = val
227
+      if (this.query.thirdLayer.date) {
228
+        this.SetQuery({layer:3, query: {page: val, startAt: moment.utc(this.query.thirdLayer.date[0]).format(), endAt: moment.utc(this.query.thirdLayer.date[1]).format()}})      
229
+      } else {
230
+         this.SetQuery({layer:3, query: {page: val,startAt: null, endAt: null}})  
231
+      }
229
       this.getList()
232
       this.getList()
230
     },
233
     },
231
     moment(time) {
234
     moment(time) {
256
   },
259
   },
257
   destroyed() {
260
   destroyed() {
258
     this.SetVisible(2)
261
     this.SetVisible(2)
262
+  },
263
+  // TODO time 持九化
264
+  watch: {
265
+    'query.thirdLayer.date': function(val) {
266
+      if(this.query.thirdLayer.date) if((val[0] = this.query.thirdLayer.date[0]) && (val[1] = this.query.thirdLayer.date[1])) return
267
+      this.SetQuery({layer:3, query: {date: val}})
268
+      console.log('test', val);
269
+    }
259
   }
270
   }
260
 }
271
 }
261
 </script>
272
 </script>

+ 15 - 16
src/views/room/index.vue

3
 <div class="app-container calendar-list-container">
3
 <div class="app-container calendar-list-container">
4
   <div  v-show="visible.firstLayer">
4
   <div  v-show="visible.firstLayer">
5
     <div class="app-container">
5
     <div class="app-container">
6
-      <el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="房間名" v-model="listQuery.name">
6
+      <el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="房間名" v-model="query.firstLayer.name">
7
       </el-input>
7
       </el-input>
8
       <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">搜尋</el-button>
8
       <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">搜尋</el-button>
9
       <el-button class="filter-item" @click="handleCreate" type="primary" icon="el-icon-edit">創建</el-button>
9
       <el-button class="filter-item" @click="handleCreate" type="primary" icon="el-icon-edit">創建</el-button>
38
     </el-table>
38
     </el-table>
39
 
39
 
40
     <div v-show="!listLoading" class="pagination-container">
40
     <div v-show="!listLoading" class="pagination-container">
41
-      <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="listQuery.page"
42
-        :page-sizes="[10,20,30, 50]" :page-size="listQuery.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
41
+      <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="query.firstLayer.page"
42
+        :page-sizes="[10,20,30, 50]" :page-size="query.firstLayer.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
43
       </el-pagination>
43
       </el-pagination>
44
     </div>
44
     </div>
45
 
45
 
56
     </el-dialog>
56
     </el-dialog>
57
 
57
 
58
   </div>
58
   </div>
59
-    <router-view :room="room"></router-view>
59
+    <router-view></router-view>
60
   </div>
60
   </div>
61
 </template>
61
 </template>
62
 
62
 
77
       list: null,
77
       list: null,
78
       total: null,
78
       total: null,
79
       listLoading: true,
79
       listLoading: true,
80
-      listQuery: {
81
-        page: 1,
82
-        limit: 20,
83
-      },
84
       temp: {
80
       temp: {
85
         name: '',
81
         name: '',
86
       },
82
       },
87
-      room: {},
88
       rules: {
83
       rules: {
89
         name: [{ type: 'string', required: true, message: '必填', trigger: 'change' }]
84
         name: [{ type: 'string', required: true, message: '必填', trigger: 'change' }]
90
       },
85
       },
97
   },
92
   },
98
   computed: {
93
   computed: {
99
     ...mapGetters([
94
     ...mapGetters([
100
-      'visible'
95
+      'visible',
96
+      'query',
97
+      'data'
101
     ])
98
     ])
102
   },
99
   },
103
   methods: {
100
   methods: {
104
     ...mapActions([
101
     ...mapActions([
105
-      'SetVisible'
102
+      'SetVisible',
103
+      'SetData',
104
+      'SetQuery'
106
     ]),
105
     ]),
107
     getList() {
106
     getList() {
108
       this.listLoading = true
107
       this.listLoading = true
109
-      fetchWechatRooms(this.listQuery).then(response => {
108
+      fetchWechatRooms(this.query.firstLayer).then(response => {
110
         this.list = response.data
109
         this.list = response.data
111
         this.total = response.data.length
110
         this.total = response.data.length
112
         this.listLoading = false
111
         this.listLoading = false
115
     handlePage(row) {
114
     handlePage(row) {
116
       const temp = Object.assign({}, row) // copy obj
115
       const temp = Object.assign({}, row) // copy obj
117
       this.SetVisible(2)
116
       this.SetVisible(2)
118
-      this.room = temp
117
+      this.SetData({layer:2, data: temp})
119
     },
118
     },
120
     handleCreate() {
119
     handleCreate() {
121
       //TODO 了解wechat 的 room 關聯
120
       //TODO 了解wechat 的 room 關聯
149
       })
148
       })
150
     },
149
     },
151
     handleFilter() {
150
     handleFilter() {
152
-      this.listQuery.page = 1
151
+      this.SetQuery({layer:1, query: {page: 1, name: this.query.firstLayer.name}})
153
       this.getList()
152
       this.getList()
154
     },
153
     },
155
     handleSizeChange(val) {
154
     handleSizeChange(val) {
156
-      this.listQuery.limit = val
155
+      this.SetQuery({layer:1, query: {limit: val, name: this.query.firstLayer.name}})      
157
       this.getList()
156
       this.getList()
158
     },
157
     },
159
     handleCurrentChange(val) {
158
     handleCurrentChange(val) {
160
-      this.listQuery.page = val
159
+      this.SetQuery({layer:1, query: {page: val, name: this.query.firstLayer.name}})      
161
       this.getList()
160
       this.getList()
162
     },
161
     },
163
     handleDialogClose() {
162
     handleDialogClose() {

+ 28 - 28
src/views/room/wechatMember/index.vue

2
   <div class="app-container calendar-list-container">
2
   <div class="app-container calendar-list-container">
3
     <div  v-show="visible.secondLayer">
3
     <div  v-show="visible.secondLayer">
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.name">
5
+        <el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="名稱" v-model="query.secondLayer.name">
6
         </el-input>
6
         </el-input>
7
         <!-- <el-select clearable @change='handleFilter' style="width: 120px" class="filter-item" v-model="listQuery.chipsSort" placeholder="點數">
7
         <!-- <el-select clearable @change='handleFilter' style="width: 120px" class="filter-item" v-model="listQuery.chipsSort" placeholder="點數">
8
           <el-option v-for="item in chipsSortOptions" :key="item.label" :label="item.label" :value="item.key">
8
           <el-option v-for="item in chipsSortOptions" :key="item.label" :label="item.label" :value="item.key">
34
         </el-table-column>
34
         </el-table-column>
35
         <el-table-column label="代理商" align="center">
35
         <el-table-column label="代理商" align="center">
36
           <template slot-scope="scope">
36
           <template slot-scope="scope">
37
-            <el-button v-show="noAgent(scope.row.WeChatUser.GambleMember)" type="primary" size="mini" icon="el-icon-edit" @click="handleAgentUpdate(scope.row)">代理商設定</el-button>
38
-            <span v-show="haveAgent(scope.row.WeChatUser.GambleMember)">{{scope.row.WeChatUser.GambleMember.name}}</span>
37
+            <el-button v-if="noAgent(scope.row.WeChatUser.GambleMember)" type="primary" size="mini" icon="el-icon-edit" @click="handleAgentUpdate(scope.row)">代理商設定</el-button>
38
+            <span v-if="haveAgent(scope.row.WeChatUser.GambleMember)">{{scope.row.WeChatUser.GambleMember.GambleAgent.name}}</span>
39
           </template>
39
           </template>
40
         </el-table-column>
40
         </el-table-column>
41
         <el-table-column align="center" label="操作" width="350">
41
         <el-table-column align="center" label="操作" width="350">
52
       </el-table>
52
       </el-table>
53
 
53
 
54
       <div v-show="!listLoading" class="pagination-container">
54
       <div v-show="!listLoading" class="pagination-container">
55
-        <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="listQuery.page"
56
-          :page-sizes="[10,20,30, 50]" :page-size="listQuery.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
55
+        <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="query.secondLayer.page"
56
+          :page-sizes="[10,20,30, 50]" :page-size="query.secondLayer.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
57
         </el-pagination>
57
         </el-pagination>
58
       </div>
58
       </div>
59
 
59
 
120
       </el-dialog>
120
       </el-dialog>
121
 
121
 
122
     </div>
122
     </div>
123
-    <router-view :member="member"></router-view>
123
+    <router-view></router-view>
124
   </div>
124
   </div>
125
 </template>
125
 </template>
126
 
126
 
145
       list: null,
145
       list: null,
146
       total: null,
146
       total: null,
147
       listLoading: true,
147
       listLoading: true,
148
-      listQuery: {
149
-        page: 1,
150
-        limit: 20,
151
-        name: '',
152
-        chipsSort: '',
153
-        updatedSort: ''
154
-      },
148
+      // listQuery: {
149
+      //   page: 1,
150
+      //   limit: 20,
151
+      //   name: '',
152
+      //   chipsSort: '',
153
+      //   updatedSort: ''
154
+      // },
155
       temp: {
155
       temp: {
156
         id: '',
156
         id: '',
157
         WeChatUser: {
157
         WeChatUser: {
168
         deposit: '上下分',
168
         deposit: '上下分',
169
         reward: '獎懲'
169
         reward: '獎懲'
170
       },
170
       },
171
-      member: {},
172
       chipsSortOptions: [{ label: '多 -> 少', key: 'DESC' }, { label: '少 -> 多', key: 'ASC' }],
171
       chipsSortOptions: [{ label: '多 -> 少', key: 'DESC' }, { label: '少 -> 多', key: 'ASC' }],
173
       updatedSortOptions: [{ label: '新 -> 舊', key: 'DESC' }, { label: '舊 -> 新', key: 'ASC' }],
172
       updatedSortOptions: [{ label: '新 -> 舊', key: 'DESC' }, { label: '舊 -> 新', key: 'ASC' }],
174
       rules: {
173
       rules: {
175
         rewardChips: [{ pattern: /^-?\d+$/, required: true, message: '請輸入整數', trigger: 'change' }],        
174
         rewardChips: [{ pattern: /^-?\d+$/, required: true, message: '請輸入整數', trigger: 'change' }],        
176
         depositChips: [{ pattern: /^-?\d+$/, required: true, message: '請輸入整數', trigger: 'change' }],                
175
         depositChips: [{ pattern: /^-?\d+$/, required: true, message: '請輸入整數', trigger: 'change' }],                
177
-        // chips: [{ pattern: /^(0|[1-9][0-9]*)$/, required: true, message: '請輸入整數', trigger: 'change' }],
178
-        // name: [{ type: 'string', required: true, message: '必填', trigger: 'change' }]
179
       },
176
       },
180
       activeName: 'deposit',
177
       activeName: 'deposit',
181
       dialogUpdateFormVisible: false,
178
       dialogUpdateFormVisible: false,
183
       agentLIstOptions: [],
180
       agentLIstOptions: [],
184
     }
181
     }
185
   },
182
   },
186
-  props: ['room'],
187
   created() {
183
   created() {
188
     this.SetVisible(2)
184
     this.SetVisible(2)
189
     this.getList()
185
     this.getList()
193
   },
189
   },
194
   computed: {
190
   computed: {
195
     ...mapGetters([
191
     ...mapGetters([
196
-      'visible'
192
+      'visible',
193
+      'data',
194
+      'query'
197
     ])
195
     ])
198
   },
196
   },
199
   methods: {
197
   methods: {
200
     ...mapActions([
198
     ...mapActions([
201
-      'SetVisible'
199
+      'SetVisible',
200
+      'SetData',
201
+      'SetQuery'
202
     ]),
202
     ]),
203
     getList() {
203
     getList() {
204
       this.listLoading = true
204
       this.listLoading = true
205
-      fetchWeChatMemberList(this.room, this.listQuery).then(response => {
205
+      fetchWeChatMemberList(this.data.secondLayer, this.query.secondLayer).then(response => {
206
         this.list = response.data.rows
206
         this.list = response.data.rows
207
         this.total = response.data.count
207
         this.total = response.data.count
208
         this.listLoading = false
208
         this.listLoading = false
256
     handlePage(row) {
256
     handlePage(row) {
257
       const temp = Object.assign({}, row) // copy obj
257
       const temp = Object.assign({}, row) // copy obj
258
       this.SetVisible(3)
258
       this.SetVisible(3)
259
-      this.member = temp.WeChatUser.GambleMember
259
+      this.SetData({layer:3, data: temp.WeChatUser.GambleMember})
260
     },
260
     },
261
     handleLog(row) {
261
     handleLog(row) {
262
-      const temp = Object.assign({}, row) // copy obj
263
       this.SetVisible(3)
262
       this.SetVisible(3)
264
-      this.member = temp.WeChatUser.GambleMember
263
+      this.SetData({layer:3, data: temp.WeChatUser.GambleMember})
265
     },
264
     },
266
     handleFilter() {
265
     handleFilter() {
267
-      this.listQuery.page = 1
266
+      this.SetQuery({layer:2, query: {page: 1, name: this.query.secondLayer.name}})
268
       this.getList()
267
       this.getList()
269
     },
268
     },
270
     handleSizeChange(val) {
269
     handleSizeChange(val) {
271
-      this.listQuery.limit = val
270
+      // this.listQuery.limit = val
271
+      this.SetQuery({layer:2, query: {limit: val, name: this.query.secondLayer.name}})   
272
       this.getList()
272
       this.getList()
273
     },
273
     },
274
     handleCurrentChange(val) {
274
     handleCurrentChange(val) {
275
-      this.listQuery.page = val
275
+      // this.listQuery.page = val
276
+      this.SetQuery({layer:2, query: {page: val, name: this.query.secondLayer.name}})    
276
       this.getList()
277
       this.getList()
277
     },
278
     },
278
     handleClick(tab, event) {
279
     handleClick(tab, event) {
354
         cancelButtonText: '取消',
355
         cancelButtonText: '取消',
355
         type: 'warning'
356
         type: 'warning'
356
       }).then(() => {
357
       }).then(() => {
357
-        resetWechatRoomMembersChips(this.room).then(response => {
358
-          console.log('11111')
358
+        resetWechatRoomMembersChips(this.data.secondLayer).then(response => {
359
           this.$message({
359
           this.$message({
360
             type: 'success',
360
             type: 'success',
361
             message: '歸零成功!'
361
             message: '歸零成功!'