From 45e340f7bef03c0047cec630ef73793010113a9b Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Wed, 6 Jan 2021 22:36:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E5=AE=8C=E6=88=90=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/assets/modular/auth/menu/menu.js | 4 +- .../assets/modular/auth/menu/menu_add.js | 41 +++++++++---------- .../pages/modular/auth/menu/menu_add.html | 33 ++++++--------- 3 files changed, 34 insertions(+), 44 deletions(-) diff --git a/src/main/webapp/assets/modular/auth/menu/menu.js b/src/main/webapp/assets/modular/auth/menu/menu.js index 6df7a257..c483d0d0 100644 --- a/src/main/webapp/assets/modular/auth/menu/menu.js +++ b/src/main/webapp/assets/modular/auth/menu/menu.js @@ -28,7 +28,7 @@ layui.use(['HttpRequest', 'treeTable', 'func'], function () { {field: 'appName', align: "center", sort: true, title: '应用名称'}, {field: 'layuiPath', align: "center", sort: true, title: '请求地址', minWidth: 180}, { - field: 'layuiIcon', align: "center", sort: true, title: '图标', templet: '

' + field: 'layuiIcon', align: "center", sort: true, title: '图标', templet: '

' }, { field: 'visible', align: "center", sort: true, title: '是否可见', templet: function (data) { @@ -70,7 +70,7 @@ layui.use(['HttpRequest', 'treeTable', 'func'], function () { */ Menu.openAddMenu = function () { func.open({ - height: 720, + height: 660, title: '添加菜单', content: Feng.ctxPath + '/view/menu/add', tableId: Menu.tableId, diff --git a/src/main/webapp/assets/modular/auth/menu/menu_add.js b/src/main/webapp/assets/modular/auth/menu/menu_add.js index 95809493..cf4d3dbe 100644 --- a/src/main/webapp/assets/modular/auth/menu/menu_add.js +++ b/src/main/webapp/assets/modular/auth/menu/menu_add.js @@ -3,8 +3,8 @@ */ var MenuInfoDlg = { data: { - pid: "", - pcodeName: "" + menuParentId: "", + menuParentName: "" } }; @@ -18,26 +18,26 @@ layui.use(['layer', 'form', 'admin', 'laydate', 'HttpRequest', 'iconPicker'], fu var iconPicker = layui.iconPicker; // 点击父级菜单 - $('#pcodeName').click(function () { - var formName = encodeURIComponent("parent.MenuInfoDlg.data.pcodeName"); - var formId = encodeURIComponent("parent.MenuInfoDlg.data.pid"); - var treeUrl = encodeURIComponent("/menu/selectMenuTreeList"); + $('#menuParentName').click(function () { + var formName = encodeURIComponent("parent.MenuInfoDlg.data.menuParentName"); + var formId = encodeURIComponent("parent.MenuInfoDlg.data.menuParentId"); + var treeUrl = encodeURIComponent("/sysMenu/layuiSelectParentMenuTreeList"); layer.open({ type: 2, title: '父级菜单', area: ['300px', '400px'], - content: Feng.ctxPath + '/system/commonTree?formName=' + formName + "&formId=" + formId + "&treeUrl=" + treeUrl, + content: Feng.ctxPath + '/view/common/tree?formName=' + formName + "&formId=" + formId + "&treeUrl=" + treeUrl, end: function () { - $("#pid").val(MenuInfoDlg.data.pid); - $("#pcodeName").val(MenuInfoDlg.data.pcodeName); + $("#menuParentId").val(MenuInfoDlg.data.menuParentId); + $("#menuParentName").val(MenuInfoDlg.data.menuParentName); } }); }); // 表单提交事件 form.on('submit(btnSubmit)', function (data) { - var ajax = new $ax(Feng.ctxPath + "/menu/add", function (data) { + var request = new HttpRequest(Feng.ctxPath + "/sysMenu/add", 'post', function (data) { Feng.success("添加成功!"); //传给上个页面,刷新table用 @@ -47,10 +47,10 @@ layui.use(['layer', 'form', 'admin', 'laydate', 'HttpRequest', 'iconPicker'], fu admin.closeThisDialog(); }, function (data) { - Feng.error("添加失败!" + data.responseJSON.message) + Feng.error("添加失败!" + data.message) }); - ajax.set(data.field); - ajax.start(); + request.set(data.field); + request.start(true); //添加 return false 可成功跳转页面 return false; @@ -58,7 +58,7 @@ layui.use(['layer', 'form', 'admin', 'laydate', 'HttpRequest', 'iconPicker'], fu //初始化图标选择 iconPicker.render({ - elem: '#icon', + elem: '#layuiIcon', type: 'fontClass', search: true, page: true, @@ -71,18 +71,15 @@ layui.use(['layer', 'form', 'admin', 'laydate', 'HttpRequest', 'iconPicker'], fu //初始化字典详细列表 $("#dictDetails").html(''); - var ajax = new $ax(Feng.ctxPath + "/dict/listDictsByCode", function (data) { - + var request = new HttpRequest(Feng.ctxPath + "/sysApp/list", 'get', function (data) { for (var i = 0; i < data.data.length; i++) { - var name = data.data[i].name; - var code = data.data[i].code; - $("#dictDetails").append(''); + var name = data.data[i].appName; + var code = data.data[i].appCode; + $("#dictDetails").append(''); } form.render(); - }, function (data) { }); - ajax.set("dictTypeCode", "SYSTEM_TYPE"); - ajax.start(); + request.start(); }); diff --git a/src/main/webapp/pages/modular/auth/menu/menu_add.html b/src/main/webapp/pages/modular/auth/menu/menu_add.html index af50208a..ce16a290 100644 --- a/src/main/webapp/pages/modular/auth/menu/menu_add.html +++ b/src/main/webapp/pages/modular/auth/menu/menu_add.html @@ -8,53 +8,46 @@
- +
- +
- +
- +
- - + +
- +
- - +
- +
- +
- -
- -
-
-
- +
- +
- +