8 changed files with 224 additions and 24 deletions
@ -0,0 +1,24 @@ |
|||||||
|
<div class="box"> |
||||||
|
<nz-table #basicTable [nzData]="listOfData" [nzShowPagination]='false' [nzPageSize]='10'> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th>ip地址</th> |
||||||
|
<th>所属油站</th> |
||||||
|
<th>设备状态</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<tr *ngFor="let data of basicTable.data"> |
||||||
|
<td>{{ data.hostIPAddress }}</td> |
||||||
|
<td>{{ data.gasStationName }}</td> |
||||||
|
<td>{{ data.state == 'Disconnected' ? '未连接' : '已连接' }}</td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</nz-table> |
||||||
|
<div class="pagination"> |
||||||
|
<nz-pagination [nzHideOnSinglePage]="false" [nzPageIndex]="1" [nzTotal]="num" [nzPageSize]="10" |
||||||
|
[nzShowTotal]="totalTemplate" nzShowQuickJumper (nzPageIndexChange)="pageChange($event)"> |
||||||
|
</nz-pagination> |
||||||
|
<ng-template #totalTemplate let-total> 16条/页,共{{num}}条 </ng-template> |
||||||
|
</div> |
||||||
|
</div> |
@ -0,0 +1,40 @@ |
|||||||
|
import { HttpClient } from '@angular/common/http'; |
||||||
|
import { Component, OnInit } from '@angular/core'; |
||||||
|
|
||||||
|
@Component({ |
||||||
|
selector: 'app-condition-monitoring', |
||||||
|
templateUrl: './condition-monitoring.component.html', |
||||||
|
styleUrls: ['./condition-monitoring.component.scss'] |
||||||
|
}) |
||||||
|
export class ConditionMonitoringComponent implements OnInit { |
||||||
|
|
||||||
|
constructor(private http: HttpClient) { } |
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
this.getConditionMonitoring() |
||||||
|
} |
||||||
|
|
||||||
|
listOfData: any |
||||||
|
num: string |
||||||
|
PageNumber: number = 1 |
||||||
|
//获取盒子状态
|
||||||
|
getConditionMonitoring() { |
||||||
|
let params = { |
||||||
|
PageNumber: this.PageNumber, |
||||||
|
PageSize: 10 |
||||||
|
} |
||||||
|
this.http.get('/api/EdgeDevices/Statuses', { params: params }).subscribe( |
||||||
|
(data: any) => { |
||||||
|
console.log(data) |
||||||
|
this.listOfData = data.items |
||||||
|
this.num = data.totalCount |
||||||
|
}, err => { |
||||||
|
|
||||||
|
} |
||||||
|
) |
||||||
|
} |
||||||
|
pageChange($event) { |
||||||
|
this.PageNumber = $event |
||||||
|
this.getConditionMonitoring() |
||||||
|
} |
||||||
|
} |
@ -1,27 +1,129 @@ |
|||||||
@import "~ng-zorro-antd/ng-zorro-antd.min.css"; |
@import "~ng-zorro-antd/ng-zorro-antd.min.css"; |
||||||
|
|
||||||
@import "~ng-zorro-antd/style/index.min.css"; /* 引入基本样式 */ |
@import "~ng-zorro-antd/style/index.min.css"; |
||||||
@import "~ng-zorro-antd/button/style/index.min.css"; /* 引入组件样式 */ |
/* 引入基本样式 */ |
||||||
|
@import "~ng-zorro-antd/button/style/index.min.css"; |
||||||
|
/* 引入组件样式 */ |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* css初始化 */ |
/* css初始化 */ |
||||||
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; } |
html, |
||||||
body { font-family: Roboto, "Helvetica Neue", sans-serif; } |
body { |
||||||
ul,ol,dl,li,dt,dd,p,form,input,h1,h2,h3,h4,h5,h6,section,article,aside,header,footer,nav,figure,time,mark,main,canvas { margin: 0; padding: 0; } |
margin: 0; |
||||||
b,strong,i,em,h1,h2,h3,h4,h5,h6 { font-weight: 500; font-style: normal; } |
padding: 0; |
||||||
img { border: none; outline: none; } |
width: 100%; |
||||||
a { text-decoration: none; color:#000; } |
height: 100%; |
||||||
ul,ol,li { list-style: none; overflow-x: hidden; } |
overflow: hidden; |
||||||
textarea { resize: none; } |
} |
||||||
|
|
||||||
|
body { |
||||||
|
font-family: Roboto, "Helvetica Neue", sans-serif; |
||||||
|
} |
||||||
|
|
||||||
|
ul, |
||||||
|
ol, |
||||||
|
dl, |
||||||
|
li, |
||||||
|
dt, |
||||||
|
dd, |
||||||
|
p, |
||||||
|
form, |
||||||
|
input, |
||||||
|
h1, |
||||||
|
h2, |
||||||
|
h3, |
||||||
|
h4, |
||||||
|
h5, |
||||||
|
h6, |
||||||
|
section, |
||||||
|
article, |
||||||
|
aside, |
||||||
|
header, |
||||||
|
footer, |
||||||
|
nav, |
||||||
|
figure, |
||||||
|
time, |
||||||
|
mark, |
||||||
|
main, |
||||||
|
canvas { |
||||||
|
margin: 0; |
||||||
|
padding: 0; |
||||||
|
} |
||||||
|
|
||||||
|
b, |
||||||
|
strong, |
||||||
|
i, |
||||||
|
em, |
||||||
|
h1, |
||||||
|
h2, |
||||||
|
h3, |
||||||
|
h4, |
||||||
|
h5, |
||||||
|
h6 { |
||||||
|
font-weight: 500; |
||||||
|
font-style: normal; |
||||||
|
} |
||||||
|
|
||||||
|
img { |
||||||
|
border: none; |
||||||
|
outline: none; |
||||||
|
} |
||||||
|
|
||||||
|
a { |
||||||
|
text-decoration: none; |
||||||
|
color: #000; |
||||||
|
} |
||||||
|
|
||||||
|
ul, |
||||||
|
ol, |
||||||
|
li { |
||||||
|
list-style: none; |
||||||
|
overflow-x: hidden; |
||||||
|
} |
||||||
|
|
||||||
|
textarea { |
||||||
|
resize: none; |
||||||
|
} |
||||||
|
|
||||||
/* 滚动条样式 */ |
/* 滚动条样式 */ |
||||||
// ::-webkit-scrollbar:horizontal { width: 5px; background-color: white; } |
// ::-webkit-scrollbar:horizontal { width: 5px; background-color: white; } |
||||||
::-webkit-scrollbar-thumb { background-color: #999; } |
::-webkit-scrollbar-thumb { |
||||||
|
background-color: #999; |
||||||
|
} |
||||||
|
|
||||||
|
app-root { |
||||||
|
height: 100%; |
||||||
|
} |
||||||
|
|
||||||
app-root { height: 100%; } |
.blue { |
||||||
.blue {cursor: pointer;color: #1890ff;} |
cursor: pointer; |
||||||
.red {cursor: pointer;color: #ff4d4f;} |
color: #1890ff; |
||||||
|
} |
||||||
|
|
||||||
|
.red { |
||||||
|
cursor: pointer; |
||||||
|
color: #ff4d4f; |
||||||
|
} |
||||||
|
|
||||||
.ant-tabs-content { |
.ant-tabs-content { |
||||||
height: 100%; |
height: 100%; |
||||||
} |
} |
||||||
|
|
||||||
|
.box { |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
overflow-y: auto; |
||||||
|
background: #fff; |
||||||
|
box-sizing: border-box; |
||||||
|
padding: 20px; |
||||||
|
} |
||||||
|
.ant-pagination-next, .ant-pagination-prev{ |
||||||
|
overflow: hidden; |
||||||
|
} |
||||||
|
.pagination { |
||||||
|
margin: 15px 0; |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
justify-content: center; |
||||||
|
} |
Loading…
Reference in new issue