[前端]修复userList页面avalon重定义问题[CI SKIP]

This commit is contained in:
esp 2015-08-25 09:27:46 +08:00
parent 581bc61c96
commit 876af8d233

View File

@ -3,7 +3,16 @@ require(["jquery", "avalon", "csrfToken", "bsAlert", "validator"], function ($,
// avalon:定义模式 userList
avalon.ready(function () {
avalon.vmodels.userList = null;
//avalon.vmodels.userList = null;
if (avalon.vmodels.userList) {
var vm = avalon.vmodels.userList;
// initialize avalon object
userList= [], previousPage= 0, nextPage= 0, page= 1,
editingUserId= 0, totalPage: 1, keyword: "", showAdminOnly: false,
//user editor fields
username: "", realName: "", email: "", adminType: 0, id: 0,
}
else {
var vm = avalon.define({
$id: "userList",
//通用变量
@ -55,6 +64,7 @@ require(["jquery", "avalon", "csrfToken", "bsAlert", "validator"], function ($,
getPageData(1);
}
});
}
vm.$watch("showAdminOnly", function () {
getPageData(1);
});