<div class="content-heading  justify-content-between">
  <div>划线分组管理</div>
  <div class="float-right">
    <div class="row">
      <div><input class="form-control wd-xs input-group-lg" type="text" [(ngModel)]="searchValue"
                  maxlength="128"/></div>
      <div class="btn-group mb-1 mr-1 ml-3" dropdown>
        <button class="btn dropdown-toggle btn-secondary" type="button" dropdownToggle>录取分组
          <span class="caret"></span>
        </button>
        <div *dropdownMenu class="dropdown-menu" role="menu">
          <a class="dropdown-item" href="#" (click)="openUnionGroup()">合并划线分组</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item text-danger" href="#" (click)="openInitWindow()">划线初始化</a>
        </div>
      </div>
    </div>
  </div>
</div>

<ng-container *ngIf="groupMap">
  <table class="table table-striped table-hover table-bordered">
    <thead>
    <tr>
      <th class="th-index"></th>
      <td></td>
      <th>划线分组</th>
      <th>包含专业</th>
      <th>总批次</th>
      <th>当前批次</th>
      <th>批次状态</th>
      <th>划线方式</th>
      <th>男女单列</th>
      <th>合格最低分</th>
      <th>其他参数</th>
      <td></td>
    </tr>
    </thead>
    <tbody>
    <tr *ngFor="let v of groupMap['GroupArray'] | arrayFilter:  searchValue ; let i = index">
      <td>{{v.pn_order}}</td>
      <td>
        <div class="form-check" *ngIf="groupMap['AspectArray_'+v.pn_id].length === 1">
          <div class="checkbox c-checkbox">
            <label>
              <input type="checkbox" [(ngModel)]="v.checked"/>
              <span class="fa fa-check"></span></label>
          </div>
        </div>
        <button class="btn btn-primary" type="button" (click)="dismissGroup(v)"
                *ngIf="groupMap['AspectArray_'+v.pn_id].length > 1">
          打散分组
        </button>
      </td>
      <td><span class="table-sort" (click)="openGroupDetail(v)">{{v.pn_name}}</span></td>
      <td>
        <span *ngIf="groupMap['AspectArray_'+v.pn_id].length > 1 ">
          <div *ngFor="let ap of groupMap['AspectArray_'+v.pn_id]">{{ap.aspect_name}}<span
            *ngIf="ap.variety_name"> 【{{ap.variety_name}}】</span></div>
        </span>
      </td>
      <td>{{v.pn_batchs}}</td>
      <td>{{v.cur_batch}}</td>
      <td>{{v.cur_status}}</td>
      <td>{{v.pn_type | frameDict :'PlanGroupType'}}</td>
      <td [innerHTML]="v.sex_flag | frameStatusCustom:['男女单列','']"></td>
      <td>{{v.qualified_min_score}} </td>
      <td>{{v.qualified_subject_param}} </td>
      <td>
        <button class="btn btn-primary" type="button" (click)="lockGroup(v)"  *ngIf="v.cur_status === 'Init'">锁定划线
        </button>
        <button class="btn btn-success" type="button" (click)="completeGroup(v)"  *ngIf="v.cur_status === 'Lock'">保存划线
        </button>
        <button class="btn btn-success" type="button" (click)="publishPlan(v)"  *ngIf="v.cur_status === 'Complete'">发布榜单
        </button>
        <button class="btn btn-success" type="button" (click)="sendNotice(v)"  *ngIf="v.cur_status === 'Publish'">发送微信消息
        </button>


      </td>
    </tr>
    </tbody>
  </table>
</ng-container>
