<div class="searchBar" @fade>
  <app-search-item [label]="'topicModuleName' | translate" [(value)]="topicModuleName"></app-search-item>
  <div class="btnLine">
    <button nz-button [nzType]="'primary'" class="searchBtn" [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>{{'topicModuleName' | translate}}</span></th>
      <th nz-th><span>{{'front' | translate}}</span></th>
      <th nz-th><span>{{'belongCompany' | translate}}</span></th>
      <th nz-th><span>{{'createTime' | 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.topicModelName}}</td>
      <td nz-td>{{one.prefixName}}</td>
      <td nz-td>{{one.companyName}}</td>
      <td nz-td>{{one.createTime | date: 'yyyy-MM-dd HH:mm:ss'}}</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" [nzTitle]="isUpdate ? ('update' | translate) : ('add' | translate)"
          [nzFooter]="foot1" (nzOnCancel)="cancel('isAddConV')" nzMaskClosable="false">
  <ng-template #con1>
    <app-search-item inModal="true" isMust="true" [label]="'topicModuleName' | translate" [(value)]="req.topicModelName"></app-search-item>
    <app-search-item isMust="true" inModal="true" [label]="'front' | translate" [(value)]="req.prefixName"></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]="'isSaveOtherTopicModel' | translate"
          [nzFooter]="foot2" (nzOnCancel)="cancel('isSaveOther')" nzMaskClosable="false">
  <ng-template #con2>
    <app-search-item inModal="true" isMust="true" [label]="'moduleName' | translate" [(value)]="req2.newTopicModelName"></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>
