<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="3">
        <nz-select nzAllowClear style="width: 100%;" [(ngModel)]="obj.classification" nzPlaceHolder="全部分类">
            <ng-container *ngFor="let item of typeOneList">
                <nz-option [nzLabel]="item.label" [nzValue]="item.value"></nz-option>
            </ng-container>
        </nz-select>
    </div>
    <div nz-col nzSpan="3">
        <nz-select nzAllowClear style="width: 100%;" [(ngModel)]="obj.type" nzPlaceHolder="二类子项">
            <ng-container *ngFor="let item of typeList">
                <nz-option [nzLabel]="item.label" [nzValue]="item.value"></nz-option>
            </ng-container>
        </nz-select>
    </div>
    <div nz-col nzSpan="3" class="text-center">
        <button (click)="modal.isVisible = true" [nzLoading]="isDownload" nz-button nzType="default"><i
                class="anticon anticon-download"></i>模版下载
        </button>
    </div>
    <div nz-col nzSpan="3" class="text-center">
        <button (click)="showUploadModal()" nz-button nzType="default"><i class="anticon anticon-upload"></i>导入资产
        </button>
    </div>
    <div nz-col nzSpan="3" class="text-center">
        <button (click)="downLoad()" [nzLoading]="isDownload" nz-button nzType="default"><i
                class="anticon anticon-download"></i>导出资产
        </button>
    </div>
    <div nz-col nzSpan="8">
    </div>
</div>

<div nz-row [nzGutter]="4" class="search-form">
    <div nz-col nzSpan="3">
        <input type="text" nz-input [(ngModel)]="obj.name" placeholder="资产名称">
    </div>
    <div nz-col nzSpan="3" class="text-center">
        <input type="text" nz-input [(ngModel)]="obj.no" placeholder="资产编号">
    </div>
    <div nz-col nzSpan="3" class="text-center">
        <input type="text" nz-input [(ngModel)]="obj.attributionProject" placeholder="归属项目">
    </div>
    <div nz-col nzSpan="3">
        <input type="text" nz-input [(ngModel)]="obj.contacts" placeholder="负责人">
    </div>
    <div nz-col nzSpan="4">
        <button (click)="search()" nz-button nzType="default"><i class="anticon anticon-search"></i>搜索</button>
    </div>
    <div nz-col nzSpan="2">
    </div>
    <div nz-col nzSpan="2">
<!--        <button (click)="batchDelete()" nz-button nzType="default"><i class="anticon anticon-close-circle-o"></i>批量删除-->
<!--        </button>-->
    </div>
    <div nz-col nzOffset="2" nzSpan="2">
        <button (click)="showAddModal()" nz-button nzType="default"><i class="anticon anticon-plus-circle-o"></i>添加
        </button>
    </div>
</div>

<nz-table #nzTable [nzData]="dataSet" [nzLoading]="isLoading" [nzFrontPagination]="false" [nzTotal]="totalNum"
          [nzPageIndex]="pageNum" [nzPageSize]="pageCount" (nzPageIndexChange)="change($event)">
    <thead>
    <tr>
        <th nzShowCheckbox [(nzChecked)]="allChecked" [nzIndeterminate]="indeterminate"
            (nzCheckedChange)="checkAll($event)"></th>
        <th >设备编码</th>
        <th nzWidth="15%">资产名称</th>
        <th>资产分类</th>
        <th>版本型号</th>
        <th>操作系统</th>
        <th>内部ip地址</th>
        <th>cpu核数</th>
        <th>内存数</th>
        <th nzWidth="10%">操作</th>
    </tr>
    </thead>
    <tbody>
    <tr *ngFor="let data of nzTable.data">
        <td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="selectItem(data,$event)"></td>
        <td>{{data.equipmentCode}}</td>
        <td>{{data.name}}</td>
        <td>{{data.classification || '信息化设备'}}</td>
        <td>{{data.versionMode}}</td>
        <td>{{data.operatingSystem}}</td>
        <td>{{data.ipInternalAddress}}</td>
        <td>{{data.cpuMultiNumber}}</td>
        <td>{{data.memoryCount}}</td>
        <td class="handle main-color">
            <span *ngIf="data.status == 1" (click)="lookEvent(data)">查看</span>
            <span (click)="showEditModal(data)">编辑</span>
            <span class="handle-delete" (click)="deleteHandle(data)">删除</span>
        </td>
    </tr>
    </tbody>
</nz-table>
<!--导入资产-->
<smart-upload-asset #smartUploadAsset (done)="getList()"></smart-upload-asset>
<!--添加资产-->
<smart-create-property #smartCreateProperty (done)="getList()"></smart-create-property>

<!--添加图片-->
<nz-modal [nzMaskClosable]="false" [nzWidth]="620" [(nzVisible)]="modal.isVisible" [nzTitle]="'模版下载'" (nzOnCancel)="modal.isVisible = false"
          (nzOnOk)="handleOk()" [nzOkLoading]="isDownload">
    <div>
        <nz-form-item>
            <nz-form-label [nzSpan]="7" nzRequired nzFor="equipmentTypeid">模版类型</nz-form-label>
            <nz-form-control [nzSpan]="17">
                <nz-radio-group [(ngModel)]="modal.modalType">
                    <label *ngFor="let item of typeList" (click)="search()" nz-radio-button
                           [nzValue]="item.value">{{item.label}}</label>
                </nz-radio-group>
            </nz-form-control>
        </nz-form-item>
    </div>
</nz-modal>
