<form nz-form [formGroup]="validateForm" (ngSubmit)="save($event,validateForm.value,validateForm.valid)" [nzLayout]="'vertical'"
|
#f="ngForm">
|
<nz-card [nzBordered]="false" nzTitle="报警阀值(注意,只有部分选项有 反向三级 数值,没有可不填)">
|
<nz-table #nzTable [nzDataSource]="grid.data" [nzPageSize]="10" [nzLoading]="grid.loading" [nzShowTotal]="true">
|
<thead nz-thead>
|
<tr>
|
<th nz-th [nzCheckbox]="true">
|
<label nz-checkbox formControlName="_allChecked" [nzIndeterminate]="indeterminate" (ngModelChange)="checkAll($event)"></label>
|
</th>
|
<th nz-th>
|
传感器名称(单位)
|
</th>
|
<th nz-th>
|
一级
|
</th>
|
<th nz-th>
|
二级
|
</th>
|
<th nz-th>
|
三级
|
</th>
|
<th nz-th [ngStyle]="{'width': '72px'}">
|
启用反向
|
</th>
|
<th nz-th>
|
<span *ngIf="hasDegression">反向一级</span>
|
</th>
|
<th nz-th>
|
<span *ngIf="hasDegression">反向二级</span>
|
</th>
|
<th nz-th>
|
<span *ngIf="hasDegression">反向三级</span>
|
</th>
|
</tr>
|
</thead>
|
<tbody formGroupName="alarmLevels" nz-tbody>
|
<tr nz-tbody-tr *ngFor="let row of nzTable.data" formGroupName="{{row.sensorKey}}">
|
|
<td nz-td [nzCheckbox]="true">
|
<label nz-checkbox formControlName="enable"></label>
|
</td>
|
<td nz-td>
|
<span>
|
{{ row.name }}({{ row.unit }})
|
</span>
|
</td>
|
<td nz-td formArrayName="increment" *ngFor="let in of validateForm.get('alarmLevels.'+row.sensorKey+'.increment').controls; index as i">
|
<div nz-form-item>
|
<div nz-form-control nzHasFeedback>
|
<nz-input [formControlName]="i" maxlength="20" nzDisabled="{{ !f.value['alarmLevels'][row.sensorKey]['enable'] }}"></nz-input>
|
</div>
|
</div>
|
</td>
|
<td nz-td style="padding-top:0px;">
|
<div nz-form-control>
|
<nz-switch formControlName="degressEnable" (click)="refreshHasDegression(f.value['alarmLevels'][row.sensorKey]['degressEnable'])"
|
nzDisabled="{{ !f.value['alarmLevels'][row.sensorKey]['enable'] }}"></nz-switch>
|
</div>
|
</td>
|
<td nz-td formArrayName="degression" *ngFor="let in of validateForm.get('alarmLevels.'+row.sensorKey+'.degression').controls; index as i">
|
<div *ngIf="f.value['alarmLevels'][row.sensorKey]['degressEnable']" nz-form-item>
|
<div nz-form-control nzHasFeedback>
|
<nz-input [formControlName]="i" maxlength="20" nzDisabled="{{ !f.value['alarmLevels'][row.sensorKey]['enable'] }}"></nz-input>
|
</div>
|
</div>
|
</td>
|
</tr>
|
</tbody>
|
</nz-table>
|
</nz-card>
|
<div [ngStyle]="{'background-color':'#f5f7fa','width':'110%','left':'-5%','height':'20px','position':'relative'}"></div>
|
<nz-card [nzBordered]="false" nzTitle="报警方式" formGroupName="alarmMode">
|
<label nz-checkbox formControlName="enable">
|
<span>启用报警</span>
|
</label>
|
<div [ngStyle]="{'margin-left': '20%'}">
|
<br/>
|
<br/>
|
<br/>
|
<div *ngFor="let i of [1,2,3]" nz-form-item nz-row class="mb-sm">
|
<div nz-form-label nz-col [nzSm]="3" [nzXs]="24">
|
<span [ngSwitch]="i">
|
<label *ngSwitchCase="1">一级报警方式:</label>
|
<label *ngSwitchCase="2">二级报警方式:</label>
|
<label *ngSwitchCase="3">三级报警方式:</label>
|
</span>
|
</div>
|
<div nz-form-control nz-col [nzSpan]="12" nzHasFeedback>
|
<nz-select formControlName="{{ 'level'+i }}" [nzMode]="'multiple'" [nzPlaceHolder]="'选择 报警方式'" [nzNotFoundContent]="'无法找到'"
|
nzDisabled="{{ !f.value['alarmMode']['enable'] }}">
|
<nz-option *ngFor="let option of alarmModes" [nzLabel]="option.label" [nzValue]="option.value" [nzDisabled]="option.disabled">
|
</nz-option>
|
</nz-select>
|
</div>
|
<br/>
|
<br/>
|
<br/>
|
</div>
|
</div>
|
</nz-card>
|
<footer-toolbar errorCollect>
|
<span [ngStyle]="{'color':'red','width':'300px','margin-right':'40px'}">{{ errorMessage }}</span>
|
<label>组织名称:</label>
|
<span [ngStyle]="{'font-size': '16px','font-weight': 'bold','margin-right':'30px'}">{{ organization.name }}</span>
|
<button nz-button type="button" (click)="backToList()">返回</button>
|
<button nz-button [nzType]="'primary'" [nzLoading]="isSaving">
|
<span>
|
保存
|
<span *ngIf="isSaving">中</span>
|
</span>
|
</button>
|
</footer-toolbar>
|
</form>
|