<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/NewAutonumber/newAutonumberEditView.html', 'newAutonumberEditController')"
                    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], 'core/NewAutonumber/newAutonumberEditView.html', 'newAutonumberEditController')"
                    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({
                            "new_name":"实体名称",
                            "new_nofieldname":"单号字段",
                            "new_prefix":"前缀",
                            "new_isyear":"是否包含年",
                            "new_istwo":"是否两位年",
                            "new_ismonth":"是否包含月",
                            "new_isday":"是否包含日",
                            "new_length":"流水号长度"
                        })'>
                <i class="fa fa-download"></i>
                导出
            </button>
        </div>
    </div>
    <div class="col-sm-4">
        <form class="input-group">
            <span class="input-group-btn">
                <button type="button"
                        ng-click="vm.filter = !vm.filter"
                        ng-class="{true: 'bg-blue-active', false:''}[vm.filter]"
                        class="btn btn-link">
                    <i class="fa fa-filter"></i> 筛选
                </button>
            </span>
            <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 ng-show="vm.filter" class="box box-primary">
    <div class="box-header with-border">
        <h3 class="box-title">筛选</h3>

        <div class="box-tools pull-right">
            <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
            </button>
        </div>
    </div>
    <!-- /.box-header -->
    <!-- form start -->
    <form class="form-horizontal">
        <div class="box-body">
            <div class="form-group">
                <rt-input rt-type="text" rt-title="实体名称" rt-label-col="1" rt-col="2"
                          ng-model="vm.view.searchList[0].Value"></rt-input>
            </div>
        </div>
        <!-- /.box-body -->
        <div class="box-footer">
            <div class="btn-group pull-right">
                <button type="button" class="btn btn-primary" ng-click="vm.actions.search()">搜索</button>
                <button type="button" class="btn btn-default" ng-click="vm.actions.clearSearchList()">重置</button>
            </div>
        </div>
        <!-- /.box-footer -->
    </form>
</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="new_name">实体名称</th>
                    <th>单号字段</th>
                    <th>前缀</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"
                    ng-dblclick="vm.actions.edit(row.Id,'core/NewAutonumber/newAutonumberEditView.html', 'newAutonumberEditController')">
                    <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.new_name}}</a>
                    </td>
                    <td ng-if="vm.view.type=='grid'">
                        {{row.new_name}}
                    </td>
                    <td>
                        {{row.new_nofieldname}}
                    </td>
                    <td>
                        {{row.new_prefix}}
                    </td>
                    <td>
                        {{row.new_isyear === true?'是':'否'}}
                    </td>
                    <td>
                        {{row.new_istwo === true?'是':'否'}}
                    </td>
                    <td>
                        {{row.new_ismonth === true?'是':'否'}}
                    </td>
                    <td>
                        {{row.new_isday === true?'是':'否'}}
                    </td>
                    <td>
                        {{row.new_length === true?'是':'否'}}
                    </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>