Commit 28a369ef authored by wangqinghua's avatar wangqinghua

单位

parent 4042b28d
......@@ -66,6 +66,25 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
this.getGroup();
}
//获取流量
getList() {
this.outNowEchartData = [];
this.inNowEchartData = [];
this.obj.hostid = null;
this.onchange();
this.getInList();
this.getOutList();
}
getListIO() {
this.outNowEchartData = [];
this.inNowEchartData = [];
this.getInList();
this.getOutList();
}
onEchartInit(e){
this.echartObj = e;
}
......@@ -133,7 +152,6 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
},
backgroundColor: '#eee',
tooltip: {
// trigger: 'axis',
formatter: (params) => {
if(params.data){
let res = params.seriesName;
......@@ -209,12 +227,12 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
(res) => {
if (res.errCode == 10000) {
const inData = {
clock:this.datePipe.transform(res.data.time,"yyyy-MM-dd HH:mm"),
clock:this.datePipe.transform(res.data.time,"HH:mm:ss"),
avg:(res.data.in)
};
this.inNowEchartData.push(inData);
const outData = {
clock:this.datePipe.transform(res.data.time,"yyyy-MM-dd HH:mm"),
clock:this.datePipe.transform(res.data.time,"HH:mm:ss"),
avg:(res.data.out)
};
this.outNowEchartData.push(outData);
......@@ -245,6 +263,11 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
text: '进出口流量实时趋势图',
left: 'center',
},
legend: {
data: ['进口流量', '出口流量'],
align: 'left',
left: 10
},
backgroundColor: '#eee',
tooltip: {
// trigger: 'axis',
......@@ -271,8 +294,7 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
},
xAxis: {
data: this.inNowEchartData.map(e => {
let date = this.datePipe.transform(e.clock, 'yyyy-MM-dd HH:mm');
return date;
return e.clock;
}),
name: '时间',
},
......@@ -323,10 +345,11 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
//页面离开
ngOnDestroy() {
//销毁定时任务
console.log("销毁定时任务");
clearInterval(this.time_);
}
//获取图标数据
//获取趋势数据
getEcharts(itemid) {
this.isLoading = true;
const data = {
......@@ -378,6 +401,7 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
);
}
//
setEacharts() {
let itemStyle = {
normal: {},
......@@ -395,6 +419,11 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
text: '进出口流量峰值趋势图',
left: 'center',
},
legend: {
data: ['进口流量', '出口流量'],
align: 'left',
left: 10
},
backgroundColor: '#eee',
tooltip: {
// trigger: 'axis',
......@@ -468,19 +497,6 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
this.isLoading = false;
}
//获取流量
getList() {
this.obj.hostid = null;
this.onchange();
this.getInList();
this.getOutList();
}
getListIO() {
this.getInList();
this.getOutList();
}
//in改变页数
inChnagePage(e) {
this.inPageNum = e;
......
......@@ -154,13 +154,14 @@
<nz-table #checkTable [nzData]="checkList" [nzFrontPagination]="false" [nzTotal]="totalNum" [nzPageIndex]="pageIndex" [nzPageSize]="pageSize" (nzPageIndexChange)="change($event)" [nzLoading]="loading">
<thead>
<tr>
<th nzWidth="250px">监测点名称</th>
<th >最新数据</th>
<th nzWidth="200px">最新数据时间</th>
<th>监测点分类</th>
<th>更新时间间隔</th>
<th>图表</th>
<th nzWidth="250px">操作</th>
<th nzWidth="15%">监测点名称</th>
<th nzWidth="10%">最新数据</th>
<th nzWidth="15%">最新数据时间</th>
<th nzWidth="10%">监测点分类</th>
<th nzWidth="10%">更新时间间隔</th>
<th nzWidth="5%">图表</th>
<th nzWidth="15%">状态</th>
<th nzWidth="10%">信息</th>
</tr>
</thead>
<tbody>
......@@ -177,7 +178,9 @@
<nz-tag [nzColor]="color.gray"></nz-tag>
</ng-container>
{{data.name}}</td>
<td>{{data.lastvalue}}</td>
<td>
<span title="123123">{{data.lastvalue}}</span>
</td>
<td>{{data.lastclock}}</td>
<td>{{data.itemType}}</td>
<td>{{data.delay}}</td>
......@@ -192,11 +195,12 @@
<span *ngIf="data.triggerCount == 0" (click)="showAddThresholdModal(data)">添加阈值</span>
<span *ngIf="data.triggerCount > 0" (click)="showEditThresholdModal(data)">编辑阈值</span>
</ng-container>
<span *ngIf="data.status == 0 && data.state==0" (click)="updateItem(data.itemid,1)" style="color: red">停止</span>
<span *ngIf="data.status == 0 && data.state==0" (click)="updateItem(data.itemid,1)" style="color: red">启用</span>
<span *ngIf="data.status == 0 && data.state==1" (click)="updateItem(data.itemid,1)" style="color: red">不支持的</span>
<span *ngIf="data.status == 1 && data.state==0" (click)="updateItem(data.itemid,0)" style="color: green">启用</span>
<span *ngIf="data.status == 1 && data.state==1" (click)="updateItem(data.itemid,0)" style="color: green">启用</span>
<span *ngIf="data.status == 1 && data.state==0" (click)="updateItem(data.itemid,0)" style="color: green">停止</span>
<span *ngIf="data.status == 1 && data.state==1" (click)="updateItem(data.itemid,0)" style="color: green">停止</span>
</td>
<td>{{data.error}}</td>
</tr>
</tbody>
</nz-table>
......
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