<div class="content-heading  justify-content-between">
  <div>面试考场管理<span *ngIf="checkin.refresh_time !== undefined" class="ml-2">  共【{{roomArray.length}}】个考场</span>
  </div>
  <!-- {{checkin.refresh_time}} -->
  <div class="float-right">
    <div class="row">
      <div class="wd-xl">
        <ngx-select [items]="agentArray" [(ngModel)]="checkin.agent_id"
                    (ngModelChange)="requestDateArray()" [autoClearSearch]="true"
                    optionValueField="ly_agent_id" optionTextField="ly_agent_name"></ngx-select>
      </div>
      <div class="ml-3 wd-sm" *ngIf="checkin.agent_id!==undefined">
        <ngx-select [items]="dateArray" [(ngModel)]="checkin.exam_date" [autoClearSearch]="true"
                    (ngModelChange)="changeDate()"
                    optionValueField="exam_date" optionTextField="exam_date"></ngx-select>
      </div>
      <div class="ml-3 mr-2" *ngIf="checkin.exam_date!==undefined">
        <ngx-select [items]="timeArray" [(ngModel)]="checkin.time_type" 
                    placeholder="请选择时段"
                    class="wd-wide" (ngModelChange)="changeDate()"
                    optionValueField="dict_value" optionTextField="dict_text"></ngx-select>
      </div>

      <div class="btn-group ml-3" dropdown *ngIf="checkin!==undefined && checkin.exam_date!==undefined">
        <button class="btn dropdown-toggle btn-secondary" type="button" dropdownToggle>考场辅助功能
          <span class="caret"></span>
        </button>
        <div *dropdownMenu class="dropdown-menu" role="menu">
          <a class="dropdown-item" href="#" (click)="ajax.optrRecord('exam/interview/room/start/all.htm', this.checkin,{
          'successMsg':'已尝试开启所有未开开始的考场，请10秒检查处理结果',successMsgType:'Swal',confirmMsg:'确定要将所有未开启的考场开启吗？', showMsg:true
          }, {RequestWithLoading:true})">全部开启</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="#" (click)="ajax.optrRecord('exam/interview/room/close/all.htm', this.checkin,{
            'successMsg':'已关闭所有考场',successMsgType:'Swal',confirmMsg:'关闭考场会影响正在进行的考试，请谨慎操作，确定要关闭所有考场吗？', showMsg:true
            }, {RequestWithLoading:true})">全部关闭</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="#" (click)="ajax.optrRecord('exam/interview/room/judge/login/all.htm', this.checkin,{
          'successMsg':'所有考场未登录的评委已标记为登录，请10秒检查处理结果',successMsgType:'Swal',confirmMsg:'所有评委模拟登录，确定吗？', showMsg:true
          }, {RequestWithLoading:true})">评委登录</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="#"
             (click)="FuncService.ajaxDownload('frame/report/download.htm', {report_name:'ExamRoomJudgeInterview', report_title :'【'+checkin.exam_date+'】面试考场评委清单',ly_agent_id:checkin.agent_id,exam_date:checkin.exam_date})">下载考场</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="#" (click)="downloadRoom()">下载考场详情</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="#" (click)="FuncService.ajaxDownload('frame/report/download.htm', {report_name:'MissExamStdReport', report_title :'缺考考生', time_type:checkin.time_type, ly_exam_date: checkin.exam_date })">导出缺考考生</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="#" (click)="FuncService.ajaxDownload('frame/report/download.htm', {report_name:'StdInroomReport', report_title :'考生进场详情', time_type:checkin.time_type, ly_exam_date: checkin.exam_date })">导出考生详情</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="#" (click)="FuncService.ajaxDownload('frame/report/download.htm', {report_name:'ExamRoomTimeReport', report_title :'考场时间详情', optr_dept:FrameService.FrameOptr.optr_dept })">导出考场时间</a>
        </div>
      </div>
    </div>
  </div>
</div>

