<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'" ng-show="vm.privilege.IsCreate"
                ui-sref=".edit({id:''})" ui-sref-opts="{location:true}">
                <i class="fa fa-plus"></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="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-hover">
                <thead>
                    <tr>
                        <th rt-field-code="name">单号</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>
                            <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>
                            {{row.absence_type.Name}}
                        </td>
                        <td>
                            {{row.total_days}}
                        </td>
                        <td>
                            {{row.start_date | date:'yyyy-MM-dd HH:mm'}}
                        </td>
                        <td>
                            {{row.end_date | date:'yyyy-MM-dd HH:mm'}}
                        </td>
                        <td>
                            {{row.approvalStatus}}
                        </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>