fengxiang
2018-03-14 aee3b7ea53df69cedae9e8210987000caf059c9f
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
  <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 style="width:45px;">
            <label>序号</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>
        <th nz-th>
             <span>校准值</span>
        </th>
      </tr>
    </thead>
    <tbody nz-tbody>
      <tr nz-tbody-tr *ngFor="let row of nzTable.data,index as i">
        <td nz-td  [ngClass]="{'bg-grey-1':true}" style="text-align:center;">
            {{ i }}
        </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>
         <td>
             <nz-input-number [(ngModel)]="data.value[row.sensorKey]" [nzStep]="0.1"></nz-input-number>
         </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>