Browse Source

刷新访问不到数据,echarts去掉y轴缩放,添加加载等待

luyanan 6 years ago
parent
commit
ef76124707

+ 2 - 9
src/api/bridgeInfo.js

59
// 未读报警
59
// 未读报警
60
60
61
// 监测信息
61
// 监测信息
62
export function getMonitorByDay(params) {
62
export function getMonitorByDay(params, flag) {
63
  return request({
63
  return request({
64
    url: '/ajax/collect/wave/server/dayTime',
64
    url: flag ? '/ajax/collect/wave/server/time' : '/ajax/collect/wave/server/dayTime',
65
    method: 'get',
65
    method: 'get',
66
    params
66
    params
67
  })
67
  })
68
}
68
}
69
// export function getSysTime(params) {
70
//   return request({
71
//     url: '/ajax/sys/serviceTime',
72
//     method: 'get',
73
//     params
74
//   })
75
// }
76
export function getMonitorByTime(params) {
69
export function getMonitorByTime(params) {
77
  return request({
70
  return request({
78
    url: '/ajax/collect/wave/server/time',
71
    url: '/ajax/collect/wave/server/time',

+ 1 - 1
src/components/DefaultPage/index.vue

33
    width: 100%;
33
    width: 100%;
34
    height: 42%;
34
    height: 42%;
35
    z-index: 11;
35
    z-index: 11;
36
    padding:40px;
36
    padding: 50px;
37
    box-sizing: border-box;
37
    box-sizing: border-box;
38
    display: flex;
38
    display: flex;
39
    justify-content:center;
39
    justify-content:center;

+ 2 - 2
src/permission.js

23
      next({ path: '/' })
23
      next({ path: '/' })
24
      NProgress.done()
24
      NProgress.done()
25
    } else {
25
    } else {
26
      queryInfo.queryAllInfo()
26
      if (store.getters.roles.length === 0) { // 判断当前用户是否已拉取完user_info信息
27
      if (store.getters.roles.length === 0) { // 判断当前用户是否已拉取完user_info信息
27
        // console.log(5555)
28
        // console.log(5555)
28
        store.dispatch('GetUserInfo').then(res => { // 拉取user_info
29
        store.dispatch('GetUserInfo').then(res => { // 拉取user_info
42
        if (hasPermission(store.getters.roles, to.meta.roles)) {
43
        if (hasPermission(store.getters.roles, to.meta.roles)) {
43
          next()
44
          next()
44
        } else {
45
        } else {
45
          console.log(777)
46
          // console.log(777)
46
        }
47
        }
47
      }
48
      }
48
      queryInfo.queryAllInfo()
49
    }
49
    }
50
  } else {
50
  } else {
51
    if (whiteList.indexOf(to.path) !== -1) {
51
    if (whiteList.indexOf(to.path) !== -1) {

+ 3 - 0
src/styles/index.scss

88
    background-image: url('/static/touchwave.png');
88
    background-image: url('/static/touchwave.png');
89
    background-size: 300px 28px;
89
    background-size: 300px 28px;
90
  }
90
  }
91
}
92
.load-box{
93
  min-height:160px;
91
}
94
}

+ 17 - 1
src/utils/queryInfo.js

10
  serverList = [],
10
  serverList = [],
11
  deviceList = [],
11
  deviceList = [],
12
  transducerList = [],
12
  transducerList = [],
13
  listOk = false,
14
  cbArr = [],
15
  qaiCb = function(func) {
16
    if (listOk) {
17
      func()
18
    } else {
19
      cbArr.push(func)
20
    }
21
  },
13
  queryAllInfo = function() {
22
  queryAllInfo = function() {
23
    // setTimeout(function() {
14
    if (!bridgeObj.server && store.getters.roles.indexOf('1') === -1) {
24
    if (!bridgeObj.server && store.getters.roles.indexOf('1') === -1) {
15
      request({
25
      request({
16
        url: '/ajax/all/byUser',
26
        url: '/ajax/all/byUser',
24
          serverList = res.data.server
34
          serverList = res.data.server
25
          deviceList = res.data.device
35
          deviceList = res.data.device
26
          transducerList = res.data.transducer
36
          transducerList = res.data.transducer
37
          listOk = true
38
          cbArr.forEach(function(item) {
39
            item()
40
          })
27
        }
41
        }
28
      })
42
      })
29
    }
43
    }
44
    // }, 1)
30
  },
45
  },
31
  queryServers = function(bid, flag) {
46
  queryServers = function(bid, flag) {
32
    const obj = serverList
47
    const obj = serverList
75
    queryAllInfo: queryAllInfo,
90
    queryAllInfo: queryAllInfo,
76
    queryServers: queryServers,
91
    queryServers: queryServers,
77
    queryDevices: queryDevices,
92
    queryDevices: queryDevices,
78
    queryTrans: queryTrans
93
    queryTrans: queryTrans,
94
    qaiCb: qaiCb
79
  }
95
  }
80
96
81
export default ret
97
export default ret

+ 11 - 6
src/views/bridgesConsole/bridgeDanger/dangerDetail.vue

5
        <span>{{alarmTime}}</span>
5
        <span>{{alarmTime}}</span>
6
        <span>{{alarmTit}}</span>
6
        <span>{{alarmTit}}</span>
7
      </div>
7
      </div>
8
      <el-row class="line-chart-box">
9
        <el-col :xs="24" :sm="24" :lg="24" v-for="(item, index) in alarmShowList" :key="item.index">
10
          <lineChart :chartData="item" :lineColor="index" :historyM="historyM"></lineChart>
11
        </el-col>
12
      </el-row>
8
      <div class="load-box" v-loading="loadprogress">
9
        <el-row class="line-chart-box">
10
          <el-col :xs="24" :sm="24" :lg="24" v-for="(item, index) in alarmShowList" :key="item.index">
11
            <lineChart :chartData="item" :lineColor="index" :historyM="historyM"></lineChart>
12
          </el-col>
13
        </el-row>
14
      </div>
13
      <div class="pagination-container">
15
      <div class="pagination-container">
14
        <el-pagination
16
        <el-pagination
15
          background
17
          background
38
      alarmRead: false,
40
      alarmRead: false,
39
      alarmList: [],
41
      alarmList: [],
40
      pageSize: 6,
42
      pageSize: 6,
41
      pageNo: 1
43
      pageNo: 1,
44
      loadprogress: false
42
    }
45
    }
43
  },
46
  },
