fengxiang
2018-01-10 3517e796f650b8aed52165c1a5905456f54033ef
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
<div class="modal-header">
  <div class="modal-title">配置传感器</div>
</div>
<nz-table #nzTable [nzDataSource]="grid.data"  [nzPageSize]="8"
  [nzLoading]="grid.loading" [nzShowTotal]="true" >
  <thead nz-thead>
    <tr>
      <th nz-th [nzCheckbox]="true">
        <label nz-checkbox [(ngModel)]="grid.allChecked" [nzIndeterminate]="grid.indeterminate" (ngModelChange)="grid.checkAll($event)"></label>
      </th>
      <th nz-th *ngFor="let col of grid.columns" [ngStyle]="{'width':col.width,'text-align':col['align'] === undefined?'left':col.align}">
        <span>{{ col.text }}</span>
        <nz-table-sort *ngIf="col.isSort" [(nzValue)]="col.sort" (nzValueChange)="sort(col.name,$event)"></nz-table-sort>
      </th>
    </tr>
  </thead>
  <tbody nz-tbody>
    <tr nz-tbody-tr *ngFor="let row of nzTable.data">
      <td nz-td [nzCheckbox]="true">
        <label nz-checkbox [(ngModel)]="row.checked" (ngModelChange)="grid.refreshStatus($event)"></label>
      </td>
      <td nz-td *ngFor="let col of grid.columns" [ngStyle]="{'width':col.width,'text-align':col['align'] === undefined?'left':col.align}">
        <span [ngSwitch]="col.type">
          <!-- 要使用管道,无法自动生成 -->
          <span *ngSwitchDefault> {{ row[col.name]|tyepHandle:col:row }} </span>
          <!-- 要使用管道,无法自动生成 -->
        </span>
      </td>
    </tr>
  </tbody>
</nz-table>
<div class="modal-footer">
  <button nz-button type="button" (click)="close()">关闭</button>
  <button nz-button [nzType]="'primary'" (click)="save($event)" [nzLoading]="isSaving">               
         <span >
            保存<span *ngIf="isSaving" >中</span>
         </span>
  </button>
</div>