<div class="content-heading  justify-content-between">
  <div>科目原始成绩</div>
  <div class="float-right">

    <div class="row">
      <div class="btn-group ml-3 mr-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 text-primary" href="#" (click)="uploader.uploadFiles()">导入成绩</a>
          <a class="dropdown-item" href="#" (click)="uploader.downloadTempalte()">导入模版下载</a> -->
          <a class="dropdown-item" href="#" (click)="ModalService.showUploadWindow(bsService,'score/subject/upload.htm',
        {},{
          uploadTitle:'导入成绩',
          templateFile:'模版-科目原始分导入.xlsx',
          uploadCallback:uploadCallback.bind(this),
          autoClose:true
        })">导入成绩</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item text-warning" href="#" (click)="makeSubjectScore()">重算所有科目</a>
          <a class="dropdown-item text-warning" href="#" (click)="makeSubjectScore(subject?.subject_id)"
             *ngIf="subject">重算【{{subject.subject_name}}】</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item text-warning" href="#" (click)="makeInterviewSubjectScore()">合成所有无纸化分</a>
          <a class="dropdown-item text-warning" href="#" (click)="makeInterviewSubjectScore(subject?.subject_id)"
             *ngIf="subject">合成【{{subject.subject_name}}】无纸化分</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="#" *ngIf="subject"
             (click)="downloadScore()">下载【{{subject.subject_name}}】原始分</a>

          <a class="dropdown-item" href="#"
             (click)="downloadScore()">下载所有原始分</a>
        </div>
      </div>
      
      <div class="ml-1 row">
        <div class="wd-xs">
          <ngx-select [items]="batchNameArray" [(ngModel)]="score.batch_id" 
                      [autoClearSearch]="true" optionValueField="dict_value" optionTextField="dict_text"
                      placeholder="批次"></ngx-select>
        </div>
        <div  class="col-lg-4 wd-xxl">
          <ngx-select [items]="aspectArray" [(ngModel)]="score.aspect_id" (ngModelChange)="getSubject(score.aspect_id,score.batch_id)"
                      [autoClearSearch]="true" optionValueField="aspect_id" optionTextField="aspect_text"
                      placeholder="请选择专业"></ngx-select>
        </div>
        <div  class="col-lg-4 wd-xxl">
          <ngx-select [items]="subjectArray" [(ngModel)]="score.subject_id" (ngModelChange)="requestSubjectScore()"
                      [autoClearSearch]="true" optionValueField="subject_id" optionTextField="subject_text"
                      placeholder="请选择考试科目"></ngx-select>
        </div>
      </div>
      

      
    </div>

  </div>
</div>

<div class="table-responsive bg-white table-full">
  <table class="table table-striped table-hover table-bordered" *ngIf="pager.getRecords().length>0">
    <thead>
    <tr>
      <th>考生姓名</th>
      <th>性别</th>
      <th><span class="table-sort" (click)="pager.sort('aspect_num')">专业考号</span></th>
      <th><span class="table-sort" (click)="pager.sort('ticket_no')">准考证号</span></th>
      <th *ngIf="pager.getRecords()[0].variety_name !== undefined">乐器/舞种</th>
      <th><span class="table-sort" (click)="pager.sort('room_id,real_exam_seq')">考试考场</span></th>
      <th><span class="table-sort" (click)="pager.sort('room_id,real_exam_seq')">考试序号</span></th>
      <th><span class="table-sort" (click)="pager.sort('subject_score')">科目分</span></th>
      <th *ngFor="let s of pager.getRecords()[0].judge_num | numberArray">
        第{{s}}评委
      </th>
    </tr>
    </thead>
    <tbody>
    <tr *ngFor="let v of pager.getRecords(); let i = index">
      <td>{{v.std_name}}</td>
      <td>{{v.std_sex}}</td>
      <td>{{v.aspect_num}}</td>
      <td>{{v.ticket_no}}</td>
      <td *ngIf="v.variety_name!== undefined">{{v.variety_name}}</td>
      <td>{{v.room_addr}}</td>
      <td><span [tooltip]="v.real_exam_seq">{{v.real_exam_echo}}</span></td>
      <td>{{v.subject_score}}</td>
      <th *ngFor="let s of pager.getRecords()[0].judge_num | numberArray">
        <span [tooltip]="v['jn' + (s > 9 ? '' : '0') + s]">{{v['js' + (s > 9 ? '' : '0') + s]}}</span>
      </th>

    </tr>
    </tbody>
  </table>
  <frame-pager [url]="'./score/subject/page.htm'" [pagerParams]="{subject_id:score?.subject_id}"
               [autoRequest]="false" #pager></frame-pager>
</div>


<!-- <frame-uploader [uploadUrl]="'score/subject/upload.htm'" [templateFile]="'模版-科目原始分导入.xlsx'"
                [allowedFileType]="['xls']" [confirmMsg]="'确定要上传科目原始分吗？将覆盖已经存在的科目分信息'" #uploader></frame-uploader> -->
