Browse Source

bridgeMonitor time query

luyanan 6 years ago
parent
commit
2e916ce2a4

+ 20 - 5
src/views/bridgesConsole/bridgeMonitor/index.vue

69
          return time.getTime() > Date.now()
69
          return time.getTime() > Date.now()
70
        }
70
        }
71
      },
71
      },
72
      valueDate: this.formatTime(Date.now()).substring(0, 8),
72
      valueDate: this.formatTime(Date.now() + 8 * 60 * 60 * 1000).substring(0, 8),
73
      TimeVal: '000000',
73
      TimeVal: '000000',
74
      optionsTime: [],
74
      optionsTime: [],
75
      serverSeqArr: [],
75
      serverSeqArr: [],
108
      var that = this
108
      var that = this
109
      that.optionsTime = []
109
      that.optionsTime = []
110
      const nowHour = new Date().getHours()
110
      const nowHour = new Date().getHours()
111
      console.log(nowHour)
112
      if (nowHour > 0) {
113
        that.valueDate = this.formatTime(Date.now() + 8 * 60 * 60 * 1000).substring(0, 8)
114
      } else {
115
        that.valueDate = this.formatTime(Date.now() + 8 * 60 * 60 * 1000 - 1 * 60 * 60 * 1000).substring(0, 8)
116
      }
111
      for (let i = 0; i < 24; i++) {
117
      for (let i = 0; i < 24; i++) {
112
        var num = (i < 10 ? ('0' + i) : i)
118
        var num = (i < 10 ? ('0' + i) : i)
113
        var numpre = ((i - 1) < 10 ? ('0' + (i - 1)) : (i - 1))
114
        var oPt = {
119
        var numpre = ''
120
        var oPt = {}
121
        if (i > 0) {
122
          numpre = ((i - 1) < 10 ? ('0' + (i - 1)) : (i - 1))
123
        } else {
124
          numpre = 23
125
        }
126
        oPt = {
115
          value: `${num}0000`,
127
          value: `${num}0000`,
116
          label: `${num}:00:00 - ${num}:59:59`,
128
          label: `${num}:00:00 - ${num}:59:59`,
117
          disb: false
129
          disb: false
119
        if (nowHour === i) {
131
        if (nowHour === i) {
120
          that.TimeVal = `${numpre}0000`
132
          that.TimeVal = `${numpre}0000`
121
        }
133
        }
122
        if (nowHour <= i && that.valueDate === that.formatTime(Date.now()).substring(0, 8)) {
134
        if (nowHour <= i && nowHour !== 0 && that.valueDate === that.formatTime(Date.now() + 8 * 60 * 60 * 1000).substring(0, 8)) {
123
          oPt.disb = true
135
          oPt.disb = true
124
        }
136
        }
137
        if (nowHour === 0) {
138
          oPt.disb = false
139
        }
125
        that.optionsTime.push(oPt)
140
        that.optionsTime.push(oPt)
126
      }
141
      }
127
    },
142
    },
153
      var eDate = that.formatTime(sDateForm + 8 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000).substring(0, 14)
168
      var eDate = that.formatTime(sDateForm + 8 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000).substring(0, 14)
154
      var arr = that.serverSeqArr
169
      var arr = that.serverSeqArr
155
      var flag = false
170
      var flag = false
156
      if (that.valueDate === that.formatTime(Date.now()).substring(0, 8)) {
171
      if (that.valueDate === that.formatTime(Date.now() + 8 * 60 * 60 * 1000).substring(0, 8)) {
157
        flag = true
172
        flag = true
158
      }
173
      }
159
      if (arr === null || arr.length === 0) {
174
      if (arr === null || arr.length === 0) {

+ 1 - 1
src/views/layout/components/Navbar.vue

32
    },
32
    },
33
    logout() {
33
    logout() {
34
      this.$store.dispatch('LogOut').then(() => {
34
      this.$store.dispatch('LogOut').then(() => {
35
        location.reload() // 涓轰簡閲嶆柊瀹炰緥鍖杤ue-router瀵硅薄 閬垮厤bug
35
        location.reload() // 为了重新实例化vue-router对象 避免bug
36
      })
36
      })
37
    }
37
    }
38
  }
38
  }