<div class="listview">
    <div class="row">
        <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'"
                        ng-show="vm.privilege.IsCreate"
                        ui-sref=".edit({id:''})"
                        ui-sref-opts="{location:true}">
                    <i class="fa fa-plus"></i> 新建
                </button>
                <button class="btn btn-link"
                        ng-if="vm.view.type=='grid'"
                        ng-click="vm.actions.showForm('')"
                        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>
                <button class="btn btn-link"
                        ng-click="vm.actions.activate()"
                        ng-show="vm.privilege.IsWrite">
                    <i class="fa fa-check"></i> 激活
                </button>
                <button class="btn btn-link"
                        ng-click="vm.actions.deactivate()"
                        ng-show="vm.privilege.IsWrite">
                    <i class="fa fa-ban"></i> 停用
                </button>
            </div>
            <!-- div[.btn-group] -->
        </div>
        <form class="col-sm-4">
            <div 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>
            </div>
        </form>
        <!-- div[.col-sm-4] -->
    </div>
    <!-- div[.row]-->

    <div class="viewlist">
        <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>

        <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=" ">
            <table class="table table-hover">
                <thead>
                <tr>
                    <th>
                        <rt-header-checkbox></rt-header-checkbox>
                    </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 ng-if="vm.view.type=='default'">
                        <a id="{{row.Id}}"
                           data-toggle="sidebar"
                           data-target=".sidebar-right"
                           ui-sref=".edit({id:row.Id})"
                           ui-sref-opts="{location:true}">查看</a>
                    </td>
                    <td ng-if="vm.view.type=='grid'">
                        <a href="javascript:;"
                           ng-click="vm.actions.showForm(row.Id)">查看</a>
                    </td>
                    <td>{{row.contact_levelName}}</td>
                    <td>{{row.product_categoryName}}</td>
                    <td>
                        {{row.StateCodeName}}
                    </td>
                </tr>
                </tbody>
            </table>
        </rt-data-grid>
        <!-- rt-data-grid  -->
    </div>
    <!-- div[.panel-default] -->
</div><!-- div[.listview] -->

<div class="editview borderShadow sidebar sidebar-right sidebar-animate"
     ng-if="vm.view.type=='default'">
    <div ui-view class="content"></div>
</div><!-- div[.editview] -->