<nz-table
  class="precaution-table"
  #table
  [nzData]="list"
  nzShowPagination
  nzPaginationType="small"
  [nzFrontPagination]="false"
  [nzTotal]="pageConfig.total"
  [nzPageIndex]="pageConfig.page + 1"
  (nzPageIndexChange)="onCurrentPageChange($event - 1)"
>
  <thead>
    <tr>
      <th>企业名称</th>
      <th>更新风险类别</th>
      <th>更新原因</th>
      <th>查看变更内容</th>
      <th>更新人</th>
      <th>更新日期</th>
    </tr>
  </thead>
  <tbody>
    @for (data of table.data; track $index) {
      <tr>
        <td>{{ data.company }}</td>
        <td>{{ getTypeText(data) + ' - ' + getCategoryText(data) }}</td>
        <td>{{ data.updateReason }}</td>
        <td>
          <button nz-button nzType="link" (click)="showDetail(data)">查看详情</button>
        </td>
        <td>{{ data.updateBy }}</td>
        <td>{{ data.updatedDate | date: 'yyyy-MM-dd HH:mm' }}</td>
      </tr>
    }
  </tbody>
</nz-table>

<ng-template #detailTpl>
  <risk-item-detail [data]="recordData" [loading]="loadingRecord" [isCompare]="true"></risk-item-detail>
</ng-template>
