[前端-后台]统一各列表显示项目的大致顺序,为题目列表增添可见筛选,统一对列表中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",
|
||||
|
||||
Reference in New Issue
Block a user