mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
弹窗数据刷新
This commit is contained in:
@@ -60,6 +60,8 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
refreshInterval:null,
|
||||||
|
|
||||||
modalInfo: {},
|
modalInfo: {},
|
||||||
list: [
|
list: [
|
||||||
{
|
{
|
||||||
@@ -118,16 +120,29 @@ export default {
|
|||||||
return this.list.filter((_, index) => index % 2 !== 0).slice(0, 3) // 右列取前3个奇数索引
|
return this.list.filter((_, index) => index % 2 !== 0).slice(0, 3) // 右列取前3个奇数索引
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
beforeUnmount() {
|
||||||
|
if(this.refreshInterval){
|
||||||
|
clearInterval(this.refreshInterval)
|
||||||
|
this.refreshInterval=null
|
||||||
|
}
|
||||||
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
await Promise.all([
|
await this.loadAllData()
|
||||||
this.getStatTotalList(),
|
this.refreshInterval=setInterval(async()=>{
|
||||||
this.queryStationInfo(),
|
await this.loadAllData()
|
||||||
this.queryStationData(),
|
},30000) //30s刷新一次
|
||||||
this.getStatDayList(1)
|
|
||||||
])
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
async loadAllData(){
|
||||||
|
await Promise.all([
|
||||||
|
this.getStatTotalList(),
|
||||||
|
this.queryStationInfo(),
|
||||||
|
this.queryStationData(),
|
||||||
|
this.getStatDayList(1)
|
||||||
|
])
|
||||||
|
},
|
||||||
// 查询系统累计统计信息
|
// 查询系统累计统计信息
|
||||||
async getStatTotalList() {
|
async getStatTotalList() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -111,7 +111,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeUnmount() {
|
beforeUnmount() {
|
||||||
console.log('2222')
|
|
||||||
if(this.refreshInterval){
|
if(this.refreshInterval){
|
||||||
clearInterval(this.refreshInterval)
|
clearInterval(this.refreshInterval)
|
||||||
this.refreshInterval=null
|
this.refreshInterval=null
|
||||||
|
|||||||
Reference in New Issue
Block a user