diff --git a/src/main/java/cn/stylefeng/guns/modular/user/UserViewController.java b/src/main/java/cn/stylefeng/guns/modular/user/UserViewController.java index 015688be..f1b97891 100644 --- a/src/main/java/cn/stylefeng/guns/modular/user/UserViewController.java +++ b/src/main/java/cn/stylefeng/guns/modular/user/UserViewController.java @@ -49,4 +49,15 @@ public class UserViewController { return "/modular/system/user/user_edit.html"; } + /** + * 用户管理-角色-视图 + * + * @author chenjinlong + * @date 2021/1/7 19:09 + */ + @GetResource(name = "用户管理-角色-视图", path = "roleView") + public String roleView() { + return "/modular/system/user/user_role.html"; + } + } diff --git a/src/main/webapp/assets/modular/system/organization/organization.js b/src/main/webapp/assets/modular/system/organization/organization.js index 624c6510..de91700f 100644 --- a/src/main/webapp/assets/modular/system/organization/organization.js +++ b/src/main/webapp/assets/modular/system/organization/organization.js @@ -1,40 +1,22 @@ -layui.use(['table', 'form', 'func', 'HttpRequest', 'tree', 'util'], function () { - var $ = layui.$; - var table = layui.table; +layui.use(['layer', 'form', 'table', 'ztree', 'laydate', 'admin', 'HttpRequest', 'func', 'tree', 'util'], function () { var form = layui.form; - var func = layui.func; + var table = layui.table; var HttpRequest = layui.HttpRequest; - var xmSelect = layui.xmSelect; + var func = layui.func; var tree = layui.tree; - // 职位表管理 + /** + * 系统管理--用户管理 + */ var Organization = { - tableId: "organizationTable" + tableId: "userTable", //表格id + condition: { + orgName: "", + orgParentId: "", + orgCode: "" + } }; - - /* 渲染树形 */ - function renderTree() { - $.get(Feng.ctxPath + '/hrOrganization/treeLayui', function (data) { - tree.render({ - elem: '#organizationTree', - onlyIconControl: true, - data: data.data, - click: function (rest) { - $('#organizationTree').find('.ew-tree-click').removeClass('ew-tree-click'); - $(rest.elem).children('.layui-tree-entry').addClass('ew-tree-click'); - table.reload(Organization.tableId, { - where: {organizationId: rest.data.id}, - page: {curr: 1} - }); - } - }); - $('#organizationTree').find('.layui-tree-entry:first>.layui-tree-main>.layui-tree-txt').trigger('click'); - }); - } - - renderTree(); - // 初始化表格的列 Organization.initColumn = function () { return [[ @@ -49,13 +31,22 @@ layui.use(['table', 'form', 'func', 'HttpRequest', 'tree', 'util'], function () ]]; }; + // 选择部门时 + Organization.onClickDept = function (obj) { + console.log(obj); + Organization.condition.orgParentId = obj.data.id; + Organization.search(); + }; + + // 点击查询按钮 Organization.search = function () { var queryData = {}; + queryData['orgParentId'] = Organization.condition.orgParentId; queryData['orgName'] = $("#orgName").val(); + queryData['orgCode'] = $("#orgCode").val(); table.reload(Organization.tableId, { - where: queryData, - page: {curr: 1} + where: queryData, page: {curr: 1} }); }; @@ -96,7 +87,7 @@ layui.use(['table', 'form', 'func', 'HttpRequest', 'tree', 'util'], function () Feng.success("删除成功!"); table.reload(Organization.tableId); }, function (data) { - Feng.error("删除失败!" + data.responseJSON.message + "!"); + Feng.error("删除失败!" + data.message + "!"); }); httpRequest.set(data); httpRequest.start(true); @@ -111,7 +102,7 @@ layui.use(['table', 'form', 'func', 'HttpRequest', 'tree', 'util'], function () Feng.success("修改成功!"); }, function (data) { table.reload(Organization.tableId); - Feng.error("修改失败!" + data.responseJSON.message); + Feng.error("修改失败!" + data.message); }); httpRequest.set({"orgId": orgId, "statusFlag": checked}); httpRequest.start(true); @@ -122,13 +113,23 @@ layui.use(['table', 'form', 'func', 'HttpRequest', 'tree', 'util'], function () elem: '#' + Organization.tableId, url: Feng.ctxPath + '/hrOrganization/page', page: true, - request: {pageName: 'pageNo', limitName: 'pageSize'}, //自定义分页参数 - height: "full-158", + height: "full-98", cellMinWidth: 100, cols: Organization.initColumn(), parseData: Feng.parseData }); + // 初始化部门树 + var request = new HttpRequest(Feng.ctxPath + '/hrOrganization/treeLayui', 'get', function (data) { + tree.render({ + elem: '#deptTree', + data: data.data, + click: Organization.onClickDept, + onlyIconControl: true + }); + }); + request.start(); + // 搜索按钮点击事件 $('#btnSearch').click(function () { Organization.search(); @@ -161,4 +162,13 @@ layui.use(['table', 'form', 'func', 'HttpRequest', 'tree', 'util'], function () var checked = obj.elem.checked ? 1 : 2; Organization.updateStatus(orgId, checked); }); + }); + +$(function () { + var panehHidden = false; + if ($(this).width() < 769) { + panehHidden = true; + } + $('#myContiner').layout({initClosed: panehHidden, west__size: 260}); +}); \ No newline at end of file diff --git a/src/main/webapp/assets/modular/system/organization/organization_add.js b/src/main/webapp/assets/modular/system/organization/organization_add.js index dd47fac2..e81ff920 100644 --- a/src/main/webapp/assets/modular/system/organization/organization_add.js +++ b/src/main/webapp/assets/modular/system/organization/organization_add.js @@ -4,35 +4,31 @@ layui.use(['form', 'admin', 'HttpRequest', 'xmSelect'], function () { var admin = layui.admin; var HttpRequest = layui.HttpRequest; var xmSelect = layui.xmSelect; - var insXmSel; + var organizationXmSel; - /* 渲染树形 */ - function renderTree() { - $.get(Feng.ctxPath + '/hrOrganization/treeLayui', function (data) { - insXmSel = xmSelect.render({ - el: '#organizationEditParentSel', - height: '250px', - data: data.data, - model: {label: {type: 'text'}}, - prop: {name: 'title', value: 'id'}, - radio: true, - clickClose: true, - tree: { - show: true, - indent: 15, - strict: false, - expandedKeys: true - } - }); + // 初始化组织树 + new HttpRequest(Feng.ctxPath + "/hrOrganization/treeLayui", 'get', function (data) { + organizationXmSel = xmSelect.render({ + el: '#organization', + data: data.data, + model: {label: {type: 'text'}}, + prop: {name: 'title', value: 'id'}, + radio: true, + layVerify: 'required', + clickClose: true, + tree: { + show: true, + indent: 15, + strict: false, + expandedKeys: true + } }); - } - - renderTree(); + }).start(); //表单提交事件 form.on('submit(btnSubmit)', function (data) { //获取机构id - data.field.orgParentId = insXmSel.getValue('valueStr'); + data.field.orgParentId = organizationXmSel.getValue('valueStr'); var request = new HttpRequest(Feng.ctxPath + "/hrOrganization/add", 'post', function (data) { admin.closeThisDialog(); Feng.success("添加成功!"); diff --git a/src/main/webapp/assets/modular/system/organization/organization_edit.js b/src/main/webapp/assets/modular/system/organization/organization_edit.js index 1ace2dda..3a55c222 100644 --- a/src/main/webapp/assets/modular/system/organization/organization_edit.js +++ b/src/main/webapp/assets/modular/system/organization/organization_edit.js @@ -4,41 +4,38 @@ layui.use(['form', 'admin', 'HttpRequest', 'xmSelect'], function () { var admin = layui.admin; var HttpRequest = layui.HttpRequest; var xmSelect = layui.xmSelect; - var insXmSel; + var organizationXmSel; //获取信息详情填充表单 var request = new HttpRequest(Feng.ctxPath + "/hrOrganization/detail?orgId=" + Feng.getUrlParam("orgId"), 'get'); var result = request.start(); form.val('organizationForm', result.data); - renderTree(result.data.orgParentId); - /* 渲染树形 */ - function renderTree(orgParentId) { - $.get(Feng.ctxPath + '/hrOrganization/treeLayui', function (data) { - insXmSel = xmSelect.render({ - el: '#organizationEditParentSel', - height: '250px', - data: data.data, - initValue: [orgParentId], - model: {label: {type: 'text'}}, - prop: {name: 'title', value: 'id'}, - radio: true, - clickClose: true, - tree: { - show: true, - indent: 15, - strict: false, - expandedKeys: true - } - }); + // 初始化组织树 + new HttpRequest(Feng.ctxPath + "/hrOrganization/treeLayui", 'get', function (data) { + organizationXmSel = xmSelect.render({ + el: '#organization', + data: data.data, + initValue: [result.data.orgId], + layVerify: 'required', + model: {label: {type: 'text'}}, + prop: {name: 'title', value: 'id'}, + radio: true, + clickClose: true, + tree: { + show: true, + indent: 15, + strict: false, + expandedKeys: true + } }); - } + }).start(); //表单提交事件 form.on('submit(btnSubmit)', function (data) { //获取机构id - data.field.orgParentId = insXmSel.getValue('valueStr'); + data.field.orgParentId = organizationXmSel.getValue('valueStr'); var request = new HttpRequest(Feng.ctxPath + "/hrOrganization/edit", 'post', function (data) { admin.closeThisDialog(); diff --git a/src/main/webapp/assets/modular/system/position/position.js b/src/main/webapp/assets/modular/system/position/position.js index b6456195..a73043dc 100644 --- a/src/main/webapp/assets/modular/system/position/position.js +++ b/src/main/webapp/assets/modular/system/position/position.js @@ -97,7 +97,7 @@ layui.use(['table', 'form', 'func', 'HttpRequest', 'util'], function () { Feng.success("修改成功!"); }, function (data) { table.reload(Position.tableId); - Feng.error("修改失败!" + data.responseJSON.message); + Feng.error("修改失败!" + data.message); }); httpRequest.set({"positionId": positionId, "statusFlag": checked}); httpRequest.start(true); diff --git a/src/main/webapp/assets/modular/system/user/user.js b/src/main/webapp/assets/modular/system/user/user.js index 94fe6211..73282e2c 100644 --- a/src/main/webapp/assets/modular/system/user/user.js +++ b/src/main/webapp/assets/modular/system/user/user.js @@ -13,9 +13,9 @@ layui.use(['layer', 'form', 'table', 'ztree', 'laydate', 'admin', 'HttpRequest', var MgrUser = { tableId: "userTable", //表格id condition: { - name: "", - deptId: "", - timeLimit: "" + realName: "", + orgId: "", + account: "" } }; @@ -25,7 +25,7 @@ layui.use(['layer', 'form', 'table', 'ztree', 'laydate', 'admin', 'HttpRequest', MgrUser.initColumn = function () { //获取多语言 - var langs = layui.data('system').lang; + //var langs = layui.data('system').lang; return [[ {type: 'checkbox'}, @@ -45,7 +45,8 @@ layui.use(['layer', 'form', 'table', 'ztree', 'laydate', 'admin', 'HttpRequest', * 选择部门时 */ MgrUser.onClickDept = function (obj) { - MgrUser.condition.deptId = obj.data.id; + console.log(obj); + MgrUser.condition.orgId = obj.data.id; MgrUser.search(); }; @@ -54,9 +55,9 @@ layui.use(['layer', 'form', 'table', 'ztree', 'laydate', 'admin', 'HttpRequest', */ MgrUser.search = function () { var queryData = {}; - queryData['deptId'] = MgrUser.condition.deptId; - queryData['name'] = $("#name").val(); - queryData['timeLimit'] = $("#timeLimit").val(); + queryData['orgId'] = MgrUser.condition.orgId; + queryData['account'] = $("#account").val(); + queryData['realName'] = $("#realName").val(); table.reload(MgrUser.tableId, { where: queryData, page: {curr: 1} }); @@ -92,88 +93,57 @@ layui.use(['layer', 'form', 'table', 'ztree', 'laydate', 'admin', 'HttpRequest', } }; - /** - * 点击删除用户按钮 - * - * @param data 点击按钮时候的行数据 - */ + // 删除用户 MgrUser.onDeleteUser = function (data) { var operation = function () { - var ajax = new $ax(Feng.ctxPath + "/mgr/delete", function () { - table.reload(MgrUser.tableId); + var httpRequest = new HttpRequest(Feng.ctxPath + "/sysUser/delete", 'post', function (data) { Feng.success("删除成功!"); + table.reload(MgrUser.tableId); }, function (data) { - Feng.error("删除失败!" + data.responseJSON.message + "!"); + Feng.error("删除失败!" + data.message + "!"); }); - ajax.set("userId", data.userId); - ajax.start(); + httpRequest.set(data); + httpRequest.start(true); }; Feng.confirm("是否删除用户" + data.account + "?", operation); }; - /** - * 分配角色 - * - * @param data 点击按钮时候的行数据 - */ + // 分配角色 MgrUser.roleAssign = function (data) { - //获取多语言 - var langs = layui.data('system').lang; - - layer.open({ - type: 2, - title: langs.TITLE_ROLE_ASSIGN, - area: ['300px', '400px'], - content: Feng.ctxPath + '/mgr/role_assign?userId=' + data.userId, - end: function () { - table.reload(MgrUser.tableId); - } + func.open({ + title: '授权角色', + height: 470, + content: Feng.ctxPath + '/view/user/roleView?userId=' + data.userId, + tableId: MgrUser.tableId }); }; - /** - * 重置密码 - * - * @param data 点击按钮时候的行数据 - */ + // 重置密码 MgrUser.resetPassword = function (data) { Feng.confirm("是否重置密码为" + $("#defaultPassword").val() + "?", function () { - var ajax = new $ax(Feng.ctxPath + "/mgr/reset", function (data) { + var httpRequest = new HttpRequest(Feng.ctxPath + "/sysUser/resetPwd", 'post', function (data) { Feng.success("重置密码成功!"); + table.reload(MgrUser.tableId); }, function (data) { - Feng.error("重置密码失败!" + data.responseJSON.message + "!"); + Feng.error("重置密码失败!" + data.message + "!"); }); - ajax.set("userId", data.userId); - ajax.start(); + httpRequest.set(data); + httpRequest.start(true); }); }; - /** - * 修改用户状态 - * - * @param userId 用户id - * @param checked 是否选中(true,false),选中就是解锁用户,未选中就是锁定用户 - */ + // 修改用户状态 MgrUser.changeUserStatus = function (userId, checked) { - if (checked) { - var ajax = new $ax(Feng.ctxPath + "/mgr/unfreeze", function (data) { - Feng.success("解除冻结成功!"); - }, function (data) { - Feng.error("解除冻结失败!"); - table.reload(MgrUser.tableId); - }); - ajax.set("userId", userId); - ajax.start(); - } else { - var ajax = new $ax(Feng.ctxPath + "/mgr/freeze", function (data) { - Feng.success("冻结成功!"); - }, function (data) { - Feng.error("冻结失败!" + data.responseJSON.message + "!"); - table.reload(MgrUser.tableId); - }); - ajax.set("userId", userId); - ajax.start(); - } + + var httpRequest = new HttpRequest(Feng.ctxPath + "/sysUser/changeStatus", 'post', function (data) { + table.reload(MgrUser.tableId); + Feng.success("修改成功!"); + }, function (data) { + table.reload(MgrUser.tableId); + Feng.error("修改失败!" + data.message); + }); + httpRequest.set({"userId": userId, "statusFlag": checked}); + httpRequest.start(true); }; // 渲染表格 @@ -239,7 +209,7 @@ layui.use(['layer', 'form', 'table', 'ztree', 'laydate', 'admin', 'HttpRequest', // 修改user状态 form.on('switch(status)', function (obj) { var userId = obj.elem.value; - var checked = obj.elem.checked ? true : false; + var checked = obj.elem.checked ? 1 : 2; MgrUser.changeUserStatus(userId, checked); }); diff --git a/src/main/webapp/assets/modular/system/user/user_add.js b/src/main/webapp/assets/modular/system/user/user_add.js index 6e6a838a..98aa3ea0 100644 --- a/src/main/webapp/assets/modular/system/user/user_add.js +++ b/src/main/webapp/assets/modular/system/user/user_add.js @@ -1,38 +1,47 @@ -/** - * 用户详情对话框 - */ -var UserInfoDlg = { - data: { - deptId: "", - deptName: "" - } -}; - -layui.use(['layer', 'form', 'admin', 'laydate', 'HttpRequest', 'formSelects'], function () { +layui.use(['layer', 'form', 'admin', 'laydate', 'HttpRequest', 'xmSelect'], function () { var $ = layui.jquery; var HttpRequest = layui.HttpRequest; var form = layui.form; var admin = layui.admin; var laydate = layui.laydate; - var layer = layui.layer; - var formSelects = layui.formSelects; + var xmSelect = layui.xmSelect; + var organizationXmSel; + var positionXmSel; - // 点击部门时 - $('#deptName').click(function () { - var formName = encodeURIComponent("parent.UserInfoDlg.data.deptName"); - var formId = encodeURIComponent("parent.UserInfoDlg.data.deptId"); - var treeUrl = encodeURIComponent("/dept/tree"); - - layer.open({ - type: 2, - title: '部门选择', - area: ['300px', '400px'], - content: Feng.ctxPath + '/system/commonTree?formName=' + formName + "&formId=" + formId + "&treeUrl=" + treeUrl, - end: function () { - $("#deptId").val(UserInfoDlg.data.deptId); - $("#deptName").val(UserInfoDlg.data.deptName); + // 初始化组织树 + new HttpRequest(Feng.ctxPath + "/hrOrganization/treeLayui", 'get', function (data) { + organizationXmSel = xmSelect.render({ + el: '#organization', + data: data.data, + model: {label: {type: 'text'}}, + prop: {name: 'title', value: 'id'}, + radio: true, + layVerify: 'required', + clickClose: true, + tree: { + show: true, + indent: 15, + strict: false, + expandedKeys: true } }); + }).start(); + + // 初始化职位 + new HttpRequest(Feng.ctxPath + "/hrPosition/list", 'get', function (data) { + positionXmSel = xmSelect.render({ + el: '#position', + radio: true, + layVerify: 'required', + clickClose: true, + data: data.data, + prop: {name: 'positionName', value: 'positionId'}, + }); + }).start(); + + // 渲染时间选择框 + laydate.render({ + elem: '#birthday' }); // 添加表单验证方法 @@ -45,36 +54,23 @@ layui.use(['layer', 'form', 'admin', 'laydate', 'HttpRequest', 'formSelects'], f } }); - // 渲染时间选择框 - laydate.render({ - elem: '#birthday' - }); - // 表单提交事件 form.on('submit(btnSubmit)', function (data) { - var ajax = new $ax(Feng.ctxPath + "/mgr/add", function (data) { - Feng.success("添加成功!"); - //传给上个页面,刷新table用 - admin.putTempData('formOk', true); + // 获取机构id + data.field.orgId = organizationXmSel.getValue('valueStr'); + // 职位id + data.field.positionId = positionXmSel.getValue('valueStr'); - //关掉对话框 + var request = new HttpRequest(Feng.ctxPath + "/sysUser/add", 'post', function (data) { admin.closeThisDialog(); - + Feng.success("添加成功!"); + admin.putTempData('formOk', true); }, function (data) { - Feng.error("添加失败!" + data.responseJSON.message) + admin.closeThisDialog(); + Feng.error("添加失败!" + data.message); }); - ajax.set(data.field); - ajax.start(); - - //添加 return false 可成功跳转页面 - return false; - }); - - //初始化所有的职位列表 - formSelects.config('selPosition', { - searchUrl: Feng.ctxPath + "/position/listPositions", - keyName: 'name', - keyVal: 'positionId' + request.set(data.field); + request.start(true); }); }); \ No newline at end of file diff --git a/src/main/webapp/assets/modular/system/user/user_edit.js b/src/main/webapp/assets/modular/system/user/user_edit.js index 81ef71bf..45653f2c 100644 --- a/src/main/webapp/assets/modular/system/user/user_edit.js +++ b/src/main/webapp/assets/modular/system/user/user_edit.js @@ -1,46 +1,52 @@ -/** - * 用户详情对话框 - */ -var UserInfoDlg = { - data: { - deptId: "", - deptName: "" - } -}; - -layui.use(['layer', 'form', 'admin', 'laydate', 'HttpRequest', 'formSelects'], function () { +layui.use(['layer', 'form', 'admin', 'laydate', 'HttpRequest', 'xmSelect'], function () { var $ = layui.jquery; var HttpRequest = layui.HttpRequest; var form = layui.form; var admin = layui.admin; var laydate = layui.laydate; - var layer = layui.layer; - var formSelects = layui.formSelects; + var xmSelect = layui.xmSelect; + var organizationXmSel; + var positionXmSel; //获取信息详情填充表单 var request = new HttpRequest(Feng.ctxPath + "/sysUser/detail?userId=" + Feng.getUrlParam("userId"), 'get'); var result = request.start(); form.val('userForm', result.data); + // 初始化职位 + new HttpRequest(Feng.ctxPath + "/hrPosition/list", 'get', function (data) { + positionXmSel = xmSelect.render({ + el: '#position', + radio: true, + clickClose: true, + layVerify: 'required', + data: data.data, + initValue: [result.data.positionId], + prop: {name: 'positionName', value: 'positionId'}, + }); + }).start(); - // 点击部门时 - $('#deptName').click(function () { - var formName = encodeURIComponent("parent.UserInfoDlg.data.deptName"); - var formId = encodeURIComponent("parent.UserInfoDlg.data.deptId"); - var treeUrl = encodeURIComponent("/dept/tree"); - layer.open({ - type: 2, - title: '部门选择', - area: ['300px', '400px'], - content: Feng.ctxPath + '/system/commonTree?formName=' + formName + "&formId=" + formId + "&treeUrl=" + treeUrl, - end: function () { - console.log(UserInfoDlg.data); - $("#deptId").val(UserInfoDlg.data.deptId); - $("#deptName").val(UserInfoDlg.data.deptName); + // 初始化组织树 + new HttpRequest(Feng.ctxPath + "/hrOrganization/treeLayui", 'get', function (data) { + organizationXmSel = xmSelect.render({ + el: '#organization', + data: data.data, + initValue: [result.data.orgId], + layVerify: 'required', + model: {label: {type: 'text'}}, + prop: {name: 'title', value: 'id'}, + radio: true, + clickClose: true, + tree: { + show: true, + indent: 15, + strict: false, + expandedKeys: true } }); - }); + }).start(); + // 添加表单验证方法 form.verify({ @@ -59,28 +65,22 @@ layui.use(['layer', 'form', 'admin', 'laydate', 'HttpRequest', 'formSelects'], f // 表单提交事件 form.on('submit(btnSubmit)', function (data) { - var ajax = new $ax(Feng.ctxPath + "/mgr/edit", function (data) { - Feng.success("修改成功!"); + // 获取机构id + data.field.orgId = organizationXmSel.getValue('valueStr'); + // 职位id + data.field.positionId = positionXmSel.getValue('valueStr'); - //传给上个页面,刷新table用 - admin.putTempData('formOk', true); - - //关掉对话框 + var request = new HttpRequest(Feng.ctxPath + "/sysUser/edit", 'post', function (data) { admin.closeThisDialog(); - + Feng.success("修改成功!"); + admin.putTempData('formOk', true); }, function (data) { - Feng.error("修改失败!" + data.responseJSON.message) + admin.closeThisDialog(); + Feng.error("修改失败!" + data.message); }); - ajax.set(data.field); - ajax.start(); - //添加 return false 可成功跳转页面 - return false; + request.set(data.field); + request.start(true); }); - //初始化所有的职位列表 - // formSelects.config('selPosition', { - // searchUrl: Feng.ctxPath + "/position/listPositions?userId=" + $("#userId").val(), - // keyName: 'name', - // keyVal: 'positionId' - // }); + }); \ No newline at end of file diff --git a/src/main/webapp/assets/modular/system/user/user_role.js b/src/main/webapp/assets/modular/system/user/user_role.js new file mode 100644 index 00000000..99ad13d4 --- /dev/null +++ b/src/main/webapp/assets/modular/system/user/user_role.js @@ -0,0 +1,45 @@ +layui.use(['layer', 'form', 'admin', 'laydate', 'HttpRequest', 'xmSelect'], function () { + var $ = layui.jquery; + var HttpRequest = layui.HttpRequest; + var form = layui.form; + var admin = layui.admin; + var xmSelect = layui.xmSelect; + var roleXmSel; + + //获取信息详情填充表单 + var request = new HttpRequest(Feng.ctxPath + "/sysUser/detail?userId=" + Feng.getUrlParam("userId"), 'get'); + var result = request.start(); + form.val('userForm', result.data); + + console.log(result.data.grantRoleIdList); + // 初始化角色 + new HttpRequest(Feng.ctxPath + "/sysRole/dropDown", 'get', function (data) { + roleXmSel = xmSelect.render({ + el: '#role', + toolbar: {show: true}, + layVerify: 'required', + initValue: result.data.grantRoleIdList, + data: data.data, + prop: {name: 'name', value: 'id'}, + }); + }).start(); + + // 表单提交事件 + form.on('submit(btnSubmit)', function (data) { + // 角色ids + console.log(Feng.getUrlParam("userId")); + data.field.grantRoleIdList = roleXmSel.getValue('value'); + data.field.userId = Feng.getUrlParam("userId"); + + var request = new HttpRequest(Feng.ctxPath + "/sysUser/grantRole", 'post', function (data) { + admin.closeThisDialog(); + Feng.success("授权成功!"); + admin.putTempData('formOk', true); + }, function (data) { + admin.closeThisDialog(); + Feng.error("授权失败!" + data.message); + }); + request.set(data.field); + request.start(true); + }); +}); \ No newline at end of file diff --git a/src/main/webapp/pages/modular/system/organization/organization.html b/src/main/webapp/pages/modular/system/organization/organization.html index 5c941eeb..65d5d9f7 100644 --- a/src/main/webapp/pages/modular/system/organization/organization.html +++ b/src/main/webapp/pages/modular/system/organization/organization.html @@ -1,49 +1,43 @@ -@layout("/layout/_container.html",{js:["/assets/modular/system/organization/organization.js"]}){ +@layout("/layout/_tree_container.html",{plugins:["ztree"],js:["/assets/modular/system/organization/organization.js"]}){
机构管理
-
-
-
-
-
- - - - - - - - - - - - - - -
-
+
+
+
+
+
-
-
-
-
-
-
- -
-
- - - +
+
+
+
+
+
+
+
+ + +
+
+ +
+
+ +
+
+ + + +
+
+
- -
@@ -53,9 +47,11 @@ @} \ No newline at end of file diff --git a/src/main/webapp/pages/modular/system/user/user.html b/src/main/webapp/pages/modular/system/user/user.html index 9dbf0f4d..e653fc53 100644 --- a/src/main/webapp/pages/modular/system/user/user.html +++ b/src/main/webapp/pages/modular/system/user/user.html @@ -20,12 +20,13 @@
+
- +
- +
@@ -51,6 +52,6 @@ @} \ No newline at end of file diff --git a/src/main/webapp/pages/modular/system/user/user_add.html b/src/main/webapp/pages/modular/system/user/user_add.html index d6e4347c..582d3a77 100644 --- a/src/main/webapp/pages/modular/system/user/user_add.html +++ b/src/main/webapp/pages/modular/system/user/user_add.html @@ -8,23 +8,11 @@
- +
-
- -
- -
-
-
- -
- -
-
@@ -37,12 +25,6 @@
-
- -
- -
-
@@ -50,10 +32,36 @@
-
- +
+
- + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+
@@ -63,19 +71,23 @@
职务信息
-
- -
- - -
-
- +
+
+
+ + + + + + + +
+ +
+
diff --git a/src/main/webapp/pages/modular/system/user/user_edit.html b/src/main/webapp/pages/modular/system/user/user_edit.html index 04e8fd3d..021d6070 100644 --- a/src/main/webapp/pages/modular/system/user/user_edit.html +++ b/src/main/webapp/pages/modular/system/user/user_edit.html @@ -7,6 +7,15 @@
+ + +
+ +
+ + +
+
@@ -20,28 +29,22 @@
- +
- +
-
- + +
+
- +
-
- +
+
- - -
-
-
- -
- +
@@ -52,17 +55,23 @@
- +
- - +
+ + + + + + +
+
- +
diff --git a/src/main/webapp/pages/modular/system/user/user_role.html b/src/main/webapp/pages/modular/system/user/user_role.html new file mode 100644 index 00000000..176b62d8 --- /dev/null +++ b/src/main/webapp/pages/modular/system/user/user_role.html @@ -0,0 +1,26 @@ +@layout("/layout/_form.html",{js:["/assets/modular/system/user/user_role.js"]}){ + +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+ + +
+ +
+ +@}