[前端-后台]统一各列表显示项目的大致顺序,为题目列表增添可见筛选,统一对列表中boolen值的显示,是/否[CI SKIP]

This commit is contained in:
esp
2015-08-27 15:18:31 +08:00
parent 09e30832f9
commit f3b88e85fc
5 changed files with 23 additions and 10 deletions

View File

@@ -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",