Selaa lähdekoodia

rename vuex store

EthnaYeh 7 vuotta sitten
vanhempi
commit
d1a319623a

+ 1 - 1
src/store/getters.js

@@ -4,6 +4,6 @@ const getters = {
4 4
   avatar: state => state.user.avatar,
5 5
   username: state => state.user.username,
6 6
   roles: state => state.user.roles,
7
-  listVisble: state => state.gambleGameBucket.listVisble
7
+  visble: state => state.breadcrumb.visble
8 8
 }
9 9
 export default getters

+ 2 - 2
src/store/index.js

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

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

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

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

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

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

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

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

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
 <div class="app-container calendar-list-container">
3
-  <div  v-show="listVisble">
3
+  <div  v-show="visble">
4 4
     <div class="app-container">
5 5
       <el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="名稱" v-model="listQuery.name">
6 6
       </el-input>
@@ -126,17 +126,17 @@ export default {
126 126
     }
127 127
   },
128 128
   created() {
129
-    this.SetListVisble(true)
129
+    this.SetVisble(true)
130 130
     this.getList()
131 131
   },
132 132
   computed: {
133 133
     ...mapGetters([
134
-      'listVisble'
134
+      'visble'
135 135
     ])
136 136
   },
137 137
   methods: {
138 138
     ...mapActions([
139
-      'SetListVisble'
139
+      'SetVisble'
140 140
     ]),
141 141
     getList() {
142 142
       this.listLoading = true
@@ -212,7 +212,7 @@ export default {
212 212
     },
213 213
     handlePage(row) {
214 214
       const temp = Object.assign({}, row) // copy obj
215
-      this.SetListVisble(false)
215
+      this.SetVisble(false)
216 216
       this.member = temp
217 217
     },
218 218
     handleFilter() {