<div class="row rt-margin-bottom-before-box">
    <div class="col-sm-8">
        <div class="btn-group">
            <button class="btn btn-link" data-toggle="sidebar" data-target=".sidebar-right" ng-if="vm.view.type=='default'" ui-sref=".edit({id:''})"
                ui-sref-opts="{location:true}">
                <i class="fa fa-plus"></i> 新建
            </button>
            <button class="btn btn-link" data-toggle="{{vm.view.selectedIds.length !== 1?'':'sidebar'}}" data-target="{{vm.view.selectedIds.length !== 1?'':'.sidebar-right'}}"
                ng-click="vm.actions.copy();">
                <i class="fa fa-plus"></i> 复制
            </button>
            <!-- <button class="btn btn-link" data-toggle="sidebar" data-target=".sidebar-right" ng-click="vm.actions.distribute()">
                    <i class="fa fa-plus"></i> 分发
            </button> -->
            <button class="btn btn-link" ng-click="vm.actions.del()">
                <i class="fa fa-trash"></i> 删除
            </button>
        </div>
    </div>
    <div class="col-sm-4">
        <form class="input-group">
            <input type="search" placeholder="搜索角色名称......" class="form-control" ng-model="vm.view.searchText" />
            <span class="input-group-btn" ng-click="vm.view.search(1)">
                <button type="submit" class="btn btn-default">
                    <i class="fa fa-search"></i>
                </button>
            </span>
        </form>
    </div>
</div>
<div class="box box-primary">
    <div class="box-header" style="cursor: move;">
        <div class="box-header" style="cursor: move;">
            <div class="pull-left">
                <div class="btn-group">
                    <button class="btn btn-default dropdown-toggle" id="dropdownMenuViewSelect" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        {{vm.view.selectedView.ViewName}}
                        <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu" aria-labelledby="dropdownMenuViewSelect">
                        <li ng-repeat="view in vm.view.list track by view.Id" ng-click="vm.view.select(view)">
                            <a href="javascript:void(0)">{{view.ViewName}}</a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="nav-tabs-custom">
            <rt-data-grid rt-page-record-count="vm.page.recordCount" rt-page-index="vm.page.index" rt-page-size="vm.page.size" rt-get-data="vm.view.search()"
                rt-sort-field="vm.view.sortField" rt-rows="vm.data" rt-selected-ids="vm.view.selectedIds" rt-auto-height="{{vm.view.autoHeight}}">
                <table class="table table-condensed table-hover">
                    <thead>
                        <tr>
                            <th>
                                <rt-header-checkbox></rt-header-checkbox>
                            </th>
                            <!-- @@ 视图表头 -->
                            <th rt-field-code="RoleName">角色名称</th>
                            <th>菜单权限</th>
                            <th>操作权限</th>
                            <th>实体权限粒度</th>
                            <th>实体权限</th>
                            <th>创建时间</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr ng-repeat="row in vm.data track by row.Id">
                            <td>
                                <rt-data-checkbox value="{{row.Id}}" />
                            </td>
                            <!-- @@ 视图列表值 -->
                            <td>
                                <a id="{{row.Id}}" data-toggle="sidebar" data-target=".sidebar-right" ui-sref=".edit({id:row.Id})" ui-sref-opts="{location:true}">{{row.RoleName}}</a>
                            </td>
                            <td>
                                <a href="javascript:;" ui-sref=".rolemenu({id:row.Id})" ui-sref-opts="{location:true}" id="{{row.Id}}" data-toggle="sidebar" data-target=".sidebar-right">设置</a>
                                <!-- <a href="javascript:;" ng-click="vm.actions.showForm(row.Id, 'core/security/rolemenu/rolemenuView.html', 'rolemenuController')">设置</a> -->
                                <!-- <button class="btn btn-link" data-toggle="sidebar" data-target=".sidebar-right" ng-click="vm.actions.setting(row.Id)"> 设置2</button> -->
                            </td>
                            <td><a href="javascript:;" ui-sref=".operating({id:row.Id})" ui-sref-opts="{location:true}" id="{{row.Id}}" data-toggle="sidebar" data-target=".sidebar-right">设置</a></td>
                            <td>{{row.privilege_levelName}}</td>
                            <td><a href="javascript:;" ui-sref=".entityview({id:row.Id})" ui-sref-opts="{location:true}" id="{{row.Id}}" data-toggle="sidebar" data-target=".sidebar-right">设置</a></td>
                            <td></td>
                            <td>
                                {{row.CreatedOn | date: 'yyyy-MM-dd HH:mm'}}
                            </td>
                        </tr>
                    </tbody>
                </table>
            </rt-data-grid>
        </div>
    </div>
</div>

<div class="sidebar sidebar-right sidebar-animate rt-shadow-border-left content-wrapper" ng-if="vm.view.type=='default'">
    <div ui-view class="content"></div>
</div>