<div class="modal-header">
  <h4 class="modal-title pull-left">{{ResponseEntity.category_name}}-{{ResponseEntity.material_name}}-选择专业</h4>
</div>
<div class="modal-body">
  <div class="card card-default">
    <div class="card-body">
      <div class="row">
        <div class="col-lg-5 col-md-6">
          <div class="wd-xl wd-sm">
              <ngx-select [items]="majorArray" [(ngModel)]="currMajorIds" (ngModelChange)="selectMajor()" placeholder="专业"
                  [autoClearSearch]="true" optionValueField="major_id" optionTextField="major_name" [multiple]="true">
              </ngx-select>
          </div>
          <div class="table-responsive bg-white table-full" style="margin-top: 5px;">
            <table class="table table-striped table-hover table-bordered">
              <thead>
              <tr>
                <th align="center">
                  <div class="checkbox c-checkbox" style="text-align: center;">
                    <label style="padding:0px;margin: 0px;">
                      <input type="checkbox"
                        (change)="aspectPager.checkedMasterToggle($event)" />
                      <span class="fa fa-check"></span>
                    </label>
                  </div>
                </th>
                <th>专业代码</th>
                <th>专业名称</th>
                <th>专业方向代码</th>
                <th>专业方向名称</th>
              </tr>
              </thead>
              <tbody>
              <tr *ngFor="let v of aspectPager.getRecords(); let i = index">
                <td align="center">
                  <div class="checkbox c-checkbox input-group-sm" style="text-align: center;">
                    <label style="padding:0px;margin: 0px;">
                      <input type="checkbox" [value]="v.id" [(checked)]="v.isChecked"
                        [(ngModel)]="v.isChecked" />
                      <span class="fa fa-check"></span>
                    </label>
                  </div>
                </td>
                <td>{{v.major_code}}</td>
                <td>{{v.major_name}}</td>
                <td>{{v.aspect_code}}</td>
                <td>{{v.aspect_name}}</td>
              </tr>
              </tbody>
            </table>
            <frame-pager [url]="'./cf/aspect/page2.htm'" [pagerParams]="{school_id: this.ResponseEntity.school_id, batch_id: this.ResponseEntity.batch_id, major_ids: this.currMajorIds}" #aspectPager></frame-pager>
          </div>
        </div>
        <div class="col-lg-1 col-md-1" style="display: flex;justify-content:center;align-items:center;">
          <button class="btn btn-primary" type="button" (click)="addToRight()">添加</button>
        </div>
        <div class="col-lg-6 col-md-6">
          <div class="wd-xl wd-sm">
            <span class="text-green">已选专业</span>&nbsp;&nbsp;&nbsp;&nbsp;
            <button class="btn btn-second" type="button" (click)="deleteAll()">全部删除</button>
          </div>
          <div class="table-responsive bg-white table-full" style="margin-top: 15px;">
            <table class="table table-striped table-hover table-bordered">
              <thead>
              <tr>
                <th>序号</th>
                <th>专业代码</th>
                <th>专业名称</th>
                <th>专业方向代码</th>
                <th>专业方向名称</th>
                <th class="th-b-1"></th>
              </tr>
              </thead>
              <tbody>
                <tr *ngFor="let v of rightArray; let i = index">
                <td>{{i + 1}}</td>
                <td>{{v.major_code}}</td>
                <td>{{v.major_name}}</td>
                <td>{{v.aspect_code}}</td>
                <td>{{v.aspect_name}}</td>
                <td>
                  <span class="table-button ml-3 text-danger" (click)="delFromRight(v)"><em class="fa-lg fas fa-trash-alt "></em></span>
                </td>
              </tr>
              </tbody>
            </table>
          </div>
         </div>
      </div>
    </div>
  </div>
</div>
<div class="modal-footer">
  <button class="btn btn-primary" type="button"
          (click)="saveAll();">添加所有专业并保存
  </button>
  <button class="btn btn-primary" type="button"
          (click)="save();">保存
  </button>
  <button class="btn btn-secondary" type="button" (click)="closeWindow()">关闭窗口</button>
</div>
