配置日志查询菜单切换修改.

This commit is contained in:
zhangwq
2018-12-14 14:17:09 +08:00
parent c81d9aef22
commit e644766312
2 changed files with 34 additions and 29 deletions

View File

@@ -100,8 +100,8 @@ var toLogSearch = function(index){
// 保存配置界面URL
$("#searchForm").each(function(){
var cfgUrl = $(this).attr("action");
sessionStorage.removeItem('cfgUrl');
sessionStorage.setItem('cfgUrl',cfgUrl);
sessionStorage.removeItem('cfg_url');
sessionStorage.setItem('cfg_url',cfgUrl);
});
var td = document.getElementById(index+"logTotal");
@@ -122,7 +122,7 @@ var toLogSearch = function(index){
}
var switchMenu = function(topMenuId,functionId){
var switchMenu = function(topMenuId,functionId,oldMenuName){
// 顶部菜单切换 menuId Policies/86 Logs/152
$(".hor-menu ul li",parent.document).each(function(){
var id = $(this).children("a").attr("id");
@@ -144,8 +144,15 @@ var switchMenu = function(topMenuId,functionId){
middleMenu.push($(this).attr("menu-name"));
}
});
if(functionId == 8){
middleMenu.pop();
if(topMenuId == 152){
if(functionId == 8 || functionId == 35){// HTTP or Mail
lastMenuName = middleMenu[0];
}
sessionStorage.removeItem('old_memu_name');
sessionStorage.setItem('old_memu_name',middleMenu[middleMenu.length-1]);
}else{
lastMenuName = oldMenuName;
}
// 左侧菜单切换
@@ -153,38 +160,34 @@ var switchMenu = function(topMenuId,functionId){
var id = $(this).attr("id")
if(id.indexOf(topMenuId) != -1){
$(this).removeClass("hide");
// 收回展开的菜单
// 收回展开的菜单
$(this).find("li").each(function(index){
$(this).children("a").children("span").next().removeClass("open");
$(this).children("ul").hide();
});
var count = 0;
// 选中左侧菜单
$(this).children("li").each(function(){
if($(this).attr("menu-name") == firstMenuName){
$(this).addClass("active open");// 选中主菜单
$(this).children("a").children("span").next().addClass("open");//
$(this).children("ul").show();
$(this).find("li").each(function(){
if($.inArray($(this).attr("menu-name"),middleMenu) != -1){
$(this).addClass("active open");
$(this).children("a").children("span").next().addClass("open");
$(this).children("ul").show();
}
if($(this).attr("menu-name") == lastMenuName){
//$(this).addClass("active");
$(this).children("a").trigger("click");
return false;
}
$(this).find("li").each(function(index){
if($(this).attr("menu-name") == lastMenuName){
count++;
$(this).children("a").trigger("click");// 选中底层菜单
$(this).parents("li").each(function(){
$(this).addClass("active open");
$(this).children("a").children("span").next().addClass("open");
$(this).children("ul").show();
});
if(topMenuId == 86){
if(functionId == 35 && count == 1){// HTTP/Mail(Advanced)
return true;
}
return false;
}
}
});
}else{
$(this).addClass("hide");
}
});
//loading('onloading');

View File

@@ -86,8 +86,10 @@ function getPixelsCount(str, strFontSize){
}
function back(){
// 获取配置界面URl并跳转
var url = sessionStorage.getItem('cfgUrl');
switchMenu("86");
var url = sessionStorage.getItem('cfg_url');
var oldMenuName = sessionStorage.getItem('old_memu_name');
var functionId = url.substr(url.lastIndexOf("=")+1);
switchMenu("86",functionId,oldMenuName);
window.location.href = url;
}
//对Date的扩展将 Date 转化为指定格式的String