<div class="content-heading  justify-content-between">
  <div>视频评分考场管理<span *ngIf="checkin.refresh_time !== undefined" class="ml-2">{{checkin.refresh_time}}</span>
  </div>
  <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>
  </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="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>
      <td>{{i + 1}}</td>
      <!-- {{room.group.show_aspect_name}} -->
      <td>{{room.group.group_name}} - 第【{{room.room_seq}}】考场</td>
      <td>
        <span class="text-muted" *ngIf="room.separate_score == null || room.separate_score == '' || room.separate_score == 'InActive'">集评</span>
        <span *ngIf="room.separate_score == 'Active'" class="text-success">分评</span>
      </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)="showVideo(room)">
        <span class="text-success">{{room.real_complete_total}}</span>/
        <!-- <span class="text-success">{{room.real_inroom_total}}</span> / -->
        <span class="text-info">{{room.real_std_total}}</span>
      </span>
      </td>
      <td class="text-center">
      <span class="table-sort"  [ngClass]="{'text-success':room.judge_login_total === room.judge_total }" (click)="showJudge(room)">
        {{room.judge_login_total}} / {{room.judge_total}}</span>
      </td>
      <td class="text-center">{{room.std_sex}}</td>
      <td class="text-center">
        <span *ngIf="room.std_province == 'Active'">省内</span>
        <span *ngIf="room.std_province == 'InActive'">省外</span>
        <span *ngIf="room.std_province == ''">不限</span>
      </td>
      <td>
        <!-- <button class="btn btn-primary btn-sm" type="button" (click)="addTask(room)">
          任务追加
        </button>
        <button class="btn btn-success btn-sm" type = "button" (click)="batchInroom(room)">批量入场</button>
        <button class="btn btn-primary btn-sm" type="button" (click)="startRoom()">开启考场</button> -->
        <ng-container>
          <div class="btn-group" dropdown style="margin-top: -5px;">
            <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)="addTask(room)">任务追加</a>
              <div class="dropdown-divider"></div>
              <a class="dropdown-item text-danger" href="#" (click)="startRoom(room)" *ngIf="room.exam_status === 'Init'">开启考场</a>
              <div class="dropdown-divider" *ngIf="room.exam_status === 'Init'"></div>
              <a class="dropdown-item" href="#" (click)="judgeLogin(room)" *ngIf="room.exam_status === 'Judge'">评委登录</a>
              <div class="dropdown-divider" *ngIf="room.exam_status === 'Judge'"></div>
              <!-- && room.separate_score === 'Active' -->
              <a class="dropdown-item text-danger" href="#" (click)="batchInroom(room)" *ngIf="room.exam_status === 'Examing'">批量入场</a>
              <div class="dropdown-divider" *ngIf="room.exam_status === 'Examing'"></div>

              <!-- <a class="dropdown-item text-green" href="#" (click)="downScorePdf(room)" *ngIf="room.exam_status === 'Examing'">下载手账</a>
              <div class="dropdown-divider" *ngIf="room.exam_status === 'Examing'"></div> -->
              <a class="dropdown-item text-green" href="#" (click)="downScoreBeforePdf(room)" *ngIf="room.exam_status === 'Examing'">下载评委分数表-提交前</a>
              <div class="dropdown-divider" *ngIf="room.exam_status === 'Examing'"></div> 
              <!--适用南艺-->
              <a class="dropdown-item text-green" href="#" (click)="downScoreDetailPdf(room)" *ngIf="room.exam_status === 'Examing'">下载手账详细</a>
              <div class="dropdown-divider" *ngIf="room.exam_status === 'Examing'"></div> 
              <a class="dropdown-item text-green" href="#" (click)="downManualPdf(room)" *ngIf="room.exam_status  !== 'Init'">下载评委打分表</a>
              <div class="dropdown-divider" *ngIf="room.exam_status  !== 'Init'"></div> 
              <a class="dropdown-item text-green" href="#" (click)="downScoreManualPdf(room)" *ngIf="room.exam_status   === 'Examing'">下载评委分数表-提交后</a>
              <div class="dropdown-divider" *ngIf="room.exam_status  === 'Examing'"></div>
              <!-- <a class="dropdown-item text-green" href="#" (click)="exportStdRegInroom(room)" *ngIf="room.exam_status  !==  'Init'">下载考生进场信息</a>
              <div class="dropdown-divider" *ngIf="room.exam_status  !== 'Init'"></div> -->
              <a class="dropdown-item text-green" href="#" (click)="exportVideoStd(room)" *ngIf="room.exam_status  !==  'Init'">下载视频审核考生</a>
              <div class="dropdown-divider" *ngIf="room.exam_status  !== 'Init'"></div>
              <!-- <a class="dropdown-item text-green" href="#" (click)="exportVideoStdScore(room)" *ngIf="room.exam_status  !==  'Init'">下载分数</a>
              <div class="dropdown-divider" *ngIf="room.exam_status  !== 'Init'"></div> -->
              <a class="dropdown-item text-green" href="#" (click)="videoDataInit(room)" *ngIf="room.exam_status === 'Examing'"  frameRole resId="505041">视频审核数据初始化</a>
              
            </div>
          </div>
         </ng-container>
      </td>
    </tr>
  </ng-container>
  </tbody>
</table>

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

