<div ng-controller="ConfidentialCtrl" class="wrapper">
    <div class="panel panel-default">
        <div class="panel-body">
            <div class="form-inline">
                <div class="input-group col-sm-4">
                    <div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
                    <input type="text" placeholder="考试机构名称,地址" class="input-sm form-control"
                           ng-model="search.keyword" ng-change="goPage(1)"/>
                </div>
                <label>批次：
                    <select class="input-sm form-control" ng-model="search.batchId" ng-change="goPage(1)">
                        <option value="">所有</option>
                        <option value="{{b.id}}" ng-repeat="b in bacthList">{{b.title}}</option>
                    </select>
                </label>
                <a ng-click="downConfidential()" class="btn btn-default"><i
                        class="glyphicon glyphicon-download">导出机要交接单</i></a>
            </div>
            <table class="paper-table table-striped m-t" style="table-layout: fixed;">
                <thead>
                <tr>
                    <th width="3%">#</th>
                    <th width="5%">批次标题</th>
                    <th width="10%">考试机构省份</th>
                    <th width="10%">考试机构名称</th>
                    <th width="10%">考试机构地址</th>
                    <th width="5%">袋数</th>
                    <th width="10%">操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="row in pageModel.array">
                    <td>{{$index + 1}}</td>
                    <td>{{row.paperBatch.title}}</td>
                    <td>{{row.province.name}}</td>
                    <td>{{row.province.unit}}</td>
                    <td>{{row.province.address}}</td>
                    <td class="clip" title="{{row.bagNum}}" ng-keyup="onKeyUp(rowform,$index)">
							<span editable-text="row.bagNum" e-name="bagNum" e-form="rowform" e-type="number">
								{{row.bagNum}}
							</span>
                    </td>
                    <td style="white-space: nowrap">
                        <!-- form -->
                        <form editable-form name="rowform" onbeforesave="save($data, row.id)"
                              ng-show="rowform.$visible" class="form-buttons form-inline" shown="inserted == row">
                            <button type="submit" ng-disabled="rowform.$waiting" class="btn btn-default btn-md">
                                保存
                            </button>
                            <button type="button" ng-disabled="rowform.$waiting" ng-click="rowform.$cancel()"
                                    class="btn btn-default btn-md">
                                取消
                            </button>
                        </form>
                        <div class="buttons" ng-show="!rowform.$visible">
                            <button class="btn btn-xs btn-default" ng-click="rowform.$show()" id="btn_{{$index + 1}}">
                                <i class="glyphicon glyphicon-pencil"></i>
                            </button>
                        </div>
                    </td>
                </tr>
                </tbody>

            </table>
            <nav ng-if="pageModel.totalPage > 1">
                <ul class="pagination">
                    <li class="{{pageModel.curPage == 1 ? 'disabled' : ''}}" ng-click="goPage(pageModel.curPage - 1)">
                        <a aria-label="Previous"><span aria-hidden="true">&laquo;</span></a>
                    </li>
                    <li ng-repeat="i in [9,8,7,6,5,4,3,2,1]" ng-if="pageModel.curPage - i > 0"
                        ng-click="goPage(pageModel.curPage - i)">
                        <a>{{pageModel.curPage - i}}</a>
                    </li>
                    <li class="active"><a href="#">{{pageModel.curPage}}</a></li>
                    <li ng-repeat="i in [1,2,3,4,5,6,7,8,9]" ng-if="pageModel.curPage + i <= pageModel.totalPage"
                        ng-click="goPage(pageModel.curPage + i)">
                        <a>{{pageModel.curPage + i}}</a>
                    </li>
                    <li class="{{pageModel.curPage == pageModel.totalPage ? 'disabled' : ''}}"
                        ng-click="goPage(pageModel.curPage + 1)">
                        <a aria-label="Next"><span aria-hidden="true">&raquo;</span></a>
                    </li>
                </ul>
            </nav>
        </div>
    </div>
</div>
</div>