mirror of https://gitee.com/y_project/RuoYi.git
新增isScrollToTop页签切换滚动到顶部
parent
ff6845f5ce
commit
52b9f43ea0
|
@ -72,6 +72,14 @@ $(window).bind("load resize", function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function openToCurrentTab(obj) {
|
||||||
|
if (isScrollToTop) {
|
||||||
|
$(obj).show().siblings('.RuoYi_iframe').hide();
|
||||||
|
} else {
|
||||||
|
$(obj).css({"visibility": "visible", "position": "static"}).siblings('.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function syncMenuTab(dataId) {
|
function syncMenuTab(dataId) {
|
||||||
if (isLinkage) {
|
if (isLinkage) {
|
||||||
var $dataObj = $('a[href$="' + decodeURI(dataId) + '"]');
|
var $dataObj = $('a[href$="' + decodeURI(dataId) + '"]');
|
||||||
|
@ -157,7 +165,7 @@ $(function() {
|
||||||
// 显示tab对应的内容区
|
// 显示tab对应的内容区
|
||||||
$('.RuoYi_iframe').each(function() {
|
$('.RuoYi_iframe').each(function() {
|
||||||
if ($(this).data('id') == currentId) {
|
if ($(this).data('id') == currentId) {
|
||||||
$(this).css({"visibility": "visible", "position": "static"}).siblings('.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"});
|
openToCurrentTab(this);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$(element).addClass('active').siblings('.menuTab').removeClass('active');
|
$(element).addClass('active').siblings('.menuTab').removeClass('active');
|
||||||
|
@ -289,7 +297,7 @@ $(function() {
|
||||||
// 显示tab对应的内容区
|
// 显示tab对应的内容区
|
||||||
$('.mainContent .RuoYi_iframe').each(function() {
|
$('.mainContent .RuoYi_iframe').each(function() {
|
||||||
if ($(this).data('id') == dataUrl) {
|
if ($(this).data('id') == dataUrl) {
|
||||||
$(this).css({"visibility": "visible", "position": "static"}).siblings('.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"});
|
openToCurrentTab(this);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -308,7 +316,11 @@ $(function() {
|
||||||
|
|
||||||
// 添加选项卡对应的iframe
|
// 添加选项卡对应的iframe
|
||||||
var str1 = '<iframe class="RuoYi_iframe" name="iframe' + dataIndex + '" width="100%" height="100%" src="' + dataUrl + '" frameborder="0" data-id="' + dataUrl + '" data-refresh="' + isRefresh + '" seamless></iframe>';
|
var str1 = '<iframe class="RuoYi_iframe" name="iframe' + dataIndex + '" width="100%" height="100%" src="' + dataUrl + '" frameborder="0" data-id="' + dataUrl + '" data-refresh="' + isRefresh + '" seamless></iframe>';
|
||||||
|
if (isScrollToTop) {
|
||||||
|
$('.mainContent').find('iframe.RuoYi_iframe').hide().parents('.mainContent').append(str1);
|
||||||
|
} else {
|
||||||
$('.mainContent').find('iframe.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"}).parents('.mainContent').append(str1);
|
$('.mainContent').find('iframe.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"}).parents('.mainContent').append(str1);
|
||||||
|
}
|
||||||
|
|
||||||
$.modal.loading("数据加载中,请稍候...");
|
$.modal.loading("数据加载中,请稍候...");
|
||||||
|
|
||||||
|
@ -351,7 +363,7 @@ $(function() {
|
||||||
|
|
||||||
$('.mainContent .RuoYi_iframe').each(function() {
|
$('.mainContent .RuoYi_iframe').each(function() {
|
||||||
if ($(this).data('id') == activeId) {
|
if ($(this).data('id') == activeId) {
|
||||||
$(this).css({"visibility": "visible", "position": "static"}).siblings('.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"});
|
openToCurrentTab(this);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -379,7 +391,7 @@ $(function() {
|
||||||
$(this).parents('.menuTab').prev('.menuTab:last').addClass('active');
|
$(this).parents('.menuTab').prev('.menuTab:last').addClass('active');
|
||||||
$('.mainContent .RuoYi_iframe').each(function() {
|
$('.mainContent .RuoYi_iframe').each(function() {
|
||||||
if ($(this).data('id') == activeId) {
|
if ($(this).data('id') == activeId) {
|
||||||
$(this).css({"visibility": "visible", "position": "static"}).siblings('.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"});
|
openToCurrentTab(this);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -399,7 +411,7 @@ $(function() {
|
||||||
$('.menuTab[data-id="' + panelUrl + '"]').addClass('active').siblings('.menuTab').removeClass('active');
|
$('.menuTab[data-id="' + panelUrl + '"]').addClass('active').siblings('.menuTab').removeClass('active');
|
||||||
$('.mainContent .RuoYi_iframe').each(function() {
|
$('.mainContent .RuoYi_iframe').each(function() {
|
||||||
if ($(this).data('id') == panelUrl) {
|
if ($(this).data('id') == panelUrl) {
|
||||||
$(this).css({"visibility": "visible", "position": "static"}).siblings('.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"});
|
openToCurrentTab(this);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -441,7 +453,7 @@ $(function() {
|
||||||
// 显示tab对应的内容区
|
// 显示tab对应的内容区
|
||||||
$('.mainContent .RuoYi_iframe').each(function() {
|
$('.mainContent .RuoYi_iframe').each(function() {
|
||||||
if ($(this).data('id') == currentId) {
|
if ($(this).data('id') == currentId) {
|
||||||
$(this).css({"visibility": "visible", "position": "static"}).siblings('.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"});
|
openToCurrentTab(this);
|
||||||
isRefresh = $.common.nullToDefault($(this).data('refresh'), false);
|
isRefresh = $.common.nullToDefault($(this).data('refresh'), false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -493,7 +505,11 @@ $(function() {
|
||||||
$(this).remove();
|
$(this).remove();
|
||||||
});
|
});
|
||||||
$('.page-tabs-content').children("[data-id]:first").each(function() {
|
$('.page-tabs-content').children("[data-id]:first").each(function() {
|
||||||
|
if (isScrollToTop) {
|
||||||
|
$('.RuoYi_iframe[data-id="' + $(this).data('id') + '"]').show();
|
||||||
|
} else {
|
||||||
$('.RuoYi_iframe[data-id="' + $(this).data('id') + '"]').css({"visibility": "visible", "position": "static"});
|
$('.RuoYi_iframe[data-id="' + $(this).data('id') + '"]').css({"visibility": "visible", "position": "static"});
|
||||||
|
}
|
||||||
$(this).addClass("active");
|
$(this).addClass("active");
|
||||||
});
|
});
|
||||||
$('.page-tabs-content').css("margin-left", "0");
|
$('.page-tabs-content').css("margin-left", "0");
|
||||||
|
|
|
@ -245,7 +245,7 @@ var closeItem = function(dataId){
|
||||||
$('.menuTab[data-id="' + panelUrl + '"]', topWindow).addClass('active').siblings('.menuTab').removeClass('active');
|
$('.menuTab[data-id="' + panelUrl + '"]', topWindow).addClass('active').siblings('.menuTab').removeClass('active');
|
||||||
$('.mainContent .RuoYi_iframe', topWindow).each(function() {
|
$('.mainContent .RuoYi_iframe', topWindow).each(function() {
|
||||||
if ($(this).data('id') == panelUrl) {
|
if ($(this).data('id') == panelUrl) {
|
||||||
$(this).css({"visibility": "visible", "position": "static"}).siblings('.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"});
|
openToCurrentTab(this);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -269,7 +269,7 @@ function createMenuItem(dataUrl, menuName, isRefresh) {
|
||||||
// 显示tab对应的内容区
|
// 显示tab对应的内容区
|
||||||
$('.mainContent .RuoYi_iframe', topWindow).each(function() {
|
$('.mainContent .RuoYi_iframe', topWindow).each(function() {
|
||||||
if ($(this).data('id') == dataUrl) {
|
if ($(this).data('id') == dataUrl) {
|
||||||
$(this).css({"visibility": "visible", "position": "static"}).siblings('.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"});
|
openToCurrentTab(this);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -288,7 +288,11 @@ function createMenuItem(dataUrl, menuName, isRefresh) {
|
||||||
|
|
||||||
// 添加选项卡对应的iframe
|
// 添加选项卡对应的iframe
|
||||||
var str1 = '<iframe class="RuoYi_iframe" name="iframe' + dataIndex + '" width="100%" height="100%" src="' + dataUrl + '" frameborder="0" data-id="' + dataUrl + '" data-panel="' + panelUrl + '" seamless></iframe>';
|
var str1 = '<iframe class="RuoYi_iframe" name="iframe' + dataIndex + '" width="100%" height="100%" src="' + dataUrl + '" frameborder="0" data-id="' + dataUrl + '" data-panel="' + panelUrl + '" seamless></iframe>';
|
||||||
|
if (parent.isScrollToTop) {
|
||||||
|
$('.mainContent', topWindow).find('iframe.RuoYi_iframe').hide().parents('.mainContent').append(str1);
|
||||||
|
} else {
|
||||||
$('.mainContent', topWindow).find('iframe.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"}).parents('.mainContent').append(str1);
|
$('.mainContent', topWindow).find('iframe.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"}).parents('.mainContent').append(str1);
|
||||||
|
}
|
||||||
|
|
||||||
window.parent.$.modal.loading("数据加载中,请稍候...");
|
window.parent.$.modal.loading("数据加载中,请稍候...");
|
||||||
$('.mainContent iframe:visible', topWindow).on('load', function() {
|
$('.mainContent iframe:visible', topWindow).on('load', function() {
|
||||||
|
@ -358,6 +362,14 @@ function activeWindow() {
|
||||||
return $('.RuoYi_iframe[data-id="' + currentId + '"]', topWindow)[0].contentWindow;
|
return $('.RuoYi_iframe[data-id="' + currentId + '"]', topWindow)[0].contentWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openToCurrentTab(obj) {
|
||||||
|
if (parent.isScrollToTop) {
|
||||||
|
$(obj).show().siblings('.RuoYi_iframe').hide();
|
||||||
|
} else {
|
||||||
|
$(obj).css({"visibility": "visible", "position": "static"}).siblings('.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** 密码规则范围验证 */
|
/** 密码规则范围验证 */
|
||||||
function checkpwd(chrtype, password) {
|
function checkpwd(chrtype, password) {
|
||||||
if (chrtype == 1) {
|
if (chrtype == 1) {
|
||||||
|
|
|
@ -336,6 +336,8 @@ var mode = "history";
|
||||||
var historyPath = storage.get("historyPath");
|
var historyPath = storage.get("historyPath");
|
||||||
// 是否页签与菜单联动
|
// 是否页签与菜单联动
|
||||||
var isLinkage = true;
|
var isLinkage = true;
|
||||||
|
//是否页签切换滚动到顶部
|
||||||
|
var isScrollToTop = true;
|
||||||
|
|
||||||
// 本地主题优先,未设置取系统配置
|
// 本地主题优先,未设置取系统配置
|
||||||
if($.common.isNotEmpty(skin)){
|
if($.common.isNotEmpty(skin)){
|
||||||
|
|
|
@ -281,6 +281,8 @@ var mode = "history";
|
||||||
var historyPath = storage.get("historyPath");
|
var historyPath = storage.get("historyPath");
|
||||||
// 是否页签与菜单联动
|
// 是否页签与菜单联动
|
||||||
var isLinkage = true;
|
var isLinkage = true;
|
||||||
|
// 是否页签切换滚动到顶部
|
||||||
|
var isScrollToTop = true;
|
||||||
|
|
||||||
// 本地主题优先,未设置取系统配置
|
// 本地主题优先,未设置取系统配置
|
||||||
if($.common.isNotEmpty(skin)){
|
if($.common.isNotEmpty(skin)){
|
||||||
|
|
Loading…
Reference in New Issue