diff --git a/base-server/src/main/resources/template/js/operate/writeOperate.js b/base-server/src/main/resources/template/js/operate/writeOperate.js index 95b5559e57f9beeedaba43fccf88b3c51e0ac8fa..921306af572a46db9906684fd7cc4178f7d1a969 100644 --- a/base-server/src/main/resources/template/js/operate/writeOperate.js +++ b/base-server/src/main/resources/template/js/operate/writeOperate.js @@ -69,19 +69,6 @@ layui.config({ `, - 'customPageUrl': `
- -
- -
-
`, - 'dsFormPage': `
- -
- - -
-
`, }; var attrHtml = ''; @@ -124,15 +111,15 @@ layui.config({ } else { var operateOpenPage = json.bean.operateOpenPage; $('#eventTypeChangeBox').html(_html['operateOpenPage']); - $('#typeChangeBox').html(_html['customPageUrl']); + $('#typeChangeBox').html(commonHtml['customPageUrl']); $("#openPageName").val(operateOpenPage.name); var type = operateOpenPage.type ? "1" : "2"; $("input:radio[name=type][value=" + type + "]").attr("checked", true); if (type == 1) { - $('#typeChangeBox').html(_html['customPageUrl']); + $('#typeChangeBox').html(commonHtml['customPageUrl']); $("#pageUrl").val(operateOpenPage.pageUrl); } else { - $('#typeChangeBox').html(_html['dsFormPage']); + $('#typeChangeBox').html(commonHtml['dsFormPage']); dsFormUtil.dsFormChooseMation = operateOpenPage.dsFormPage; var serviceName = operateOpenPage.dsFormPage.serviceBeanCustom.serviceBean.name; $("#pageUrl").val(serviceName + '【' + operateOpenPage.dsFormPage.name + '】'); @@ -182,7 +169,7 @@ layui.config({ } else { // 新开页面 $('#eventTypeChangeBox').html(_html['operateOpenPage']); - $('#typeChangeBox').html(_html['customPageUrl']); + $('#typeChangeBox').html(commonHtml['customPageUrl']); loadParamsTable('pageParams'); } form.render(); @@ -190,9 +177,9 @@ layui.config({ form.on('radio(type)', function (data) { if (data.value == 1) { - $('#typeChangeBox').html(_html['customPageUrl']); + $('#typeChangeBox').html(commonHtml['customPageUrl']); } else { - $('#typeChangeBox').html(_html['dsFormPage']); + $('#typeChangeBox').html(commonHtml['dsFormPage']); } }); diff --git a/common/src/main/resources/template/js/dsFormPage/pageShow.js b/common/src/main/resources/template/js/dsFormPage/pageShow.js new file mode 100644 index 0000000000000000000000000000000000000000..6cb5c74a43acc516628794edf50cb2d261273f05 --- /dev/null +++ b/common/src/main/resources/template/js/dsFormPage/pageShow.js @@ -0,0 +1,21 @@ + +layui.config({ + base: basePath, + version: skyeyeVersion +}).extend({ + window: 'js/winui.window' +}).define(['window', 'jquery'], function (exports) { + winui.renderColor(); + var $ = layui.$; + var pageId = GetUrlParam("pageId"); + if (isNull(pageId)) { + winui.window.msg("请传入布局id", {icon: 2, time: 2000}); + return false; + } + // 获取布局信息 + AjaxPostUtil.request({url: reqBasePath + "dsformpage006", params: {id: pageId}, type: 'json', method: 'GET', callback: function (json) { + console.log(json) + }}); + + exports('pageShow', {}); +}); diff --git a/common/src/main/resources/template/tpl/dsFormPage/pageShow.html b/common/src/main/resources/template/tpl/dsFormPage/pageShow.html new file mode 100644 index 0000000000000000000000000000000000000000..0a79f0426e61583be743b3fb78cde5b1bebccd07 --- /dev/null +++ b/common/src/main/resources/template/tpl/dsFormPage/pageShow.html @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuAdd.js b/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuAdd.js index 8b6cb3d8bf8aac08f07c09ea1093d30805ef5ec7..e957d30dcbdb0b544b5a30058b567e937f8ff0cd 100644 --- a/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuAdd.js +++ b/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuAdd.js @@ -50,15 +50,26 @@ layui.config({ } form.render('select'); }); + + $('#typeChangeBox').html(commonHtml['customPageUrl']); + form.on('radio(pageType)', function (data) { + if (data.value == 1) { + $('#typeChangeBox').html(commonHtml['customPageUrl']); + } else { + $('#typeChangeBox').html(commonHtml['dsFormPage']); + } + }); form.on('submit(formAddMenu)', function (data) { if (winui.verifyForm(data.elem)) { var level = $("input[name='level']:checked").val(); + var pageType = $("input[name='pageType']:checked").val(); var params = { name: $("#name").val(), sysWinId: $("#sysWinId").val(), desktopId: $("#desktop").val(), - pageUrl: $("#pageUrl").val(), + pageType: pageType == 1 ? true : false, + pageUrl: pageType == 1 ? $("#pageUrl").val() : dsFormUtil.dsFormChooseMation.id, type: $("input[name='type']:checked").val(), level: level, parentId: level == 0 ? "0" : $("#menuParent").val(), @@ -90,6 +101,13 @@ layui.config({ $("#lockParentSel").append(str); }, async: false}); } + + $("body").on("click", ".chooseBtn", function() { + dsFormUtil.openDsFormPageChoosePage(function (dsFormChoose) { + var serviceName = dsFormChoose.serviceBeanCustom.serviceBean.name; + $("#pageUrl").val(serviceName + '【' + dsFormChoose.name + '】'); + }); + }); // 取消 $("body").on("click", "#cancle", function() { diff --git a/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuDetails.js b/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuDetails.js index ad990aedb8886a7278012ced4fb1bb4ad3101477..0cda101159b278e2e52dce4d24cb4e024c6a6591 100644 --- a/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuDetails.js +++ b/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuDetails.js @@ -17,6 +17,27 @@ layui.config({ pagination: false, method: 'GET', template: $("#beanTemplate").html(), + ajaxSendLoadBefore: function(hdb, json) { + if (json.bean.pageType) { + json.bean.pageType = '自定义页面'; + json.bean.pageName = json.bean.pageUrl; + } else { + json.bean.pageType = '表单布局'; + dsFormUtil.dsFormChooseMation = json.bean.dsFormPage; + var serviceName = json.bean.dsFormPage.serviceBeanCustom.serviceBean.name; + json.bean.pageName = serviceName + '【' + json.bean.dsFormPage.name + '】'; + } + if (json.bean.sysType == 1) { + json.bean.sysTypeName = '是'; + } else { + json.bean.sysTypeName = '否'; + } + if (json.bean.isShare == 0) { + json.bean.isShareName = '否'; + } else { + json.bean.isShareName = '是'; + } + }, ajaxSendAfter:function (json) { $("#icon").html(systemCommonUtil.initIconShow(json.bean)); @@ -25,6 +46,7 @@ layui.config({ } else { $("#level").html( "子菜单"); } + matchingLanguage(); form.render(); } diff --git a/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuEdit.js b/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuEdit.js index 9129e9f699ce771f53412b457343c18f832d6b5a..56a422f107f4399469da027f75f76926cad05ef0 100644 --- a/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuEdit.js +++ b/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuEdit.js @@ -58,6 +58,18 @@ layui.config({ $("input:radio[name='sysType'][value='" + json.bean.sysType + "']").attr("checked", true); $("input:radio[name='isShare'][value='" + json.bean.isShare + "']").attr("checked", true); + var type = json.bean.pageType ? "1" : "2"; + $("input:radio[name=pageType][value=" + type + "]").attr("checked", true); + if (type == 1) { + $('#typeChangeBox').html(commonHtml['customPageUrl']); + $("#pageUrl").val(json.bean.pageUrl); + } else { + $('#typeChangeBox').html(commonHtml['dsFormPage']); + dsFormUtil.dsFormChooseMation = json.bean.dsFormPage; + var serviceName = json.bean.dsFormPage.serviceBeanCustom.serviceBean.name; + $("#pageUrl").val(serviceName + '【' + json.bean.dsFormPage.name + '】'); + } + matchingLanguage(); form.render(); @@ -73,15 +85,25 @@ layui.config({ } form.render('select'); }); + + form.on('radio(pageType)', function (data) { + if (data.value == 1) { + $('#typeChangeBox').html(commonHtml['customPageUrl']); + } else { + $('#typeChangeBox').html(commonHtml['dsFormPage']); + } + }); form.on('submit(formEditMenu)', function (data) { if (winui.verifyForm(data.elem)) { var level = $("input[name='level']:checked").val(); + var pageType = $("input[name='pageType']:checked").val(); var params = { name: $("#name").val(), sysWinId: $("#sysWinId").val(), desktopId: $("#desktop").val(), - pageUrl: $("#pageUrl").val(), + pageType: pageType == 1 ? true : false, + pageUrl: pageType == 1 ? $("#pageUrl").val() : dsFormUtil.dsFormChooseMation.id, type: $("input[name='type']:checked").val(), level: level, parentId: level == 0 ? "0" : $("#menuParent").val(), @@ -117,6 +139,13 @@ layui.config({ $("#lockParentSel").append(str); }, async: false}); } + + $("body").on("click", ".chooseBtn", function() { + dsFormUtil.openDsFormPageChoosePage(function (dsFormChoose) { + var serviceName = dsFormChoose.serviceBeanCustom.serviceBean.name; + $("#pageUrl").val(serviceName + '【' + dsFormChoose.name + '】'); + }); + }); // 取消 $("body").on("click", "#cancle", function() { diff --git a/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuList.js b/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuList.js index a929c98c39050e10d4af5fd6bf455b4052da3d54..1a955ea155770e9c33464d3a7da10c59cf559c86 100644 --- a/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuList.js +++ b/userauth/src/main/resources/template/js/sysEveMenu/sysEveMenuList.js @@ -47,7 +47,6 @@ layui.config({ { field: 'isShare', title: '共享', align: 'center', width: 80, templet: function (d) { return d.isShare == 0 ? '否' : '是'; }}, - { field: 'parentName', title: '父菜单', width: 100 }, { field: 'pageUrl', title: '菜单链接', width: 160 }, { field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], width: 120 }, { field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 }, @@ -148,7 +147,7 @@ layui.config({ // 上移 function topOne(data) { - AjaxPostUtil.request({url: reqBasePath + "sys022", params: {rowId: data.id}, type: 'json', callback: function (json) { + AjaxPostUtil.request({url: reqBasePath + "sys022", params: {id: data.id}, type: 'json', method: 'POST', callback: function (json) { winui.window.msg(systemLanguage["com.skyeye.moveUpOperationSuccessMsg"][languageType], {icon: 1, time: 2000}); loadTable(); }}); @@ -156,7 +155,7 @@ layui.config({ // 下移 function lowerOne(data) { - AjaxPostUtil.request({url: reqBasePath + "sys023", params: {rowId: data.id}, type: 'json', callback: function (json) { + AjaxPostUtil.request({url: reqBasePath + "sys023", params: {id: data.id}, type: 'json', method: 'POST', callback: function (json) { winui.window.msg(systemLanguage["com.skyeye.moveDownOperationSuccessMsg"][languageType], {icon: 1, time: 2000}); loadTable(); }}); diff --git a/userauth/src/main/resources/template/tpl/sysEveMenu/sysEveMenuAdd.html b/userauth/src/main/resources/template/tpl/sysEveMenu/sysEveMenuAdd.html index e03d317a19e61236eca5d0ae11c6254acf2c5347..36ab0b4afcffeeb18ec3d0fd97c1f164e1b91b0a 100644 --- a/userauth/src/main/resources/template/tpl/sysEveMenu/sysEveMenuAdd.html +++ b/userauth/src/main/resources/template/tpl/sysEveMenu/sysEveMenuAdd.html @@ -18,13 +18,15 @@
-
- -
- -
如果是一级菜单,格式为:--
如果是子菜单,格式为:../../tpl/model/modellist.html
+
+ +
+ +
+
+
diff --git a/userauth/src/main/resources/template/tpl/sysEveMenu/sysEveMenuDetails.html b/userauth/src/main/resources/template/tpl/sysEveMenu/sysEveMenuDetails.html index a1f5f49685b0c32a3f6c01ae744b3db669596018..5e0d083ef707d295e01aebeac15d1d4f41bd6776 100644 --- a/userauth/src/main/resources/template/tpl/sysEveMenu/sysEveMenuDetails.html +++ b/userauth/src/main/resources/template/tpl/sysEveMenu/sysEveMenuDetails.html @@ -29,22 +29,28 @@
+
+ +
+ {{pageType}} +
+
- {{pageUrl}} + {{pageName}}
- {{desktopName}} + {{sysDesktop.name}}
- {{sysWinName}} + {{sysWin.name}}
@@ -56,7 +62,7 @@
- {{menuParentName}} + {{parentMenu.name}}
@@ -77,21 +83,6 @@ {{isShareName}}
-
- 使用信息
-
-
- -
- {{roleNum}} -
-
-
- -
- {{authpointNum}} -
-
{{/bean}} diff --git a/userauth/src/main/resources/template/tpl/sysEveMenu/sysEveMenuEdit.html b/userauth/src/main/resources/template/tpl/sysEveMenu/sysEveMenuEdit.html index b7de8ccabd448d48f2fbe45dbf0231e204c18d9e..e06460929d120fda0ec82e5b98470bb6918a66be 100644 --- a/userauth/src/main/resources/template/tpl/sysEveMenu/sysEveMenuEdit.html +++ b/userauth/src/main/resources/template/tpl/sysEveMenu/sysEveMenuEdit.html @@ -24,13 +24,15 @@
-
- -
- -
如果是一级菜单,格式为:--
如果是子菜单,格式为:../../tpl/model/modellist.html
+
+ +
+ +
+
+
diff --git a/userauth/src/main/resources/template/tpl/sysEveMenu/sysEveMenuList.html b/userauth/src/main/resources/template/tpl/sysEveMenu/sysEveMenuList.html index aa4923fab428b6cf8655c9366490abac52d2a10a..4db8f175c4d64c9b44517e02de23a6b1120c6568 100644 --- a/userauth/src/main/resources/template/tpl/sysEveMenu/sysEveMenuList.html +++ b/userauth/src/main/resources/template/tpl/sysEveMenu/sysEveMenuList.html @@ -37,7 +37,7 @@ {{# if(auth('1552957538820')){ }} 下移 {{# } }} - {{# if((d.roleNum == 0 || isNull(d.roleNum)) && auth('1552957567975')){ }} + {{# if(auth('1552957567975')){ }} {{# } }} {{# if(auth('1552957843505')){ }} diff --git a/web/src/main/resources/template/assets/lib/layui/custom.js b/web/src/main/resources/template/assets/lib/layui/custom.js index f0ede679c51c3e1d4b681aa5fcf52493f5c3b62a..408bf132d97a1948fd127bdc853ef238108bdd09 100644 --- a/web/src/main/resources/template/assets/lib/layui/custom.js +++ b/web/src/main/resources/template/assets/lib/layui/custom.js @@ -56,6 +56,8 @@ if(isNull(localStorage.getItem("sysMainMation"))){ initBaseParams(); } +var dsFormPageUrl = "../../tpl/dsFormPage/pageShow.html?pageId="; + var skyeyeVersion; // 文件路径 var fileBasePath; diff --git a/web/src/main/resources/template/assets/lib/layui/customer/common/systemCommonUtil.js b/web/src/main/resources/template/assets/lib/layui/customer/common/systemCommonUtil.js index 4e283003a09e8ac928a06be91d182c6c1571d3af..5ca9f6b3fb54c9ae595b383229a685db8bc3b130 100644 --- a/web/src/main/resources/template/assets/lib/layui/customer/common/systemCommonUtil.js +++ b/web/src/main/resources/template/assets/lib/layui/customer/common/systemCommonUtil.js @@ -321,6 +321,10 @@ var systemCommonUtil = { t.next().css("cursor", "not-allowed"); }, + checkUrl: function (url) { + return (url.startsWith('../') || url.startsWith('--')); + }, + /** * 对页面url添加版本控制 * @@ -1254,4 +1258,24 @@ var desktopMenuUtil = { return ''; } +}; + +// 公共的一些html脚本 +var commonHtml = { + + 'customPageUrl': `
+ +
+ +
如果不想跳转,可填写:--
如果想跳转,格式为:../../tpl/model/modellist.html
+
+
`, + 'dsFormPage': `
+ +
+ + +
+
`, + }; \ No newline at end of file diff --git a/web/src/main/resources/template/js/index/index.js b/web/src/main/resources/template/js/index/index.js index dd767376ceb93162b694c9183b3c2970820f59f0..f96b9da20b480317f58f6a056b86577a7db1a534 100644 --- a/web/src/main/resources/template/js/index/index.js +++ b/web/src/main/resources/template/js/index/index.js @@ -952,15 +952,27 @@ layui.config({ var id = $this.attr('win-id'); var type = parseInt($this.attr('win-opentype')); var maxOpen = parseInt($this.attr('win-maxopen')) || -1; - if (url == 'theme') { - winui.window.openTheme(loadBottomMenuIcon); - return; - } - if (!url || !title || !id) { - winui.window.msg('菜单配置错误(菜单链接、标题、id缺一不可)'); - return; - } - url = indexMenu.getUrlPath(url, menuSysWinUrl); + if (!url || !title || !id) { + winui.window.msg('菜单配置错误(菜单链接、标题、id缺一不可)'); + return; + } + // 自定义页面 + if (url == 'theme') { + winui.window.openTheme(loadBottomMenuIcon); + return; + } + + if (systemCommonUtil.checkUrl(url)) { + // 自定义页面 + if (url == 'theme') { + winui.window.openTheme(loadBottomMenuIcon); + return; + } + url = indexMenu.getUrlPath(url, menuSysWinUrl); + } else { + url = dsFormPageUrl + url; + } + if (type === 1) { // 新窗口打开 window.open(url); diff --git a/web/src/main/resources/template/js/traditionpage/index.js b/web/src/main/resources/template/js/traditionpage/index.js index 5d2fad688bfc27aeb2cd404befa7065e7ed53c51..4e7816efafb5c92a2ea0df891bbfbb6b232b4216 100644 --- a/web/src/main/resources/template/js/traditionpage/index.js +++ b/web/src/main/resources/template/js/traditionpage/index.js @@ -147,7 +147,11 @@ layui.config({ active = { //在这里给active绑定几项事件,后面可通过active调用这些事件 tabAdd: function(url, id, name) { - url = systemCommonUtil.getHasVersionUrl(url); + if (systemCommonUtil.checkUrl(url)) { + url = systemCommonUtil.getHasVersionUrl(url); + } else { + url = dsFormPageUrl + url; + } //新增一个Tab项 传入三个参数,分别对应其标题,tab页面的地址,还有一个规定的id,是标签中data-id的属性值 //关于tabAdd的方法所传入的参数可看layui的开发文档中基础方法部分 element.tabAdd('menubox', {