<div class="searchBar" @fade>
  <app-search-item [label]="'moduleName' | translate" [(value)]="moduleName"></app-search-item>
  <div class="btnLine">
    <button nz-button class="searchBtn" [nzType]="'primary'" [nzLoading]="isLoading" (click)="onSearch()"><span>{{'search' | translate}}</span></button>
    <button nz-button class="searchBtn" [nzLoading]="isLoading" (click)="onGetAll()"><span>{{'allData' | translate}}</span></button>
    <button nz-button class="searchBtn" [nzLoading]="isLoading" (click)="add()"><span>{{'add' | translate}}</span></button>
  </div>
</div>
<div class="tableBar" @fade>
  <nz-table #nzTable
            [nzData]="data"
            [nzSize]="'middle'"
            nzShowSizeChanger
            [nzLoading]="isLoading">
    <thead nz-thead>
    <tr>
      <th nz-th><span>{{'num' | translate}}</span></th>
      <th nz-th><span>{{'moduleName' | translate}}</span></th>
      <th nz-th><span>{{'wayNum' | translate}}</span></th>
      <th nz-th><span>{{'remark' | translate}}</span></th>
      <th nz-th><span>{{'oper' | translate}}</span></th>
    </tr>
    </thead>
    <tbody nz-tbody>
    <tr *ngFor="let one of nzTable.data, let i = index">
      <td nz-td>{{i + 1}}</td>
      <td nz-td class="canClick" (click)="toDetail(one)">{{one.probesModelName}}</td>
      <td nz-td>{{one.counts}}</td>
      <td nz-td>{{one.remark}}</td>
      <td nz-td>
        <span class="editSpan" (click)="update(one)">{{'update' | translate}}</span>
        <nz-divider nzType="vertical"></nz-divider>
        <span class="deleteFontColor" (click)="deleteConfirm(one)">{{'delete' | translate}}</span>
        <nz-divider nzType="vertical"></nz-divider>
        <span class="addSpan" (click)="saveOther(one)">{{'saveOther' | translate}}</span>
      </td>
    </tr>
    </tbody>
  </nz-table>
</div>
<nz-modal [(nzVisible)]="isAddConV" [nzContent]="con1" nzWidth="500"
          [nzFooter]="foot1" [nzTitle]="isUpdate ? ('update' | translate) : ('add' | translate)" (nzOnCancel)="cancel('isAddConV')" nzMaskClosable="false">
  <ng-template #con1>
    <app-search-item inModal="true" isMust="true" [label]="'moduleName' | translate" [(value)]="req.probesModelName"></app-search-item>
    <app-search-item *ngIf="!isUpdate" isMust="true" inModal="true" [label]="'wayNum' | translate" [(value)]="req.num"></app-search-item>
    <app-search-item inModal="true" [label]="'remark' | translate" [(value)]="req.remark"></app-search-item>
  </ng-template>
  <ng-template #foot1>
    <button nz-button nzType="default" [nzLoading]="isLoading" (click)="cancel('isAddConV')"><span>{{'cancel' | translate}}</span></button>
    <button nz-button nzType="primary" class="searchBtn" [nzLoading]="isLoading" (click)="save('req')"><span>{{'confirm' | translate}}</span></button>
  </ng-template>
</nz-modal>

<nz-modal [(nzVisible)]="isSaveOther" [nzContent]="con2" nzWidth="500" [nzTitle]="'isSaveOtherProbesModel' | translate"
          [nzFooter]="foot2" (nzOnCancel)="cancel('isSaveOther')" nzMaskClosable="false">
  <ng-template #con2>
    <app-search-item inModal="true" isMust="true" [label]="'moduleName' | translate" [(value)]="req2.newProbesModelName"></app-search-item>
    <!--<app-search-select isMust="true" inModal="true" [(value)]="req2.companyNo" [label]="'selectCompany' | translate" optL="companyName"-->
                       <!--[data]="companys" optV="companyNo"></app-search-select>-->
  </ng-template>
  <ng-template #foot2>
    <button nz-button nzType="default" [nzLoading]="isLoading" (click)="cancel('isSaveOther')"><span>{{'cancel' | translate}}</span></button>
    <button nz-button nzType="primary" class="searchBtn" [nzLoading]="isLoading" (click)="save('req2')"><span>{{'confirm' | translate}}</span></button>
  </ng-template>
</nz-modal>
