[前端-后台]比赛管理,对添加,编辑,列表页面的avalon使用方法做了统一的改变,防止出现页内模板改变但页面不刷新的情况下导致avalon功能间歇性异常的问题,但是代码量变大了一些,还算是整洁.具体是所有页面的avalon只在页面第一次加载的时候初始化,再次加载时只对vm内部变量重新初始化,而不调用avalon.define了[CI SKIP]
This commit is contained in:
@@ -75,6 +75,9 @@ define("admin", ["jquery", "avalon"], function ($, avalon) {
|
||||
groupId: -1,
|
||||
problemId: -1,
|
||||
adminNavList: [],
|
||||
$contestMode: -1,
|
||||
$problemId: -1,
|
||||
$contestId: -1,
|
||||
hide_loading: function () {
|
||||
$("#loading-gif").hide();
|
||||
},
|
||||
@@ -123,9 +126,10 @@ define("admin", ["jquery", "avalon"], function ($, avalon) {
|
||||
vm.template_url = "template/problem/submission_list.html";
|
||||
});
|
||||
|
||||
vm.$watch("showContestProblemPage", function (problemId, contestId) {
|
||||
vm.problemId = problemId;
|
||||
vm.contestId = contestId;
|
||||
vm.$watch("showContestProblemPage", function (problemId, contestId, contestMode) {
|
||||
vm.$problemId = problemId;
|
||||
vm.$contestId = contestId;
|
||||
vm.$contestMode = contestMode
|
||||
vm.template_url = "template/contest/edit_problem.html";
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user