中化项目-边缘主机维护-前端项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

101 lines
4.9 KiB

<div class="box">
<div class="topbox">
<form nz-form [formGroup]="validateForm" class="login-form" (ngSubmit)="submitForm()">
<nz-form-item class="searchParams">
<nz-form-control>
<nz-tree-select [nzAllowClear]="false" [nzDropdownClassName]="'maxHeightTreeSelect'" nzShowSearch
formControlName="organization" [nzNodes]="nodes" nzPlaceHolder="请选择所属机构"
[(ngModel)]="defaultOrId" [nzExpandedIcon]="multiExpandedIconTpl">
</nz-tree-select>
<ng-template #multiExpandedIconTpl let-node let-origin="origin">
<ng-container *ngIf="node.children.length == 0; else elseTemplate">
</ng-container>
<ng-template #elseTemplate>
<i nz-icon [nzType]="node.isExpanded ? 'caret-down' : 'caret-right'"
class="ant-tree-switcher-line-icon"></i>
</ng-template>
</ng-template>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<!-- <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="state">设备状态</nz-form-label> -->
<nz-form-control>
<nz-select formControlName="state" nzPlaceHolder="请选择设备状态">
<nz-option [nzValue]="0" nzLabel="离线"></nz-option>
<nz-option [nzValue]="1" nzLabel="在线"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item class="btn">
<nz-form-control>
<button nz-button nzType="primary" type="submit" class="submit"><i nz-icon
[nzType]="'search'"></i>查询</button>
</nz-form-control>
</nz-form-item>
<nz-form-item class="btn">
<nz-form-control>
<button nz-button type="button" class="reset" (click)="resetForm($event)"><i nz-icon
[nzType]="'sync'"></i>重置</button>
</nz-form-control>
</nz-form-item>
<button nz-button nzType="primary" type="button" [disabled]="setOfCheckedId.size === 0"
[nzLoading]="loading == 'RestartApps'" (click)="sendRequest('RestartApps')">
重启识别程序
</button>
<button nz-button nzType="primary" type="button" [disabled]="setOfCheckedId.size === 0"
[nzLoading]="loading == 'RestartMonitors'" (click)="sendRequest('RestartMonitors')">
重启监控程序
</button>
<button nz-button nzType="primary" type="button" [disabled]="setOfCheckedId.size === 0"
[nzLoading]="loading == 'RestartMonitors'" (click)="executeTheScript()">
执行脚本
</button>
</form>
</div>
<nz-table #basicTable nzShowSizeChanger [nzData]="listOfData" [nzLoading]="isLoading"
(nzCurrentPageDataChange)="onCurrentPageDataChange($event)" [nzShowPagination]='false' [nzPageSize]='10'>
<thead>
<tr>
<th [nzChecked]="checked" [nzIndeterminate]="indeterminate" (nzCheckedChange)="onAllChecked($event)">
</th>
<th>ip地址</th>
<th>所属油站</th>
<th>设备状态</th>
<th>识别程序状态</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td [nzChecked]="setOfCheckedId.has(data.id)" [nzDisabled]="data.disabled"
(nzCheckedChange)="onItemChecked(data.id, $event)"></td>
<td>{{ data.hostIPAddress }}</td>
<td>{{ data.gasStationName }}</td>
<td>
<ng-container *ngIf="data.hubConnectionState == 'Disconnected'; else elseTemplate">
<span style="color: red;">离线</span>
</ng-container>
<ng-template #elseTemplate>
<span style="color: rgb(52, 204, 52);">在线</span>
</ng-template>
</td>
<td>
<span style="color: red;" *ngIf="data.appState == 'Dead'">已停止</span>
<span style="color: rgb(52, 204, 52);" *ngIf="data.appState == 'Alive'">运行中</span>
</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> 10条/页,共{{num}}条 </ng-template>
</div>
</div>