<div class="mainCon" style="padding-top: 45px;">
    <Navbar [leftContent]="icon"
            (onLeftClick)="onLeftClick()"
            [rightContent]="r"
            style="background-color: #28c9bd;position: fixed;top: 0;width: 100%;z-index: 2;"
    >
        {{fieldRegionName}}控制
    </Navbar>
    <ng-template #r>
        <span (click)="pullToRefresh()">刷新</span>
    </ng-template>
    <div class="topPart">
        <ListItem multipleLine *ngIf="yewei || yewei === 0">
            当前液位:
            <div class="process">
                <div [class]="'inlineProcess ' + color" [ngStyle]="{width: proc + '%'}">
                </div>
            </div>
            {{yewei.toFixed(2)}}m
        </ListItem>
        <ListItem multipleLine *ngIf="temp || temp === 0">
            当前温度:
            <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>
</div>
<ng-template #icon>
    <span class="vo v-back"></span>
</ng-template>
