<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 (click)="ngOnInit()" nz-button nzType="primary"><i class="anticon anticon-sync"></i></button>
    <smart-full-screen></smart-full-screen>
  </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.createTime  | date:"yyyy-MM-dd HH:mm:ss"}}}}</nz-timeline-item>
        </td>
        <td class="round-tag tag-form">
            {{data.id}}
        </td>
        <td>{{data.title}}</td>
        <td>
          <span *ngIf="data.source == 0">系统告警</span>
          <span *ngIf="data.source == 1">手动新增</span>
        </td>
        <td>{{data.typeName}}</td>
        <td>
          {{data.operators[0]?.username}}
        </td>
        <td>
          <ng-container *ngIf="data.status == 0">待处理</ng-container>
          <ng-container *ngIf="data.status == 1">已结束</ng-container>
        </td>
        <td class="list-icon ">
          <span class="cursor" *ngIf="data.status == 1" (click)="lookEvent(data)">查看</span>
        </td>
      </tr>
      </tbody>
    </nz-table>

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


<!--选择资源-->
<smart-select-group #smartSelectGroup (done)="setLink($event)"></smart-select-group>