44
  components: {
47
  components: {
68
      const param = {
71
      const param = {
69
        aid: this.alarmId
72
        aid: this.alarmId
70
      }
73
      }
74
      this.loadprogress = true
71
      getDangerDetail(param).then(res => {
75
      getDangerDetail(param).then(res => {
72
        if (res.success && res.data) {
76
        if (res.success && res.data) {
77
          that.loadprogress = false
73
          var rList = []
78
          var rList = []
74
          var startTime = ''
79
          var startTime = ''
75
          for (let i = 0; i < res.data.length; i++) {
80
          for (let i = 0; i < res.data.length; i++) {

+ 30 - 19
src/views/bridgesConsole/bridgeDanger/dangerList.vue

4
      <div slot="header" class="block-title">
4
      <div slot="header" class="block-title">
5
        <span>报警信息</span>
5
        <span>报警信息</span>
6
      </div>
6
      </div>
7
      <ul class="item-ul" v-if="dangerList.length">
8
        <li :class="!item.readed ? 'readed-li' : ''" v-for="item in dangerList" :key="item.index" @click="alarmShow(item.aid, item.readed, item.alarmTime, item.device)">
9
          <span>{{item.alarmTime}}</span>
10
          <span>{{item.device}},请点击查看。</span>
11
          <span class="svg-container" v-if="!item.readed">
12
            <svg-icon icon-class="unread"></svg-icon>
13
          </span>
14
        </li>
15
      </ul>
16
      <DefaultPage v-if="!dangerList.length"></DefaultPage>
7
      <div class="load-box" v-loading="loadprogress">
8
        <ul class="item-ul" v-if="dangerList.length">
9
          <li :class="!item.readed ? 'readed-li' : ''" v-for="item in dangerList" :key="item.index" @click="alarmShow(item.aid, item.readed, item.alarmTime, item.device)">
10
            <span>{{item.alarmTime}}</span>
11
            <span>{{item.device}},请点击查看。</span>
12
            <span class="svg-container" v-if="!item.readed">
13
              <svg-icon icon-class="unread"></svg-icon>
14
            </span>
15
          </li>
16
        </ul>
17
        <DefaultPage v-if="!dangerList.length && !loadprogress"></DefaultPage>
18
      </div>
17
      <div class="pagination-container">
19
      <div class="pagination-container">
18
        <el-pagination
20
        <el-pagination
19
          background
21
          background
45
    return {
47
    return {
46
      bridgeId: '',
48
      bridgeId: '',
47
      bridgeName: '',
49
      bridgeName: '',
50
      loadprogress: true,
48
      dangerList: [],
51
      dangerList: [],
49
      pageSize: 20,
52
      pageSize: 20,
50
      pageNo: 1,
53
      pageNo: 1,
52
    }
55
    }
53
  },
56
  },
54
  created() {
57
  created() {
55
    this.bridgeId = Cookies.get('bridgeId')
56
    this.bridgeName = Cookies.get('bridgeName')
57
    this.serverSeqArr = queryInfo.queryServers(this.bridgeId, true)
58
    if (this.serverSeqArr) {
59
      this.getDangerList()
60
    }
58
    var that = this
59
    that.bridgeId = Cookies.get('bridgeId')
60
    that.bridgeName = Cookies.get('bridgeName')
61
    queryInfo.qaiCb(function() {
62
      if (that.bridgeId) {
63
        that.serverSeqArr = queryInfo.queryServers(that.bridgeId, true)
64
        if (that.serverSeqArr.length) {
65
          that.getDangerList()
66
        }
67
      }
68
    })
61
  },
69
  },
62
  methods: {
70
  methods: {
63
    getDangerList() {
71
    getDangerList() {
72
      var that = this
64
      var arr = this.serverSeqArr
73
      var arr = this.serverSeqArr
65
      const param = {
74
      const param = {
66
        seq: arr,
75
        seq: arr,
67
        pageSize: this.pageSize,
76
        pageSize: this.pageSize,
68
        pageNo: this.pageNo
77
        pageNo: this.pageNo
69
      }
78
      }
79
      that.loadprogress = true
70
      getDangerList(param).then(res => {
80
      getDangerList(param).then(res => {
71
        if (res.success && res.data.data) {
81
        if (res.success && res.data.data) {
82
          that.loadprogress = false
72
          const dataS = res.data.data
83
          const dataS = res.data.data
73
          this.total = res.data.total
84
          that.total = res.data.total
74
          for (let i = 0; i < dataS.length; i++) {
85
          for (let i = 0; i < dataS.length; i++) {
75
            if (dataS[i].alarmTime) {
86
            if (dataS[i].alarmTime) {
76
              dataS[i].alarmTime = parseTime(dataS[i].alarmTime, true)
87
              dataS[i].alarmTime = parseTime(dataS[i].alarmTime, true)
77
            }
88
            }
78
            dataS[i].device = `${this.bridgeName}大桥${dataS[i].device}采集盒检测到异常情况`
89
            dataS[i].device = `${that.bridgeName}大桥${dataS[i].device}采集盒检测到异常情况`
79
          }
90
          }
80
          this.dangerList = dataS
91
          that.dangerList = dataS
81
        }
92
        }
82
      })
93
      })
83
    },
94
    },

+ 4 - 1
src/views/bridgesConsole/bridgeDetail/components/BInfoDialog02.vue

81
      this.pageNo = val
81
      this.pageNo = val
82
    },
82
    },
83
    queryServerList() {
83
    queryServerList() {
84
      this.serverList = queryInfo.queryServers(this.$parent.bridgeId)
84
      var that = this
85
      queryInfo.qaiCb(function() {
86
        that.serverList = queryInfo.queryServers(that.$parent.bridgeId)
87
      })
85
    }
88
    }
86
  }
89
  }
87
}
90
}

+ 4 - 1
src/views/bridgesConsole/bridgeDetail/components/BInfoDialog03.vue

79
      this.pageNo = val
79
      this.pageNo = val
80
    },
80
    },
81
    queryDeviceList() {
81
    queryDeviceList() {
82
      this.deviceList = queryInfo.queryDevices(this.$parent.bridgeId)
82
      var that = this
83
      queryInfo.qaiCb(function() {
84
        that.deviceList = queryInfo.queryDevices(that.$parent.bridgeId)
85
      })
83
    }
86
    }
84
  }
87
  }
