<div class="modal-header">
  <h4 class="modal-title pull-left">适用科目配置信息</h4>
</div>

<div class="modal-body">
  <div class="card card-default">
    <div class="card-body">
      <div class=" form-group row mt-3">
          <label class="col-lg-2 col-form-label text-lg-right">科目</label>
          <div class="col-lg-6 col-md-6">
            <ngx-select [items]="subjectArray"  [(ngModel)]="choose_subject_id" optionValueField="subject_id" 
            optionTextField="full_subject_name" ></ngx-select>
          </div>
          <div class="col-lg-2">
            <button class="btn btn-primary" (click)="addSubject()">添加科目</button>
          </div>
      </div>

      <div class="form-group row">
        <div class="col-lg-2"></div>
        <div class=" table-responsive bg-white col-lg-6">
          <table class="table table-striped table-hover table-bordered">
              <thead>
                  <tr>
                      <th>#</th>
                      <th>科目代码</th>
                      <th>科目名称</th>
                      <th>操作</th>
                  </tr>
              </thead>
              <tbody>
                  <tr *ngFor="let subject of chooseArray; let j=index">
                      <td>{{j+1}}</td>
                      <td>{{subject.subject_code}}</td>
                      <td>{{subject.subject_name}}</td>
                      <td><button class="btn btn-danger" type="button"
                              (click)="removeSubject(subject)">删除</button></td>
                  </tr>
              </tbody>
          </table>
      </div>
      </div>

    </div>
  </div>
</div>

<div class="modal-footer">
    <button class="btn btn-primary" type="button" (click)="saveSubject()">
      确定科目配置
    </button>
    <button class="btn btn-secondary" type="button" (click)="closeWindow()">关闭窗口</button>
</div>
