菜单新增是否刷新页面

This commit is contained in:
RuoYi
2020-12-14 17:36:54 +08:00
parent 9c92d8f87d
commit 78eed9cd56
8 changed files with 164 additions and 115 deletions

View File

@ -80,7 +80,10 @@ function syncMenuTab(dataId) {
$dataObj.parents("ul").addClass("in")
$dataObj.parents("li").addClass("active").siblings().removeClass("active").find('li').removeClass("active");
$dataObj.parents("ul").css('height', 'auto').height();
$dataObj.click();
$(".nav ul li, .nav li").removeClass("selected");
$dataObj.parent("li").addClass("selected");
setIframeUrl(dataId);
// 顶部菜单同步处理
var tabStr = $dataObj.parents(".tab-pane").attr("id");
if ($.common.isNotEmpty(tabStr)) {
@ -104,6 +107,17 @@ function fixedSidebar() {
}, 100);
}
// 设置锚点
function setIframeUrl(href) {
if($.common.equals("history", mode)) {
storage.set('publicPath', href);
} else {
var nowUrl = window.location.href;
var newUrl = nowUrl.substring(0, nowUrl.indexOf("#"));
window.location.href = newUrl + "#" + href;
}
}
function SmoothlyMenu() {
if (isMobile && !$('body').hasClass('canvas-menu')) {
$('.navbar-static-side').fadeIn();
@ -531,17 +545,6 @@ $(function() {
$('#ax_close_max').show();
}
// 设置锚点
function setIframeUrl(href) {
if($.common.equals("history", mode)) {
storage.set('publicPath', href);
} else {
var nowUrl = window.location.href;
var newUrl = nowUrl.substring(0, nowUrl.indexOf("#"));
window.location.href = newUrl + "#" + href;
}
}
$(window).keydown(function(event) {
if (event.keyCode == 27) {
$('#content-main').removeClass('max');