Przeglądaj źródła

rename vuex store

EthnaYeh 7 lat temu
rodzic
commit
d1a319623a

+ 1 - 1
src/store/getters.js

4
   avatar: state => state.user.avatar,
4
   avatar: state => state.user.avatar,
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
-  listVisble: state => state.gambleGameBucket.listVisble
7
+  visble: state => state.breadcrumb.visble
8
 }
8
 }
9
 export default getters
9
 export default getters

+ 2 - 2
src/store/index.js

2
 import Vuex from 'vuex'
2
 import Vuex from 'vuex'
3
 import app from './modules/app'
3
 import app from './modules/app'
4
 import user from './modules/user'
4
 import user from './modules/user'
5
-import gambleGameBucket from './modules/gambleGameBucket'
5
+import breadcrumb from './modules/breadcrumb'
6
 import getters from './getters'
6
 import getters from './getters'
7
 
7
 
8
 Vue.use(Vuex)
8
 Vue.use(Vuex)
11
   modules: {
11
   modules: {
12
     app,
12
     app,
13
     user,
13
     user,
14
-    gambleGameBucket
14
+    breadcrumb
15
   },
15
   },
16
   getters
16
   getters
17
 })
17
 })

+ 17 - 0
src/store/modules/breadcrumb.js

1
+const breadcrumb = {
2
+  state: {
3
+    visble: true
4
+  },
5
+  mutations: {
6
+    SET_VISBLE: (state, visble) => {
7
+      state.visble = visble
8
+    }
9
+  },
10
+  actions: {
11
+    SetVisble({ commit }, visble) {
12
+      commit('SET_VISBLE', visble)
13
+    }
14
+  }
15
+}
16
+
17
+export default breadcrumb

+ 0 - 17
src/store/modules/gambleGameBucket.js

1
-const gambleGameBucket = {
2
-  state: {
3
-    listVisble: true
4
-  },
5
-  mutations: {
6
-    SET_LISTVISBLE: (state, listVisble) => {
7
-      state.listVisble = listVisble
8
-    }
9
-  },
10
-  actions: {
11
-    SetListVisble({ commit }, listVisble) {
12
-      commit('SET_LISTVISBLE', listVisble)
13
-    }
14
-  }
15
-}
16
-
17
-export default gambleGameBucket

+ 4 - 4
src/views/gambleGameBucket/detail/index.vue

163
         this.roundOptions.push({ label: `第 ${i} 輪`, key: i })
163
         this.roundOptions.push({ label: `第 ${i} 輪`, key: i })
164
       }
164
       }
165
     })
165
     })
166
-    this.SetListVisble(false)
166
+    this.SetVisble(false)
167
     this.getList()
167
     this.getList()
168
     fetchList({ page: 1, limit: 9999999999, chipsSort: 'DESC' }).then(response => {
168
     fetchList({ page: 1, limit: 9999999999, chipsSort: 'DESC' }).then(response => {
169
       const { rows } = response.data
169
       const { rows } = response.data
192
   },
192
   },
193
   computed: {
193
   computed: {
194
     ...mapGetters([
194
     ...mapGetters([
195
-      'listVisble'
195
+      'visble'
196
     ])
196
     ])
197
   },
197
   },
198
   methods: {
198
   methods: {
199
     ...mapActions([
199
     ...mapActions([
200
-      'SetListVisble'
200
+      'SetVisble'
201
     ]),
201
     ]),
202
     getList() {
202
     getList() {
203
       this.listLoading = true
203
       this.listLoading = true
352
     }
352
     }
353
   },
353
   },
354
   destroyed() {
354
   destroyed() {
355
-    this.SetListVisble(true)
355
+    this.SetVisble(true)
356
   }
356
   }
357
 }
357
 }
358
 </script>
358
 </script>

+ 5 - 5
src/views/gambleGameBucket/index.vue

1
 <template>
1
 <template>
2
 <div class="app-container calendar-list-container">
