<p class="text-success font-bold" ng-controller="UseBatchSummaryCtrl">{{batchSummary}}</p>
<div ng-controller="UseBatchPaperExtractCtrl" cg-busy="{promise:loading, message:'正在加载...'}">
	<ul class="nav nav-pills padder">
         <li ui-sref-active="active"><a ui-sref="batch.info.use" >启用卷管理</a></li>
         <li ui-sref-active="active" class="active"><a ui-sref="batch.info.useExtract">抽卷</a></li>
         <li ui-sref-active="active" ><a ui-sref="batch.info.useStock">库存统计</a></li>
	</ul>
	<div class="panel panel-default">
		<div class="panel-body">
			<button ng-click="showImportCourseBookWin()" class="btn btn-success">
				<i class="glyphicon glyphicon-import"> 导入课程与教材信息</i>
			</button>
			<button ng-click="showImportGJCourseWin()" class="btn btn-success">
				<i class="glyphicon glyphicon-import"> 导入共卷课程信息</i>
			</button>
			<button ng-click="showGJCourseWin()" class="btn btn-default">
				<i class="glyphicon glyphicon-eye-open"> 查看共卷课程</i>
			</button>
			<button ng-click="removeSelectedCourses()" class="btn btn-danger">
				<i class="glyphicon glyphicon-minus"> 移出</i>
			</button>
			<button ng-click="extractPapers()" class="btn btn-info">
				<i class="glyphicon glyphicon-link"> 抽取试卷</i>
			</button>
			<form class="form-inline pull-right">
				<input type="text" class="form-control" placeholder="请输入课程代码或课程名称" ng-model="search.keyword" ng-change="goPage(1)"/>
				<div class="checkbox m-l"><label><input type="checkbox" ng-model="search.noRelatedPaper" ng-change="goPage(1)"> 未关联试卷</label></div>
			</form>
			<table class="table">
				<thead>
					<tr>
						<th><input type="checkbox" ng-model="isCheckAll" ng-change="checkAll()"></th>
						<th>课程代码</th>
						<th>课程名称</th>
						<th>教材名称</th>
						<th>编者</th>
						<th>出版社</th>
						<th>版次</th>
						<!-- <th>关联试卷数量</th> -->
						<th>关联试卷代码</th>
					</tr>
				</thead>
				<tbody>
					<tr ng-repeat="row in pageModel.array" class="{{row.isChecked ? 'danger' : ''}}">
						<td><input type="checkbox" ng-model="row.isChecked"></td>
						<td >{{row.courseCode}}</td>
						<td title="{{row.courseName}}">{{row.courseName}}</td>
						<td title="{{row.bookName}}">{{row.bookName}}</td>
						<td title="{{row.bookAuthor}}">{{row.bookAuthor}}</td>
						<td title="{{row.bookPress}}">{{row.bookPress}}</td>
						<td title="{{row.bookPressYear}}">{{row.bookPressYear}}</td>
						<!-- <td title="{{row.relatedPaperNum}}">{{row.relatedPaperNum}}</td> -->
						<td title="{{row.relatedPaperCode}}">{{row.relatedPaperCode}}</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>