85
}
88
}

+ 4 - 1
src/views/bridgesConsole/bridgeDetail/components/BInfoDialog04.vue

84
      this.pageNo = val
84
      this.pageNo = val
85
    },
85
    },
86
    queryTransList() {
86
    queryTransList() {
87
      this.transducerList = queryInfo.queryTrans(this.$parent.bridgeId)
87
      var that = this
88
      queryInfo.qaiCb(function() {
89
        that.transducerList = queryInfo.queryTrans(that.$parent.bridgeId)
90
      })
88
    }
91
    }
89
  }
92
  }
90
}
93
}

+ 48 - 34
src/views/bridgesConsole/bridgeDetail/index.vue

15
            <span>报警信息</span>
15
            <span>报警信息</span>
16
            <el-button type="text" @click="queryDangerInfo">查看全部</el-button>
16
            <el-button type="text" @click="queryDangerInfo">查看全部</el-button>
17
          </div>
17
          </div>
18
          <ul class="item-ul" v-if="dangerList.length">
19
            <li :class="!item.readed ? 'readed-li' : ''" v-for="item in dangerList" :key="item.index" @click="alarmShow(item.aid, item.readed, item.alarmTime, item.device)">
20
              <span>{{item.alarmTime}}</span>
21
              <span>{{item.device}},请点击查看。</span>
