<div ng-controller="PaperAnalysisCtrl" class="wrapper">
    <div class="panel panel-default">
        <div class="panel-body" ng-show="page=='chart'">
            <div class="form-inline">
                <button class="btn btn-default" ng-click="page='page'"><i
                        class="glyphicon glyphicon-arrow-left"></i>&nbsp;返回
                </button>
            </div>
            <div id="container" style="width: 900px; height: 500px; margin: 0 auto"></div>
        </div>
        <div class="panel-body" ng-show="page=='page'">
            <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.batch" ng-change="goPage(1)">
                        <option value="">所有</option>
                        <option value="{{b}}" ng-selected="search.batch == b" ng-repeat="b in bacthList">{{b}}</option>
                    </select>
                </label>

                <button ng-click="upload()" class="btn btn-default btn-bg">
                    <i class="icon icon-share-alt">上传</i>
                </button>
            </div>
            <table class="paper-table table-striped m-t" style="table-layout: fixed;">
                <thead>
                <tr>
                    <th>#</th>
                    <th width="5%">考次</th>
                    <th width="5%">课程代码</th>
                    <th width="7%">课程名称</th>
                    <th width="5%">省份</th>
                    <th width="7%">覆盖面</th>
                    <th width="7%">科学性</th>
                    <th width="7%">难易度</th>
                    <th width="7%">认知层次</th>
                    <th width="7%">题型题量</th>
                    <th width="7%">试卷规范</th>
                    <th width="7%">实考人数<a ng-click="sort('actual_number')" ><span class="glyphicon glyphicon-sort"></span></a></th>
                    <th width="7%">及格人数<a ng-click="sort('passes_number')" ><span class="glyphicon glyphicon-sort"></span></a></th>
                    <th width="7%">及格率%<a ng-click="sort('pass_rate')" ><span class="glyphicon glyphicon-sort"></span></a></th>
                    <th width="7%">平均分<a ng-click="sort('average')" ><span class="glyphicon glyphicon-sort"></span></a></th>
                    <th width="7%">意见或建议</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="row in pageModel.array">
                    <td>{{$index + 1}}</td>
                    <td>{{row.batch}}</td>
                    <td>{{row.courseCode}}</td>
                    <td>{{row.courseName}}</td>
                    <td>{{row.province}}</td>
                    <td>{{row.coverage}}</td>
                    <td>{{row.scientificity}}</td>
                    <td>{{row.facilityValue}}</td>
                    <td>{{row.cognitiveLevel}}</td>
                    <td>{{row.questionType}}</td>
                    <td>{{row.paperNorm}}</td>
                    <td><a ng-click="showChart(row,'actualNumber','实考人数')">{{row.actualNumber}}</a></td>
                    <td><a ng-click="showChart(row,'passesNumber','及格人数')">{{row.passesNumber}}</a></td>
                    <td><a ng-click="showChart(row,'passRate','及格率')">{{row.passRate}}</a></td>
                    <td><a ng-click="showChart(row,'average','平均分')">{{row.average}}</a></td>
                    <td>{{row.remarks}}</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>
