<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('cmm/knowledge/knowledgeTypeEditView.html', 'knowledgeTypeEditController')"
                    ng-show="vm.privilege.IsCreate">
                <i class="fa fa-plus"></i> 新建
            </button>
            <button class="btn btn-link"
                    ng-click="vm.actions.edit(vm.view.selectedIds[0], 'cmm/knowledge/knowledgeTypeEditView.html', 'knowledgeTypeEditController')"
                    ng-show="vm.privilege.IsWrite">
                <i class="fa fa-pencil-square-o"></i> 编辑
            </button>
            <button class="btn btn-link" ng-click="vm.actions.del()" ng-show="vm.privilege.IsDelete">
                <i class="fa fa-trash"></i> 删除
            </button>
            <button class="btn btn-link" ng-click="vm.actions.activate()" ng-show="vm.privilege.IsActive">
                <i class="fa fa-check"></i> 激活
            </button>
            <button class="btn btn-link" ng-click="vm.actions.deactivate()" ng-show="vm.privilege.IsActive">
                <i class="fa fa-ban"></i> 停用
            </button>
            <button class="btn btn-link" ng-show="vm.privilege.IsExport"
                    ng-click='vm.actions.export({
                        "name":"知识库类别名称",
                        "parenttypeIdName":"父类别名称",
                        "StateCodeName":"状态"
                        })'>
                <i class="fa fa-download"></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.actions.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.selectedView = view">
            <a href="javascript:;" 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.actions.search()"
                      rt-sort-field="vm.view.sortField" rt-rows="vm.data" rt-selected-ids="vm.view.selectedIds">
            <table class="table table-condensed table-hover">
                <thead>
                <tr>
                    <th>
                        <rt-header-checkbox></rt-header-checkbox>
                    </th>
                    <th rt-field-code="name">知识库类别名称</th>
                    <th>父类别名称</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="row in vm.data track by row.Id"
                    ng-dblclick="vm.actions.edit(row.Id,'cmm/knowledge/knowledgeTypeEditView.html', 'knowledgeTypeEditController')">
                    <td>
                        <rt-data-checkbox value="{{row.Id}}"/>
                    </td>
                    <td ng-if="vm.view.type=='default'">
                        <a id="{{row.Id}}" data-toggle="sidebar" data-target=".sidebar-right"
                           ui-sref=".readonly({id:row.Id})" ui-sref-opts="{location:true}">{{row.name}}</a>
                    </td>
                    <td ng-if="vm.view.type=='grid'">
                        {{row.name}}
                    </td>
                    <td>
                        {{row.parenttypeId.Name}}
                    </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>