优化后台页面刷新跳转

pull/495/MERGE
Karson 2025-05-20 15:26:40 +08:00
parent 9e3f10cf75
commit 26159a2095
1 changed files with 7 additions and 11 deletions

View File

@ -222,16 +222,12 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi
//如果是刷新操作则直接返回刷新前的页面 //如果是刷新操作则直接返回刷新前的页面
if (Config.referer) { if (Config.referer) {
if (Config.referer === $(addtabs).attr("url")) { var active = $("ul.sidebar-menu li a[url='" + Config.referer + "']");
var active = $("ul.sidebar-menu li a[addtabs=" + $(addtabs).attr("addtabs") + "]"); if (multiplenav && active.length === 0) {
if (multiplenav && active.length == 0) { active = $("ul li a[url='" + Config.referer + "']");
active = $("ul li a[addtabs='" + $(addtabs).attr("addtabs") + "']"); }
} if (active.length > 0) {
if (active.length > 0) { active.trigger("click");
active.trigger("click");
} else {
$(addtabs).appendTo(document.body).addClass("hide").trigger("click");
}
} else { } else {
//刷新页面后跳到到刷新前的页面 //刷新页面后跳到到刷新前的页面
Backend.api.addtabs(Config.referer); Backend.api.addtabs(Config.referer);
@ -333,7 +329,7 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi
// 切换菜单栏 // 切换菜单栏
$(document).on("click", ".sidebar-toggle", function () { $(document).on("click", ".sidebar-toggle", function () {
setTimeout(function(){ setTimeout(function () {
var value = $("body").hasClass("sidebar-collapse") ? 1 : 0; var value = $("body").hasClass("sidebar-collapse") ? 1 : 0;
setTimeout(function () { setTimeout(function () {
$(window).trigger("resize"); $(window).trigger("resize");