<div class="modal-header">
  <h4 class="modal-title pull-left">【{{ResponseEntity.optr_name}}（{{ResponseEntity.login_name}}）】角色列表</h4>
</div>
<div class="modal-body">
  <div class=" table-responsive bg-white">
    <table class="table table-striped table-hover table-bordered">
      <thead>
      <tr>
        <th>#</th>
        <th><span href="#" (click)="pager.sort('role_name')">角色名称</span></th>
        <th>是否已分配</th>
        <th>操作员数</th>
        <th>资源总数</th>
        <th>主页地址</th>
        <th class="th-b-4"></th>
      </tr>
      </thead>
      <tbody>
      <tr *ngFor="let v of pager.getRecords(); let i = index">
        <td>{{i+1}}</td>
        <td>{{v.role_name}}</td>
        <td><span *ngIf="v.optr_id" class="text-success">已分配</span></td>
        <td>{{v.optr_count}}</td>
        <td>{{v.res_count}}</td>
        <td>{{v.home_page}}</td>
        <td>
          <button class="btn btn-primary btn-sm" type="button" (click)="pager.optrRecord('frame/optr/role/dist.htm', {optr_id: ResponseEntity.optr_id, role_id: v.role_id}, {successMsg:'已成功为操作员分配角色权限！', confirmMsg: '确定要给该操作员分配角色【'+ v.role_name +'】吗？', successMsgType:'Swal'})" *ngIf="v.optr_id === undefined">
            分配权限
          </button>
          <button class="btn btn-danger btn-sm" type="button" (click)="pager.optrRecord('frame/optr/role/recover.htm',  {optr_id: ResponseEntity.optr_id, role_id: v.role_id}, {successMsg:'已成功回收操作员的角色权限！', confirmMsg: '确定要回收该操作员的角色【'+ v.role_name +'】吗？', successMsgType:'Swal'})" *ngIf="v.optr_id !== undefined">
            取消分配
          </button>
        </td>
      </tr>
      </tbody>
    </table>
    <frame-pager [url]="'./frame/role/page.htm'" [pagerParams]="{optr_id: ResponseEntity.optr_id}" #pager></frame-pager>
  </div>
</div>
<div class="modal-footer">
  <button class="btn btn-secondary" type="button" (click)="closeWindow()">关闭窗口</button>
</div>
