<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>
        子分类详情
      </nz-breadcrumb-item>
      <nz-breadcrumb-item>
        资产详情
      </nz-breadcrumb-item>
    </nz-breadcrumb>
  </div>
  <div nz-col nzSpan="8" class="text-right">
    <button nz-button nzType="primary"><i class="anticon anticon-search"></i></button>
    <button nz-button nzType="primary"><i class="anticon anticon-sync"></i></button>
    <button nz-button nzType="primary"><i class="anticon anticon-arrows-alt"></i></button>
  </div>
</div>

<nz-tabset  class="tabs-smart ">
  <nz-tab #thirdTabs nzTitle="资产信息" >
    <div nz-form class="ant-advanced-search-form form-select">

      <div nz-row [nzGutter]="24">
        <div nz-col [nzSpan]="12">
          <nz-form-item nzFlex>
            <nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired nzFor="equipmentTypeid">资产编号
            </nz-form-label>
            <nz-form-control [nzSpan]="14">
              {{inventoryExtend?.name}}
              <button (click)="linkThen()" nz-button nzType="primary">关联</button>
            </nz-form-control>
          </nz-form-item>
        </div>

        <div nz-col [nzSpan]="12">
          <nz-form-item nzFlex>
            <nz-form-label [nzSpan]="6">负责人</nz-form-label>
            <nz-form-control [nzSpan]="14">
              {{inventoryExtend?.person}}
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>

      <div nz-row [nzGutter]="24">
        <div nz-col [nzSpan]="12">
          <nz-form-item nzFlex>
            <nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired nzFor="equipmentTypeid">资产名称
            </nz-form-label>
            <nz-form-control [nzSpan]="14">
              {{inventoryExtend?.name}}
            </nz-form-control>
          </nz-form-item>
        </div>

        <div nz-col [nzSpan]="12">
          <nz-form-item nzFlex>
            <nz-form-label [nzSpan]="6">负责人</nz-form-label>
            <nz-form-control [nzSpan]="14">
              {{inventoryExtend?.person}}
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>

      <div nz-row [nzGutter]="24">
        <div nz-col [nzSpan]="12">
          <nz-form-item nzFlex>
            <nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired nzFor="secondLevelType">资产数量
            </nz-form-label>
            <nz-form-control [nzSpan]="14">
              {{inventoryExtend?.inventorycount}}
            </nz-form-control>
          </nz-form-item>
        </div>

        <div nz-col [nzSpan]="12">
          <nz-form-item nzFlex>
            <nz-form-label [nzSpan]="6" nzFor="invertoryname">品牌</nz-form-label>
            <nz-form-control [nzSpan]="14">
              {{inventoryExtend?.invertoryname}}
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>

      <div nz-row [nzGutter]="24">
        <div nz-col [nzSpan]="12">
          <nz-form-item nzFlex>
            <nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired >库存</nz-form-label>
            <nz-form-control [nzSpan]="14">
              {{inventoryExtend?.stock}}
            </nz-form-control>
          </nz-form-item>
        </div>

        <div nz-col [nzSpan]="12">
          <nz-form-item nzFlex>
            <nz-form-label [nzSpan]="6" >型号</nz-form-label>
            <nz-form-control [nzSpan]="14">
              {{inventoryExtend?.serialnoA}}
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>

      <div nz-row [nzGutter]="24">
        <div nz-col [nzSpan]="12">
          <nz-form-item nzFlex>
            <nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired>使用</nz-form-label>
            <nz-form-control [nzSpan]="14">
              {{inventoryExtend?.usedcount}}
            </nz-form-control>
          </nz-form-item>
        </div>

        <div nz-col [nzSpan]="12">
          <nz-form-item nzFlex>
            <nz-form-label [nzSpan]="6" >MAC地址</nz-form-label>
            <nz-form-control [nzSpan]="14">
              {{inventoryExtend?.mac}}
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>
      <div nz-row [nzGutter]="24">
        <div nz-col [nzSpan]="12">
          <nz-form-item nzFlex>
            <nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired >借出</nz-form-label>
            <nz-form-control [nzSpan]="14">
              {{inventoryExtend?.lendcount}}
            </nz-form-control>
          </nz-form-item>
        </div>

        <div nz-col [nzSpan]="12">
          <nz-form-item nzFlex>
            <nz-form-label [nzSpan]="6">维保到期</nz-form-label>
            <nz-form-control [nzSpan]="14">
              {{inventoryExtend?.maintenanceExpiration}}
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>

      <div nz-row [nzGutter]="24">
        <div nz-col [nzSpan]="12">
          <nz-form-item nzFlex>
            <nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired>维修</nz-form-label>
            <nz-form-control [nzSpan]="14">
              {{inventoryExtend?.repaircount}}
            </nz-form-control>
          </nz-form-item>
        </div>

        <div nz-col [nzSpan]="12">
          <nz-form-item nzFlex>
            <nz-form-label [nzSpan]="6">存放地点</nz-form-label>
            <nz-form-control [nzSpan]="14">
              {{inventoryExtend?.storageLocation}}
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>

      <div nz-row [nzGutter]="24">
        <div nz-col [nzSpan]="12">
          <nz-form-item nzFlex>
            <nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired >报废</nz-form-label>
            <nz-form-control [nzSpan]="14">
              {{inventoryExtend?.scrapcount}}
              <!--<input nz-input placeholder="报废" name="scrapcount" [(ngModel)]="inventoryExtend?.scrapcount">-->
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>
      <div nz-row [nzGutter]="24">
        <div nz-col [nzSpan]="12">
          <nz-form-item nzFlex>
            <nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired >父分类
            </nz-form-label>
            <nz-form-control [nzSpan]="14">
            </nz-form-control>
          </nz-form-item>
        </div>

      </div>
      <div nz-row [nzGutter]="24">
        <div nz-col [nzSpan]="12">
          <nz-form-item nzFlex>
            <nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired >子分类
            </nz-form-label>
            <nz-form-control [nzSpan]="14">
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>
    </div>
  </nz-tab>
  <nz-tab #thirdTabs nzTitle="关联事件" >
    <nz-table #nzTable [nzData]="thingList" [nzFrontPagination]="false" [nzTotal]="totalNum" [nzPageIndex]="pageNum" [nzPageSize]="pageCount" (nzPageIndexChange)="change($event)" [nzLoading]="loading">
      <thead>
      <tr>
        <th nzShowSort>时间</th>
        <th>事件编号</th>
        <th>标题</th>
        <th nzWidth="15%">事件来源</th>
        <th>事件分类</th>
        <th>处理人</th>
        <th>状态</th>
        <th style="text-align: center">发送记录</th>
      </tr>
      </thead>
      <tbody>
      <tr *ngFor="let data of thingList">
        <td class="table-timeline">
          <nz-timeline-item>{{data.clock}}</nz-timeline-item>
        </td>
        <td class="round-tag tag-form">
          <nz-tag *ngIf="data.priority == 4 || data.priority == 5" [nzColor]="'#fc0d1b'"></nz-tag>
          <nz-tag *ngIf="data.priority == 2 || data.priority == 3" [nzColor]="'#fd9827'"></nz-tag>
        </td>
        <td>{{data.hostname}}</td>
        <td>{{data.description}}</td>
        <td>{{data.equipmentType}}</td>
        <td>{{data.continuedTime}}</td>
        <td>
          <ng-container *ngIf="data.r_clock">已恢复</ng-container>
          <ng-container *ngIf="!data.r_clock">告警中</ng-container>
        </td>
        <td class="list-icon"><i class="anticon anticon-profile"></i></td>
      </tr>
      </tbody>
    </nz-table>

  </nz-tab>
</nz-tabset>

<!--选择资源-->
<smart-device #smartDevice (done)="setLink($event)"></smart-device>
