Commit face4507 authored by wangqinghua's avatar wangqinghua

update

parent 808838e6
...@@ -72,13 +72,28 @@ ...@@ -72,13 +72,28 @@
</div> </div>
</div> </div>
<nz-spin [nzSpinning]="isLoading"> <nz-spin [nzSpinning]="isLoading">
<div style="height: 400px">
<ng-container *ngIf="echartType == 'now'"> <ng-container *ngIf="echartType == 'now'">
<div echarts [options]="nowChartOption" (chartInit)="onEchartInit($event)" <ng-container *ngIf="data.now">
style="height: 400px;width: 100%"></div> <div class="img-noData">
<div class="noData" title="暂无数据"></div>
</div>
</ng-container>
<ng-container *ngIf="!data.now">
<div echarts [options]="nowChartOption" (chartInit)="onEchartInit($event)" style="height: 400px;width: 100%"></div>
</ng-container>
</ng-container> </ng-container>
<ng-container *ngIf="echartType == 'history'"> <ng-container *ngIf="echartType == 'history'">
<ng-container *ngIf="data.history">
<div class="img-noData">
<div class="noData" title="暂无数据"></div>
</div>
</ng-container>
<ng-container *ngIf="!data.history">
<div echarts [options]="chartOption" style="height: 400px;width: 100%"></div> <div echarts [options]="chartOption" style="height: 400px;width: 100%"></div>
</ng-container> </ng-container>
</ng-container>
</div>
</nz-spin> </nz-spin>
<div class="padding-15-0"> <div class="padding-15-0">
<ng-container *ngIf="echartType == 'history'"> <ng-container *ngIf="echartType == 'history'">
......
...@@ -55,6 +55,11 @@ export class FlowTrendComponent implements OnInit, OnDestroy { ...@@ -55,6 +55,11 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
time_; time_;
data = {
now:false,
history:false
}
constructor(private topologySer: TopologyService, private overAllSer: OverAllService, constructor(private topologySer: TopologyService, private overAllSer: OverAllService,
private message: NzMessageService, private datePipe: DatePipe) { private message: NzMessageService, private datePipe: DatePipe) {
} }
...@@ -232,7 +237,13 @@ export class FlowTrendComponent implements OnInit, OnDestroy { ...@@ -232,7 +237,13 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
if (res.errCode == 10000) { if (res.errCode == 10000) {
this.inNowEchartData=res.data.in; this.inNowEchartData=res.data.in;
this.outNowEchartData=res.data.out; this.outNowEchartData=res.data.out;
if(this.inNowEchartData.length == 0 && this.outNowEchartData.length == 0){
this.data.now = true;
this.message.warning("实时流量数据暂无");
}else{
this.data.now = false;
this.flashEcharts(); this.flashEcharts();
}
} else { } else {
this.message.warning(res.errMsg); this.message.warning(res.errMsg);
} }
...@@ -385,11 +396,17 @@ export class FlowTrendComponent implements OnInit, OnDestroy { ...@@ -385,11 +396,17 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
}); });
this.setEacharts(); this.setEacharts();
} else { } else {
this.inEchartData = []; this.outEchartData = [];
this.message.warning('出口流量图表暂无数据'); this.message.warning('出口流量图表暂无数据');
this.isLoading = false; this.isLoading = false;
this.setEacharts(); this.setEacharts();
} }
if( this.inEchartData.length == 0 && this.outEchartData.length == 0){
this.data.history = true;
}else{
this.data.history = false;
}
} }
); );
} else { } else {
......
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