<ion-header style="background-color: #F3F4F4;">

</ion-header>

<ion-content  color='light' style="height: 100%">
  <h1 style="
            font-size: 16px;
            padding-left: 5px;
            border-left: 5px solid #28c9bd;
            line-height: 25px;
            margin-bottom: 5px;">模式状态</h1>
  <ion-item lines="full">
    <ion-label>运行模式</ion-label>
    <ion-select multiple="false" cancelText="取消" okText="确认" [(ngModel)]="controlModel" disabled="true">
      <ion-select-option *ngFor="let option of controlModelOptions" [value]="option.modelId">{{option.modelValue}}</ion-select-option>
    </ion-select>
  </ion-item>
  <h1 style="
            font-size: 16px;
            padding-left: 5px;
            border-left: 5px solid #28c9bd;
            line-height: 25px;
            margin-bottom: 5px;">控制/状态</h1>
  <ion-item *ngIf="batchSwitch" lines="full" insert="false">
    <ion-label>一键控制</ion-label>
    <!--<ion-toggle slot="end" [checked]="batchSwitch.op" [disabled]="batchSwitch.s"></ion-toggle>-->
    <v-switch (click)="allCheck(batchSwitch)" [value]="batchSwitch.op" [disabled]="batchSwitch.disabled" [loading]="batchSwitch.load"></v-switch>
  </ion-item>
  <div>
    <ion-card *ngFor="let device of devices" class="card" color="white">
      <ion-card-header>
        <ion-card-subtitle align="center">{{device.fieldDeviceName}}</ion-card-subtitle>
      </ion-card-header>

      <ion-card-content>
        <!--<ion-toggle slot="middle" [checked]="device.state"></ion-toggle>-->
        <v-switch class="btn-switch" (click)="deviceCheck(device)" [value]="device.state" [disabled]="device.disabled" [loading]="device.load"></v-switch>
      </ion-card-content>
    </ion-card>
  </div>
</ion-content>
