<div class="mainCon">
    <Navbar [leftContent]="icon"
            (onLeftClick)="onLeftClick()"
            style="background-color: #28c9bd"
    >
        {{fieldRegionName}}控制
    </Navbar>
    <PullToRefresh [direction]="state.direction"
                   [(ngModel)]="state.refreshState"
                   [endReachedRefresh]="state.endReachedRefresh"
                   (onRefresh)="pullToRefresh($event)"
                   style="min-height: calc(100% - 45px)"
    >
    <div class="topPart">
        <ListItem multipleLine *ngIf="this.yewei">
            当前液位:
            <div class="process">
                <div [class]="'inlineProcess ' + color" [ngStyle]="{width: proc + '%'}">
                </div>
            </div>
            {{yewei.toFixed(2)}}m
        </ListItem>
        <ListItem multipleLine *ngIf="this.temp">
            当前温度:
            <div style="display: inline-block;margin-left: calc(100% - 145px);vertical-align: middle">
                {{temp.toFixed(2)}}℃
            </div>
        </ListItem>
    </div>
    <div class="bottomPart">
        <ListItem multipleLine *ngFor="let a of allBtns">
            一键控制{{a.l}}
            <v-switch [value]="a.v" (click)="allCheck(a)" [loading]="a.d"></v-switch>
        </ListItem>
    </div>
    <div class="bottomPart">
        <ListItem multipleLine *ngFor="let a of devices;let i = index">
            {{a.fieldDeviceName}}
            <v-switch [value]="a.value" (click)="toggle(a)" [loading]="a.loading"></v-switch>
        </ListItem>
    </div>
    </PullToRefresh>
</div>
<ng-template #icon>
    <span class="vo v-back"></span>
</ng-template>
