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() {
|
||||
return {
|
||||
refreshInterval:null,
|
||||
|
||||
modalInfo: {},
|
||||
list: [
|
||||
{
|
||||
@@ -118,7 +120,22 @@ 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 this.loadAllData()
|
||||
this.refreshInterval=setInterval(async()=>{
|
||||
await this.loadAllData()
|
||||
},30000) //30s刷新一次
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
async loadAllData(){
|
||||
await Promise.all([
|
||||
this.getStatTotalList(),
|
||||
this.queryStationInfo(),
|
||||
@@ -126,8 +143,6 @@ export default {
|
||||
this.getStatDayList(1)
|
||||
])
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 查询系统累计统计信息
|
||||
async getStatTotalList() {
|
||||
try {
|
||||
|
||||
@@ -111,7 +111,6 @@ export default {
|
||||
}
|
||||
},
|
||||
beforeUnmount() {
|
||||
console.log('2222')
|
||||
if(this.refreshInterval){
|
||||
clearInterval(this.refreshInterval)
|
||||
this.refreshInterval=null
|
||||
|
||||
Reference in New Issue
Block a user