<!-- start 面包屑 -->
<app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 -->
<!--条件搜索-->

<div class="inner-content">
  <span>共计 {{dataArray.length}} 条数据</span>
  <div class="operating-button">
  </div>

  <!--数组表格 -->
  <nz-table #basicTable
            [nzData]="dataArray"
            [nzTotal]="dataArray.length"
            [nzLoading]="tableLoading"
            [nzScroll]="{ x: '550px'}">
    <thead>
    <tr>
      <th nzWidth="100px">平台ID</th>
      <th nzWidth="100px">平台名称</th>
      <th nzWidth="100px">平台优先级
        <i nz-icon nz-tooltip nzTooltipTitle="平台使用优先级，数字越小优先级越高" nzType="question-circle" nzTheme="outline"></i>
      </th>
      <th nzWidth="100px">平台状态</th>
      <th nzWidth="150px" nzRight="0px">操作</th>
    </tr>
    </thead>
    <tbody>
    <tr *ngFor="let data of basicTable.data;let i = index">
      <td>{{data.id}}</td>
      <td>{{data.platformName}}</td>
      <td>{{data.sort}}</td>
      <td>
        <span *ngIf="data.status == 1">已启用</span>
        <span *ngIf="data.status == 2">未启用</span>
      </td>
      <td nzRight="0px" class="table-td-operation">
        <a (click)="showSortConfigModal(data)">修改优先级</a>
      </td>
    </tr>
    </tbody>
  </nz-table>
</div>

<nz-modal [nzVisible]="sortConfigModal" nzWidth="350px" nzTitle="修改{{this.platformForm.controls['platformName'].value}}优先级" [nzFooter]="null" (nzOnCancel)="closeSortConfigModal()">
  <ng-container *nzModalContent>
    <form nz-form [formGroup]="platformForm">
      <nz-form-item>
        <nz-form-label [nzSm]="6" nzRequired>优先级
          <i nz-icon nz-tooltip nzTooltipTitle="平台使用优先级，数字越小优先级越高" nzType="question-circle" nzTheme="outline"></i>
        </nz-form-label>
        <nz-form-control>
          <nz-form-control [nzSm]="24">
            <nz-input-number formControlName="sort" style="width: 100%;" [nzMin]="1" [nzMax]="99" [nzStep]="1"></nz-input-number>
          </nz-form-control>
        </nz-form-control>
      </nz-form-item>
    </form>
  </ng-container>
  <div style="text-align: center">
    <button nz-button nzType="primary" style="width: 100px;" (click)="saveSortConfig()">保存</button>
  </div>

</nz-modal>