<table class="table table-striped table-hover table-bordered">
  <thead>
  <tr>
    <th class="th-index"></th>
    <th class="text-center">面试项目</th>
    <th class="text-center">考场地址</th>
    <th class="text-center">考场密钥</th>
    <th class="text-center">考场状态</th>
    <th class="text-center">完成/进场/确认/检录/总数</th><!---->
    <th class="text-center">评委</th>
    <!-- <th class="text-center">当前考生</th> -->
    <!-- <th class="text-center">会议链接</th> -->
    <th class="wd-sm"></th>
  </tr>
  </thead>
  <tbody>

  <ng-container *ngFor="let room of roomArray; let i = index">
    <tr *ngIf="room.group.pagerless_flag === 'Active' && room.room_status=== 'Active'">
      <td>{{i + 1}}</td>
      <td>{{room.group.group_name}} - 第【{{room.room_seq}}】考场</td>
      <td>{{room.room_addr}}</td>
      <td class="text-center">{{room.room_key}}</td>
      <td class="text-center"> <span
        [ngClass]="{'text-info':room.exam_status === 'Examing','text-success':room.exam_status === 'Complete'}">{{room.exam_status | frameDict:'ExamRoomStatus'}}</span>
      </td>
      <td class="text-center">
      <span class="table-sort" (click)="showStd(room)">
        <span class="text-success">{{room.real_complete_total}}</span> /
        <span class="text-info">{{room.real_inroom_total}}</span> /
        <span class="text-primary">{{room.real_info_total}}</span> /
        <span>{{room.real_checkin_total}}</span>/
        <span>{{room.real_std_total}}</span>
        <!-- / <span class="text-muted">{{room.ly_std_total+room.other_std_total}}</span>-->
      </span>
      </td>
      <td class="text-center">
      <span class="table-sort" (click)="showJudge(room)"
            [ngClass]="{'text-success':room.judge_login_total === room.group.room_judge_num }">{{room.judge_login_total}}
        / {{room.group.room_judge_num}}</span>
      </td>
      <!-- <td><span *ngIf="room.group.pack_flag!=='Active'">{{room.current_std_name}}</span>
        <span *ngIf="room.group.pack_flag==='Active'">第【{{room.current_pack}}】批</span>
      </td>-->
      <!-- <td>
        <span *ngIf="room.tencent_meeting_url" class="text-success" [tooltip]="room.tencent_meeting_url">已绑定会议</span>
      </td> -->
      <td>
        <div class="btn-group ml-3" dropdown>
          <button class="btn dropdown-toggle btn-secondary" type="button" dropdownToggle>考场功能
            <span class="caret"></span>
          </button>
          <div *dropdownMenu class="dropdown-menu" role="menu">
            <a class="dropdown-item" href="#" (click)="ajax.optrRecord('exam/interview/room/start.htm',room,{
          'successMsg':'已尝试开启考场，请10秒检查处理结果',successMsgType:'Swal',showMsg:true,confirmMsg:'确定要开启的考场【'+room.room_addr+'】吗？'
          }, {RequestWithLoading:true})" *ngIf="room.exam_status === 'Init'">开启考场</a>
            <div class="dropdown-divider" *ngIf="room.exam_status === 'Init'"></div>
            <a class="dropdown-item" href="#" (click)="ajax.optrRecord('exam/interview/room/judge/login.htm',room,{
          'successMsg':'已模拟所有评委登录，请10秒检查处理结果',successMsgType:'Swal',showMsg:true,confirmMsg:'确定要对考场【'+room.room_addr+'】进行所有评委登录操作吗？'
          }, {RequestWithLoading:true})" *ngIf="room.exam_status === 'Judge'">评委登录</a>
            <div class="dropdown-divider" *ngIf="room.exam_status === 'Judge'"></div>
            <a class="dropdown-item" href="#" (click)="showPrintScore(room)" *ngIf="room.exam_status !== 'Init'">打印评委分数</a>
            <div class="dropdown-divider" *ngIf="room.exam_status !== 'Init'"></div>
            <!-- <a class="dropdown-item" href="#" (click)="bindMeetingUrl(room)" *ngIf="room.exam_status !== 'Init'">会议链接绑定</a>
            <div class="dropdown-divider" *ngIf="room.exam_status !== 'Init'"></div> -->
            <!-- <a class="dropdown-item" href="#" (click)="batchInRoom(room)" *ngIf="room.exam_status !== 'Init'">批量入场</a> -->
            <!-- <div class="dropdown-divider" *ngIf="room.exam_status !== 'Init'"></div>
            <a class="dropdown-item" href="#" (click)="colseRoom(room)" *ngIf="room.exam_status !== 'Init'">关闭考场</a> -->
          </div>
        </div>
      </td>
    </tr>
  </ng-container>
  </tbody>
</table>

<frame-ajax #ajax [autoRequest]="false"></frame-ajax>

