@@ -35,6 +35,7 @@ export default {
that.global.ws.onmessage = (res)=> {
this.$store.commit('wsInfoMiT',res)
+ this.$store.commit('pusTimer',30)
};
that.global.ws.onclose = function () {
@@ -6,7 +6,8 @@ Vue.use(Vuex)
export default new Vuex.Store({
state: {
wsInfo: null,
- StationID: ''
+ StationID: '',
+ wsTimer: 30
},
mutations: {
wsInfoMiT(state, val) {
@@ -15,6 +16,12 @@ export default new Vuex.Store({
changeStationID(state, val) {
state.StationID = val
+ pusTimer(state, val) {
+ state.wsTimer = val
+ },
+ editTimer(state) {
+ state.wsTimer--
+ }