2
 <div class="app-container calendar-list-container">
3
-  <div class="app-container" v-show="listVisble">
3
+  <div class="app-container" v-show="visble">
4
     <el-table :data="list" v-loading.body="listLoading" element-loading-text="Loading" border fit highlight-current-row
4
     <el-table :data="list" v-loading.body="listLoading" element-loading-text="Loading" border fit highlight-current-row
5
       style="width: 100%">
5
       style="width: 100%">
6
       <el-table-column label="ID">
6
       <el-table-column label="ID">
69
   },
69
   },
70
   created() {
70
   created() {
71
     this.getList()
71
     this.getList()
72
-    this.SetListVisble(true)
72
+    this.SetVisble(true)
73
   },
73
   },
74
   computed: {
74
   computed: {
75
     ...mapGetters([
75
     ...mapGetters([
76
-      'listVisble'
76
+      'visble'
77
     ])
77
     ])
78
   },
78
   },
79
   methods: {
79
   methods: {
80
     ...mapActions([
80
     ...mapActions([
81
-      'SetListVisble'
81
+      'SetVisble'
82
     ]),
82
     ]),
83
     getList() {
83
     getList() {
84
       this.listLoading = true
84
       this.listLoading = true
93
       fetchGameBid(row).then(response => {
93
       fetchGameBid(row).then(response => {
94
         this.temp.bidChips = response.data
94
         this.temp.bidChips = response.data
95
       })
95
       })
96
-      this.SetListVisble(false)
96
+      this.SetVisble(false)
97
       this.bucket = this.temp
97
       this.bucket = this.temp
98
       // fetchMemberRecords(row).then(response => {
98
       // fetchMemberRecords(row).then(response => {
99
       //   console.log(response.data)
99
       //   console.log(response.data)

+ 2 - 2
src/views/gambleMember/detail/index.vue

42
   },
42
   },
43
   methods: {
43
   methods: {
44
     ...mapActions([
44
     ...mapActions([
45
-      'SetListVisble'
45
+      'SetVisble'
46
     ]),
46
     ]),
47
     // fetchData() {
47
     // fetchData() {
48
     //   this.listLoading = true
48
     //   this.listLoading = true
53
     // }
53
     // }
54
   },
54
   },
55
   destroyed() {
55
   destroyed() {
56
-    this.SetListVisble(true)
56
+    this.SetVisble(true)
57
   }
57
   }
58
 }
58
 }
59
 </script>
59
 </script>

+ 5 - 5
src/views/gambleMember/index.vue

1
 <template>
1
 <template>
2
 <div class="app-container calendar-list-container">
2
 <div class="app-container calendar-list-container">
3
-  <div  v-show="listVisble">
3
+  <div  v-show="visble">
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="listQuery.name">
6
       </el-input>
6
       </el-input>
126
     }
126
     }
127
   },
127
   },
128
   created() {
128
   created() {
129
-    this.SetListVisble(true)
129
+    this.SetVisble(true)
130
     this.getList()
130
     this.getList()
131
   },
131
   },
132
   computed: {
132
   computed: {
133
     ...mapGetters([
133
     ...mapGetters([
134
-      'listVisble'
134
+      'visble'
135
     ])
135
     ])
136
   },
136
   },
137
   methods: {
137
   methods: {
138
     ...mapActions([
138
     ...mapActions([
139
-      'SetListVisble'
139
+      'SetVisble'
140
     ]),
140
     ]),
141
     getList() {
141
     getList() {
142
       this.listLoading = true
142
       this.listLoading = true
212
     },
212
     },
213
     handlePage(row) {
213
     handlePage(row) {
214
       const temp = Object.assign({}, row) // copy obj
214
       const temp = Object.assign({}, row) // copy obj
215
-      this.SetListVisble(false)
215
+      this.SetVisble(false)
216
       this.member = temp
216
       this.member = temp
217
     },
217
     },
218
     handleFilter() {
218
     handleFilter() {