<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>
    </div>
</div>
<div nz-row [nzGutter]="4" class="search-form">
    <div nz-col nzSpan="14">
        预警级别:
        <nz-radio-group [(ngModel)]="obj.level">
            <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="3">
        <button (click)="handleAddModal()"
                nz-button nzType="default"><i class="anticon anticon-plus-circle-o"></i>新增预警规则
        </button>
    </div>
    <div nz-col nzSpan="5">
        <input type="text" (keyup.enter)="search()" nz-input [(ngModel)]="obj.keyword" placeholder="预警名称、预警内容、触发规则、创建人">
    </div>
    <div nz-col nzSpan="2">
        <button (click)="search()"
                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 nzWidth="20%">规则名称</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.name}}</td>
        <td>
            <span *ngIf="data.type == 1">资源预警</span>
            <span *ngIf="data.type == 2">业务预警</span>
            <span *ngIf="data.type == 3">工作预警</span>
        </td>
        <td>
            <span *ngIf="data.level == '1'">一般</span>
            <span *ngIf="data.level == '9'">严重</span>
        </td>
        <td>
            {{data.content}}
        </td>
        <td>{{data.createUser}}</td>
        <td>{{data.createTime}}</td>
        <td class="handle main-color">
<!--            <span>查看</span>-->
            <span (click)="handleLook(data)">查看</span>
            <span (click)="handleDelete(data)">删除</span>
        </td>
    </tr>
    </tbody>
</nz-table>
<smart-warnging-rule #smartWarningRule (done)="getList()"></smart-warnging-rule>
<smart-warning-rule-look #smartWarningRuleLook></smart-warning-rule-look>
