From a4c4f737a8ec26621e26960a5ab704717b48155b Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 6 Aug 2020 13:35:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E9=A1=B5=E7=AD=BE=E8=81=94?= =?UTF-8?q?=E5=8A=A8=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-admin/src/main/resources/static/ruoyi/index.js | 9 +++++++-- ruoyi-admin/src/main/resources/static/ruoyi/js/common.js | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/index.js b/ruoyi-admin/src/main/resources/static/ruoyi/index.js index 8fdd22c4a..705e82e47 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/index.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/index.js @@ -75,7 +75,7 @@ $(window).bind("load resize", function() { function syncMenuTab(dataId) { if(isLinkage) { var $dataObj = $('a[href$="' + decodeURI(dataId) + '"]'); - if (!$dataObj.hasClass("noactive")) { + if ($dataObj.attr("class") != null && !$dataObj.hasClass("noactive")) { $('.nav ul').removeClass("in"); $dataObj.parents("ul").addClass("in") $dataObj.parents("li").addClass("active").siblings().removeClass("active").find('li').removeClass("active"); @@ -254,7 +254,12 @@ $(function() { menuName = $.trim($(this).text()), flag = true; - if (!$('a[href$="' + dataUrl + '"]').hasClass("noactive")) { + var $dataObj = $('a[href$="' + decodeURI(dataUrl) + '"]'); + if (!$dataObj.hasClass("noactive")) { + $('.nav ul').removeClass("in"); + $dataObj.parents("ul").addClass("in") + $dataObj.parents("li").addClass("active").siblings().removeClass("active").find('li').removeClass("active"); + $dataObj.parents("ul").css('height', 'auto').height(); $(".nav ul li, .nav li").removeClass("selected"); $(this).parent("li").addClass("selected"); } diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/js/common.js b/ruoyi-admin/src/main/resources/static/ruoyi/js/common.js index affc223db..fc8c9b16c 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/js/common.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/js/common.js @@ -291,7 +291,7 @@ function createMenuItem(dataUrl, menuName) { }); // 选项卡菜单不存在 if (flag) { - var str = '' + menuName + ' '; + var str = '' + menuName + ' '; $('.menuTab', topWindow).removeClass('active'); // 添加选项卡对应的iframe