Browse Source

历史数据查询问题

lyn7568 6 years ago
parent
commit
1c44810701
1 changed files with 14 additions and 8 deletions
  1. 14 8
      src/views/bridgesConsole/bridgeMonitor/index.vue

+ 14 - 8
src/views/bridgesConsole/bridgeMonitor/index.vue

104
    })
104
    })
105
  },
105
  },
106
  methods: {
106
  methods: {
107
    optionsCreat() {
107
    optionsCreat(val) {
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)
111
      if (!val) {
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
          that.pickerOptions0 = {
117
            disabledDate(time) {
118
              return time.getTime() > Date.now() - 8.64e7
119
            }
120
          }
121
        }
116
      }
122
      }
117
      for (let i = 0; i < 24; i++) {
123
      for (let i = 0; i < 24; i++) {
118
        var num = (i < 10 ? ('0' + i) : i)
124
        var num = (i < 10 ? ('0' + i) : i)
134
        if (nowHour <= i && nowHour !== 0 && that.valueDate === that.formatTime(Date.now() + 8 * 60 * 60 * 1000).substring(0, 8)) {
140
        if (nowHour <= i && nowHour !== 0 && that.valueDate === that.formatTime(Date.now() + 8 * 60 * 60 * 1000).substring(0, 8)) {
135
          oPt.disb = true
141
          oPt.disb = true
136
        }
142
        }
137
        if (nowHour === 0) {
143
        if (nowHour === 0 || that.valueDate !== that.formatTime(Date.now() + 8 * 60 * 60 * 1000).substring(0, 8)) {
138
          oPt.disb = false
144
          oPt.disb = false
139
        }
145
        }
140
        that.optionsTime.push(oPt)
146
        that.optionsTime.push(oPt)
219
    },
225
    },
220
    changeDate(val) {
226
    changeDate(val) {
221
      this.valueDate = val
227
      this.valueDate = val
222
      this.optionsCreat()
228
      this.optionsCreat(val)
223
    },
229
    },
224
    changeTimeRange(val) {
230
    changeTimeRange(val) {
225
      this.TimeVal = val
231
      this.TimeVal = val