fengxiang
2018-07-20 4c75d3f7678238a61f7c644f2a673896b454525a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<div class="content__title">
        <h1>
            设备状态
            <small>设备状态显示:正常,离线</small>
        </h1>
    </div>
    <nz-card [nzBordered]="false">
        <div nz-row class="mb-sm">
            <div  nz-col [nzSpan]="4">
                    <button nz-button (click)="addOrModify($event)" [nzType]="'primary'" [nzSize]="'large'">
                        <i class="anticon anticon-plus"></i><span>新建</span>
                    </button>
                    <ng-container *ngIf="selectedRows.length > 0">
                    <button nz-button [nzSize]="'large'" (click)="deleteSelected()">批量删除</button>
                    </ng-container>
            </div>
            <div  nz-col [nzSpan]="7">
                  <span style="padding: 5px 10px;">
                    组织:                  
                  </span>
                  <nz-select style="width: 79%;" [(ngModel)]="queryMap.orgId" (ngModelChange)="setOrgId($event)" [nzPlaceHolder]="'选择 组织(输入名称搜索)'"
                    nzAllowClear [nzFilter]="false" nzShowSearch  (nzSearchChange)="orgSelectChange($event)" [nzNotFoundContent]="'无法找到'" >
                    <nz-option *ngFor="let option of orgOptions" [nzLabel]="option.name" [nzValue]="option.id" [nzDisabled]="option.disabled">
                    </nz-option>
                  </nz-select>
            </div>
            <div  nz-col [nzSpan]="7">
                    <span style="padding: 5px 10px;">
                            监控站:                  
                          </span>
                          <nz-select style="width: 75%;" [(ngModel)]="queryMap.mpointId" (ngModelChange)="setMpointId($event)" [nzPlaceHolder]="'选择 监控站名称(输入名称搜索)'"
                          nzAllowClear [nzFilter]="false" nzShowSearch (nzSearchChange)="monitorPointChange($event)" [nzNotFoundContent]="'无法找到'" >
                            <nz-option *ngFor="let option of monitorPoints" [nzLabel]="option.name" [nzValue]="option.id" [nzDisabled]="option.disabled">
                            </nz-option>
                          </nz-select>
            </div>
            <div  nz-col [nzSpan]="6">
                    <nz-input [ngStyle]="{'width': '240px','float':'right'}" [(ngModel)]="queryText" name=""  [nzPlaceHolder]="'请输入设备名称或设备mac'"
                    (keyup)="queryTextChanged($event)" (change)="queryTextChanged($event)" ></nz-input>
            </div>
        </div>
        <div class="mb-md">
                <nz-alert *ngIf="selectedRows.length > 0" [nzType]="'info'" [nzShowIcon]="true"> 
                    <span alert-body>
                        已选择<strong class="text-primary">{{selectedRows.length}}</strong>项
                    </span> 
                </nz-alert>
        </div>
    <simple-table #simpleTable  [data]="listUrl" [extraParams]="extraParams"  [columns]="columns" [showTotal]="true"
    [reqReName]="{pi: 'pageIndex',ps: 'pageSize'}"  (checkboxChange)="checkboxChange($event)" [ps]="10" [resReName]="{list: 'data',total: 'total'}">
    <ng-template st-row="state-badge" let-item let-index="index">
            <ng-container [ngSwitch]="item.state">
                    <span *ngSwitchCase="'0'">
                         <nz-badge [nzStatus]="'success'" [nzText]="'正常'"></nz-badge>
                    </span>
                    <span *ngSwitchCase="'1'">
                         <nz-badge [nzStatus]="'processing'" [nzText]="'轻度'"></nz-badge>
                    </span>
                    <span *ngSwitchCase="'2'">
                            <nz-badge [nzStatus]="'warning'" [nzText]="'中度'"></nz-badge>
                    </span>
                    <span *ngSwitchCase="'3'">
                            <nz-badge [nzStatus]="'error'" [nzText]="'严重'"></nz-badge>
                    </span>
                    <span *ngSwitchDefault>
                            <nz-badge [nzStatus]="'default'" [nzText]="'离线'"></nz-badge>
                    </span>
            </ng-container>
        </ng-template>
    </simple-table>
    </nz-card>