fix:修改问题

1 panel页面渲染chart时直接显示占好位置,不根据滚动条监测懒加载chart图表。只有当chart 出现在 浏览器窗口后才请求prom接口获取数据。
This commit is contained in:
hyx
2020-05-21 09:03:30 +08:00
parent 3b67691d79
commit 6bb65cd34e
4 changed files with 134 additions and 36 deletions

View File

@@ -273,6 +273,18 @@ export default {
}
}
},
getCurrentTime(){
let timeTypeId = this.showTime.id;
if(timeTypeId===0){
return this.searchTime;
}else {
if(!timeTypeId){timeTypeId = 4;}
let currentTime = this.timeData.find(item => item.id === timeTypeId);
this.setSearchTime(currentTime.type,currentTime.value);
return this.searchTime;
}
},
setSearchTime(type,val){
if(type==='minute'){
let startTime = bus.timeFormate(new Date(bus.computeTimezone(new Date().getTime())).setMinutes(new Date(bus.computeTimezone(new Date().getTime())).getMinutes() - val),'yyyy-MM-dd hh:mm:ss');