22
              <span class="svg-container" v-if="!item.readed">
23
                <svg-icon icon-class="unread"></svg-icon>
24
              </span>
25
            </li>
26
          </ul>
27
          <DefaultPage v-if="!dangerList.length"></DefaultPage>
18
          <div class="load-box" v-loading="loadprogress1">
19
            <ul class="item-ul" v-if="dangerList.length">
20
              <li :class="!item.readed ? 'readed-li' : ''" v-for="item in dangerList" :key="item.index" @click="alarmShow(item.aid, item.readed, item.alarmTime, item.device)">
21
                <span>{{item.alarmTime}}</span>
22
                <span>{{item.device}},请点击查看。</span>
23
                <span class="svg-container" v-if="!item.readed">
24
                  <svg-icon icon-class="unread"></svg-icon>
25
                </span>
26
              </li>
27
            </ul>
28
            <DefaultPage v-if="!dangerList.length && !loadprogress1"></DefaultPage>
29
          </div>
28
        </el-card>
30
        </el-card>
29
        <el-card class="box-card block-group">
31
        <el-card class="box-card block-group">
30
          <div slot="header" class="block-title">
32
          <div slot="header" class="block-title">
31
            <span>实时监测</span>
33
            <span>实时监测</span>
32
            <el-button v-if="serverSeqArr.length" type="text" @click="updateDataList">刷新</el-button>
34
            <el-button v-if="serverSeqArr.length" type="text" @click="updateDataList">刷新</el-button>
33
          </div>
35
          </div>
34
          <el-row class="line-chart-box" v-if="monitorList.length">
35
            <el-col :xs="24" :sm="24" :lg="24" v-for="item in monitorShowList" :key="item.index">
36
              <lineChart :chartData="item" :maxXcount="maxShowLength"></lineChart>
37
            </el-col>
38
          </el-row>
39
          <DefaultPage v-if="!monitorList.length"></DefaultPage>
36
          <div class="load-box" v-loading="loadprogress2">
37
            <el-row class="line-chart-box" v-if="monitorList.length">
38
              <el-col :xs="24" :sm="24" :lg="24" v-for="item in monitorShowList" :key="item.index">
39
                <lineChart :chartData="item" :maxXcount="maxShowLength"></lineChart>
40
              </el-col>
41
            </el-row>
42
            <DefaultPage v-if="!monitorList.length && !loadprogress2"></DefaultPage>
43
          </div>
40
          <div class="pagination-container">
44
          <div class="pagination-container">
41
            <el-pagination
45
            <el-pagination
42
              background
46
              background
112
  },
116
  },
