<!--监控项列表-->
<div nz-row class="breadcrumbs">
  <div nz-col nzSpan="16">
    <nz-breadcrumb class="padding-8-0">
      <nz-breadcrumb-item>
        首页
      </nz-breadcrumb-item>
      <nz-breadcrumb-item>
        <a>综合监控</a>
      </nz-breadcrumb-item>
      <nz-breadcrumb-item>
        模版配置
      </nz-breadcrumb-item>
      <nz-breadcrumb-item>
        模版：{{tempName}}
      </nz-breadcrumb-item>
      <nz-breadcrumb-item>
        监控项
      </nz-breadcrumb-item>
    </nz-breadcrumb>
  </div>
  <div nz-col nzSpan="8" class="text-right">
    <button (click)="ngOnInit()" nz-button nzType="primary"><i class="anticon anticon-sync"></i></button>
    <smart-full-screen></smart-full-screen>
  </div>
</div>
<div nz-row [nzGutter]="4" class="search-form">
  <div nz-col nzSpan="3">
    <button (click)="showAddModal()" nz-button nzType="default"><i class="anticon anticon-plus-circle-o"></i>添加监控项</button>
  </div>
  <div nz-col nzSpan="15"></div>
  <div nz-col nzSpan="6">
    <input (keyup.enter)="getCheckList()" style="width: 200px;" type="text" nz-input [(ngModel)]="searchName" placeholder="输入监测点名称">
    <button (click)="getCheckList()" nz-button nzType="default"><i class="anticon anticon-search"
                                                                   style="color: #6097b7"></i>搜索</button>
    <!--<button (click)="deleteBatchCheck()" nz-button nzType="default"><i class="anticon anticon-close-circle-o"></i>批量删除</button>-->
  </div>
</div>

<div nz-row>
  <div class="padding-15-0">
    <nz-radio-group [(ngModel)]="itemTypeValue" [nzButtonStyle]="'solid'">
      <label *ngFor="let item of itemTypeList" (click)="changeType(item)" nz-radio-button nzValue="{{item.applicationid}}">{{item.name}}</label>
    </nz-radio-group>
  </div>
  <nz-table #checkTable [nzData]="checkList" [nzFrontPagination]="false" [nzTotal]="totalNum" [nzPageIndex]="pageIndex" [nzPageSize]="pageSize" (nzPageIndexChange)="change($event)" [nzLoading]="loading">
    <thead>
    <tr>
      <th nzWidth="250px">监测点名称</th>
      <th>监测点分类</th>
      <th>更新时间间隔</th>
      <th nzWidth="250px">操作</th>
    </tr>
    </thead>
    <tbody>
    <tr *ngFor="let data of checkTable.data">
      <td class="tag-form">
        <ng-container *ngIf="data.status == 0">
          <nz-tag *ngIf="data.priority == 4 || data.priority == 5" class="tag-red" [nzColor]="color.red"></nz-tag>
          <nz-tag *ngIf="data.priority == 2 || data.priority == 3" class="tag-yellow" [nzColor]="color.yellow"></nz-tag>
          <ng-container *ngIf="data.priority != 2 && data.priority != 3 && data.priority != 4 && data.priority != 5">
            <nz-tag class="tag-green" [nzColor]="color.green"></nz-tag>
          </ng-container>
        </ng-container>
        <ng-container *ngIf="data.status == 1">
          <nz-tag class="tag-gray" [nzColor]="color.gray"></nz-tag>
        </ng-container>
        {{data.name}}</td>
      <td>{{data.itemType}}</td>
      <td>{{data.delay}}</td>
      <td class="handle cursor main-color">
        <ng-container *ngIf="!data.flags">
          <span (click)="showEditModal(data)">编辑监测点</span>
          <span (click)="deleteCheckItem(data)">删除监测点</span>
          <br>
        </ng-container>
        <span *ngIf="data.status == 0 && data.state==0" (click)="updateItem(data.itemid,1)" style="color: red">停止</span>
        <span *ngIf="data.status == 0 && data.state==1" (click)="updateItem(data.itemid,1)" style="color: red">不支持的</span>
        <span *ngIf="data.status == 1 && data.state==0" (click)="updateItem(data.itemid,0)" style="color: green">启用</span>
        <span *ngIf="data.status == 1 && data.state==1" (click)="updateItem(data.itemid,0)" style="color: green">启用</span>
      </td>
    </tr>
    </tbody>
  </nz-table>
</div>

<!--监控项-->
<smart-basi-check #smartBasiCheck (done)="getList()"></smart-basi-check>
