From 38f7ecb67164bd9aebdbd9e9c4a379294ca86ed1 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 6 Sep 2021 16:44:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E4=BE=8B=E6=BC=94=E7=A4=BA=E4=B8=AD?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=A4=9A=E5=B1=82=E7=AA=97=E5=8F=A3=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../demo/controller/DemoDialogController.java | 18 +++++ .../resources/templates/demo/modal/table.html | 68 ++++++++++++++++--- .../templates/demo/modal/table/frame1.html | 53 +++++++++++++++ .../templates/demo/modal/table/frame2.html | 24 +++++++ .../templates/demo/modal/table/parent.html | 11 ++- 5 files changed, 162 insertions(+), 12 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/demo/modal/table/frame1.html create mode 100644 ruoyi-admin/src/main/resources/templates/demo/modal/table/frame2.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/demo/controller/DemoDialogController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/demo/controller/DemoDialogController.java index 78d6da74b..6b95a7420 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/demo/controller/DemoDialogController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/demo/controller/DemoDialogController.java @@ -77,4 +77,22 @@ public class DemoDialogController { return prefix + "/table/parent"; } + + /** + * 多层窗口frame1 + */ + @GetMapping("/frame1") + public String frame1() + { + return prefix + "/table/frame1"; + } + + /** + * 多层窗口frame2 + */ + @GetMapping("/frame2") + public String frame2() + { + return prefix + "/table/frame2"; + } } diff --git a/ruoyi-admin/src/main/resources/templates/demo/modal/table.html b/ruoyi-admin/src/main/resources/templates/demo/modal/table.html index 18c16be9f..f573615d0 100644 --- a/ruoyi-admin/src/main/resources/templates/demo/modal/table.html +++ b/ruoyi-admin/src/main/resources/templates/demo/modal/table.html @@ -24,49 +24,97 @@
弹层框
-

弹出复选框表格及单选框表格(点击提交后得到数据并回显到父窗体)。

- - +

弹出层,点击提交后得到数据并回显到父窗体。

+ + +

+
+
+
+
弹层框
+
+
+

多层弹出,点击提交后得到数据并回显到父窗体。

+ +

+
+
+
+ + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/demo/modal/table/frame2.html b/ruoyi-admin/src/main/resources/templates/demo/modal/table/frame2.html new file mode 100644 index 000000000..b4940fefb --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/demo/modal/table/frame2.html @@ -0,0 +1,24 @@ + + + + + + +
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/demo/modal/table/parent.html b/ruoyi-admin/src/main/resources/templates/demo/modal/table/parent.html index 766061702..b6347a168 100644 --- a/ruoyi-admin/src/main/resources/templates/demo/modal/table/parent.html +++ b/ruoyi-admin/src/main/resources/templates/demo/modal/table/parent.html @@ -4,6 +4,7 @@ +
@@ -81,15 +82,21 @@ } $.modal.close(); // 父页面的方法 - // parent.selectUsers(); + // activeWindow().selectUsers(); // 父页面的变量 - parent.$('#userids').html(rows.join()); + activeWindow().$('#userids').html('我是通过方式一来的:' + rows.join()); } /* 添加用户-选择用户-提交(回调形式-父页面调用子页面) */ function getSelections() { return $.table.selectFirstColumns(); } + + $("#bootstrap-table").on("check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table", function (e, rowsAfter, rowsBefore) { + var rows = $.common.equals("uncheck-all", e.type) ? rowsBefore : rowsAfter; + var rowIds = $.table.affectedRowIds(rows); + $("#rowIds").val(rowIds); + }); \ No newline at end of file