113
  data() {
117
  data() {
114
    return {
118
    return {
119
      loadprogress1: true,
120
      loadprogress2: true,
115
      bridgeId: '',
121
      bridgeId: '',
116
      bridgeName: '',
122
      bridgeName: '',
117
      dialogW: '860px',
123
      dialogW: '860px',
123
      serverList: [],
129
      serverList: [],
124
      deviceList: [],
130
      deviceList: [],
125
      transducerList: [],
131
      transducerList: [],
126
      monitorList: [],
127
      currentNo: 1,
132
      currentNo: 1,
128
      currentSize: 4,
133
      currentSize: 4,
129
      currentTime: '',
134
      currentTime: '',
130
      sysTime: '',
135
      sysTime: '',
131
      localTimeiv: '',
136
      localTimeiv: '',
132
      eastEightDistrict: 8 * 60 * 60 * 1000,
137
      eastEightDistrict: 8 * 60 * 60 * 1000,
133
      jishiTime: null,
134
      maxShowLength: 300,
138
      maxShowLength: 300,
135
      monitorCache: []
139
      monitorList: [],
140
      monitorCache: [],
141
      jishiTime: null
136
    }
142
    }
137
  },
143
  },
138
  watch: {
144
  watch: {
139
    '$route'(to, from) {
140
      if (!(to.path === '/bridgeHome/bridgeDetail')) {
145
    $route(to, from) {
146
      if (to.path !== '/bridgeHome/bridgeDetail') {
141
        clearTimeout(this.jishiTime)
147
        clearTimeout(this.jishiTime)
142
        this.jishiTime = null
148
        this.jishiTime = null
143
      }
149
      }
149
    }
155
    }
150
  },
156
  },
151
  created() {
157
  created() {
158
    var that = this
152
    if (urlParse('id')) {
159
    if (urlParse('id')) {
153
      this.bridgeId = urlParse('id')
154
      this.bridgeName = urlParse('name')
160
      that.bridgeId = urlParse('id')
161
      that.bridgeName = urlParse('name')
155
    } else {
162
    } else {
156
      this.bridgeId = Cookies.get('bridgeId')
157
      this.bridgeName = Cookies.get('bridgeName')
163
      that.bridgeId = Cookies.get('bridgeId')
164
      that.bridgeName = Cookies.get('bridgeName')
158
    }
165
    }
159
    this.getDictoryData()
160
    if (this.bridgeId) {
161
      this.serverSeqArr = queryInfo.queryServers(this.bridgeId, true)
162
      if (this.serverSeqArr.length) {
163
        this.updateDataList()
166
    that.getDictoryData()
167
    queryInfo.qaiCb(function() {
168
      if (that.bridgeId) {
169
        that.serverSeqArr = queryInfo.queryServers(that.bridgeId, true)
170
        if (that.serverSeqArr.length) {
171
          that.updateDataList()
172
          that.getDangerList()
173
        }
164
      }
174
      }
165
    }
175
    })
166
  },
176
  },
