<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 lines="full">
    <i class="vo v-yue{{curDate}}"></i>
    <span style="margin-left: 100px; font-size:15px"> 开启时间     {{on}}<br><br>关闭时间     {{off}}</span>
  </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="devices" lines="full" insert="false">
    <ion-label>一键控制</ion-label>
<!--    <ion-toggle slot="end" [checked]="batchSwitch.op"></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>
