<div class="list-template">
  <div class="list-template__content">
    <div class="list-template__top" nz-row>
      <div nz-col nzXl='19' class="list-template__searchBox">
        <div class="list-template__searchItem">
          <span class="label">来电科室：</span>
          <input nz-input class="formItem" placeholder="请输入关键字" [(ngModel)]="searchCriteria.callDept" />
        </div>
        <div class="list-template__searchItem">
          <span class="label">主叫号码：</span>
          <input nz-input class="formItem" placeholder="请输入主叫号码" [(ngModel)]="searchCriteria.dTMFA" />
        </div>
        <div class="list-template__searchItem">
          <span class="label label--big">已接/未接：</span>
          <nz-select [nzDropdownMatchSelectWidth]="false" class="formItem" nzServerSearch nzShowSearch nzAllowClear
            nzPlaceHolder="请选择已接/未接" [(ngModel)]="searchCriteria.callState" (ngModelChange)="changeHospital($event)">
            <nz-option nzLabel="已接" nzValue="1"></nz-option>
            <nz-option nzLabel="未接" nzValue="0"></nz-option>
          </nz-select>
        </div>
        <div class="list-template__searchItem">
          <span class="label label--big">呼入/呼出：</span>
          <nz-select [nzDropdownMatchSelectWidth]="false" class="formItem" nzServerSearch nzShowSearch nzAllowClear
            nzPlaceHolder="请选择呼入/呼出" [(ngModel)]="searchCriteria.callType" (ngModelChange)="changeCall($event)">
            <nz-option nzLabel="呼入" nzValue="1"></nz-option>
            <nz-option nzLabel="呼出" nzValue="0"></nz-option>
          </nz-select>
        </div>
        <div class="list-template__searchItem">
          <span class="label">开始时间：</span>
          <nz-date-picker [ngModel]="searchCriteria.responseTime" (ngModelChange)="searchCriteria.responseTime = $event"
            nzShowTime></nz-date-picker>
        </div>
      </div>
      <div nz-col nzXl="5" class="list-template__btns">
        <button class="btn default" (click)='reset()'>重置</button>
        <button class="btn default ml8" (click)='getList(1)'>搜索</button>
      </div>
    </div>
    <div class="list-template__bottom">
      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
        [nzLoading]="loading1">
        <thead>
          <tr class="thead">
            <th nzWidth="5%">序号</th>
            <th nzWidth="10%">来电科室</th>
            <th nzWidth="10%">主叫电话</th>
            <th nzWidth="10%">被叫电话</th>
            <th nzWidth="15%">开始时间</th>
            <th nzWidth="15%">结束时间</th>
            <th nzWidth="10%">通话时长</th>
            <th nzWidth="5%">已接/未接</th>
            <th nzWidth="5%">呼入/呼出</th>
            <th nzWidth="15%">操作</th>
          </tr>
        </thead>
        <tbody>
          <tr *ngFor="let data of listOfData;let i = index">
            <td>{{ i+1 }}</td>
            <td>{{ data.callDept||'-' }}</td>
            <td>{{ data.dTMFA||'-' }}</td>
            <td>{{ data.dTMFB||'-' }}</td>
            <td>{{ data.responseTime||'-' }}</td>
            <td>{{ data.overTime||'-' }}</td>
            <td *ngIf="data.longTime!==undefined">{{data.longTime}}秒</td>
            <td *ngIf="data.longTime===undefined">-</td>
            <td>{{data.callState == 1?'已接':'未接'}}</td>
            <td>{{data.callType == 1?'呼入':(data.callType == 0?'呼出':'-')}}</td>
            <td>
              <div class="coop">
                <span (click)="addModal(data.path)" *ngIf="data.path">回放录音</span>
                <span *ngIf="!data.path">-</span>
              </div>
            </td>
          </tr>
        </tbody>
      </nz-table>
      <div class="list-template__pagination">
        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize"
          (nzPageIndexChange)="getList(0)" (nzPageSizeChange)="getList(0)">
        </nz-pagination>
      </div>
    </div>
  </div>

  <!-- 新增/编辑模态框 -->
  <div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modal">
    <div class="modalBody">
      <div class="title">回放录音<i class="icon_transport transport-guanbi" (click)="hideAddModal()"></i>
      </div>
      <div class="content audio">
        <audio controls style="outline: none;">
          <source [src]="audioPath" type="audio/wav">
        </audio>
      </div>
      <div class=" display_flex justify-content_flex-center">
        <button class="btn cancel" nz-button nzType="default" (click)="hideAddModal()">知道了</button>
      </div>
    </div>
  </div>
</div>
<!-- 遮罩 -->
<app-mask *ngIf="maskFlag"></app-mask>
