Commit 233fea0c authored by wangqinghua's avatar wangqinghua

templateid

parent d48ba054
......@@ -64,6 +64,12 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
this.obj.startTime = this.datePipe.transform(today, 'yyyy-MM-dd') + ' 00:00:00';
this.obj.endTime = this.datePipe.transform(today, 'yyyy-MM-dd') + ' 23:59:59';
this.getGroup();
this.time_ = setInterval(()=>{
if(this.obj.hostid){
this.findByTime();
}
},5000)
}
//获取流量
......@@ -123,9 +129,6 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
this.obj.hostid = this.hostList[0].hostid + '';
this.getEcharts(null);
this.setNowEchart();
this.time_ = setInterval(() => {
this.findByTime();
}, 6000);
} else {
this.message.warning('当前资源组无资源');
}
......@@ -239,7 +242,7 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
this.flashEcharts();
} else {
this.message.warning(res.errMsg);
clearInterval(this.time_);
// clearInterval(this.time_);
}
}
);
......@@ -345,8 +348,9 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
//页面离开
ngOnDestroy() {
//销毁定时任务
console.log("销毁定时任务");
clearInterval(this.time_);
if(this.time_){
clearInterval(this.time_);
}
}
//获取趋势数据
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment