Browse Source

feat 首页气象预警+异常设备接口

wangqin
qingzhengli 8 months ago
parent
commit
84dd8ec38e
  1. 27
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/FocusedMonitoring/index.vue

27
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/FocusedMonitoring/index.vue

@ -25,12 +25,12 @@
<div>施工路段</div>
</div>
<div class="monitor-item keep-ratio">
<span class="fault">4</span>
<span class="fault">{{ weatherForecast }}</span>
<span class="unit"></span>
<div>气象预警</div>
</div>
<div class="monitor-item keep-ratio">
<span class="abnormal">5</span>
<span class="abnormal">{{ abnormalDeviceNum }}</span>
<div>异常设备</div>
</div>
<div class="monitor-item keep-ratio">
@ -59,6 +59,8 @@ export default {
trafficIncidents: [0, 0],
constructionSection: 0,
perceiveEvent: 0,
abnormalDeviceNum: 0,
weatherForecast: 0
}
},
created() {
@ -74,8 +76,18 @@ export default {
method: "post",
data: {}
}),
request({
url: `/business/device/abnormalDevice`,
method: "get",
data: {}
}),
request({
url: `/weatherForecast/queryTheNumberOfMeteorologicalWarning`,
method: "post",
data: {}
}),
])
.then(([trafficIncidents, perceiveEvent]) => {
.then(([trafficIncidents, perceiveEvent, abnormalDeviceNum, weatherForecast]) => {
if (trafficIncidents.status === 'fulfilled' && trafficIncidents.value.code == 200) {
const data = trafficIncidents.value.data;
@ -92,7 +104,14 @@ export default {
this.perceiveEvent = data.number || 0;
}
if (abnormalDeviceNum.status === 'fulfilled' && abnormalDeviceNum.value.code == 200) {
const data = abnormalDeviceNum.value.data;
this.abnormalDeviceNum = data || 0;
}
if (weatherForecast.status === 'fulfilled' && weatherForecast.value.code == 200) {
const data = weatherForecast.value.data;
this.weatherForecast = data || 0;
}
})
}
}

Loading…
Cancel
Save