<div class="panel panel-default">
  <div>
    <!--标题-->
    <div class="panel-title">
      <nav aria-label="breadcrumb">
        <ol class="breadcrumb">
          <li class="breadcrumb-item active" aria-current="page">课程考试情况统计</li>
        </ol>
      </nav>
    </div>
  </div>

  <div class="panel-body ml-sm " [hidden]="editShowType=='only'">
    <!--查询条件-->
    <div class="row mb-3 ml-1" [hidden]="editShowType=='only'">
      <div class="col-lg-12">
        <form (ngSubmit)="framePager.goSearch()" class="form-inline">
          <!-- 支持排序 -->
          <table>
            <tr>
          <td>
          <div class="input-group mr-1 input-group-sm">
            <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;批次：</label>
            <flex-select [allowClear]="true" [url]="YEAR_CODE_URL" respDataPath="array" optionValueField="year_code"
              optionTextField="examyearmonth" [(ngModel)]="query.year_code" placeholder="请选择"
              [ngModelOptions]="{standalone: true}" width="150" noResultsFound="无数据">
            </flex-select>
          </div>
          </td>
          <td>
              <div class="input-group mr-1 input-group-sm">
            <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;成绩类型：</label>
            <select name="score_type" style="width: 160px;"
            [(ngModel)]="query.score_type" 
            [ngModelOptions]="{standalone: true}"
            class="form-control">
            
            <option value="1">统考成绩</option>
            <option value="2">合成成绩</option>
        </select>
      </div>
    </td>
    <td>
        <div class="input-group mr-1 input-group-sm">
    <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;关键字：</label>
    <input name="query" [(ngModel)]="query.query" class="input-sm form-control" type="text" value=""
      maxlength="64" placeholder="请输入课程关键字">
    </div>
  </td>
      </tr>
      <tr>
          <td>
              <div class="input-group mr-1 input-group-sm">
              <label>主考学校：</label>
              <flex-select [allowClear]="true" [url]="SCHOOL_URL" respDataPath="array" optionValueField="id" optionTextField="org_name"
                [(ngModel)]="query.school_id" placeholder="请选择"  noResultsFound="无数据" width="150"
                [ngModelOptions]="{standalone: true}">
              </flex-select>
            </div>
          </td>
          <td>
              <div class="input-group mr-1 input-group-sm">
                  <label>考生备案类型：</label>
                  <select name="std_type" style="width: 180px;"
                  [(ngModel)]="query.std_type" 
                  [ngModelOptions]="{standalone: true}"
                  class="form-control">
                  <option value="">--请选择--</option>
                  <option value="1">专本衔接</option>
                  <option value="2">网络助学</option>
              </select>
            </div>
          </td>

          <td>
              <div class="input-group mr-1 input-group-sm">
                  <label>备案专业：</label>
                  <flex-select [allowClear]="true"
                  [url]= "'pl/plMajor/openMajorList.htm'"
                  
                  respDataPath= "array"
                  optionValueField="major_code"
                  optionTextField="full_name"
                  [(ngModel)]="query.major_code"
                  placeholder="请选择"
                  width = "150"
                  noResultsFound = "无数据"
                  [ngModelOptions]="{standalone: true}"
                  >
              </flex-select>
                </div>
          </td>
          
        <td>
      <button class="btn btn-primary btn-rounded btn-outline btn-sm  mr-1">
        <i class="fa fa-search"></i> 查询</button>
        <button class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip" data-placement="left" (click)="export()"
        title="导出">
        <i class="fa icon-layers"></i> 导出</button>
      </td>
      </tr>
      </table>
      </form>
    </div>
  </div>


  


  <!--表格-->
  <div class="row" [hidden]="editShowType=='only'">
    <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>
            <th align="center">及格人数</th>
            <th align="center">及格率(%)</th>
            <th align="center">平均分</th>
          </tr>
        </thead>
        <tbody>
          <tr *ngFor="let item of framePager.getRecords(); let i = index">
            <td>{{framePager.pageStart+i}}</td>
            <td align="center">{{item.course_code}}</td>
            <td>{{item.course_name}}</td>
            <td align="right">{{item.allnum}}</td>
            <td align="right">{{item.nums}}</td>
            <td align="right">{{item.passnum}}</td>
            <td align="right">{{item.passrate}}</td>
            <td align="right">{{item.averscore}}</td>
          </tr>
        </tbody>
      </table>
      <frame-pager [url]="QUERY_URL" hideSearch="true" hasCheck="true" #framePager (preReqEvent)="search($event)">
      </frame-pager>
    </div>
    <!-- 编辑页面 -->
    <div class="col-lg-12" *ngIf="item && editShowType != null &&editShowType!='modal'">
      <ng-container *ngTemplateOutlet="editTemplateModal">
      </ng-container>
    </div>

  </div>
</div>
<!-- only编辑页面-->
<div class="col-lg-12" *ngIf="editShowType != null &&editShowType =='only'">
  <ng-container *ngTemplateOutlet="editTemplateModal">
  </ng-container>
</div>

</div>