From 169282e9db9f653754237ac55a5565cda6d8e82b Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Sat, 21 Jan 2023 16:44:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=92=E8=89=B2=E7=AE=A1=E7=90=86=E6=95=B4?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E4=BD=8E=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template/js/sysEveRole/sysEveRoleAdd.js | 6 ++--- .../js/sysEveRole/sysEveRoleAppMenu.js | 10 +++---- .../template/js/sysEveRole/sysEveRoleEdit.js | 14 +++++----- .../template/js/sysEveRole/sysEveRoleList.js | 22 +++++++++------- .../js/sysEveRole/sysEveRolePCMenu.js | 16 ++++++------ .../tpl/sysEveRole/sysEveRoleAdd.html | 14 +++++----- .../tpl/sysEveRole/sysEveRoleAppMenu.html | 4 +-- .../tpl/sysEveRole/sysEveRoleEdit.html | 26 +++++++++---------- .../tpl/sysEveRole/sysEveRoleList.html | 4 +-- .../tpl/sysEveRole/sysEveRolePCMenu.html | 4 +-- .../template/assets/lib/layui/custom.js | 4 +-- 11 files changed, 64 insertions(+), 60 deletions(-) diff --git a/userauth/src/main/resources/template/js/sysEveRole/sysEveRoleAdd.js b/userauth/src/main/resources/template/js/sysEveRole/sysEveRoleAdd.js index 627099ba9..3ae204485 100644 --- a/userauth/src/main/resources/template/js/sysEveRole/sysEveRoleAdd.js +++ b/userauth/src/main/resources/template/js/sysEveRole/sysEveRoleAdd.js @@ -18,11 +18,11 @@ layui.config({ form.on('submit(formAddBean)', function (data) { if (winui.verifyForm(data.elem)) { var params = { - roleName: $("#roleName").val(), - roleDesc: $("#roleDesc").val() + name: $("#name").val(), + remark: $("#remark").val() }; - AjaxPostUtil.request({url: reqBasePath + "sys015", params: params, type: 'json', method: "POST", callback: function (json) { + AjaxPostUtil.request({url: reqBasePath + "writeSysRole", params: params, type: 'json', method: "POST", callback: function (json) { parent.layer.close(index); parent.refreshCode = '0'; }}); diff --git a/userauth/src/main/resources/template/js/sysEveRole/sysEveRoleAppMenu.js b/userauth/src/main/resources/template/js/sysEveRole/sysEveRoleAppMenu.js index ffc4108ed..20ab31174 100644 --- a/userauth/src/main/resources/template/js/sysEveRole/sysEveRoleAppMenu.js +++ b/userauth/src/main/resources/template/js/sysEveRole/sysEveRoleAppMenu.js @@ -60,10 +60,10 @@ layui.config({ /********* tree 处理 start *************/ var tree; - AjaxPostUtil.request({url: reqBasePath + "sys038", params: {rowId: parent.rowId}, type: 'json', callback: function (json) { - $("#roleName").text(json.bean.roleName); - $("#roleDesc").text(json.bean.roleDesc); - checkeRows = json.rows; + AjaxPostUtil.request({url: reqBasePath + "querySysRoleById", params: {id: parent.rowId}, type: 'json', method: "GET", callback: function (json) { + $("#name").text(json.bean.name); + $("#remark").text(json.bean.remark); + checkeRows = json.bean.appMenuIds; tree = fsTree.render({ id: "treeDemo", @@ -80,7 +80,7 @@ layui.config({ var zTree = zTreeObj.getCheckedNodes(false); for (var i = 0; i < zTree.length; i++) { for(var j = 0; j < checkeRows.length; j++){ - if(zTree[i].id == checkeRows[j].menuId){ + if(zTree[i].id == checkeRows[j]){ zTreeObj.checkNode(zTree[i], true); } } diff --git a/userauth/src/main/resources/template/js/sysEveRole/sysEveRoleEdit.js b/userauth/src/main/resources/template/js/sysEveRole/sysEveRoleEdit.js index b684ff8c9..641e6c43d 100644 --- a/userauth/src/main/resources/template/js/sysEveRole/sysEveRoleEdit.js +++ b/userauth/src/main/resources/template/js/sysEveRole/sysEveRoleEdit.js @@ -11,9 +11,9 @@ layui.config({ form = layui.form, textool = layui.textool; - AjaxPostUtil.request({url: reqBasePath + "sys016", params: {rowId: parent.rowId}, type: 'json', method: "GET", callback: function (json) { - $("#roleName").val(json.bean.roleName); - $("#roleDesc").val(json.bean.roleDesc); + AjaxPostUtil.request({url: reqBasePath + "querySysRoleById", params: {id: parent.rowId}, type: 'json', method: "GET", callback: function (json) { + $("#name").val(json.bean.name); + $("#remark").val(json.bean.remark); textool.init({eleId: 'roleDesc', maxlength: 250}); }}); @@ -22,12 +22,12 @@ layui.config({ form.on('submit(formEditBean)', function (data) { if (winui.verifyForm(data.elem)) { var params = { - roleName: $("#roleName").val(), - roleDesc: $("#roleDesc").val(), - rowId: parent.rowId + name: $("#name").val(), + remark: $("#remark").val(), + id: parent.rowId }; - AjaxPostUtil.request({url: reqBasePath + "sys017", params: params, type: 'json', method: "PUT", callback: function (json) { + AjaxPostUtil.request({url: reqBasePath + "writeSysRole", params: params, type: 'json', method: "POST", callback: function (json) { parent.layer.close(index); parent.refreshCode = '0'; }}); diff --git a/userauth/src/main/resources/template/js/sysEveRole/sysEveRoleList.js b/userauth/src/main/resources/template/js/sysEveRole/sysEveRoleList.js index aa09ca822..e253e7309 100644 --- a/userauth/src/main/resources/template/js/sysEveRole/sysEveRoleList.js +++ b/userauth/src/main/resources/template/js/sysEveRole/sysEveRoleList.js @@ -25,11 +25,12 @@ layui.config({ limit: getLimit(), cols: [[ { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' }, - { field: 'roleName', title: '角色名称', width: 120 }, - { field: 'roleDesc', title: '角色描述', width: 520 }, - { field: 'userNum', title: '使用用户数量', width: 150 }, - { field: 'parentName', title: '父角色', width: 150 }, - { field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 }, + { field: 'name', title: '角色名称', width: 120 }, + { field: 'remark', title: '角色描述', width: 520 }, + { field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], width: 120 }, + { field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 }, + { field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 }, + { field: 'lastUpdateTime', title: systemLanguage["com.skyeye.lastUpdateTime"][languageType], align: 'center', width: 150 }, { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 300, toolbar: '#tableBar' } ]], done: function(json) { @@ -58,7 +59,7 @@ layui.config({ function del(data, obj) { layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], { icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType] }, function (index) { layer.close(index); - AjaxPostUtil.request({url: reqBasePath + "sys018", params: {rowId: data.id}, type: 'json', method: "DELETE", callback: function (json) { + AjaxPostUtil.request({url: reqBasePath + "deleteRoleById", params: {id: data.id}, type: 'json', method: "DELETE", callback: function (json) { winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000}); loadTable(); }}); @@ -87,7 +88,9 @@ layui.config({ title: "手机端菜单授权", pageId: "sysEveRoleAppMenu", area: ['90vw', '90vh'], - callBack: function (refreshCode) {}}); + callBack: function (refreshCode) { + winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); + }}); } // PC端菜单授权 @@ -98,7 +101,9 @@ layui.config({ title: "PC端菜单授权", pageId: "sysEveRolePCMenu", area: ['90vw', '90vh'], - callBack: function (refreshCode) {}}); + callBack: function (refreshCode) { + winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); + }}); } // 新增角色 @@ -115,7 +120,6 @@ layui.config({ }); form.render(); - // 刷新数据 $("body").on("click", "#reloadTable", function() { loadTable(); }); diff --git a/userauth/src/main/resources/template/js/sysEveRole/sysEveRolePCMenu.js b/userauth/src/main/resources/template/js/sysEveRole/sysEveRolePCMenu.js index 527c6a67a..b22f30344 100644 --- a/userauth/src/main/resources/template/js/sysEveRole/sysEveRolePCMenu.js +++ b/userauth/src/main/resources/template/js/sysEveRole/sysEveRolePCMenu.js @@ -25,8 +25,8 @@ layui.config({ menuIds.push(nodes[i].id); } var params = { - roleName: $("#roleName").html(), - roleDesc: $("#roleDesc").html(), + name: $("#name").html(), + remark: $("#remark").html(), menuIds: JSON.stringify(menuIds), rowId: parent.rowId }; @@ -42,10 +42,10 @@ layui.config({ /********* tree 处理 start *************/ var tree; - AjaxPostUtil.request({url: reqBasePath + "sys016", params: {rowId: parent.rowId}, type: 'json', method: "GET", callback: function (json) { - $("#roleName").text(json.bean.roleName); - $("#roleDesc").text(json.bean.roleDesc); - checkeRows = json.rows; + AjaxPostUtil.request({url: reqBasePath + "querySysRoleById", params: {id: parent.rowId}, type: 'json', method: "GET", callback: function (json) { + $("#name").text(json.bean.name); + $("#remark").text(json.bean.remark); + checkeRows = json.bean.menuIds; tree = fsTree.render({ id: "treeDemo", @@ -61,8 +61,8 @@ layui.config({ var zTreeObj = $.fn.zTree.getZTreeObj(id); var zTree = zTreeObj.getCheckedNodes(false); for (var i = 0; i < zTree.length; i++) { - for(var j = 0; j < checkeRows.length; j++){ - if(zTree[i].id == checkeRows[j].menuId){ + for (var j = 0; j < checkeRows.length; j++) { + if (zTree[i].id == checkeRows[j]) { zTreeObj.checkNode(zTree[i], true); } } diff --git a/userauth/src/main/resources/template/tpl/sysEveRole/sysEveRoleAdd.html b/userauth/src/main/resources/template/tpl/sysEveRole/sysEveRoleAdd.html index d40a4a30d..eb70f23c4 100644 --- a/userauth/src/main/resources/template/tpl/sysEveRole/sysEveRoleAdd.html +++ b/userauth/src/main/resources/template/tpl/sysEveRole/sysEveRoleAdd.html @@ -9,19 +9,19 @@
-
- +
+
- +
-
- +
+
- +
-
+
diff --git a/userauth/src/main/resources/template/tpl/sysEveRole/sysEveRoleAppMenu.html b/userauth/src/main/resources/template/tpl/sysEveRole/sysEveRoleAppMenu.html index 6711f38c4..4c704e393 100644 --- a/userauth/src/main/resources/template/tpl/sysEveRole/sysEveRoleAppMenu.html +++ b/userauth/src/main/resources/template/tpl/sysEveRole/sysEveRoleAppMenu.html @@ -15,13 +15,13 @@
- +
- +
diff --git a/userauth/src/main/resources/template/tpl/sysEveRole/sysEveRoleEdit.html b/userauth/src/main/resources/template/tpl/sysEveRole/sysEveRoleEdit.html index 7519bbb37..434d2c00e 100644 --- a/userauth/src/main/resources/template/tpl/sysEveRole/sysEveRoleEdit.html +++ b/userauth/src/main/resources/template/tpl/sysEveRole/sysEveRoleEdit.html @@ -9,19 +9,19 @@
-
- -
- -
-
-
- -
- -
-
-
+
+ +
+ +
+
+
+ +
+ +
+
+
diff --git a/userauth/src/main/resources/template/tpl/sysEveRole/sysEveRoleList.html b/userauth/src/main/resources/template/tpl/sysEveRole/sysEveRoleList.html index 97b48b526..fb80b019e 100644 --- a/userauth/src/main/resources/template/tpl/sysEveRole/sysEveRoleList.html +++ b/userauth/src/main/resources/template/tpl/sysEveRole/sysEveRoleList.html @@ -16,10 +16,10 @@