<div class="content-heading  justify-content-between">
    <div>面试考场管理<span *ngIf="room.refresh_time !== undefined" class="ml-2">  共【{{roomArr.length}}】个考场</span>
    </div>
    <div class="float-right">
      <div class="row">
        <div class="wd-sm">
            <ngx-select [items]="schoolArr" [(ngModel)]="room.school_id"
                        (ngModelChange)="listBatch()" [autoClearSearch]="true"
                        optionValueField="school_id" optionTextField="school_name"></ngx-select>
          </div>
        <div class="ml-3 wd-xl" *ngIf="room.school_id !==undefined">
          <ngx-select [items]="batchArr" [(ngModel)]="room.batch_id"
                      (ngModelChange)="listExamDate()" [autoClearSearch]="true"
                      optionValueField="batch_id" optionTextField="batch_name"></ngx-select>
        </div>
        <div class="ml-3 wd-sm" *ngIf="room.batch_id!==undefined">
          <ngx-select [items]="dateArr" [(ngModel)]="room.exam_date" [autoClearSearch]="true"
                      (ngModelChange)="changeDate()"  optionValueField="exam_date" optionTextField="exam_date"></ngx-select>
        </div>
        <div class="ml-3 mr-2" *ngIf="room.exam_date!==undefined">
          <ngx-select [items]="timeArr" [(ngModel)]="room.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="room!==undefined && room.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('ly/room/interview/start/all.htm', this.room,{
            'successMsg':'已尝试开启所有未开开始的考场，请稍后检查处理结果',successMsgType:'Swal',confirmMsg:'确定要将所有未开启的考场开启吗？', showMsg:true
            }, {RequestWithLoading:true})">全部开启</a>
            <div class="dropdown-divider"></div>
            <a class="dropdown-item" href="#" (click)="ajax.optrRecord('ly/room/interview/close/all.htm', this.room,{
              'successMsg':'已关闭所有考场',successMsgType:'Swal',confirmMsg:'关闭考场会影响正在进行的考试，请谨慎操作，确定要关闭所有考场吗？', showMsg:true
              }, {RequestWithLoading:true})">全部关闭</a>
            <div class="dropdown-divider"></div>
            <a class="dropdown-item" href="#" (click)="ajax.optrRecord('ly/room/interview/judge/login/all.htm', this.room,{
            'successMsg':'所有考场未登录的评委已标记为登录，请稍后检查处理结果',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 :'【'+room.exam_date+'】面试考场评委清单',batch_id:room.batch_id,exam_date:room.exam_date})">下载考场</a>
            <div class="dropdown-divider"></div>
            <a class="dropdown-item" href="#" (click)="downloadRoom()">下载考场详情</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="wd-sm"></th>
    </tr>
    </thead>
    <tbody>

    <ng-container *ngFor="let room of roomArr; let i = index">
      <tr class="text-center">
        <td>{{i + 1}}</td>
        <td>{{room.group.group_name}} - 第【{{room.room_seq}}】考场</td>
        <td>{{room.group.res_play_mode | frameDict: 'ResPlayMode'}}</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>{{room.dist_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>
          <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('ly/room/interview/start.htm',{ly_room_id:room.ly_room_id},{
            'successMsg':'已尝试开启考场，请稍后检查处理结果',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)="colseRoom(room)" *ngIf="room.exam_status == 'Examing'">关闭考场</a>
              <div class="dropdown-divider" *ngIf="room.exam_status === 'Examing'"></div>
              <a class="dropdown-item" href="#" (click)="ajax.optrRecord('ly/room/interview/judge/login.htm',{ly_room_id:room.ly_room_id},{
            'successMsg':'已模拟所有评委登录，请稍后检查处理结果',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)="showStdTask(room)" *ngIf="room.exam_status == 'Examing'">任务追加</a>
              <div class="dropdown-divider" *ngIf="room.exam_status === 'Examing'"></div>
              <a class="dropdown-item mr-2" href="#" (click)="showPrintHand(room)" *ngIf="room.exam_status === 'Examing'" >下载评委手账</a>
              <div class="dropdown-divider" *ngIf="room.exam_status === 'Examing'"></div>
              <a class="dropdown-item mr-2" href="#" (click)="showPrintScore(room)" *ngIf="room.exam_status === 'Examing'">下载评委评分表</a>
              <div class="dropdown-divider" *ngIf="room.exam_status=== 'Examing'" ></div>
              <a class="dropdown-item  mr-2" href="#" (click)="showVideoStd(room)" *ngIf="room.exam_status === 'Examing'">下载视频审核考生</a>
              <div class="dropdown-divider" *ngIf="room.exam_status=== 'Examing'"></div>
              <a class="dropdown-item" href="#" (click)="ajax.optrRecord('ly/room/interview/scorecheck.htm',{ly_room_id:room.ly_room_id},{
            'successMsg':'已模拟所有评委登录，请稍后检查处理结果',successMsgType:'Swal',showMsg:true,confirmMsg:'确定要对考场【'+room.room_addr+'】进行评分时间检查吗，请勿频繁使用本功能？'
            }, {RequestWithLoading:true})" *ngIf="room.exam_status === 'Examing'">检查评分时间</a>
              <div class="dropdown-divider"  ></div>
              <a class="dropdown-item  mr-2" href="#" (click)="showAllStd(room)" >下载已分发考生</a>
            </div>
          </div>
        </td>
      </tr>
    </ng-container>
    </tbody>
  </table>


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