Commit 28a369ef authored by wangqinghua's avatar wangqinghua

单位

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