<div class="searchDataWrap">
  <div class="searchData">
    <div class="searchDataItem">
      <span class="label">建单时间</span>：
      <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
      </nz-range-picker>
    </div>
    <div class="searchDataItem">
      <span class="label">分组</span>：
      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeGroupInp($event)" nzAllowClear nzPlaceHolder="请选择分组" [(ngModel)]="groupId" (nzOpenChange)="openChangeGroup($event)">
        <ng-container *ngFor="let option of groupList">
          <nz-option *ngIf="!isLoading" [nzLabel]="option.groupName" [nzValue]="option.id"></nz-option>
        </ng-container>
        <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
          <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
        </nz-option>
      </nz-select>
    </div>
  </div>
  <div class="operation">
    <i class="icon_transport transport-gengduo" (click)="showMore()"></i>
    <button nz-button class="btn default" (click)="search()">查询</button>
    <button nz-button class="btn default ml8" (click)="reset()">重置</button>
    <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
  </div>
</div>
<div class="moreFilter" *ngIf="fieldConfig.fields.buildingDTO || fieldConfig.fields.deptDTO">
  <span>{{fieldConfig.fields.buildingDTO?.buildingName}}</span>
  <span>{{fieldConfig.fields.deptDTO?.dept}}</span>
</div>
<nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
  <thead (nzSortChange)="sort($event)" nzSingleSort>
    <tr>
      <th nzWidth="12%">人员(编码)</th>
      <th nzWidth="11%" nzShowSort nzSortKey="totalCount" [(nzSort)]="sortCurrent.totalCount">工单数量</th>
      <th nzWidth="11%" nzShowSort nzSortKey="totalGrade" [(nzSort)]="sortCurrent.totalGrade">总积分</th>
      <th nzWidth="11%" nzShowSort nzSortKey="response_time_num" [(nzSort)]="sortCurrent.response_time_num">平均响应时间</th>
      <th nzWidth="11%" nzShowSort nzSortKey="execution_time_num" [(nzSort)]="sortCurrent.execution_time_num">平均送达时间</th>
      <th nzWidth="11%" nzShowSort nzSortKey="aveper" [(nzSort)]="sortCurrent.aveper">按时完成达标率</th>
      <th nzWidth="11%" nzShowSort nzSortKey="total_time" [(nzSort)]="sortCurrent.total_time">平均总时间</th>
      <th nzWidth="11%" nzShowSort nzSortKey="five_count" [(nzSort)]="sortCurrent.five_count">五分钟内工单</th>
      <th nzWidth="11%" nzShowSort nzSortKey="special_close" [(nzSort)]="sortCurrent.special_close">特殊关闭数</th>
    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let data of listOfData">
      <td>{{ data.name }}</td>
      <td>{{ data.totalCount }}</td>
      <td>{{ data.totalGrade }}</td>
      <td>{{ data.response_time_num }}</td>
      <td>{{ data.execution_time_num }}</td>
      <td>{{ data.aveper }}</td>
      <td>{{ data.total_time }}</td>
      <td>{{ data.five_count }}</td>
      <td>{{ data.special_close }}</td>
    </tr>
  </tbody>
  <ng-template #footerTpl>
    <table class="footTable">
      <tr *ngFor="let data of listOfDataEnd">
        <td style="width: 12%">{{ data.name }}</td>
        <td style="width: 11%">{{ data.totalCount }}</td>
        <td style="width: 11%">{{ data.totalGrade }}</td>
        <td style="width: 11%">{{ data.response_time_num }}</td>
        <td style="width: 11%">{{ data.execution_time_num }}</td>
        <td style="width: 11%">{{ data.aveper }}</td>
        <td style="width: 11%">{{ data.total_time }}</td>
        <td style="width: 11%">{{ data.five_count }}</td>
        <td style="width: 11%">{{ data.special_close }}</td>
      </tr>
    </table>
  </ng-template>
</nz-table>
<div class="pagination">
  <ng-template #totalTemplate let-total> 共 {{ total }} 条 </ng-template>
  <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize" (nzPageIndexChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)" (nzPageSizeChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)" nzShowSizeChanger [nzPageSizeOptions]="[30,50,100,200]" [nzShowTotal]="totalTemplate"></nz-pagination>
</div>

<!-- 详细搜索 -->
<app-distribution-search-more [fieldConfig]="fieldConfig" *ngIf="showSearchMore" [hosId]="hosId" [queryType]="queryType"  [dutyId]="dutyId"  [parentDutyId]="parentDutyId" (cancelEvent)="cancelEvent()" (submitEvent)="submitEvent($event)"></app-distribution-search-more>
