From 0ff589cabbf6e0e912df0ec501c6ae584f727cc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=A1=E5=AE=85=E7=94=B7?= <530765310@qq.com> Date: Tue, 8 Aug 2023 13:33:57 +0000 Subject: [PATCH] =?UTF-8?q?=E9=A1=B6=E7=BA=A7=E8=8F=9C=E5=8D=95=E5=8F=AA?= =?UTF-8?q?=E6=9C=89=E4=B8=80=E7=BA=A7=E7=9A=84=E6=97=B6=E5=80=99=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E7=82=B9=E5=87=BB=E6=B7=BB=E5=8A=A0iframe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 御宅男 <530765310@qq.com> --- component/pear/module/menu.js | 67 ++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 29 deletions(-) diff --git a/component/pear/module/menu.js b/component/pear/module/menu.js index 33cde7f..a6ceea5 100644 --- a/component/pear/module/menu.js +++ b/component/pear/module/menu.js @@ -129,6 +129,32 @@ layui.define(['table', 'jquery', 'element'], function (exports) { } clickEvent(dom, data); }) + + $("body").on("click","#" + _this.option.control + " .pear-nav-control [pear-id]", function () { + var dom = $(this); + if ($(this).attr("pear-href") == "javascript:;") { + $("#" + _this.option.elem).find(".pear-nav-tree").css({ + display: 'none' + }); + $("#" + _this.option.elem).find(".pear-nav-tree[pear-id='" + $(this).attr("pear-id") + "']").css({ + display: 'block' + }); + $("#" + _this.option.control).find(".pe-title").html($(this).attr("pear-title")); + $("#" + _this.option.control).find("") + _this.option.change($(this).attr("pear-id"), $(this).attr("pear-title"), $(this).attr("pear-href")) + }else{ + var data = { + menuId: dom.attr("pear-id"), + menuTitle: dom.attr("pear-title"), + menuPath: dom.attr("pear-title"), + menuIcon: dom.attr("pear-icon"), + menuUrl: dom.attr("pear-href"), + openType: dom.attr("pear-type") + }; + clickEvent(dom, data); + + } + }) } function hash(dom) { @@ -330,30 +356,24 @@ layui.define(['table', 'jquery', 'element'], function (exports) { var index = 0; var controlItemPe = '
'; $.each(option.data, function (i, item) { + if(item.children != null && item.children.length > 0){ + item.href = 'javascript:;'; + } var menuItem = ''; var controlItem = ''; - if (i === option.defaultMenu) { - controlItem = '
  • ' + item.title + '
  • '; - menuItem = '