[前端]完成比赛列表中,查看比赛提交的分页页面与api的对接[CI SKIP]
This commit is contained in:
@@ -237,11 +237,14 @@ require(["jquery", "avalon", "csrfToken", "bsAlert", "editor", "datetimePicker",
|
|||||||
addProblem: function () {
|
addProblem: function () {
|
||||||
vm.$fire("up!showContestProblemPage", 0, vm.contestList[vm.editingProblemContestIndex-1].id, vm.editMode);
|
vm.$fire("up!showContestProblemPage", 0, vm.contestList[vm.editingProblemContestIndex-1].id, vm.editMode);
|
||||||
},
|
},
|
||||||
showProblemEditor: function(el) {
|
showProblemEditPage: function(el) {
|
||||||
vm.$fire("up!showContestProblemPage", el.id, vm.contestList[vm.editingProblemContestIndex-1].id, vm.editMode);
|
vm.$fire("up!showContestProblemPage", el.id, vm.contestList[vm.editingProblemContestIndex-1].id, vm.editMode);
|
||||||
},
|
},
|
||||||
showSubmissionPage: function() {
|
showSubmissionPage: function(el) {
|
||||||
vm.$fire("up!showContestSubmissionPage", el.id, vm.contestList[vm.editingProblemContestIndex-1].id, vm.editMode);
|
var problemId = 0
|
||||||
|
if (el)
|
||||||
|
problemId = el.id;
|
||||||
|
vm.$fire("up!showContestSubmissionPage", problemId, vm.contestList[vm.editingProblemContestIndex-1].id, vm.editMode);
|
||||||
},
|
},
|
||||||
getYesOrNo: function(yORn) {
|
getYesOrNo: function(yORn) {
|
||||||
if (yORn) return "是";
|
if (yORn) return "是";
|
||||||
|
|||||||
@@ -44,13 +44,15 @@ require(["jquery", "avalon", "csrfToken", "bsAlert"], function ($, avalon, csrfT
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getPage: function (page_index) {
|
getPage: function (page_index) {
|
||||||
|
if (!page_index)
|
||||||
|
var page_index = vm.page;
|
||||||
getPageData(page_index);
|
getPageData(page_index);
|
||||||
},
|
},
|
||||||
showSubmissionDetailPage: function (submissionId) {
|
showSubmissionDetailPage: function (submissionId) {
|
||||||
|
|
||||||
},
|
},
|
||||||
showProblemListPage: function(){
|
goBack: function(check){
|
||||||
vm.$fire("up!showProblemListPage");
|
vm.$fire("up!showContestListPage");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -58,7 +60,9 @@ require(["jquery", "avalon", "csrfToken", "bsAlert"], function ($, avalon, csrfT
|
|||||||
getPageData(1);
|
getPageData(1);
|
||||||
|
|
||||||
function getPageData(page) {
|
function getPageData(page) {
|
||||||
var url = "/api/admin/submission/?paging=true&page=" + page + "&page_size=10&problem_id=" + avalon.vmodels.admin.problemId;
|
var url = "/api/admin/contest_submission/?paging=true&page=" + page + "&page_size=10&contest_id=" + avalon.vmodels.admin.$contestId;
|
||||||
|
if (avalon.vmodels.admin.$problemId)
|
||||||
|
url += "&problem_id=" + avalon.vmodels.admin.$problemId
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
|||||||
@@ -158,8 +158,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-md-12" ms-visible="editingProblemContestIndex">
|
<div class="col-md-12" ms-visible="editingProblemContestIndex">
|
||||||
<label>题目列表</label>
|
<label>题目列表</label>
|
||||||
<a href="javascript:void(0)" class="btn btn-success btn-sm" ms-click="addProblem()">添加</a>
|
<a href="javascript:void(0)" class="btn btn-success btn-sm" ms-click="addProblem()">添加题目</a>
|
||||||
<a href="javascript:void(0)" class="btn btn-success btn-sm" ms-click="showSubmission()">查看提交</a>
|
<a href="javascript:void(0)" class="btn btn-info btn-sm" ms-click="showSubmissionPage()">查看提交</a>
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<tr>
|
<tr>
|
||||||
<th>编号</th>
|
<th>编号</th>
|
||||||
@@ -177,7 +177,9 @@
|
|||||||
<td>{{ el.create_time|date("yyyy-MM-dd HH:mm:ss") }}</td>
|
<td>{{ el.create_time|date("yyyy-MM-dd HH:mm:ss") }}</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="javascript:void(0)" class="btn-sm btn-info"
|
<a href="javascript:void(0)" class="btn-sm btn-info"
|
||||||
ms-click="showProblemEditor(el)">编辑</a>
|
ms-click="showProblemEditPage(el)">编辑</a>
|
||||||
|
<a href="javascript:void(0)" class="btn-sm btn-info"
|
||||||
|
ms-click="showSubmissionPage(el)">提交</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
<div ms-controller="contestSubmissionList" class="col-md-9">
|
<div ms-controller="contestSubmissionList" class="col-md-9">
|
||||||
<nav>
|
<nav>
|
||||||
<ul class="pager">
|
<ul class="pager">
|
||||||
<li class="previous" ms-click="showProblemListPage()"><a href="javascript:void(0)"><span
|
<li class="previous" ms-click="goBack()"><a href="javascript:void(0)"><span
|
||||||
aria-hidden="true">←</span> 返回</a></li>
|
aria-hidden="true">←</span> 返回</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
<h1>提交列表</h1>
|
<h1>提交列表</h1>
|
||||||
|
<a href="javascript:void(0)" class="btn btn-sm btn-primary" ms-click="getPage(1)">
|
||||||
|
<span class="glyphicon glyphicon-refresh"></span> 刷新
|
||||||
|
</a>
|
||||||
|
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user