<ion-header mode="ios">
  <ion-toolbar color="gray">
    <ion-buttons slot="start">
      <ion-back-button color="secondary" defaultHref="/index" text=""></ion-back-button>
    </ion-buttons>
    <!--<ion-searchbar (ionInput)="getItems($event)" (ionClear)="resetItems()" debounce="1000" style="height: 40px;"></ion-searchbar>-->
    <ion-searchbar (ionInput)="getItems($event)" debounce="1000" style="height: 40px;"></ion-searchbar>

    <!--<ion-searchbar debounce="1000" style="height: 40px;"></ion-searchbar>-->
      <!--<ion-searchbar (ionInput)="getItems($event)" [(ngModel)]="searchItem"></ion-searchbar>-->
    <!--<div class="topSearch">
      <SearchBar [placeholder]="'点击此处进行搜索'" [(ngModel)]="searchText"
                 (onCancel)="searchText ='';toggleFocus(false);"
                 [setFocus]="false" (onFocus)="toggleFocus(true)" (onBlur)="toggleFocus(false)"
                 (onClear)="searchText ='';toggleFocus(false);"></SearchBar>
    </div>-->
  </ion-toolbar>
  <!--<v-search *ngIf="ifFocus" [(value)]="searchText"></v-search>-->
  <ion-slides style="width: 100%; height: 125px;" mode="ios"
              [options]="lunbo" #slide (ionSlideTouchEnd)="slideDidChange()">
    <ion-slide class="slideCon" *ngFor="let one of imgs">
      <div class="inBox">
        <img [src]="'../../../../assets/lunbo/' + one">
      </div>
    </ion-slide>
  </ion-slides>

</ion-header>
<ion-content color='light'>
  <ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
    <ion-refresher-content></ion-refresher-content>
  </ion-refresher>
  <h1 style="
            font-size: 16px;
            padding-left: 5px;
            border-left: 5px solid #28c9bd;
            line-height: 25px;
            margin-bottom: 5px;">故障统计</h1>
  <div style="margin-left:1%">
  <v-kanban class="home-bar" name="热应激" [inData]="thiGood" iconClass="vo v-youxuan" iconColor="#3e9058" iconSize="25px" fontSize="25px"></v-kanban>
  <v-kanban class="home-bar" name="热应激" [inData]="thiBad" iconClass="vo v-yujing" iconColor="#FAB139" iconSize="25px" fontSize="25px"></v-kanban>
  <v-kanban class="home-bar" name="故障总数" [inData]="alarmTotal" iconClass="vo v-guzhang2" iconColor="#B23706" iconSize="25px" fontSize="25px"></v-kanban>
  </div>
  <h1 style="
            font-size: 16px;
            padding-left: 5px;
            border-left: 5px solid #28c9bd;
            line-height: 25px;
            margin-bottom: 5px;">牛舍列表</h1>
  <ion-list *ngIf="items.length > 0" mode="md" class="listview" insert = "false" line="none" style="width:96%;margin-left: 2%">
    <ion-item *ngFor="let item of items" (click)="toControl(item)" class="ion-item" style="width: 100%; --padding-start: 0px">
      <div class="item">
        <div class="top">
          <i *ngIf="item.alarm" class="vo v-tixing"></i> {{item.fieldRegionName}}
        </div>
        <div class="content">
          <span *ngIf="item.temp">温度: &nbsp;&nbsp;{{item.temp}} ℃ &nbsp;&nbsp;</span>
          <span *ngIf="item.humi">湿度: &nbsp;&nbsp;{{item.humi}} %  &nbsp;&nbsp;</span>
          <span *ngIf="item.heatStressLevel">热应激等级: &nbsp;&nbsp;<span class="warmColor{{item.heatStressLevel}}">{{item.heatStressLevelName}}</span></span>
        </div>
        <div class="bottom">
          <span [ngClass]="{'online': item.online, 'offline': !item.online}">{{item.online ? '在线' : '离线'}}    </span>
          <span *ngIf="item.operationModel" class="online">{{item.operationModel ? '远控' :'现控'}}    </span>
          <span *ngIf="item.operationModel" [ngClass]="{'online': item.isWisdomModel, 'offline': !item.isWisdomModel}" class="online">智控    </span>
          <span *ngIf="item.ts" class="right">{{item.ts | date: 'yyyy-MM-dd HH:mm'}}</span>
        </div>
      </div>
    </ion-item>
  </ion-list>
</ion-content>
