<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="row">
        <div class="wd-xl wd-sm">
            <ngx-select [items]="schoolArray" [(ngModel)]="query.school_id" (ngModelChange)="queryBatchArray()" placeholder="学校"
                [autoClearSearch]="true" optionValueField="school_id" optionTextField="school_name">
            </ngx-select>
        </div>
        <div class="wd-xl wd-sm ml-1">
            <ngx-select [items]="batchArray" [(ngModel)]="query.batch_id"  placeholder="批次"
                [autoClearSearch]="true" optionValueField="batch_id" optionTextField="batch_name">
            </ngx-select>
        </div>
      </div>
      <div class="row">
        <div class="table-responsive bg-white table-full" style="margin-top: 3px;">
          <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)="pager.checkedMasterToggle($event)" />
                    <span class="fa fa-check"></span>
                  </label>
                </div>
              </th>              
              <th>材料大类</th>
              <th>材料名称</th>
              <th>排序</th>
              <th>文件最小</th>
              <th>文件最大</th>
              <th>是否上传</th>
              <th>启用状态</th>
              <th>材料说明</th>
              <th>备注</th>
            </tr>
            </thead>
            <tbody>
            <tr *ngFor="let v of pager.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.category_name}}</td>
              <td>{{v.material_name}}</td>
              <td>{{v.ord}}</td>
              <td>{{v.min_size}}</td>
              <td>{{v.max_size}}</td>
              <td [innerHTML]="v.need_upload | frameDict:'YesOrNo'"></td>
              <td [innerHTML]="v.status | frameDict:'EnableStatus'"></td>
              <td title="{{v.material_desc}}">{{v.material_desc | subStr: 30}}</td>
              <td>{{v.remark}}</td>
            </tr>
            </tbody>
          </table>
          <frame-pager [url]="'./cf/material/def/page.htm'" [pagerParams]="{school_id: query.school_id}" #pager></frame-pager>
        </div>        
      </div>
    </div>
  </div>
</div>
<div class="modal-footer">
  <button class="btn btn-primary" type="button"
          (click)="save();">保存
  </button>
  <button class="btn btn-secondary" type="button" (click)="closeWindow()">关闭窗口</button>
</div>
