投运时间,系统总览刷新,图表警告处理等

This commit is contained in:
ym1026
2025-09-17 14:54:33 +08:00
parent 9377e7f8e6
commit a94ad0f8f8
18 changed files with 85 additions and 437 deletions

View File

@@ -54,6 +54,7 @@ export default {
components: { Map },
data() {
return {
refreshInterval:null,
showFlag: false,
stationId: null,
deviceInfo: {},
@@ -109,31 +110,44 @@ export default {
return this.list.filter((_, index) => index % 2 !== 0).slice(0, 3) // 右列取前3个奇数索引
}
},
beforeUnmount() {
if(this.refreshInterval){
clearInterval(this.refreshInterval)
this.refreshInterval=null
}
},
async mounted() {
await Promise.all([
this.getOnLineList(),
this.getStatTotalList(),
this.getOperTotalList(),
this.getStatDayList(1),
this.getStatDayList(2),
this.getStatDayList(3)
]).then((r) => {
if (
this.deviceInfo.energy &&
this.deviceInfo.charge &&
this.deviceInfo.pv
) {
const newArr = this.mergedArray(
this.deviceInfo.energy,
this.deviceInfo.charge,
this.deviceInfo.pv
)
this.deviceInfo.alarm = newArr
}
})
await this.loadAllData()
this.refreshInterval=setInterval(async()=>{
await this.loadAllData()
},30000) //30s刷新一次
},
methods: {
async loadAllData(){
await Promise.all([
this.getOnLineList(),
this.getStatTotalList(),
this.getOperTotalList(),
this.getStatDayList(1),
this.getStatDayList(2),
this.getStatDayList(3)
]).then((r) => {
if (
this.deviceInfo.energy &&
this.deviceInfo.charge &&
this.deviceInfo.pv
) {
const newArr = this.mergedArray(
this.deviceInfo.energy,
this.deviceInfo.charge,
this.deviceInfo.pv
)
this.deviceInfo.alarm = newArr
}
})
},
getCurrentStation(e) {
this.stationId = e
},