|
@@ -2,11 +2,11 @@
|
|
|
* 系统管理--用户管理的单例对象
|
|
|
*/
|
|
|
var MgrUser = {
|
|
|
- id: "managerTable",//表格id
|
|
|
- seItem: null, //选中的条目
|
|
|
+ id: "managerTable", //表格id
|
|
|
+ seItem: null, //选中的条目
|
|
|
table: null,
|
|
|
layerIndex: -1,
|
|
|
- deptid:0
|
|
|
+ deptid: 0
|
|
|
};
|
|
|
|
|
|
/**
|
|
@@ -16,34 +16,43 @@ MgrUser.initColumn = function () {
|
|
|
var columns = [
|
|
|
{field: 'selectItem', radio: true},
|
|
|
{title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'},
|
|
|
- {title: '账号', field: 'account', align: 'center', valign: 'middle','class': 'uitd_showTip',},
|
|
|
- {title: '姓名', field: 'name', align: 'center', valign: 'middle','class': 'uitd_showTip',},
|
|
|
- {title: '性别', field: 'sexName', align: 'center', valign: 'middle'},
|
|
|
- {title: '账号类型', field: 'type', align: 'center', valign: 'middle','class': 'uitd_showTip',
|
|
|
+ {title: '账号', field: 'account', align: 'center', valign: 'middle', 'class': 'uitd_showTip', },
|
|
|
+ {title: '姓名', field: 'name', align: 'center', valign: 'middle', 'class': 'uitd_showTip', },
|
|
|
+ {title: '性别', field: 'sexName', align: 'center', valign: 'middle',
|
|
|
+ formatter: function (value, row, index) {
|
|
|
+ if (value == 1) {
|
|
|
+ return "男";
|
|
|
+ }
|
|
|
+ return "女";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {title: '账号类型', field: 'type', align: 'center', valign: 'middle', 'class': 'uitd_showTip',
|
|
|
formatter: function (value, row, index) {
|
|
|
if (value == 1) {
|
|
|
return "晋江市现代产业体系人才";
|
|
|
- }else if (value == 2) {
|
|
|
+ } else if (value == 2) {
|
|
|
return "集成电路优秀人才";
|
|
|
- }else if (value == 3) {
|
|
|
+ } else if (value == 3) {
|
|
|
return "海峡计划申报";
|
|
|
- }else if (value == 4) {
|
|
|
+ } else if (value == 4) {
|
|
|
return "super";
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- {title: '角色', field: 'roleName', align: 'center', valign: 'middle','class': 'uitd_showTip',},
|
|
|
- {title: '单位', field: 'companyName', align: 'center', valign: 'middle','class': 'uitd_showTip',},
|
|
|
- {title: '邮箱', field: 'email', align: 'center', valign: 'middle','class': 'uitd_showTip',},
|
|
|
- {title: '电话', field: 'phone', align: 'center', valign: 'middle', sortable: false,'class': 'uitd_showTip',},
|
|
|
- {title: '创建时间', field: 'createTime', align: 'center', valign: 'middle', sortable: true,'class': 'uitd_showTip',},
|
|
|
+ {title: '角色', field: 'roleName', align: 'center', valign: 'middle', 'class': 'uitd_showTip', },
|
|
|
+ {title: '单位', field: 'companyName', align: 'center', valign: 'middle', 'class': 'uitd_showTip', },
|
|
|
+ {title: '邮箱', field: 'email', align: 'center', valign: 'middle', 'class': 'uitd_showTip', },
|
|
|
+ {title: '电话', field: 'phone', align: 'center', valign: 'middle', sortable: false, 'class': 'uitd_showTip', },
|
|
|
+ {title: '创建时间', field: 'createTime', align: 'center', valign: 'middle', sortable: true, 'class': 'uitd_showTip', },
|
|
|
{title: '状态', field: 'status', align: 'center', valign: 'middle', sortable: true,
|
|
|
formatter: function (value, row, index) {
|
|
|
if (value == 1) {
|
|
|
return "<button type=\"button\" style=\"line-height: 1.3\" class=\"btn btn-primary btn-xs\">启用</button>";
|
|
|
- }if (value == 2) {
|
|
|
+ }
|
|
|
+ if (value == 2) {
|
|
|
return "<button type=\"button\" style=\"line-height: 1.3\" class=\"btn btn-warning btn-xs\">冻结</button>";
|
|
|
- }if (value == 3) {
|
|
|
+ }
|
|
|
+ if (value == 3) {
|
|
|
return "<button type=\"button\" style=\"line-height: 1.3\" class=\"btn btn-danger btn-xs\">被删除</button>";
|
|
|
}
|
|
|
}
|
|
@@ -75,7 +84,7 @@ MgrUser.openAddMgr = function () {
|
|
|
area: ['1000px', '560px'], //宽高
|
|
|
fix: false, //不固定
|
|
|
maxmin: true,
|
|
|
- content: Feng.ctxPath + '/mgr/user_add'
|
|
|
+ content: '/admin/user/add'
|
|
|
});
|
|
|
MgrUser.layerIndex = index;
|
|
|
};
|
|
@@ -92,7 +101,7 @@ MgrUser.openChangeUser = function () {
|
|
|
area: ['1000px', '450px'], //宽高
|
|
|
fix: false, //不固定
|
|
|
maxmin: true,
|
|
|
- content: Feng.ctxPath + '/mgr/user_edit/' + this.seItem.id
|
|
|
+ content: '/admin/user/edit/userId/' + this.seItem.id
|
|
|
});
|
|
|
MgrUser.layerIndex = index;
|
|
|
}
|
|
@@ -110,7 +119,7 @@ MgrUser.roleAssign = function () {
|
|
|
area: ['300px', '400px'], //宽高
|
|
|
fix: false, //不固定
|
|
|
maxmin: true,
|
|
|
- content: Feng.ctxPath + '/mgr/role_assign/' + this.seItem.id
|
|
|
+ content: Feng.ctxPath + '/admin/user/role_assign/userId/' + this.seItem.id
|
|
|
});
|
|
|
MgrUser.layerIndex = index;
|
|
|
}
|
|
@@ -122,19 +131,19 @@ MgrUser.roleAssign = function () {
|
|
|
MgrUser.delMgrUser = function () {
|
|
|
if (this.check()) {
|
|
|
|
|
|
- var operation = function(){
|
|
|
+ var operation = function () {
|
|
|
var userId = MgrUser.seItem.id;
|
|
|
- var ajax = new $ax(Feng.ctxPath + "/mgr/delete", function () {
|
|
|
- Feng.success("删除成功!");
|
|
|
+ var ajax = new $ax("/admin/user/delete", function (data) {
|
|
|
+ Feng.success(data.msg);
|
|
|
MgrUser.table.refresh();
|
|
|
}, function (data) {
|
|
|
- Feng.error("删除失败!" + data.responseJSON.message + "!");
|
|
|
+ Feng.error(data.responseJSON.msg);
|
|
|
});
|
|
|
ajax.set("userId", userId);
|
|
|
ajax.start();
|
|
|
};
|
|
|
|
|
|
- Feng.confirm("是否删除用户" + MgrUser.seItem.account + "?",operation);
|
|
|
+ Feng.confirm("是否删除用户" + MgrUser.seItem.account + "?", operation);
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -145,11 +154,11 @@ MgrUser.delMgrUser = function () {
|
|
|
MgrUser.freezeAccount = function () {
|
|
|
if (this.check()) {
|
|
|
var userId = this.seItem.id;
|
|
|
- var ajax = new $ax(Feng.ctxPath + "/mgr/freeze", function (data) {
|
|
|
- Feng.success("冻结成功!");
|
|
|
+ var ajax = new $ax("/admin/user/freeze", function (data) {
|
|
|
+ Feng.success(data.msg);
|
|
|
MgrUser.table.refresh();
|
|
|
}, function (data) {
|
|
|
- Feng.error("冻结失败!" + data.responseJSON.message + "!");
|
|
|
+ Feng.error(data.responseJSON.msg);
|
|
|
});
|
|
|
ajax.set("userId", userId);
|
|
|
ajax.start();
|
|
@@ -163,11 +172,11 @@ MgrUser.freezeAccount = function () {
|
|
|
MgrUser.unfreeze = function () {
|
|
|
if (this.check()) {
|
|
|
var userId = this.seItem.id;
|
|
|
- var ajax = new $ax(Feng.ctxPath + "/mgr/unfreeze", function (data) {
|
|
|
- Feng.success("解除冻结成功!");
|
|
|
+ var ajax = new $ax("/admin/user/unfreeze", function (data) {
|
|
|
+ Feng.success(data.msg);
|
|
|
MgrUser.table.refresh();
|
|
|
}, function (data) {
|
|
|
- Feng.error("解除冻结失败!");
|
|
|
+ Feng.error(data.responseJSON.msg);
|
|
|
});
|
|
|
ajax.set("userId", userId);
|
|
|
ajax.start();
|
|
@@ -184,10 +193,10 @@ MgrUser.resetPwd = function () {
|
|
|
btn: ['确定', '取消'],
|
|
|
shade: false //不显示遮罩
|
|
|
}, function () {
|
|
|
- var ajax = new $ax(Feng.ctxPath + "/mgr/reset", function (data) {
|
|
|
- Feng.success("重置密码成功!");
|
|
|
+ var ajax = new $ax("/admin/user/reset", function (data) {
|
|
|
+ Feng.success(data.msg);
|
|
|
}, function (data) {
|
|
|
- Feng.error("重置密码失败!");
|
|
|
+ Feng.error(data.responseJSON.msg);
|
|
|
});
|
|
|
ajax.set("userId", userId);
|
|
|
ajax.start();
|
|
@@ -232,8 +241,8 @@ MgrUser.onClickDept = function (e, treeId, treeNode) {
|
|
|
|
|
|
$(function () {
|
|
|
var defaultColunms = MgrUser.initColumn();
|
|
|
- var table = new BSTable("managerTable", "/mgr/list", defaultColunms);
|
|
|
- table.setPaginationType("client");
|
|
|
+ var table = new BSTable("managerTable", "/admin/user/list", defaultColunms);
|
|
|
+ table.setPaginationType("server");
|
|
|
table.setQueryParams(MgrUser.formParams());
|
|
|
MgrUser.table = table.init();
|
|
|
//初始化单位下拉框
|
|
@@ -242,6 +251,6 @@ $(function () {
|
|
|
"displayCode": "id",
|
|
|
"displayName": "name",
|
|
|
"type": "GET",
|
|
|
- "url": Feng.ctxPath + "/company/selectAll"
|
|
|
+ "url": "/admin/company/selectAll"
|
|
|
});
|
|
|
});
|