<ng-container *ngIf="agent">
  <div class="content-heading  justify-content-between">
    <div>评委规则 - {{agent?.ly_agent_name}}</div>
    <div class="float-right">

    </div>
  </div>
  <div class="row">
    <div class="col-xl-4" *ngFor="let group of ajax.getMap()['GroupArray']">
      <div class="card card-default">
        <div class="card-header">
          <div class="float-right"><span class="table-button" (click)="addRule(group)"><em
            class="fa-lg fas fa-plus"></em></span></div>
          <div class="mr-3 float-right badge badge-info">考场数：{{group.room_total}}</div>
          <div class="mr-2 float-right badge badge-primary">评委数：<span *ngIf="group.ly_judge_total>0">{{group.ly_judge_total}} / </span>{{group.room_judge_num}}</div>
          <div class="card-title"
               [ngClass]="{'text-success':group.room_judge_num - group.ly_judge_total ===0,'text-danger':(group.ly_judge_total === undefined ||group.room_judge_num - group.ly_judge_total !==0)}">{{group.group_name}}</div>
        </div>
        <!-- START list group item-->
        <div class="list-group-item list-group-item-action" *ngFor="let rule of ajax.getMap()['RuleArray_' + group.ly_group_id];let i=index;">
          <div class="media">
            <img class="align-self-start mx-2 circle thumb32" src="assets/img/user/0{{i+1}}.jpg" alt="Image">
            <div class="media-body text-truncate">
              <p class="mb-1">
                <strong class="text-primary">
                  <span class="circle bg-success circle-lg text-left"></span>
                  <span>{{rule.rule_name}}<span class="ml-2">{{rule.group_priortiy}} / {{rule.gobal_priortiy}}</span></span>
                </strong>
              </p>
              <p class="mb-1 text-sm" *ngIf="rule.rule_chief === 'Active'">限定主评委</p>
              <p class="mb-1 text-sm" *ngIf="rule.rule_school_flag === 'Active'">限定本校评委</p>
              <p class="mb-1 text-sm" *ngIf="rule.rule_school_flag === 'InActive'">限定校外评委</p>
              <p class="mb-1 text-sm" *ngIf="rule.rule_school !==undefined && rule.rule_school.length >0">限定学校：{{rule.rule_school}}</p>
              <p class="mb-1 text-sm" *ngIf="rule.rule_title !==undefined && rule.rule_title.length >0">限定职称：{{rule.rule_title}}</p>
              <p class="mb-1 text-sm" *ngIf="rule.rule_sex !==undefined && rule.rule_sex.length >0">限定性别：{{rule.rule_sex}}</p>
              <p class="mb-1 text-sm" *ngIf="rule.rule_breeds !==undefined && rule.rule_breeds.length >0">限定类型：{{rule.rule_breeds}}</p>
            </div>
            <div class="ml-auto">
              <div class="ml-2"><span class="text-muted text-sm">评委数：</span><span class="text-bold text-1-2">{{rule.judge_total}}</span></div>
              <div class="ml-3"><span class="table-button"
                         (click)="showModal({ResponseEntity:rule,mapUrl:'exam/judge/rule/init.htm',mapParam:{ly_group_id:group.ly_group_id,ly_agent_id:group.ly_agent_id}})"><em
                class="fa fas fa-edit"></em></span>
                <span class="table-button ml-3"
                      (click)="deleteRule(rule)"><em
                  class="fa fas fa-trash-alt text-danger"></em></span>
              </div>
            </div>
          </div>
        </div>

      </div>
    </div>
  </div>
  <frame-ajax [autoRequest]="false" [requestParam]="{ly_agent_id:agent?.ly_agent_id}"
              [url]="'exam/judge/rule/group.htm'" [ajaxDataType]="'map'" #ajax></frame-ajax>


</ng-container>
