<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>
  </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="6">
    预警级别:
    <nz-radio-group [(ngModel)]="obj.ruleLevel">
      <label *ngFor="let item of warning_leavel" (click)="search()" nz-radio-button
             [nzValue]="item.value">{{item.label}}</label>
    </nz-radio-group>
  </div>
  <div nz-col nzSpan="10">
    预警时间:
    <nz-radio-group [(ngModel)]="time.timeType" (ngModelChange)="changeTimeType($event)">
      <label *ngFor="let item of warning_time" nz-radio-button
             [nzValue]="item.value">{{item.label}}</label>
    </nz-radio-group>
  </div>
  <div nz-col nzSpan="8">
    <ng-container *ngIf="time.timeType == '99'">
      <nz-date-picker
              nzFormat="yyyy-MM-dd"
              [(ngModel)]="time.startTime"
              nzPlaceHolder="开始时间"></nz-date-picker>
      <nz-date-picker
              nzFormat="yyyy-MM-dd"
              [(ngModel)]="time.endTime"
              nzPlaceHolder="结束时间"></nz-date-picker>
    </ng-container>
  </div>
</div>
<div nz-row [nzGutter]="4" class="search-form">
  <div nz-col nzSpan="10">
    <input type="text" (keyup.enter)="search()" nz-input [(ngModel)]="obj.keyword"
           placeholder="预警内容、触发规则、批注人、批注内容">
  </div>
  <div nz-col nzSpan="2">
    <button (click)="searchValue()"
            nz-button nzType="default"><i class="anticon anticon-search"></i>搜索
    </button>
  </div>
</div>
<nz-table #nzTable [nzData]="page.list" [nzLoading]="page.isLoading" [nzFrontPagination]="false"
          [nzTotal]="page.totalNum"
          [nzPageIndex]="page.pageNum" [nzPageSize]="page.pageCount" (nzPageIndexChange)="change($event)">
  <thead>
  <tr>
    <th>预警时间</th>
    <th>预警级别</th>
    <th>预警内容</th>
    <th>规则名称</th>
    <th>最新批注人</th>
    <th>批注内容</th>
    <th>操作</th>
  </tr>
  </thead>
  <tbody>
  <tr *ngFor="let data of nzTable.data">
    <td>{{data.createTime}}</td>
    <td>
      <span *ngIf="data.ruleLevel == 1">一般</span>
      <span *ngIf="data.ruleLevel == 2">严重</span>
    </td>
    <td>{{data.ruleContent}}</td>
    <td>{{data.ruleName}}</td>
    <td>{{data.newestRemarkPerson}}</td>
    <td>{{data.newestRemark}}</td>
    <td class="handle main-color">
      <span (click)="handleEdit(data)">添加批注</span>
      <span (click)="handleLook(data)">查看</span>
    </td>
  </tr>
  </tbody>
</nz-table>
<smart-notation #smartNotation (done)="getList()"></smart-notation>
