<div class="row rt-margin-bottom-before-box">
    <div class="col-sm-8">
        <div class="btn-group">
            <button class="btn btn-link" ng-click="vm.actions.new('core/security/roleoperating/roleOperatingEditView.html', 'roleOperatingEditController')" ng-show="vm.privilege.IsCreate">
                    <i class="fa fa-plus"></i> 新建
                </button>
            <button class="btn btn-link" ng-click="vm.actions.del()" ng-show="vm.privilege.IsDelete">
                    <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()">
                    <button type="submit" class="btn btn-default">
                        <i class="fa fa-search"></i>
                    </button>
                </span>
        </form>
    </div>
</div>

<div class="nav-tabs-custom">
    <ul class="nav nav-tabs">
        <li ng-repeat="view in vm.view.list track by view.Id" ng-class="{true:'active',false:'inactive'}[view.Id == vm.view.selectedView.Id]"
            ng-click="vm.view.select(view)">
            <a href="#1" onclick="return false;" data-toggle="tab">{{view.ViewName}}</a>
        </li>
    </ul>
    <div class="tab-content">
        <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="name">操作名称</th>
                        <th rt-field-code="code">操作编码</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 href="javascript:;" ng-click="vm.actions.edit(row.Id, 'core/security/roleoperating/roleOperatingEditView.html', 'roleOperatingEditController')">{{row.name}}</a>
                        </td>
                        <td>{{row.code}}</td>
                        <td>
                            <span ng-repeat="role in row.Roles track by role.Id">
                                {{role.Name}}
                            </span>
                        </td>
                        <td>{{row.remarks}}</td>
                    </tr>
                </tbody>
            </table>
        </rt-data-grid>
    </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>