<div class="content-heading  justify-content-between">
  <div>资源管理</div>
  <div class="float-right">
    <div class="btn-group mb-1 mr-1" dropdown>
      <button class="btn dropdown-toggle btn-secondary btn-lg" type="button" dropdownToggle>资源管理
        <span class="caret"></span>
      </button>
      <div *dropdownMenu class="dropdown-menu modal-lg" role="menu">
        <a class="dropdown-item" href="#" (click)="showModal({'arrayUrl':'frame/res/all.htm'})">新增资源</a>
        <div class="dropdown-divider"></div>
        <a class="dropdown-item" href="#" (click)="showComponentModal(FrameResTreeComponent,{'arrayUrl':'frame/res/all.htm'})">资源树</a>
        <div class="dropdown-divider"></div>
        <a class="dropdown-item" href="#" (click)="syncRes()">菜单同步</a>
      </div>
    </div>
  </div>
</div>
<div class="table-responsive bg-white">
  <table class="table table-striped table-hover table-bordered">
    <thead>
    <tr>
      <th class="th-index">#</th>
      <th><span (click)="pager.sort('res_id')">资源编号</span></th>
      <th><span (click)="pager.sort('res_name')">资源名称</span></th>
      <th><span (click)="pager.sort('res_url')">路由地址</span></th>
      <th><span (click)="pager.sort('res_type')">资源类型</span></th>
      <th>资源层级</th>
      <th>资源图标</th>
      <th><span (click)="pager.sort('res_pid')">父资源</span></th>
      <th>状态</th>
      <th class="th-b-2"></th>
    </tr>
    </thead>
    <tbody>
    <tr *ngFor="let v of pager.getRecords(); let i = index">
      <td>{{i + 1}}</td>
      <td>{{v.res_id}}</td>
      <td>{{v.res_name}}</td>
      <td>{{v.res_url}}</td>
      <td>{{v.res_type | frameDict: 'FrameResType'}}</td>
      <td>{{v.res_level}}</td>
      <td><em class="{{v.res_css}}"></em><span class="ml-2">{{v.res_css}}</span></td>
      <td>{{v.res_pid}}</td>
      <td [innerHTML]="v.res_status | frameStatus "></td>
      <td>
        <span class="cursor-hand" (click)="showModal({ResponseEntity:v, arrayUrl:'frame/res/all.htm'})"><em class="fa-lg fas fa-edit"></em></span>
        <span class="cursor-hand ml-3 text-danger"
              (click)="pager.optrRecord('frame/res/delete.htm', v, {successMsg:'资源删除完成，角色关联资源同时被移除！', confirmMsg: '确定要删除该资源吗？', successMsgType:'Swal'})"><em
          class="fa-lg fas fa-trash-alt "></em></span>

      </td>
    </tr>
    </tbody>
  </table>
  <frame-pager url="frame/res/page.htm" #pager></frame-pager>
</div>