167
  methods: {
177
  methods: {
168
    updateDataList() {
178
    updateDataList() {
179
      clearTimeout(this.jishiTime)
180
      this.jishiTime = null
169
      this.monitorList = []
181
      this.monitorList = []
170
      this.monitorCache = []
182
      this.monitorCache = []
171
      this.getSysTime()
183
      this.getSysTime()
172
      this.getDangerList()
173
    },
184
    },
174
    getDangerList() {
185
    getDangerList() {
175
      var arr = this.serverSeqArr
186
      var arr = this.serverSeqArr
178
        pageSize: 5,
189
        pageSize: 5,
179
        pageNo: 1
190
        pageNo: 1
180
      }
191
      }
192
      this.loadprogress1 = true
181
      getDangerList(param).then(res => {
193
      getDangerList(param).then(res => {
182
        if (res.success && res.data.data) {
194
        if (res.success && res.data.data) {
195
          this.loadprogress1 = false
183
          const dataS = res.data.data
196
          const dataS = res.data.data
184
          for (let i = 0; i < dataS.length; i++) {
197
          for (let i = 0; i < dataS.length; i++) {
185
            if (dataS[i].alarmTime) {
198
            if (dataS[i].alarmTime) {
202
          that.localTimeiv = localTime - that.sysTime
215
          that.localTimeiv = localTime - that.sysTime
203
          that.first_Q = true
216
          that.first_Q = true
204
          that.getTimingMonitor()
217
          that.getTimingMonitor()
218
        } else {
219
          that.loadprogress2 = false
205
        }
220
        }
206
      })
221
      })
207
    },
222
    },
217
      var startTime = this.formatTime(this.sysTime)
232
      var startTime = this.formatTime(this.sysTime)
218
      var endTime = this.formatTime(this.sysTime)
233
      var endTime = this.formatTime(this.sysTime)
219
      that.sysTime += 1000
234
      that.sysTime += 1000
220
      // var startTime = this.formatTime(this.first_Q ? (this.sysTime - preTime) : this.sysTime)
221
      // var endTime = this.formatTime(this.sysTime)
222
      getMonitorByTime({ seq: arr, begin: startTime, end: endTime }).then(res => {
235
      getMonitorByTime({ seq: arr, begin: startTime, end: endTime }).then(res => {
223
        var mCache = that.monitorCache
236
        var mCache = that.monitorCache
224
        var mList = []
237
        var mList = []
225
        if (res.success && res.data) {
238
        if (res.success && res.data) {
226
          if (that.first_Q) {
239
          if (that.first_Q) {
240
            that.loadprogress2 = false
227
            if (res.data.length) {
241
            if (res.data.length) {
228
              that.first_Q = false
242
              that.first_Q = false
229
              var ftime = res.data[0].ctime
243
              var ftime = res.data[0].ctime

+ 37 - 15
src/views/bridgesConsole/bridgeMonitor/index.vue

17
              :key="item.value"
17
              :key="item.value"
18
              :label="item.label"
18
              :label="item.label"
19
              :value="item.value"
19
              :value="item.value"
20
              :disabled="item.disb"
20
              @change="changeTimeRange">
21
              @change="changeTimeRange">
21
            </el-option>
22
            </el-option>
22
          </el-select>
23
          </el-select>
65
      bridgeId: '',
66
      bridgeId: '',
66
      pickerOptions0: {
67
      pickerOptions0: {
67
        disabledDate(time) {
68
        disabledDate(time) {
68
          return time.getTime() > Date.now() - 8.64e7
69
          return time.getTime() > Date.now()
69
        }
70
        }
70
      },
71
      },
71
      valueDate: this.formatTime(Date.now() - 8.64e7).substring(0, 8),
72
      valueDate: this.formatTime(Date.now()).substring(0, 8),
72
      TimeVal: '000000',
73
      TimeVal: '000000',
73
      optionsTime: [],
74
      optionsTime: [],
74
      serverSeqArr: [],
75
      serverSeqArr: [],
90
    }
91
    }
91
  },
92
  },
92
  created() {
93
  created() {
93
    this.bridgeId = Cookies.get('bridgeId')
94
    this.optionsCreat()
95
    this.serverSeqArr = queryInfo.queryServers(this.bridgeId, true)
96
    if (this.serverSeqArr.length) {
97
      this.getMonitorByDay()
98
    }
94
    var that = this
95
    that.bridgeId = Cookies.get('bridgeId')
96
    that.optionsCreat()
97
    queryInfo.qaiCb(function() {
98
      if (that.bridgeId) {
99
        that.serverSeqArr = queryInfo.queryServers(that.bridgeId, true)
100
        if (that.serverSeqArr.length) {
101
          that.getMonitorByDay()
102
        }
103
      }
104
    })
99
  },
105
  },
100
  methods: {
106
  methods: {
101
    optionsCreat() {
107
    optionsCreat() {
108
      var that = this
109
      that.optionsTime = []
110
      const nowHour = new Date().getHours()
102
      for (let i = 0; i < 24; i++) {
111
      for (let i = 0; i < 24; i++) {
103
        var num = (i < 10 ? ('0' + i) : i)
112
        var num = (i < 10 ? ('0' + i) : i)
113
        var numpre = ((i - 1) < 10 ? ('0' + (i - 1)) : (i - 1))
104
        var oPt = {
114
        var oPt = {
105
          value: `${num}0000`,
115
          value: `${num}0000`,
106
          label: `${num}:00:00 - ${num}:59:59`
116
          label: `${num}:00:00 - ${num}:59:59`,
117
          disb: false
107
        }
118
        }
108
        this.optionsTime.push(oPt)
119
        if (nowHour === i) {
120
          that.TimeVal = `${numpre}0000`
121
        }
122
        if (nowHour <= i && that.valueDate === that.formatTime(Date.now()).substring(0, 8)) {
123
          oPt.disb = true
124
        }
125
        that.optionsTime.push(oPt)
109
      }
126
      }
110
    },
127
    },
111
    formatTime(time) {
128
    formatTime(time) {
118
      var that = this
135
      var that = this
119
      var clearInt = setInterval(function() {
136
      var clearInt = setInterval(function() {
120
        that.proBar = that.proBar + parseInt((Math.random() * 10), 10)
137
        that.proBar = that.proBar + parseInt((Math.random() * 10), 10)
121
        if (that.proBar >= 84) {
122
          that.proBar = 84
138
        if (that.proBar >= 96) {
139
          that.proBar = 96
123
          clearInterval(clearInt)
140
          clearInterval(clearInt)
124
        }
141
        }
125
      }, 1000 * Math.random())
142
      }, 1500 * Math.random())
126
    },
143
    },
127
    getMonitorByDay() {
144
    getMonitorByDay() {
128
      this.progressShow = true
145
      this.progressShow = true
134
      var sDate = that.valueDate + that.TimeVal
151
      var sDate = that.valueDate + that.TimeVal
135
      var sDateForm = (new Date(parseTime(sDate, true, true))).getTime()
152
      var sDateForm = (new Date(parseTime(sDate, true, true))).getTime()
136
      var eDate = that.formatTime(sDateForm + 8 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000).substring(0, 14)
153
      var eDate = that.formatTime(sDateForm + 8 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000).substring(0, 14)
137
      var arr = this.serverSeqArr
138
      getMonitorByDay({ seq: arr, begin: sDate, end: eDate }).then(res => {
154
      var arr = that.serverSeqArr
155
      var flag = false
156
      if (that.valueDate === that.formatTime(Date.now()).substring(0, 8)) {
157
        flag = true
158
      }
159
      getMonitorByDay({ seq: arr, begin: sDate, end: eDate }, flag).then(res => {
139
        NProgress.inc()
160
        NProgress.inc()
140
        if (res.success && res.data) {
161
        if (res.success && res.data) {
141
          this.progressShow = false
162
          this.progressShow = false
169
    },
190
    },
170
    changeDate(val) {
191
    changeDate(val) {
171
      this.valueDate = val
192
      this.valueDate = val
193
      this.optionsCreat()
172
    },
194
    },
173
    changeTimeRange(val) {
195
    changeTimeRange(val) {
174
      this.TimeVal = val
196
      this.TimeVal = val

+ 0 - 13
src/views/bridgesConsole/lineChart/LineChart.vue

153
              xAxisIndex: [0],
153
              xAxisIndex: [0],
154
              start: 0,
154
              start: 0,
155
              end: 100
155
              end: 100
156
            },
157
            {
158
              type: 'slider',
159
              show: true,
160
              yAxisIndex: [0],
161
              start: 0,
162
              end: 100
163
            },
164
            {
165
              type: 'inside',
166
              yAxisIndex: [0],
167
              start: 0,
168
              end: 100
169
            }
156
            }
170
          ]
157
          ]
171
        })
158
        })

+ 33 - 28
src/views/dashboard/other/index.vue

1
<template>
1
<template>
2
  <div class="dashboard-editor-container">
2
  <div class="dashboard-editor-container">
3
    <div v-if="!showComp">
4
      <el-row class="panel-group" :gutter="40">
5
        <el-col :xs="24" :sm="12" :lg="6" class="card-panel-col" v-for="item in dataList" :key="item.index" @click.native="goToDashboardC(item.id, item.shortName)">
6
          <div class='card-panel'>
7
            <div class="card-panel-icon-wrapper">
8
              <div class="card-image" :style="{ backgroundImage: 'url(/data/bridge'+ item.img +')'}"></div>
3
    <div class="load-box" v-loading="loadprogress">
4
      <div v-if="!showComp">
5
        <el-row class="panel-group" :gutter="40">
6
          <el-col :xs="24" :sm="12" :lg="6" class="card-panel-col" v-for="item in dataList" :key="item.index" @click.native="goToDashboardC(item.id, item.shortName)">
7
            <div class='card-panel'>
8
              <div class="card-panel-icon-wrapper">
9
                <div class="card-image" :style="{ backgroundImage: 'url(/data/bridge'+ item.img +')'}"></div>
10
              </div>
11
              <div class="card-panel-description">
12
                <div class="card-panel-text">桥梁名称 <span>{{item.shortName}}</span></div>
13
                <div class="card-panel-text" :class="item.alarmNum>0?'card-panel-text-red':''">未读报警 {{item.alarmNum ? item.alarmNum : alarmNum}}条</div>
14
              </div>
9
            </div>
15
            </div>
10
            <div class="card-panel-description">
11
              <div class="card-panel-text">桥梁名称 <span>{{item.shortName}}</span></div>
12
              <div class="card-panel-text" :class="item.alarmNum>0?'card-panel-text-red':''">未读报警 {{item.alarmNum ? item.alarmNum : alarmNum}}条</div>
13
            </div>
14
          </div>
15
        </el-col>
16
      </el-row>
17
      <div class="pagination-container">
18
        <el-pagination
19
          background
20
          @current-change="handleCurrentChange"
21
          :page-size="9"
22
          layout="prev, pager, next, jumper"
23
          :total="total">
24
        </el-pagination>
16
          </el-col>
17
        </el-row>
18
        <div class="pagination-container" v-if="!loadprogress">
19
          <el-pagination
20
            background
21
            @current-change="handleCurrentChange"
22
            :page-size="9"
23
            layout="prev, pager, next, jumper"
24
            :total="total">
25
          </el-pagination>
26
        </div>
25
      </div>
27
      </div>
26
    </div>
27
    <div class="defaut-container" v-if="showComp">
28
      <div>
29
        <img class="plat-pic" src="/static/touchwave.png" width="460">
30
        <p class="plat-tit">欢迎 <span>{{name}}</span> 使用声脉桥梁云监控平台</p>
31
        <p class="plat-tip">您目前没有任何桥梁数据,请联系管理员</p>
28
      <div class="defaut-container" v-if="showComp">
29
        <div>
30
          <img class="plat-pic" src="/static/touchwave.png" width="460">
31
          <p class="plat-tit">欢迎 <span>{{name}}</span> 使用声脉桥梁云监控平台</p>
32
          <p class="plat-tip">您目前没有任何桥梁数据,请联系管理员</p>
33
        </div>
32
      </div>
34
      </div>
33
    </div>
35
    </div>
34
  </div>
36
  </div>
52
      pageSize: 10,
54
      pageSize: 10,
53
      pageNo: 1,
55
      pageNo: 1,
54
      dataList: [],
56
      dataList: [],
55
      showComp: false
57
      showComp: false,
58
      loadprogress: false
56
    }
59
    }
57
  },
60
  },
58
  computed: {
61
  computed: {
70
        pageSize: this.pageSize,
73
        pageSize: this.pageSize,
71
        pageNo: this.pageNo
74
        pageNo: this.pageNo
72
      }
75
      }
76
      this.loadprogress = true
73
      getBridgeList(param).then(res => {
77
      getBridgeList(param).then(res => {
74
        if (res.success) {
78
        if (res.success) {
75
          var $data = res.data.data
79
          var $data = res.data.data
80
          this.loadprogress = false
76
          if ($data.length > 0) {
81
          if ($data.length > 0) {
77
            this.total = res.data.total
82
            this.total = res.data.total
78
            for (let i = 0; i < $data.length; i++) {
83
            for (let i = 0; i < $data.length; i++) {

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

126
  right: 0;
126
  right: 0;
127
  height: 50px;
127
  height: 50px;
128
  line-height: 50px;
128
  line-height: 50px;
129
  z-index:1002;
129
  z-index:2002;
130
  border-radius: 0px !important;
130
  border-radius: 0px !important;
131
  background-color: #2d3a4b;
131
  background-color: #2d3a4b;
132
  border-bottom: 1px solid #e6e6e6;
132
  border-bottom: 1px solid #e6e6e6;