<div class="searchDataWrap">
  <div class="searchData">
    <app-custom-change-date #customChangeDate [isShowType]="false"></app-custom-change-date>
    <div class="searchDataItem">
      <span class="label">人员</span>：
      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeUserInp($event)" nzAllowClear nzPlaceHolder="请选择人员" [(ngModel)]="userId" (nzOpenChange)="openChangeUser($event)">
        <ng-container *ngFor="let option of userList">
          <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [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" nz-tooltip nzTooltipTitle="更多搜索" (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.groupDTO || fieldConfig.fields.deptDTO || fieldConfig.fields.buildingDTO || fieldConfig.fields.taskTypeDTO || fieldConfig.fields.statisticsTypeDTO">
  <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
  <span>{{fieldConfig.fields.statisticsTypeDTO?.name}}</span>
  <span>{{fieldConfig.fields.taskTypeDTO?.taskName}}</span>
	<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="evaCount" [(nzSort)]="sortCurrent.evaCount">评价总工单数</th>
      <th nzWidth="11%" nzShowSort nzSortKey="eva1" [(nzSort)]="sortCurrent.eva1">一星评价数</th>
      <th nzWidth="11%" nzShowSort nzSortKey="eva2" [(nzSort)]="sortCurrent.eva2">二星评价数</th>
      <th nzWidth="11%" nzShowSort nzSortKey="eva3" [(nzSort)]="sortCurrent.eva3">三星评价数</th>
      <th nzWidth="11%" nzShowSort nzSortKey="eva4" [(nzSort)]="sortCurrent.eva4">四星评价数</th>
      <th nzWidth="11%" nzShowSort nzSortKey="eva5" [(nzSort)]="sortCurrent.eva5">五星评价数</th>
      <th nzWidth="11%" nzShowSort nzSortKey="avgCount" [(nzSort)]="sortCurrent.avgCount">平均总星级</th>
    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let data of listOfData">
      <td>{{ data.userName }}<ng-container *ngIf="data.userAccount">({{ data.userAccount }})</ng-container></td>
      <td>{{ data.totalCount }}</td>
      <td>{{ data.evaCount }}</td>
      <td>{{ data.eva1 }}</td>
      <td>{{ data.eva2 }}</td>
      <td>{{ data.eva3 }}</td>
      <td>{{ data.eva4 }}</td>
      <td>{{ data.eva5 }}</td>
      <td>{{ data.avgCount }}</td>
    </tr>
  </tbody>
  <ng-template #footerTpl>
    <table class="footTable">
      <tr *ngFor="let data of listOfDataEnd">
        <td style="width: 12%">{{ data.userName }}</td>
        <td style="width: 11%">{{ data.totalCount }}</td>
        <td style="width: 11%">{{ data.evaCount }}</td>
        <td style="width: 11%">{{ data.eva1 }}</td>
        <td style="width: 11%">{{ data.eva2 }}</td>
        <td style="width: 11%">{{ data.eva3 }}</td>
        <td style="width: 11%">{{ data.eva4 }}</td>
        <td style="width: 11%">{{ data.eva5 }}</td>
        <td style="width: 11%">{{ data.avgCount }}</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>
