Commit 233fea0c authored by wangqinghua's avatar wangqinghua

templateid

parent d48ba054
...@@ -64,6 +64,12 @@ export class FlowTrendComponent implements OnInit, OnDestroy { ...@@ -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.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.obj.endTime = this.datePipe.transform(today, 'yyyy-MM-dd') + ' 23:59:59';
this.getGroup(); this.getGroup();
this.time_ = setInterval(()=>{
if(this.obj.hostid){
this.findByTime();
}
},5000)
} }
//获取流量 //获取流量
...@@ -123,9 +129,6 @@ export class FlowTrendComponent implements OnInit, OnDestroy { ...@@ -123,9 +129,6 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
this.obj.hostid = this.hostList[0].hostid + ''; this.obj.hostid = this.hostList[0].hostid + '';
this.getEcharts(null); this.getEcharts(null);
this.setNowEchart(); this.setNowEchart();
this.time_ = setInterval(() => {
this.findByTime();
}, 6000);
} else { } else {
this.message.warning('当前资源组无资源'); this.message.warning('当前资源组无资源');
} }
...@@ -239,7 +242,7 @@ export class FlowTrendComponent implements OnInit, OnDestroy { ...@@ -239,7 +242,7 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
this.flashEcharts(); this.flashEcharts();
} else { } else {
this.message.warning(res.errMsg); this.message.warning(res.errMsg);
clearInterval(this.time_); // clearInterval(this.time_);
} }
} }
); );
...@@ -345,8 +348,9 @@ export class FlowTrendComponent implements OnInit, OnDestroy { ...@@ -345,8 +348,9 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
//页面离开 //页面离开
ngOnDestroy() { ngOnDestroy() {
//销毁定时任务 //销毁定时任务
console.log("销毁定时任务"); if(this.time_){
clearInterval(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