[前端-后台]统一各列表显示项目的大致顺序,为题目列表增添可见筛选,统一对列表中boolen值的显示,是/否[CI SKIP]
This commit is contained in:
@@ -26,11 +26,9 @@ require(["jquery", "avalon", "csrfToken", "bsAlert", "editor", "validator"],
|
||||
showGlobalViewRadio: true,
|
||||
isGlobal: true,
|
||||
allGroups: [],
|
||||
getState: function (el) { //获取公告当前状态,显示
|
||||
if (el.visible)
|
||||
return "可见";
|
||||
else
|
||||
return "隐藏";
|
||||
getYesOrNo: function(yORn) {
|
||||
if (yORn) return "是";
|
||||
return "否";
|
||||
},
|
||||
getNext: function () {
|
||||
if (!vm.nextPage)
|
||||
|
||||
@@ -14,6 +14,7 @@ require(["jquery", "avalon", "csrfToken", "bsAlert"], function ($, avalon, csrfT
|
||||
page: 1,
|
||||
totalPage: 1,
|
||||
keyword: "",
|
||||
showVisibleOnly: false,
|
||||
getNext: function () {
|
||||
if (!vm.nextPage)
|
||||
return;
|
||||
@@ -40,14 +41,23 @@ require(["jquery", "avalon", "csrfToken", "bsAlert"], function ($, avalon, csrfT
|
||||
},
|
||||
showProblemSubmissionPage: function(problemId){
|
||||
vm.$fire("up!showProblemSubmissionPage", problemId);
|
||||
},
|
||||
getYesOrNo: function(yORn) {
|
||||
if (yORn) return "是";
|
||||
return "否";
|
||||
}
|
||||
});
|
||||
vm.$watch("showVisibleOnly", function () {
|
||||
getPageData(1);
|
||||
});
|
||||
}
|
||||
getPageData(1);
|
||||
function getPageData(page) {
|
||||
var url = "/api/admin/problem/?paging=true&page=" + page + "&page_size=10";
|
||||
if (vm.keyword != "")
|
||||
url += "&keyword=" + vm.keyword;
|
||||
if (vm.showVisibleOnly)
|
||||
url += "&visible=true";
|
||||
$.ajax({
|
||||
url: url,
|
||||
dataType: "json",
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
<th>创建时间</th>
|
||||
<th>更新时间</th>
|
||||
<th>创建者</th>
|
||||
<td>可见范围</td>
|
||||
<th>状态</th>
|
||||
<th>可见范围</th>
|
||||
<th>可见</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr ms-repeat="announcementList">
|
||||
@@ -18,7 +18,7 @@
|
||||
<td>{{ el.last_update_time|date("yyyy-MM-dd HH:mm:ss")}}</td>
|
||||
<td>{{ el.created_by.username }}</td>
|
||||
<td ms-text="el.is_global?'全局可见':'组内可见'"></td>
|
||||
<td>{{ getState(el)}}</td>
|
||||
<td>{{ getYesOrNo(el.visible)}}</td>
|
||||
<td>
|
||||
<button class="btn-sm btn-info" ms-click="editAnnouncement(el)">编辑</button>
|
||||
</td>
|
||||
|
||||
@@ -16,18 +16,18 @@
|
||||
<th>ID</th>
|
||||
<th>比赛</th>
|
||||
<th>公开排名</th>
|
||||
<th>可见</th>
|
||||
<th>创建时间</th>
|
||||
<th>创建者</th>
|
||||
<th>可见</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr ms-repeat="contestList">
|
||||
<td>{{ el.id }}</td>
|
||||
<td>{{ el.title }}</td>
|
||||
<td>{{ getYesOrNo(el.show_rank) }}</td>
|
||||
<td>{{ getYesOrNo(el.visible) }}</td>
|
||||
<td>{{ el.create_time|date("yyyy-MM-dd HH:mm:ss")}}</td>
|
||||
<td>{{ el.created_by.username }}</td>
|
||||
<td>{{ getYesOrNo(el.visible) }}</td>
|
||||
<td>
|
||||
<a class="btn btn-info btn-sm" href="javascript:void(0)" ms-click="showEditContestArea($index+1)">编辑</a>
|
||||
<a class="btn btn-info btn-sm" href="javascript:void(0)" ms-click="showEditProblemArea($index+1)">题目</a>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<th>题目</th>
|
||||
<th>创建时间</th>
|
||||
<th>作者</th>
|
||||
<td>可见</td>
|
||||
<td>通过次数/提交总数</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
@@ -25,6 +26,7 @@
|
||||
<td>{{ el.title }}</td>
|
||||
<td>{{ el.create_time|date("yyyy-MM-dd HH:mm:ss")}}</td>
|
||||
<td>{{ el.created_by.username }}</td>
|
||||
<td>{{ getYesOrNo(el.visible) }}</td>
|
||||
<td>{{ el.total_accepted_number }}/{{ el.total_submit_number }}</td>
|
||||
<td>
|
||||
<button class="btn-sm btn-info" ms-click="showEditProblemPage(el.id)">编辑</button>
|
||||
@@ -32,6 +34,9 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="form-group">
|
||||
<label>仅显示可见 <input ms-duplex-checked="showVisibleOnly" type="checkbox"/></label>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
页数:{{ page }}/{{ totalPage }}
|
||||
<button ms-attr-class="getBtnClass('pre')" ms-click="getPrevious">上一页</button>
|
||||
|
||||
Reference in New Issue
Block a user