From eb36c8811c8f42df101f1dac0bbcbac3cd63b42b Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 3 Oct 2018 21:44:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E6=8C=89=E9=92=AE=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=88=E6=8F=90=E4=BA=A4/=E5=85=B3=E9=97=AD?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/static/ruoyi/css/ry-ui.css | 7 +++- src/main/resources/static/ruoyi/js/ry-ui.js | 36 +++++++++++++++++-- .../resources/templates/monitor/job/add.html | 12 +++---- .../resources/templates/monitor/job/edit.html | 15 ++++---- .../templates/monitor/operlog/detail.html | 5 --- .../templates/system/config/add.html | 17 ++++----- .../templates/system/config/edit.html | 19 +++++----- .../resources/templates/system/dept/add.html | 22 +++++------- .../resources/templates/system/dept/edit.html | 21 +++++------ .../templates/system/dict/data/add.html | 18 ++++------ .../templates/system/dict/data/edit.html | 18 ++++------ .../templates/system/dict/type/add.html | 20 +++++------ .../templates/system/dict/type/edit.html | 20 +++++------ .../resources/templates/system/menu/add.html | 17 ++++----- .../resources/templates/system/menu/edit.html | 17 ++++----- .../resources/templates/system/post/add.html | 21 +++++------ .../resources/templates/system/post/edit.html | 21 +++++------ .../resources/templates/system/role/add.html | 17 ++++----- .../resources/templates/system/role/edit.html | 17 ++++----- .../resources/templates/system/role/rule.html | 16 +++------ .../resources/templates/system/user/add.html | 18 ++++------ .../resources/templates/system/user/edit.html | 13 ++++--- .../templates/system/user/profile/edit.html | 17 ++++----- .../system/user/profile/resetPwd.html | 17 ++++----- .../templates/system/user/resetPwd.html | 15 ++++---- .../resources/templates/vm/html/add.html.vm | 15 ++++---- .../resources/templates/vm/html/edit.html.vm | 15 ++++---- .../resources/templates/vm/html/list.html.vm | 12 +++---- 28 files changed, 216 insertions(+), 262 deletions(-) diff --git a/src/main/resources/static/ruoyi/css/ry-ui.css b/src/main/resources/static/ruoyi/css/ry-ui.css index 1b74afd7..fec1de99 100644 --- a/src/main/resources/static/ruoyi/css/ry-ui.css +++ b/src/main/resources/static/ruoyi/css/ry-ui.css @@ -335,8 +335,13 @@ label { } } +@media ( min-width : 768px) { + .select-list li { + float: left; + } +} + .select-list li { - float: left; color: #333; margin: 5px 15px 5px 0px; } diff --git a/src/main/resources/static/ruoyi/js/ry-ui.js b/src/main/resources/static/ruoyi/js/ry-ui.js index 99af28bf..90db6beb 100644 --- a/src/main/resources/static/ruoyi/js/ry-ui.js +++ b/src/main/resources/static/ruoyi/js/ry-ui.js @@ -304,8 +304,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; + } }); }, // 弹出层指定参数选项 @@ -401,8 +409,23 @@ }, // 详细信息 detail: function(id) { - var url = $.common.isEmpty(id) ? $.table._option.detailUrl : $.table._option.detailUrl.replace("{id}", id); - $.modal.open($.table._option.modalName + "详细", url); + var _url = $.common.isEmpty(id) ? $.table._option.detailUrl : $.table._option.detailUrl.replace("{id}", id); + layer.open({ + type: 2, + area: ['800px', ($(window).height() - 50) + 'px'], + fix: false, + //不固定 + maxmin: true, + shade: 0.3, + title: $.table._option.modalName + "详细", + content: _url, + btn: [' 关闭'], + // 弹层外区域关闭 + shadeClose: true, + cancel: function(index) { + return true; + } + }); }, // 删除信息 remove: function(id) { @@ -494,6 +517,13 @@ return true; } return false; + }, + // 表单验证 + form: function (id) { + if ($.common.isEmpty(id)) { + return false; + } + return $(id).validate().form(); } }, // 树插件封装处理 diff --git a/src/main/resources/templates/monitor/job/add.html b/src/main/resources/templates/monitor/job/add.html index beacb3c0..1411ee77 100644 --- a/src/main/resources/templates/monitor/job/add.html +++ b/src/main/resources/templates/monitor/job/add.html @@ -58,12 +58,6 @@ -
-
- - -
-
@@ -86,6 +80,12 @@ $.operate.save(prefix + "/add", $('#form-job-add').serialize()); } }); + + function submitHandler() { + if ($.validate.form("#form-job-add")) { + $.operate.save(prefix + "/add", $('#form-job-add').serialize()); + } + } diff --git a/src/main/resources/templates/monitor/job/edit.html b/src/main/resources/templates/monitor/job/edit.html index 1374170b..faa986ac 100644 --- a/src/main/resources/templates/monitor/job/edit.html +++ b/src/main/resources/templates/monitor/job/edit.html @@ -59,12 +59,6 @@ -
-
- - -
-
@@ -82,11 +76,14 @@ cronExpression:{ required:true, }, - }, - submitHandler:function(form){ - $.operate.save(prefix + "/edit", $('#form-job-edit').serialize()); } }); + + function submitHandler() { + if ($.validate.form("#form-job-edit")) { + $.operate.save(prefix + "/edit", $('#form-job-edit').serialize()); + } + } diff --git a/src/main/resources/templates/monitor/operlog/detail.html b/src/main/resources/templates/monitor/operlog/detail.html index 09275a33..b3bfc5cf 100644 --- a/src/main/resources/templates/monitor/operlog/detail.html +++ b/src/main/resources/templates/monitor/operlog/detail.html @@ -41,11 +41,6 @@
-
-
- -
-
diff --git a/src/main/resources/templates/system/config/add.html b/src/main/resources/templates/system/config/add.html index 0749ca29..99cb1903 100644 --- a/src/main/resources/templates/system/config/add.html +++ b/src/main/resources/templates/system/config/add.html @@ -38,17 +38,11 @@ -
-
- - -
-
diff --git a/src/main/resources/templates/system/config/edit.html b/src/main/resources/templates/system/config/edit.html index 6d9dfbc5..df769230 100644 --- a/src/main/resources/templates/system/config/edit.html +++ b/src/main/resources/templates/system/config/edit.html @@ -39,18 +39,12 @@ -
-
- - -
-
diff --git a/src/main/resources/templates/system/dept/add.html b/src/main/resources/templates/system/dept/add.html index c16a68b9..c3807093 100644 --- a/src/main/resources/templates/system/dept/add.html +++ b/src/main/resources/templates/system/dept/add.html @@ -51,19 +51,12 @@ - -
-
- - -
-
diff --git a/src/main/resources/templates/system/dict/data/edit.html b/src/main/resources/templates/system/dict/data/edit.html index d0b8d5e1..a334566e 100644 --- a/src/main/resources/templates/system/dict/data/edit.html +++ b/src/main/resources/templates/system/dict/data/edit.html @@ -75,18 +75,11 @@ - -
-
- - -
-
diff --git a/src/main/resources/templates/system/dict/type/add.html b/src/main/resources/templates/system/dict/type/add.html index cba62ae1..eafe55cc 100644 --- a/src/main/resources/templates/system/dict/type/add.html +++ b/src/main/resources/templates/system/dict/type/add.html @@ -32,18 +32,11 @@ - -
-
- - -
-
diff --git a/src/main/resources/templates/system/dict/type/edit.html b/src/main/resources/templates/system/dict/type/edit.html index 795c2464..27480ec3 100644 --- a/src/main/resources/templates/system/dict/type/edit.html +++ b/src/main/resources/templates/system/dict/type/edit.html @@ -33,18 +33,11 @@ - -
-
- - -
-
diff --git a/src/main/resources/templates/system/menu/add.html b/src/main/resources/templates/system/menu/add.html index ce734c00..affa4f24 100644 --- a/src/main/resources/templates/system/menu/add.html +++ b/src/main/resources/templates/system/menu/add.html @@ -64,12 +64,6 @@ -
-
- - -
-
@@ -108,11 +102,14 @@ "menuName": { remote: "菜单已经存在" } - }, - submitHandler:function(form){ - $.operate.save(prefix + "/add", $('#form-menu-add').serialize()); - } + } }); + + function submitHandler() { + if ($.validate.form("#form-menu-add")) { + $.operate.save(prefix + "/add", $('#form-menu-add').serialize()); + } + } $(function() { $("input[name='icon']").focus(function() { diff --git a/src/main/resources/templates/system/menu/edit.html b/src/main/resources/templates/system/menu/edit.html index 45f349a2..8a82a4b0 100644 --- a/src/main/resources/templates/system/menu/edit.html +++ b/src/main/resources/templates/system/menu/edit.html @@ -65,12 +65,6 @@ -
-
- - -
-
@@ -118,11 +112,14 @@ "menuName": { remote: "菜单已经存在" } - }, - submitHandler:function(form){ - $.operate.save(prefix + "/edit", $('#form-menu-edit').serialize()); - } + } }); + + function submitHandler() { + if ($.validate.form("#form-menu-edit")) { + $.operate.save(prefix + "/edit", $('#form-menu-edit').serialize()); + } + } $(function() { $("input[name='icon']").focus(function() { diff --git a/src/main/resources/templates/system/post/add.html b/src/main/resources/templates/system/post/add.html index f45451c6..0483bec0 100644 --- a/src/main/resources/templates/system/post/add.html +++ b/src/main/resources/templates/system/post/add.html @@ -38,18 +38,12 @@ -
-
- - -
-
diff --git a/src/main/resources/templates/system/post/edit.html b/src/main/resources/templates/system/post/edit.html index 4ab53835..97696d23 100644 --- a/src/main/resources/templates/system/post/edit.html +++ b/src/main/resources/templates/system/post/edit.html @@ -39,18 +39,12 @@ -
-
- - -
-
diff --git a/src/main/resources/templates/system/role/add.html b/src/main/resources/templates/system/role/add.html index 65c418a8..ea0bcf62 100644 --- a/src/main/resources/templates/system/role/add.html +++ b/src/main/resources/templates/system/role/add.html @@ -48,12 +48,6 @@ -
-
- - -
-
@@ -116,11 +110,14 @@ "roleKey": { remote: "角色权限已经存在" } - }, - submitHandler:function(form){ - add(); - } + } }); + + function submitHandler() { + if ($.validate.form("#form-role-add")) { + add(); + } + } function add() { var roleName = $("input[name='roleName']").val(); diff --git a/src/main/resources/templates/system/role/edit.html b/src/main/resources/templates/system/role/edit.html index 05954e8f..07c5e286 100644 --- a/src/main/resources/templates/system/role/edit.html +++ b/src/main/resources/templates/system/role/edit.html @@ -49,12 +49,6 @@ -
-
- - -
-
@@ -123,10 +117,7 @@ "roleKey": { remote: "角色权限已经存在" } - }, - submitHandler:function(form){ - edit(); - } + } }); function edit() { @@ -159,6 +150,12 @@ } }); } + + function submitHandler() { + if ($.validate.form("#form-role-edit")) { + edit(); + } + } diff --git a/src/main/resources/templates/system/role/rule.html b/src/main/resources/templates/system/role/rule.html index d50616c6..218618b3 100644 --- a/src/main/resources/templates/system/role/rule.html +++ b/src/main/resources/templates/system/role/rule.html @@ -35,12 +35,6 @@
-
-
- - -
-
@@ -59,11 +53,11 @@ $("#dataScope").change(); }); - $("#form-role-edit").validate({ - submitHandler:function(form){ - edit(); - } - }); + function submitHandler() { + if ($.validate.form("#form-role-edit")) { + edit(); + } + } function edit() { var roleId = $("input[name='roleId']").val(); diff --git a/src/main/resources/templates/system/user/add.html b/src/main/resources/templates/system/user/add.html index 74df6719..9e05c494 100644 --- a/src/main/resources/templates/system/user/add.html +++ b/src/main/resources/templates/system/user/add.html @@ -79,13 +79,6 @@ - -
-
- - -
-
@@ -167,11 +160,14 @@ "phonenumber":{ remote: "手机号码已经存在" } - }, - submitHandler:function(form){ - add(); - } + } }); + + function submitHandler() { + if ($.validate.form("#form-user-add")) { + add(); + } + } function add() { var userId = $("input[name='userId']").val(); diff --git a/src/main/resources/templates/system/user/edit.html b/src/main/resources/templates/system/user/edit.html index 8ddda359..97ab7d95 100644 --- a/src/main/resources/templates/system/user/edit.html +++ b/src/main/resources/templates/system/user/edit.html @@ -74,13 +74,6 @@ - -
-
- - -
-
@@ -147,6 +140,12 @@ edit(); } }); + + function submitHandler() { + if ($.validate.form("#form-user-edit")) { + edit(); + } + } function edit() { var userId = $("input[name='userId']").val(); diff --git a/src/main/resources/templates/system/user/profile/edit.html b/src/main/resources/templates/system/user/profile/edit.html index cb07bfbd..30475345 100644 --- a/src/main/resources/templates/system/user/profile/edit.html +++ b/src/main/resources/templates/system/user/profile/edit.html @@ -50,12 +50,6 @@ -
-
- - -
-
@@ -113,11 +107,14 @@ "phonenumber":{ remote: "手机号码已经存在" } - }, - submitHandler:function(form){ - $.operate.save(ctx + "system/user/profile/update", $('#form-user-edit').serialize()); - } + } }); + + function submitHandler() { + if ($.validate.form("#form-user-edit")) { + $.operate.save(ctx + "system/user/profile/update", $('#form-user-edit').serialize()); + } + } diff --git a/src/main/resources/templates/system/user/profile/resetPwd.html b/src/main/resources/templates/system/user/profile/resetPwd.html index e7836ef4..20d1f98f 100644 --- a/src/main/resources/templates/system/user/profile/resetPwd.html +++ b/src/main/resources/templates/system/user/profile/resetPwd.html @@ -31,12 +31,6 @@ 请再次输入您的密码 -
-
- - -
-
@@ -82,11 +76,14 @@ equalTo: "两次密码输入不一致" } - }, - submitHandler:function(form){ - $.operate.save(ctx + "system/user/profile/resetPwd", $('#form-user-resetPwd').serialize()); - } + } }); + + function submitHandler() { + if ($.validate.form("#form-user-resetPwd")) { + $.operate.save(ctx + "system/user/profile/resetPwd", $('#form-user-resetPwd').serialize()); + } + } diff --git a/src/main/resources/templates/system/user/resetPwd.html b/src/main/resources/templates/system/user/resetPwd.html index 6de19eb5..8f4db9cc 100644 --- a/src/main/resources/templates/system/user/resetPwd.html +++ b/src/main/resources/templates/system/user/resetPwd.html @@ -18,12 +18,6 @@ -
-
- - -
-
@@ -35,11 +29,14 @@ minlength: 5, maxlength: 20 }, - }, - submitHandler:function(form){ - $.operate.save(ctx + "system/user/resetPwd", $('#form-user-resetPwd').serialize()); } }); + + function submitHandler() { + if ($.validate.form("#form-user-resetPwd")) { + $.operate.save(ctx + "system/user/resetPwd", $('#form-user-resetPwd').serialize()); + } + } diff --git a/src/main/resources/templates/vm/html/add.html.vm b/src/main/resources/templates/vm/html/add.html.vm index 07a8ded1..130de149 100644 --- a/src/main/resources/templates/vm/html/add.html.vm +++ b/src/main/resources/templates/vm/html/add.html.vm @@ -15,12 +15,6 @@ #end #end -
-
- - -
-
@@ -31,11 +25,14 @@ xxxx:{ required:true, }, - }, - submitHandler: function(form) { - $.operate.save(prefix + "/add", $('#form-${classname}-add').serialize()); } }); + + function submitHandler() { + if ($.validate.form("#form-${classname}-add")) { + $.operate.save(prefix + "/add", $('#form-${classname}-add').serialize()); + } + } diff --git a/src/main/resources/templates/vm/html/edit.html.vm b/src/main/resources/templates/vm/html/edit.html.vm index 34dd8e39..4f6d6743 100644 --- a/src/main/resources/templates/vm/html/edit.html.vm +++ b/src/main/resources/templates/vm/html/edit.html.vm @@ -16,12 +16,6 @@ #end #end -
-
- - -
-
@@ -32,11 +26,14 @@ xxxx:{ required:true, }, - }, - submitHandler: function(form) { - $.operate.save(prefix + "/edit", $('#form-${classname}-edit').serialize()); } }); + + function submitHandler() { + if ($.validate.form("#form-${classname}-edit")) { + $.operate.save(prefix + "/edit", $('#form-${classname}-edit').serialize()); + } + } diff --git a/src/main/resources/templates/vm/html/list.html.vm b/src/main/resources/templates/vm/html/list.html.vm index d7dd2c14..18d6e305 100644 --- a/src/main/resources/templates/vm/html/list.html.vm +++ b/src/main/resources/templates/vm/html/list.html.vm @@ -4,12 +4,12 @@
-