<!--
 * @Author: your name
 * @Date: 2021-11-29 15:22:34
 * @LastEditTime: 2021-12-10 10:48:13
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \tms-obc-web\src\app\routes\usercenter\components\freight\list\list.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]="service.http.loading" -->

    <!-- 查询字段大于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]="_$expand">
        <button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">导出</button>
        <button nz-button nzType="primary" [disabled]="!sf.valid" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
        <button nz-button (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" -->

  <st
    #st
    [bordered]="true"
    [columns]="columns"
    [data]='service.$api_get_operate_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] }"
    [loadingDelay]="500"
    [loading]="service.http.loading"
  >
    <ng-template st-row="carLength" let-item let-index="index">
    <div>{{item?.carModel}}-{{item?.carLength?  item?.carLength + '米' : ''}}-{{ item?.carLoad? item?.carLoad + '吨' : ''}}</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>
