<div class="content-heading  justify-content-between">
  <div>在线考试考场<span *ngIf="currentStep === 'Init'"> - 请输入考场密码</span>
    <span *ngIf="currentStep === 'Room' && checkin.refresh_time !== undefined">{{checkin.refresh_time}}</span>
  </div>
  <div class="float-right" *ngIf="currentStep !== 'Init'">
    <div class="btn-group mb-1 mr-1 ml-3" dropdown>
      <button class="btn dropdown-toggle btn-secondary btn-lg" type="button" dropdownToggle>辅助功能
        <span class="caret"></span>
      </button>
      <div *dropdownMenu class="dropdown-menu modal-lg" role="menu">
        <a class="dropdown-item" href="#" (click)="goInit()">输入考场密钥</a>
        <div class="dropdown-divider"></div>

      </div>
    </div>
  </div>

</div>


<!-- 检录主窗口 -->
<div class="card card-default m-5" *ngIf="currentStep === 'Init'">
  <div class="card-body">
    <fieldset>
      <div class="form-group row">
        <div class="col-lg-12">
          <div class="d-flex align-items-center mb-3">
            <input class="form-control mt-1 cert_field" [(ngModel)]="room_key" maxlength="12"
                   (keyup.enter)="changePassword()"/>
          </div>
        </div>
      </div>
    </fieldset>

  </div>

</div>


<table class="table table-striped table-hover table-bordered" *ngIf="currentStep === 'Room'">
  <thead>
    <tr>
      <th class="text-center" *ngIf="examShowInterview == 'Active'">面试项目</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 roomList; let i = index">
      <tr>
        <td *ngIf="examShowInterview == 'Active'">{{room.group.group_name}} - 第【{{room.room_seq}}】考场</td>
        <td>{{room.room_addr}}</td>
        <td>{{room.room_key}}</td>
        <td>{{room.exam_status | frameDict:'ExamRoomStatus'}}</td>
        <td>
          <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 class="text-muted">{{room.ly_std_total+room.other_std_total}}</span> -->
            </span>
        </td>
        <td>
          <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',confirmMsg:'确定要开启的考场【'+room.room_addr+'】吗？', showMsg:true
            }, {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',confirmMsg:'确定要对考场【'+room.room_addr+'】进行所有评委登录操作吗？', showMsg:true
            }, {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>