瀏覽代碼

进度条延迟显示加载到100%状态

luyanan 6 年之前
父節點
當前提交
236bfb2a4e
共有 1 個文件被更改,包括 13 次插入8 次删除
  1. 13 8
      src/views/bridgesConsole/bridgeMonitor/index.vue

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

21
              @change="changeTimeRange">
21
              @change="changeTimeRange">
22
            </el-option>
22
            </el-option>
23
          </el-select>
23
          </el-select>
24
          <el-button type="primary" @click="getMonitorByDay">查询</el-button>
24
          <el-button type="primary" @click="getMonitorByDay" :disabled="progressShow">查询</el-button>
25
      </div>
25
      </div>
26
      <el-row class="line-chart-box">
26
      <el-row class="line-chart-box">
27
        <el-col :xs="24" :sm="24" :lg="24" v-for="item in alarmShowList" :key="item.index" v-if="alarmList.length">
28
          <lineChart :chartData="item" :historyM="historyM"></lineChart>
29
        </el-col>
30
        <div class="progress-box" v-if="progressShow">
27
        <div class="progress-box" v-if="progressShow">
31
          <span>正在加载 {{proBar}}%</span>
28
          <span>正在加载 {{proBar}}%</span>
32
          <el-progress :text-inside="true" :stroke-width="18" :percentage="proBar"></el-progress>
29
          <el-progress :text-inside="true" :stroke-width="18" :percentage="proBar"></el-progress>
33
        </div>
30
        </div>
31
        <el-col :xs="24" :sm="24" :lg="24" v-for="item in alarmShowList" :key="item.index" v-if="alarmList.length">
32
          <lineChart :chartData="item" :historyM="historyM"></lineChart>
33
        </el-col>
34
      </el-row>
34
      </el-row>
35
      <DefaultPage v-if="!alarmList.length && !progressShow"></DefaultPage>
35
      <DefaultPage v-if="!alarmList.length && !progressShow"></DefaultPage>
36
      <div class="pagination-container">
36
      <div class="pagination-container">
142
      }, 1500 * Math.random())
142
      }, 1500 * Math.random())
143
    },
143
    },
144
    getMonitorByDay() {
144
    getMonitorByDay() {
145
      this.progressShow = true
146
      NProgress.start()
147
      var that = this
145
      var that = this
146
      that.progressShow = true
147
      NProgress.start()
148
      that.proBar = 0
148
      that.proBar = 0
149
      that.alarmList = []
149
      that.alarmList = []
150
      that.changeProgress()
150
      that.changeProgress()
159
      getMonitorByDay({ seq: arr, begin: sDate, end: eDate }, flag).then(res => {
159
      getMonitorByDay({ seq: arr, begin: sDate, end: eDate }, flag).then(res => {
160
        NProgress.inc()
160
        NProgress.inc()
161
        if (res.success && res.data) {
161
        if (res.success && res.data) {
162
          this.progressShow = false
162
          that.proBar = 100
163
          var monitorList = []
163
          var monitorList = []
164
          for (let i = 0; i < res.data.length; i++) {
164
          for (let i = 0; i < res.data.length; i++) {
165
            var str = res.data[i].cid
165
            var str = res.data[i].cid
184
            monitorData.seData.push(res.data[i].hvalue)
184
            monitorData.seData.push(res.data[i].hvalue)
185
            monitorData.seData.push(res.data[i].lvalue)
185
            monitorData.seData.push(res.data[i].lvalue)
186
          }
186
          }
187
          that.alarmList = monitorList
187
          if (that.proBar === 100) {
188
            that.alarmList = monitorList
189
            setTimeout(function() {
190
              that.progressShow = false
191
            }, 1)
192
          }
188
        }
193
        }
189
      })
194
      })
190
    },
195
    },