Browse Source

persistence wechatGameMaster

Unknown 7 years ago
parent
commit
955c09898e
1 changed files with 14 additions and 10 deletions
  1. 14 10
      src/views/room/wechatGameMaster/index.vue

+ 14 - 10
src/views/room/wechatGameMaster/index.vue

3
 <div class="app-container calendar-list-container">
3
 <div class="app-container calendar-list-container">
4
   <div  v-show="visible.secondLayer">
4
   <div  v-show="visible.secondLayer">
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.secondLayer.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>
96
       createFormData: null
96
       createFormData: null
97
     }
97
     }
98
   },
98
   },
99
-  props: ['room'],
99
+  // props: ['room'],
100
   created() {
100
   created() {
101
     this.SetVisible(2)
101
     this.SetVisible(2)
102
     this.getList()
102
     this.getList()
106
   },
106
   },
107
   computed: {
107
   computed: {
108
     ...mapGetters([
108
     ...mapGetters([
109
-      'visible'
109
+      'visible',
110
+      'data',
111
+      'query'
110
     ])
112
     ])
111
   },
113
   },
112
   methods: {
114
   methods: {
113
     ...mapActions([
115
     ...mapActions([
114
-      'SetVisible'
116
+      'SetVisible',
117
+      'SetData',
118
+      'SetQuery'
115
     ]),
119
     ]),
116
     getList() {
120
     getList() {
117
       this.listLoading = true
121
       this.listLoading = true
118
-      fetchWechatGameMaster(this.room, this.listQuery).then(response => {
122
+      fetchWechatGameMaster(this.data.secondLayer, this.query.secondLayer).then(response => {
119
         this.list = response.data.rows
123
         this.list = response.data.rows
120
         this.total = response.data.count
124
         this.total = response.data.count
121
         this.listLoading = false
125
         this.listLoading = false
130
     createData() {
134
     createData() {
131
      this.$refs['createForm'].validate((valid) => {
135
      this.$refs['createForm'].validate((valid) => {
132
         if (valid) {
136
         if (valid) {
133
-          const room = Object.assign({}, this.room)            
137
+          const room = Object.assign({}, this.data.secondLayer)            
134
           const createFormData = Object.assign({}, this.createFormData.value)
138
           const createFormData = Object.assign({}, this.createFormData.value)
135
           console.log('eqwewq', createFormData)
139
           console.log('eqwewq', createFormData)
136
           createWechatGameMaster(room, createFormData).then(() => {
140
           createWechatGameMaster(room, createFormData).then(() => {
154
       })
158
       })
155
     },
159
     },
156
     handleFilter() {
160
     handleFilter() {
157
-      this.listQuery.page = 1
161
+      this.SetQuery({layer:2, query: {page: 1, name: this.query.secondLayer.name}})
158
       this.getList()
162
       this.getList()
159
     },
163
     },
160
     handleSizeChange(val) {
164
     handleSizeChange(val) {
161
-      this.listQuery.limit = val
165
+      this.SetQuery({layer:2, query: {limit: val, name: this.query.secondLayer.name}})   
162
       this.getList()
166
       this.getList()
163
     },
167
     },
164
     handleCurrentChange(val) {
168
     handleCurrentChange(val) {
165
-      this.listQuery.page = val
169
+      this.SetQuery({layer:2, query: {page: val, name: this.query.secondLayer.name}})    
166
       this.getList()
170
       this.getList()
167
     },
171
     },
168
     handleDialogClose() {
172
     handleDialogClose() {
178
         page: 1,
182
         page: 1,
179
         name: query,
183
         name: query,
180
       }
184
       }
181
-      fetchWeChatMemberList(this.room, temp).then(response => {
185
+      fetchWeChatMemberList(this.data.secondLayer, temp).then(response => {
182
         if (!response.data.rows) return
186
         if (!response.data.rows) return
183
         this.agentLIstOptions = response.data.rows.map(v => ({
187
         this.agentLIstOptions = response.data.rows.map(v => ({
184
           key: v.WeChatUser.name,
188
           key: v.WeChatUser.name,