From 12fc86a51c0764ae3ea69b23ea3fe461e0e3fe42 Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Thu, 3 Nov 2022 22:18:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E7=AE=A1=E7=90=86=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../materialCategory/materialCategoryList.js | 1 - .../template/js/companyJob/companyJobList.js | 1 - .../js/companyMation/companyMationList.js | 1 - .../template/js/sysEveMenu/sysEveMenuAdd.js | 101 +++++++ .../js/sysEveMenu/sysEveMenuDetails.js | 38 +++ .../template/js/sysEveMenu/sysEveMenuEdit.js | 129 ++++++++ .../sysEveMenuList.js} | 108 +++---- .../template/js/sysevemenu/sysevemenuadd.js | 172 ----------- .../js/sysevemenu/sysevemenudetails.js | 53 ---- .../template/js/sysevemenu/sysevemenuedit.js | 280 ------------------ .../sysEveMenuAdd.html} | 78 ++--- .../tpl/sysEveMenu/sysEveMenuDetails.html | 125 ++++++++ .../sysEveMenuEdit.html} | 60 ++-- .../tpl/sysEveMenu/sysEveMenuList.html | 58 ++++ .../tpl/sysevemenu/sysevemenudetails.html | 21 -- .../sysevemenu/sysevemenudetailsTemplate.tpl | 88 ------ .../tpl/sysevemenu/sysevemenulist.html | 98 ------ .../assets/lib/winui/js/winui.desktop.js | 3 +- .../main/resources/template/js/index/index.js | 18 +- 19 files changed, 561 insertions(+), 872 deletions(-) create mode 100644 userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuAdd.js create mode 100644 userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuDetails.js create mode 100644 userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuEdit.js rename userauth/src/main/resources/template/js/{sysevemenu/sysevemenulist.js => sysEveMenu/sysEveMenuList.js} (68%) delete mode 100644 userauth/src/main/resources/template/js/sysevemenu/sysevemenuadd.js delete mode 100644 userauth/src/main/resources/template/js/sysevemenu/sysevemenudetails.js delete mode 100644 userauth/src/main/resources/template/js/sysevemenu/sysevemenuedit.js rename userauth/src/main/resources/template/tpl/{sysevemenu/sysevemenuadd.html => sysEveMenu/sysEveMenuAdd.html} (55%) create mode 100644 userauth/src/main/resources/template/tpl/sysEveMenu/sysEveMenuDetails.html rename userauth/src/main/resources/template/tpl/{sysevemenu/sysevemenuedit.html => sysEveMenu/sysEveMenuEdit.html} (67%) create mode 100644 userauth/src/main/resources/template/tpl/sysEveMenu/sysEveMenuList.html delete mode 100644 userauth/src/main/resources/template/tpl/sysevemenu/sysevemenudetails.html delete mode 100644 userauth/src/main/resources/template/tpl/sysevemenu/sysevemenudetailsTemplate.tpl delete mode 100644 userauth/src/main/resources/template/tpl/sysevemenu/sysevemenulist.html diff --git a/erp/src/main/resources/template/js/materialCategory/materialCategoryList.js b/erp/src/main/resources/template/js/materialCategory/materialCategoryList.js index 85961aa37..62f98ecfe 100644 --- a/erp/src/main/resources/template/js/materialCategory/materialCategoryList.js +++ b/erp/src/main/resources/template/js/materialCategory/materialCategoryList.js @@ -24,7 +24,6 @@ layui.config({ limits: getLimits(), limit: getLimit(), cols: [[ - { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' }, { field: 'name', title: '名称', align: 'left', width: 200 }, { field: 'sort', title: systemLanguage["com.skyeye.serialNumber"][languageType], align: 'center', width: 80 }, { field: 'remark', title: '备注', align: 'left', width: 200 }, diff --git a/organization/src/main/resources/template/js/companyJob/companyJobList.js b/organization/src/main/resources/template/js/companyJob/companyJobList.js index 0f948e9ac..640cd98e4 100644 --- a/organization/src/main/resources/template/js/companyJob/companyJobList.js +++ b/organization/src/main/resources/template/js/companyJob/companyJobList.js @@ -54,7 +54,6 @@ layui.config({ url: reqBasePath + 'companyjob001', where: getTableParams(), cols: [[ - { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' }, { field: 'jobName', title: '职位名称', width: 180 }, { field: 'id', title: '职位简介', width: 80, align: 'center', templet: function (d) { return ''; diff --git a/organization/src/main/resources/template/js/companyMation/companyMationList.js b/organization/src/main/resources/template/js/companyMation/companyMationList.js index 43008a743..dbc02d856 100644 --- a/organization/src/main/resources/template/js/companyMation/companyMationList.js +++ b/organization/src/main/resources/template/js/companyMation/companyMationList.js @@ -20,7 +20,6 @@ layui.config({ url: reqBasePath + 'companymation001', where:{companyName: $("#companyName").val()}, cols: [[ - { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' }, { field: 'companyName', width: 300, title: '公司名称'}, { field: 'companyDesc', width: 80, title: '公司简介', align: 'center', templet: function (d) { return ''; diff --git a/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuAdd.js b/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuAdd.js new file mode 100644 index 000000000..9bdf39d81 --- /dev/null +++ b/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuAdd.js @@ -0,0 +1,101 @@ + +layui.config({ + base: basePath, + version: skyeyeVersion +}).extend({ + window: 'js/winui.window' +}).define(['window', 'table', 'jquery', 'winui', 'colorpicker', 'fileUpload'], function (exports) { + winui.renderColor(); + layui.use(['form'], function (form) { + var index = parent.layer.getFrameIndex(window.name); + var $ = layui.$; + var colorpicker = layui.colorpicker; + var selOption = getFileContent('tpl/template/select-option.tpl'); + + // 加载图标信息 + systemCommonUtil.initIconChooseHtml('iconMation', form, colorpicker, 12); + + matchingLanguage(); + form.render(); + + // 桌面信息 + systemCommonUtil.getSysDesttop(function (json) { + $("#desktop").html(getDataUseHandlebars(selOption, json)); + form.render('select'); + }); + + // 所属系统 + showGrid({ + id: "menuSysWinId", + url: reqBasePath + "querySysEveWinList", + params: {}, + pagination: false, + method: "GET", + template: selOption, + ajaxSendLoadBefore: function(hdb) {}, + ajaxSendAfter:function (json) { + form.render('select'); + } + }); + + // 菜单类型变化事件 + form.on('radio(menuLevel)', function (data) { + var val = data.value; + if (val == 0) { + $("#lockParentSel").html(""); + $("#parentIdBox").addClass("layui-hide"); + } else if (val == 1) { + $("#parentIdBox").removeClass("layui-hide"); + loadChildMenu(); + } + form.render('select'); + }); + + form.on('submit(formAddMenu)', function (data) { + if (winui.verifyForm(data.elem)) { + var menuLevel = $("input[name='menuLevel']:checked").val(); + var params = { + menuName: $("#menuName").val(), + menuNameEn: $("#menuNameEn").val(), + sysWinId: $("#menuSysWinId").val(), + desktopId: $("#desktop").val(), + menuUrl: $("#menuUrl").val(), + menuType: $("input[name='menuType']:checked").val(), + menuLevel: menuLevel, + parentId: menuLevel == 0 ? "0" : $("#menuParent").val(), + menuSysType: $("input[name='menuSysType']:checked").val(), + isShare: $("input[name='isShare']:checked").val(), + }; + + // 获取图标信息 + params = systemCommonUtil.getIconChoose(params); + if (!params["iconChooseResult"]) { + return false; + } + AjaxPostUtil.request({url: reqBasePath + "sys007", params: params, type: 'json', callback: function(json) { + parent.layer.close(index); + parent.refreshCode = '0'; + }}); + } + return false; + }); + + // 加载一级菜单 + function loadChildMenu() { + AjaxPostUtil.request({url: reqBasePath + "sys009", params: {parentId: '0'}, type: 'json', method: 'GET', callback: function (json) { + var str = ''; + $("#lockParentSel").append(str); + }, async: false}); + } + + // 取消 + $("body").on("click", "#cancle", function() { + parent.layer.close(index); + }); + + }); +}); \ No newline at end of file diff --git a/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuDetails.js b/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuDetails.js new file mode 100644 index 000000000..e57252788 --- /dev/null +++ b/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuDetails.js @@ -0,0 +1,38 @@ + +layui.config({ + base: basePath, + version: skyeyeVersion +}).extend({ + window: 'js/winui.window', +}).define(['window', 'table', 'jquery', 'winui'], function (exports) { + winui.renderColor(); + layui.use(['form'], function (form) { + var index = parent.layer.getFrameIndex(window.name); + var $ = layui.$; + + showGrid({ + id: "showForm", + url: reqBasePath + "sys040", + params: {id: parent.rowId}, + pagination: false, + method: 'GET', + template: $("#beanTemplate").html(), + ajaxSendAfter:function (json) { + $("#icon").html(systemCommonUtil.initIconShow(json.bean)); + + if(json.bean.parentId == '0'){ + $("#menuLevel").html("父菜单"); + } else { + $("#menuLevel").html( "子菜单"); + } + matchingLanguage(); + form.render(); + } + }); + + $("body").on("click","#menuIconPic", function() { + systemCommonUtil.showPicImg(fileBasePath + json.bean.menuIconPic); + }) + + }); +}); \ No newline at end of file diff --git a/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuEdit.js b/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuEdit.js new file mode 100644 index 000000000..774bb3542 --- /dev/null +++ b/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuEdit.js @@ -0,0 +1,129 @@ + +layui.config({ + base: basePath, + version: skyeyeVersion +}).extend({ + window: 'js/winui.window' +}).define(['window', 'table', 'jquery', 'winui', 'colorpicker', 'fileUpload'], function (exports) { + winui.renderColor(); + layui.use(['form'], function (form) { + var index = parent.layer.getFrameIndex(window.name); + var $ = layui.$; + var colorpicker = layui.colorpicker; + var selOption = getFileContent('tpl/template/select-option.tpl'); + + showGrid({ + id: "showForm", + url: reqBasePath + "sys040", + params: {id: parent.rowId}, + pagination: false, + method: 'GET', + template: $("#beanTemplate").html(), + ajaxSendLoadBefore: function(hdb) {}, + ajaxSendAfter:function (json) { + // 加载图标信息 + systemCommonUtil.initEditIconChooseHtml('iconMation', form, colorpicker, 12, json.bean); + + // 桌面信息 + systemCommonUtil.getSysDesttop(function (data) { + // 加载账户数据 + $("#desktop").html(getDataUseHandlebars(selOption, data)); + $("#desktop").val(json.bean.desktopId); + form.render('select'); + }); + + // 所属系统 + showGrid({ + id: "menuSysWinId", + url: reqBasePath + "querySysEveWinList", + params: {}, + pagination: false, + method: "GET", + template: selOption, + ajaxSendLoadBefore: function(hdb) {}, + ajaxSendAfter: function(j) { + $("#menuSysWinId").val(json.bean.sysWinId); + form.render('select'); + } + }); + + // 菜单类型 + $("input:radio[name='menuLevel'][value='" + json.bean.menuLevel + "']").attr("checked", true); + if(json.bean.menuLevel == '0'){ + $("#parentIdBox").addClass("layui-hide"); + } else { + loadChildMenu(); + $("#menuParent").val(json.bean.parentId); + } + $("input:radio[name='menuType'][value='" + json.bean.menuType + "']").attr("checked", true); + $("input:radio[name='menuSysType'][value='" + json.bean.menuSysType + "']").attr("checked", true); + $("input:radio[name='isShare'][value='" + json.bean.isShare + "']").attr("checked", true); + + matchingLanguage(); + form.render(); + + // 菜单类型变化事件 + form.on('radio(menuLevel)', function (data) { + var val = data.value; + if (val == 0) { + $("#lockParentSel").html(""); + $("#parentIdBox").addClass("layui-hide"); + } else if (val == 1) { + $("#parentIdBox").removeClass("layui-hide"); + loadChildMenu(); + } + form.render('select'); + }); + + form.on('submit(formEditMenu)', function (data) { + if (winui.verifyForm(data.elem)) { + var menuLevel = $("input[name='menuLevel']:checked").val(); + var params = { + menuName: $("#menuName").val(), + menuNameEn: $("#menuNameEn").val(), + sysWinId: $("#menuSysWinId").val(), + desktopId: $("#desktop").val(), + menuUrl: $("#menuUrl").val(), + menuType: $("input[name='menuType']:checked").val(), + menuLevel: menuLevel, + parentId: menuLevel == 0 ? "0" : $("#menuParent").val(), + menuSysType: $("input[name='menuSysType']:checked").val(), + isShare: $("input[name='isShare']:checked").val(), + id: parent.rowId, + }; + + // 获取图标信息 + params = systemCommonUtil.getIconChoose(params); + if (!params["iconChooseResult"]) { + return false; + } + + AjaxPostUtil.request({url: reqBasePath + "sys010", params: params, type: 'json', method: 'PUT', callback: function(json) { + parent.layer.close(index); + parent.refreshCode = '0'; + }}); + } + return false; + }); + } + }); + + // 加载一级菜单 + function loadChildMenu() { + AjaxPostUtil.request({url: reqBasePath + "sys009", params: {parentId: '0'}, type: 'json', method: 'GET', callback: function (json) { + var str = ''; + $("#lockParentSel").append(str); + }, async: false}); + } + + // 取消 + $("body").on("click", "#cancle", function() { + parent.layer.close(index); + }); + + }); +}); \ No newline at end of file diff --git a/userauth/src/main/resources/template/js/sysevemenu/sysevemenulist.js b/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuList.js similarity index 68% rename from userauth/src/main/resources/template/js/sysevemenu/sysevemenulist.js rename to userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuList.js index dbcb4d714..288b3b716 100644 --- a/userauth/src/main/resources/template/js/sysevemenu/sysevemenulist.js +++ b/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuList.js @@ -8,38 +8,18 @@ layui.config({ version: skyeyeVersion }).extend({ window: 'js/winui.window' -}).define(['window', 'table', 'jquery', 'winui', 'form', 'fsCommon', 'fsTree'], function (exports) { +}).define(['window', 'tableTreeDj', 'jquery', 'winui', 'form', 'fsTree'], function (exports) { winui.renderColor(); var $ = layui.$, form = layui.form, fsTree = layui.fsTree, - fsCommon = layui.fsCommon, - table = layui.table; - var parentId = ""; + tableTree = layui.tableTreeDj; + var sysWinId = ""; authBtn('1552958167410'); - showGrid({ - id: "menuLevel", - url: reqBasePath + "sys021", - params: {}, - pagination: false, - template: getFileContent('tpl/template/select-option.tpl'), - ajaxSendLoadBefore: function(hdb) { - }, - ajaxSendAfter:function (json) { - form.render('select'); - } - }); - - // 桌面信息 - systemCommonUtil.getSysDesttop(function (json) { - $("#desktop").html(getDataUseHandlebars(getFileContent('tpl/template/select-option.tpl'), json)); - form.render('select'); - }); - function initLoadTable() { - table.render({ + tableTree.render({ id: 'messageTable', elem: '#messageTable', method: 'post', @@ -50,30 +30,18 @@ layui.config({ limits: getLimits(), limit: getLimit(), cols: [[ - { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' }, - { field: 'menuName', title: '菜单名称', width: 120, templet: function (d) { - return '' + d.menuName + ''; - }}, + { field: 'menuName', title: '菜单名称', width: 120 }, { field: 'menuNameEn', title: '英文名称', width: 150 }, { field: 'id', title: '图标', align: 'center', width: 60, templet: function (d) { return systemCommonUtil.initIconShow(d); }}, - { field: 'menuLevel', title: '菜单级别', width: 140, templet: function (d) { - if(d.parentId == '0'){ - return "创世菜单"; - } else { - return "子菜单-->" + d.menuLevel + "级子菜单"; - } + { field: 'orderNum', title: '排序', align: 'center', width: 80 }, + { field: 'menuLevel', title: '菜单类型', align: 'center', width: 100, templet: function (d) { + return d.menuLevel == 0 ? '父菜单' : '子菜单'; }}, - { field: 'desktopName', title: '所属桌面', width: 140}, + { field: 'desktopName', title: '所属桌面', width: 120 }, { field: 'isShare', title: '共享', align: 'center', width: 80, templet: function (d) { - if(d.isShare == 0){ - return '否'; - } else if (d.isShare == 1){ - return '是'; - } else { - return '参数错误'; - } + return d.isShare == 0 ? '否' : '是'; }}, { field: 'menuParentName', title: '父菜单', width: 100 }, { field: 'menuUrl', title: '菜单链接', width: 160 }, @@ -81,14 +49,21 @@ layui.config({ { 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'} + { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 320, toolbar: '#tableBar' } ]], done: function(json) { matchingLanguage(); + initTableSearchUtil.initAdvancedSearch($("#messageTable")[0], json.searchFilter, form, "请输入菜单名称", function () { + tableTree.reload("messageTable", {page: {curr: 1}, where: getTableParams()}); + }); } + }, { + keyId: 'id', + keyPid: 'parentId', + title: 'menuName', }); - - table.on('tool(messageTable)', function (obj) { + + tableTree.getTable().on('tool(messageTable)', function (obj) { var data = obj.data; var layEvent = obj.event; if (layEvent === 'del') { // 删除 @@ -122,19 +97,14 @@ layui.config({ //异步加载的方法 function onClickTree(event, treeId, treeNode) { if(treeNode == undefined) { - parentId = ""; + sysWinId = ""; } else { - parentId = treeNode.id; + sysWinId = treeNode.id; } loadTable(); } /********* tree 处理 end *************/ - // 刷新数据 - $("body").on("click", "#reloadTable", function() { - loadTable(); - }); - // 删除 function del(data, obj) { layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function (index) { @@ -150,9 +120,9 @@ layui.config({ function details(data) { rowId = data.id; _openNewWindows({ - url: "../../tpl/sysevemenu/sysevemenudetails.html", + url: "../../tpl/sysEveMenu/sysEveMenuDetails.html", title: systemLanguage["com.skyeye.detailsPageTitle"][languageType], - pageId: "sysevemenudetails", + pageId: "sysEveMenuDetails", area: ['90vw', '90vh'], callBack: function (refreshCode) { }}); @@ -162,9 +132,9 @@ layui.config({ function edit(data) { rowId = data.id; _openNewWindows({ - url: "../../tpl/sysevemenu/sysevemenuedit.html", + url: "../../tpl/sysEveMenu/sysEveMenuEdit.html", title: systemLanguage["com.skyeye.editPageTitle"][languageType], - pageId: "sysevemenuedit", + pageId: "sysEveMenuEdit", area: ['90vw', '90vh'], callBack: function (refreshCode) { winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); @@ -191,9 +161,9 @@ layui.config({ // 新增菜单 $("body").on("click", "#addBean", function() { _openNewWindows({ - url: "../../tpl/sysevemenu/sysevemenuadd.html", + url: "../../tpl/sysEveMenu/sysEveMenuAdd.html", title: systemLanguage["com.skyeye.addPageTitle"][languageType], - pageId: "sysevemenuadd", + pageId: "sysEveMenuAdd", area: ['90vw', '90vh'], callBack: function (refreshCode) { winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); @@ -215,28 +185,16 @@ layui.config({ } form.render(); - form.on('submit(formSearch)', function (data) { - if (winui.verifyForm(data.elem)) { - table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()}); - } - return false; + $("body").on("click", "#reloadTable", function() { + loadTable(); }); - function loadTable() { - table.reloadData("messageTable", {where: getTableParams()}); + tableTree.reload("messageTable", {where: getTableParams()}); } function getTableParams() { - return { - menuName: $("#menuName").val(), - menuUrl: $("#menuUrl").val(), - parentId: parentId, - menuLevel: $("#menuLevel").val(), - desktopId: $("#desktop").val(), - isShare: $("#isShare").val(), - parentMenuName: $("#parentMenuName").val() - }; + return $.extend(true, {sysWinId: sysWinId}, initTableSearchUtil.getSearchValue("messageTable")); } - exports('sysevemenulist', {}); + exports('sysEveMenuList', {}); }); diff --git a/userauth/src/main/resources/template/js/sysevemenu/sysevemenuadd.js b/userauth/src/main/resources/template/js/sysevemenu/sysevemenuadd.js deleted file mode 100644 index 970ae70e3..000000000 --- a/userauth/src/main/resources/template/js/sysevemenu/sysevemenuadd.js +++ /dev/null @@ -1,172 +0,0 @@ - -layui.config({ - base: basePath, - version: skyeyeVersion -}).extend({ - window: 'js/winui.window' -}).define(['window', 'table', 'jquery', 'winui', 'colorpicker', 'fileUpload'], function (exports) { - winui.renderColor(); - layui.use(['form'], function (form) { - var index = parent.layer.getFrameIndex(window.name); - var $ = layui.$; - var colorpicker = layui.colorpicker; - var selOption = getFileContent('tpl/template/select-option.tpl'); - - var parentId = "0"; - - // 加载图标信息 - systemCommonUtil.initIconChooseHtml('iconMation', form, colorpicker, 12); - - matchingLanguage(); - form.render(); - - // 桌面信息 - systemCommonUtil.getSysDesttop(function (json) { - $("#desktop").html(getDataUseHandlebars(selOption, json)); - form.render('select'); - }); - - // 所属系统 - showGrid({ - id: "menuSysWinId", - url: reqBasePath + "querySysEveWinList", - params: {}, - pagination: false, - method: "GET", - template: selOption, - ajaxSendLoadBefore: function(hdb) {}, - ajaxSendAfter:function (json) { - form.render('select'); - } - }); - - //菜单级别变化事件 - form.on('radio(menuLevel)', function (data) { - var val = data.value; - if(val == '1'){//创世菜单 - $("#parentIdBox").addClass("layui-hide"); - } else if (val == '2'){ - parentId = "0"; - $("#lockParentSel").html(""); - $("#parentIdBox").removeClass("layui-hide"); - loadChildMenu(); - } else { - winui.window.msg('状态值错误', {icon: 2, time: 2000}); - } - }); - - //系统菜单同步 - form.on('switch(isNecessary)', function (data) { - //同步开关值 - $(data.elem).val(data.elem.checked); - }); - - //同步共享 - form.on('switch(isShare)', function (data) { - //同步开关值 - $(data.elem).val(data.elem.checked); - }); - - form.on('select(selectParent)', function(data) { - if (data.value != parentId){ - if(isNull(data.value) || data.value == '请选择'){ - layui.$(data.elem).parent('dd').nextAll().remove(); - if(layui.$(data.elem).parent('dd').prev().children('select[class=menuParent]').length > 0){ - parentId = layui.$(data.elem).parent('dd').prev().children('select[class=menuParent]')[0].value; - } else { - parentId = "0"; - } - } else { - layui.$(data.elem).parent('dd').nextAll().remove(); - parentId = data.value; - loadChildMenu(); - } - } - }); - - form.on('submit(formAddMenu)', function (data) { - if (winui.verifyForm(data.elem)) { - var params = { - menuName: $("#menuName").val(), - menuNameEn: $("#menuNameEn").val(), - sysWinId: data.field.menuSysWinId, - desktopId: data.field.desktop, - menuUrl: $("#menuUrl").val(), - menuType: data.field.menuType - }; - - // 获取图标信息 - params = systemCommonUtil.getIconChoose(params); - if (!params["iconChooseResult"]) { - return false; - } - - if (data.field.menuLevel == '1'){//创世菜单 - params.parentId = '0'; - } else if (data.field.menuLevel == '2'){//子菜单 - var $menu = layui.$('.menuParent'); - var str = ""; - for (var i = 0; i < $menu.length; i++) { - if (!isNull($menu[i].value) && $menu[i].value != '请选择') { - str += $menu[i].value + ","; - } - } - if (isNull(str)) {//父菜单为空 - winui.window.msg("请至少选择一级父菜单", {icon: 2, time: 2000}); - return false; - } else { - params.parentId = str; - } - } else { - winui.window.msg('状态值错误', {icon: 2, time: 2000}); - } - if ($("#menuSysType").val() == 'true') { - params.menuSysType = '1'; - } else { - params.menuSysType = '2'; - } - if ($("#isShare").val() == 'true') { - params.isShare = '1'; - } else { - params.isShare = '0'; - } - AjaxPostUtil.request({url: reqBasePath + "sys007", params: params, type: 'json', callback: function(json) { - parent.layer.close(index); - parent.refreshCode = '0'; - }}); - } - return false; - }); - - //加载同级菜单 - function loadChildMenu(){ - AjaxPostUtil.request({url: reqBasePath + "sys009", params: {parentId: parentId}, type: 'json', callback: function (json) { - var str = '
'; - $("#lockParentSel").append(str); - form.render('select'); - }}); - } - - //获取菜单级别 - function getMenuLevelName(level){ - if(level == '0'){ - return "创世菜单"; - } else { - return level + "级子菜单"; - } - } - - //初始化加载隐藏创世菜单 - $("#parentIdBox").addClass("layui-hide"); - - // 取消 - $("body").on("click", "#cancle", function() { - parent.layer.close(index); - }); - - }); -}); \ No newline at end of file diff --git a/userauth/src/main/resources/template/js/sysevemenu/sysevemenudetails.js b/userauth/src/main/resources/template/js/sysevemenu/sysevemenudetails.js deleted file mode 100644 index 135a80239..000000000 --- a/userauth/src/main/resources/template/js/sysevemenu/sysevemenudetails.js +++ /dev/null @@ -1,53 +0,0 @@ - -layui.config({ - base: basePath, - version: skyeyeVersion -}).extend({ - window: 'js/winui.window', -}).define(['window', 'table', 'jquery', 'winui'], function (exports) { - winui.renderColor(); - layui.use(['form'], function (form) { - var index = parent.layer.getFrameIndex(window.name); - var $ = layui.$; - - showGrid({ - id: "showForm", - url: reqBasePath + "sys040", - params: {rowId:parent.rowId}, - pagination: false, - template: getFileContent('tpl/sysevemenu/sysevemenudetailsTemplate.tpl'), - ajaxSendAfter:function (json) { - var str = ''; - if(json.bean.menuIconType == '1'){ - if(isNull(json.bean.menuIconBg)){ - str += '