<!--
 * @Author: your name
 * @Date: 2021-11-29 15:22:34
 * @LastEditTime : 2022-04-20 17:06:02
 * @LastEditors  : Shiming
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath     : \\tms-obc-web\\src\\app\\routes\\vehicle\\components\\audit\\audit.component.html
-->
<!-- 页头 -->
<page-header-wrapper></page-header-wrapper>
<nz-card>
  <!-- 搜索区 -->
  <!-- 搜索表单 -->
  <div nz-row nzGutter="8">
    <!-- 查询字段小于或等于3个时，不显示伸缩按钮 -->
    <div nz-col nzSpan="24" *ngIf="queryFieldCount <= 4">
      <sf #sf [schema]="schema" [ui]="ui" [mode]="'search'" [disabled]="!sf?.valid" (formSubmit)="st?.load(1)"
        (formReset)="resetSF()"></sf>

    </div>
    <!-- [loading]="false" -->

    <!-- 查询字段大于3个时，根据展开状态调整布局 -->
    <ng-container *ngIf="queryFieldCount > 4">
      <div nz-col [nzSpan]="_$expand ? 24 : 18">
        <sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
      </div>
      <div nz-col [nzSpan]="_$expand ? 24 : 6" class="text-right">
        <button nz-button nzType="primary" acl [acl-ability]="['VEHICLE-AUDIT-search']"
          [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
        <button nz-button nzType="primary" [disabled]="false" (click)="exportFire()">导出</button>
        <button nz-button [disabled]="false" (click)="resetSF()">重置</button>
        <button nz-button nzType="link" (click)="expandToggle()">
          {{ !_$expand ? '展开' : '收起' }}
          <i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
        </button>
      </div>
    </ng-container>
  </div>
</nz-card>
<nz-card>
  <!-- 数据列表 -->
  <!-- [data]="service.$api_get_supplier_page" -->
  <nz-tabset (nzSelectedIndexChange)="selectChange($event)" [nzSelectedIndex]='defaultTabs'
    [nzTabBarExtraContent]="extraTemplate">
    <nz-tab [nzTitle]="'全部'"></nz-tab>
    <nz-tab [nzTitle]="'待审核'"></nz-tab>
    <nz-tab [nzTitle]="'审核通过'"></nz-tab>
    <nz-tab [nzTitle]="'驳回'"></nz-tab>
  </nz-tabset>
  <st #st [bordered]="true" [scroll]="{ x: '1200px' }" [columns]="columns" [data]='service.$api_get_userCarLicense_list'
    [req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
    [res]="{ reName: { list: 'data.records', total: 'data.total' }, process: dataProcess }"
    [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }" [loading]="false">
    <ng-template st-row="carLength" let-item let-index="index">
      <div>{{item?.carModel}}-{{item?.carLengthLabel? item?.carLengthLabel + '米' : ''}}-{{ item?.carLoad?
        item?.carLoad + '吨' : ''}}</div>
    </ng-template>
    <ng-template st-row="isSelf" let-item let-index="index">
      <div>{{item?.isSelf ? '是' : '否'}}</div>
    </ng-template>
    <ng-template st-row="contactsPhone" let-item let-index="index">
      <div style="color: #52c41a;" (click)="daoyun(item)">
        {{ item.contactsPhone }}
      </div>
    </ng-template>
    <ng-template st-row="stateCol" let-item let-index="index">
      <nz-tag *ngIf="item.stateLocked" nzColor="error">冻结</nz-tag>
      <nz-tag *elseBlock nzColor="success">正常</nz-tag>
    </ng-template>
  </st>
</nz-card>
<ng-template #extraTemplate>
  <!-- 工具栏 -->
  <div class="toolbar" style="float: right;
    padding-bottom: 15px;">
    <button nz-button nzType="primary" (click)="addModal()">添加车辆</button>
  </div>
</ng-template>
