<ng-template #queryTemplateModal>
<div class="modal-content">
  <div class="modal-header info-success-qm">
    <div class="pull-left">
      <em class="fa-lg fas fa-edit "></em> 课程选择
    </div>
    <button type="button" class="close" (click)="_concel();">×</button>
  </div>
  <div class="modal-body">
    <div [ngTemplateOutlet]="courseSelectTemplate"></div>
  </div>
  <div class="modal-footer">
    <button class="btn btn-default" (click)="_confirm();">
      <i class="icon-close"> </i> 选择
    </button>
    <button class="btn btn-default" (click)="_concel();">
      <i class="icon-close"> </i> 关闭
    </button>
  </div>
</div>
</ng-template>
<ng-template #courseSelectTemplate>
<div class="row mb-3 ml-1">
  <div class="col-lg-12">
    <form (ngSubmit)="framePager.goSearch()" class="form-inline">
      <div class="input-group mr-1 input-group-sm">
        <label>关键字：</label>
        <input name="query" [(ngModel)]="query.query" class="input-sm form-control" type="text" maxlength="64">
      </div>
      <button class="btn btn-primary btn-rounded btn-outline btn-sm  mr-1" (click)="framePager.goSearch()">
        <i class="fa fa-search"></i> 查询</button>
    </form>
  </div>
</div>
<div class="row">
  <div class="col-lg-12 ml-0">
    <table class="table table-sm table-striped table-hover table-bordered bg-white">
      <thead>
        <th width="5%">
          <div class="checkbox c-checkbox" *ngIf="isSelectTypeM()">
            <label>
              <input type="checkbox" (change)="framePager.checkedMasterToggle($event)" />
              <span class="fa fa-check"></span>
            </label>
          </div>
        </th>
        <th>课程代码</th>
        <th>课程名称</th>
        <th>学分</th>
        <th>课程类型</th>
      </thead>
      <tr *ngFor="let item of framePager.getRecords(); let i = index">
        <td>
          <label *ngIf="isSelectTypeM()" style="margin: 0px !important">
            <div class="checkbox c-checkbox input-group-sm">
              <input type="checkbox" [value]="item.id" [(checked)]="item.isChecked" [(ngModel)]="item.isChecked" />
              <span class="fa fa-check"></span>
            </div>
          </label>

            <label class="radio-inline c-radio" style="margin: 0px !important" *ngIf="isSelectTypeS()">
              <input type="radio" name="radio" [value]="item.id" (click)="toggleCheck(item)"  [(ngModel)]="radioItem.id"/>
              <span class="fa fa-circle" style="margin: 0px !important"></span>
            </label>
        </td>
        <td>{{item.course_code}}</td>
        <td>{{item.course_name}}</td>
        <td>{{item.course_score}}</td>
        <td>{{item.course_exam_type | frameDict:'CourseNature'}}</td>
      </tr>
    </table>
    <frame-pager [url]="QUERY_URL" hideSearch="true" hasCheck="true" #framePager (preReqEvent)="search($event)"></frame-pager>
  </div>
</div>
</ng-template>