|
|
@@ -1,5 +1,11 @@
|
|
|
<template>
|
|
|
- <div class="qxz screen-content-box">
|
|
|
+ <div
|
|
|
+ class="qxz screen-content-box"
|
|
|
+ v-loading="loading"
|
|
|
+ element-loading-text="加载中"
|
|
|
+ element-loading-spinner="el-icon-loading"
|
|
|
+ element-loading-background="rgba(0, 0, 0, 0.6)"
|
|
|
+ >
|
|
|
<p class="title">
|
|
|
气象监测
|
|
|
<el-select
|
|
|
@@ -49,7 +55,8 @@ export default {
|
|
|
return {
|
|
|
selId: '',
|
|
|
equipList: [],
|
|
|
- equipStatus: []
|
|
|
+ equipStatus: [],
|
|
|
+ loading: false
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -126,31 +133,36 @@ export default {
|
|
|
data: this.qs.stringify({
|
|
|
device_id: this.selId
|
|
|
})
|
|
|
- }).then((res) => {
|
|
|
- this.loading = false
|
|
|
- if (res.data.message === '') {
|
|
|
- const { dat, conf } = res.data.data
|
|
|
- // console.log(dat, conf, 'resent, compare')
|
|
|
- let recent = []
|
|
|
- Object.keys(conf).forEach((key) => {
|
|
|
- if (conf[key]) {
|
|
|
- let item = conf[key].split('#')
|
|
|
- let val = dat[key].split('#')
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ this.loading = false
|
|
|
+ if (res.data.message === '') {
|
|
|
+ const { dat, conf } = res.data.data
|
|
|
+ // console.log(dat, conf, 'resent, compare')
|
|
|
+ let recent = []
|
|
|
+ Object.keys(conf).forEach((key) => {
|
|
|
+ if (conf[key]) {
|
|
|
+ let item = conf[key].split('#')
|
|
|
+ let val = dat[key].split('#')
|
|
|
|
|
|
- recent.push({
|
|
|
- num: val[1],
|
|
|
- value: val[0] || '--',
|
|
|
- unit: item[1],
|
|
|
- name: item[0]
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ recent.push({
|
|
|
+ num: val[1],
|
|
|
+ value: val[0] || '--',
|
|
|
+ unit: item[1],
|
|
|
+ name: item[0]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
- this.equipStatus = this.formateArray(Math.ceil(recent.length / 2), 2, recent)
|
|
|
- } else {
|
|
|
- this.$message.error(res.data.message)
|
|
|
- }
|
|
|
- })
|
|
|
+ this.equipStatus = this.formateArray(Math.ceil(recent.length / 2), 2, recent)
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.data.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.loading = false
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
components: {}
|