<div class="list-template">
  <div class="list-template__content">
    <div class="list-template__top" nz-row>
      <div nz-col nzXl='18' class="list-template__searchBox">
        <div class="list-template__searchItem">
          <nz-radio-group [(ngModel)]="dateType" (ngModelChange)="changeDateType($event)">
            <label *ngFor="let data of dateTypes" nz-radio-button [nzValue]="data.value">{{data.label}}</label>
          </nz-radio-group>
        </div>
        <div class="list-template__searchItem">
          <span class="label">发起时间</span>：
          <nz-range-picker *ngIf="dateType=='day'" [(ngModel)]="dateRange" [nzAllowClear]='false'
            [nzDisabledDate]="disabledDate" (ngModelChange)="changeDate($event)">
          </nz-range-picker>
          <nz-month-picker *ngIf="dateType=='month'" [(ngModel)]="monthRangeStart" [nzDisabledDate]="disabledMonthStart"
            (ngModelChange)="changeMonthStart($event)" nzPlaceHolder="请选择开始月份">
          </nz-month-picker>
          <span *ngIf="dateType=='month'"> ~ </span>
          <nz-month-picker *ngIf="dateType=='month'" [(ngModel)]="monthRangeEnd" [nzDisabledDate]="disabledMonthEnd"
            (ngModelChange)="changeMonthEnd($event)" nzPlaceHolder="请选择截止月份">
          </nz-month-picker>
          <nz-year-picker *ngIf="dateType=='year'" [(ngModel)]="yearRangeStart" [nzDisabledDate]="disabledYearStart"
            (ngModelChange)="changeYearStart($event)" nzPlaceHolder="请选择开始年份">
          </nz-year-picker>
          <span *ngIf="dateType=='year'"> ~ </span>
          <nz-year-picker *ngIf="dateType=='year'" [(ngModel)]="yearRangeEnd" (ngModelChange)="changeYearEnd($event)"
            [nzDisabledDate]="disabledYearEnd" nzPlaceHolder="请选择截止年份">
          </nz-year-picker>
        </div>
        <div class="list-template__searchItem ml8">
          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="false" nzPlaceHolder="请选择时间"
            [(ngModel)]="defRange" (ngModelChange)="changeDateRange($event)">
            <nz-option nzLabel="{{data.label}}" nzValue="{{data.id}}" *ngFor="let data of defRanges"></nz-option>
          </nz-select>
        </div>
      </div>
      <div nz-col nzXl='6' class="list-template__btns">
        <button nz-button class="btn default" (click)='search(1)'>搜索</button>
        <button nz-button class="btn default ml8" (click)='export()' [nzLoading]="loading2">导出</button>
        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
      </div>
    </div>
    <div class="list-template__bottom">
      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
        [nzLoading]="loading1">
        <thead (nzSortChange)="sort($event)" nzSingleSort>
          <tr class="thead">
            <th nzWidth="5%">序号</th>
            <th nzWidth="15%">日期</th>
            <th nzShowSort nzWidth="20%" nzSortKey="source1" [(nzSort)]="sortCurrent.source1">服务台建单数量</th>
            <th nzShowSort nzWidth="20%" nzSortKey="source2" [(nzSort)]="sortCurrent.source2">护士端建单数量</th>
            <th nzShowSort nzWidth="20%" nzSortKey="source3" [(nzSort)]="sortCurrent.source3">系统自动建单数量</th>
            <th nzShowSort nzWidth="20%" nzSortKey="source4" [(nzSort)]="sortCurrent.source4">微信端建单数量</th>
          </tr>
        </thead>
        <tbody>
          <tr *ngFor="let data of listOfData;let index=index;">
            <td>{{index+(pageIndex-1) * pageSize + 1}}</td>
            <td>{{ data.date }}</td>
            <td>{{ data.source1||0}}</td>
            <td>{{data.source2||0}}</td>
            <td>{{data.source3||0}}</td>
            <td>{{data.source4||0}}</td>
          </tr>
        </tbody>
      </nz-table>
      <div class="list-template__pagination">
        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
          (nzPageIndexChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)"
          (nzPageSizeChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)">
        </nz-pagination>
      </div>
    </div>
  </div>
</div>
<!-- 操作成功/失败提示框 -->
<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
  [info]="promptInfo"></app-prompt-modal>

<!-- 查看详情 -->
<router-outlet></router-outlet>
