From 29b590d369f7fc15b15fc9e6cdf1893c3b4904c5 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 4 Jan 2019 11:37:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BF=AE=E6=94=B9=E5=85=A8?= =?UTF-8?q?=E5=B1=8F/=E7=A1=AE=E8=AE=A4=E5=8F=96=E6=B6=88=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/static/ruoyi/js/ry-ui.js | 10 +++++++++- .../templates/system/notice/add.html | 19 ++++++++----------- .../templates/system/notice/edit.html | 19 ++++++++----------- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js index eaf77120..d47f1c20 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js @@ -391,8 +391,16 @@ shade: 0.3, title: title, content: url, + btn: ['确定', '关闭'], // 弹层外区域关闭 - shadeClose: true + shadeClose: true, + yes: function(index, layero) { + var iframeWin = layero.find('iframe')[0]; + iframeWin.contentWindow.submitHandler(); + }, + cancel: function(index) { + return true; + } }); layer.full(index); }, diff --git a/ruoyi-admin/src/main/resources/templates/system/notice/add.html b/ruoyi-admin/src/main/resources/templates/system/notice/add.html index a60c2a72..b0c4b2e3 100644 --- a/ruoyi-admin/src/main/resources/templates/system/notice/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/notice/add.html @@ -37,12 +37,6 @@ -
-
- - -
-
@@ -61,13 +55,16 @@ noticeTitle:{ required:true, } - }, - submitHandler: function(form) { - var sHTML = $('.summernote').code(); - $("#noticeContent").val(sHTML); - $.operate.save(prefix + "/add", $('#form-notice-add').serialize()); } }); + + function submitHandler() { + if ($.validate.form()) { + var sHTML = $('.summernote').code(); + $("#noticeContent").val(sHTML); + $.operate.save(prefix + "/add", $('#form-notice-add').serialize()); + } + } diff --git a/ruoyi-admin/src/main/resources/templates/system/notice/edit.html b/ruoyi-admin/src/main/resources/templates/system/notice/edit.html index f5eee47e..e1df4d4a 100644 --- a/ruoyi-admin/src/main/resources/templates/system/notice/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/notice/edit.html @@ -38,12 +38,6 @@ -
-
- - -
-
@@ -66,13 +60,16 @@ xxxx:{ required:true, }, - }, - submitHandler: function(form) { - var sHTML = $('.summernote').code(); - $("#noticeContent").val(sHTML); - $.operate.save(prefix + "/edit", $('#form-notice-edit').serialize()); } }); + + function submitHandler() { + if ($.validate.form()) { + var sHTML = $('.summernote').code(); + $("#noticeContent").val(sHTML); + $.operate.save(prefix + "/edit", $('#form-notice-edit').serialize()); + } + }