<div class="panel panel-default">
  <!--标题-->
  <div class="panel-title">
    <nav aria-label="breadcrumb">
      <ol class="breadcrumb">
        <li class="breadcrumb-item active" aria-current="page">考场预测(注意：缴费时间结束之前，数据有可能会有变化)</li>
      </ol>
    </nav>
  </div>

  <!--查询条件-->
  <div class="row mb-3 ml-1" [hidden]="editShowType=='only' || editShowType=='special'|| editShowType=='net'">
    <div class="col-lg-12">
        <form (ngSubmit)="framePager.goSearch()" class="form-inline">

          
                <!--选择考试-->
                <div class="input-group mr-1 input-group-sm">
                    <label class="ml-sm">&nbsp;&nbsp;考试批次：</label>
                    <flex-select [allowClear]="true"
                                [url]= "'pl/plExamTime/listtime.htm'"
                                respDataPath= "array"
                                optionValueField="id"
                                optionTextField="exam_year_month"
                                [(ngModel)]="query.examTimeId"
                               
                                placeholder="请选择"
                                [ngModelOptions]="{standalone: true}"
                                width = "80"
                                noResultsFound = "无数据"
                                >
                    </flex-select>
            </div>&nbsp;&nbsp;
            

            <button class="btn btn-primary btn-rounded btn-outline btn-sm  mr-1" (click)="queryExamNum()">
                <i class="fa fa-search"></i> 查询</button>
            <button class="btn btn-primary btn-rounded btn-outline btn-sm  mr-1" (click)="resetData()">
                <i class="fa fa-undo"></i> 重置</button>
                <button class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip" data-placement="left"
        (click)="showNetCourse('net')" title="非网评课程报考统计">
        <i class="fa icon-anchor"></i> 当前批次非网评课程报考统计</button>

      <button class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip" data-placement="left"
        (click)="showSpecialCourse('special')" title="特殊课程报考统计">
        <i class="fa icon-anchor"></i> 当前批次特殊课程报考统计</button>
        </form>
    </div>
</div>
<div class="row mb-3 ml-1" [hidden]="editShowType=='only' || editShowType=='special'|| editShowType=='net'">
  <div class="col-lg-12">
  <ul class="list-group"  [hidden]="editShowType=='only' || editShowType=='special'|| editShowType=='net'">
    <li class="list-group-item text-left" *ngFor="let item of examNumList">
      <h4>{{year}}年{{month}}月第{{item.batch}}场预测需要总考场：
        <a href="#" class="text-warning">{{(item.common_num === undefined ? 0 : item.common_num)+(item.special_num === undefined ? 0 :item.special_num)}} </a>个 &nbsp;&nbsp;
        需要普通考场：<a href="#" class="text-warning">{{item.common_num === undefined ? 0 : item.common_num}} </a>个 &nbsp;&nbsp;
        需要特殊考场：<a href="#" class="text-warning">{{item.special_num === undefined ? 0 :item.special_num }} </a>个 &nbsp;&nbsp;
        

      </h4>
    </li>
    <li class="list-group-item text-center"  *ngIf="examNumList && examNumList.length === 0"><h4>没有可查询的记录</h4></li>
  </ul>
</div>
</div>
  
<!-- only编辑页面-->
<div class="col-lg-12" *ngIf="editShowType != null &&editShowType =='special'">
  <ng-container *ngTemplateOutlet="editSpecialTemplateModal">
  </ng-container>
</div>

<div class="col-lg-12" *ngIf="editShowType != null &&editShowType =='net'">
  <ng-container *ngTemplateOutlet="editNetTemplateModal">
  </ng-container>
</div>

</div>



<ng-template #editSpecialTemplateModal>
  <div class="modal-content">
    <div class="modal-header info-success-qm">
      <div class="pull-left">
        <em class="fa-lg fas fa-edit "></em> <span>特殊课程报考统计</span>
      </div>

      <button type="button" class="close" (click)="hideModal()">×</button>
    </div>

    <div class="modal-body">
      <div [ngTemplateOutlet]="editSpecialFormTemplate"></div>

    </div>
    <div class="modal-footer">
        <button class="btn btn-default" (click)="exportSpecialCourse()">
            <i class="fa icon-cloud-download"> </i> 导出
          </button>
      <button class="btn btn-default" (click)="hideModal()">
        <i class="icon-close"> </i> 关闭
      </button>
    </div>
  </div>
</ng-template>


<ng-template #editSpecialFormTemplate>
  <div class="col-sm-12 ml-0">
    <table class="table table-sm table-striped table-hover table-bordered bg-white">
      <thead>
        <tr>
          <th>序号</th>
          <th align="center">课程代码</th>
          <th>课程名称</th>
          <th align="center">考试场次</th>
          <th align="center">报考人数</th>
        </tr>
      </thead>
      <tbody>
        <tr *ngFor="let item of stdEnrolList; let i = index" align="center">
          <td>{{i+1}}</td>
          <td align="center">{{item.course_code}}</td>
          <td>{{item.course_name}}</td>
          <td align="center">{{item.batch}}</td>
          <td align="right">{{item.num}}</td>
        </tr>
      </tbody>

    </table>
  </div>
</ng-template>


<ng-template #editNetTemplateModal>
  <div class="modal-content">
    <div class="modal-header info-success-qm">
      <div class="pull-left">
        <em class="fa-lg fas fa-edit "></em> <span>非网评课程报考统计</span>
      </div>

      <button type="button" class="close" (click)="hideModal()">×</button>
    </div>

    <div class="modal-body">
      <div [ngTemplateOutlet]="editNetFormTemplate"></div>

    </div>
    <div class="modal-footer">
        <button class="btn btn-default" (click)="exportNetCourse()">
            <i class="fa icon-cloud-download"> </i> 导出
          </button>
      <button class="btn btn-default" (click)="hideModal()">
        <i class="icon-close"> </i> 关闭
      </button>
    </div>
  </div>
</ng-template>


<ng-template #editNetFormTemplate>
  <div class="col-sm-12 ml-0">
    <table class="table table-sm table-striped table-hover table-bordered bg-white">
      <thead>
        <tr>
          <th>序号</th>
          <th  align="center">课程代码</th>
          <th>课程名称</th>
          <th  align="center">考试场次</th>
          <th  align="center">报考人数</th>
        </tr>
      </thead>
      <tbody>
        <tr *ngFor="let item of stdNetEnrolList; let i = index">
          <td>{{i+1}}</td>
          <td  align="center">{{item.course_code}}</td>
          <td>{{item.course_name}}</td>
          <td align="center">{{item.batch}}</td>
          <td  align="right">{{item.num}}</td>
        </tr>
      </tbody>

    </table>
  </div>
</ng-template>