mirror of https://gitee.com/y_project/RuoYi.git
新增关闭左侧/关闭右侧/新窗口打开
parent
b1f4952cde
commit
7b4c8f89e1
|
@ -92,6 +92,21 @@ $(function() {
|
||||||
return width;
|
return width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 激活指定选项卡
|
||||||
|
function setActiveTab(element) {
|
||||||
|
if (!$(element).hasClass('active')) {
|
||||||
|
var currentId = $(element).data('id');
|
||||||
|
// 显示tab对应的内容区
|
||||||
|
$('.RuoYi_iframe').each(function() {
|
||||||
|
if ($(this).data('id') == currentId) {
|
||||||
|
$(this).show().siblings('.RuoYi_iframe').hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$(element).addClass('active').siblings('.menuTab').removeClass('active');
|
||||||
|
scrollToTab(element);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//滚动到指定选项卡
|
//滚动到指定选项卡
|
||||||
function scrollToTab(element) {
|
function scrollToTab(element) {
|
||||||
var marginLeftVal = calSumWidth($(element).prevAll()),
|
var marginLeftVal = calSumWidth($(element).prevAll()),
|
||||||
|
@ -473,30 +488,74 @@ $(function() {
|
||||||
},
|
},
|
||||||
"close_other": {
|
"close_other": {
|
||||||
name: "关闭其他",
|
name: "关闭其他",
|
||||||
icon: "fa-close",
|
icon: "fa-window-close-o",
|
||||||
callback: function(key, opt) {
|
callback: function(key, opt) {
|
||||||
|
setActiveTab(this);
|
||||||
tabCloseOther();
|
tabCloseOther();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"close_left": {
|
||||||
|
name: "关闭左侧",
|
||||||
|
icon: "fa-reply",
|
||||||
|
callback: function(key, opt) {
|
||||||
|
setActiveTab(this);
|
||||||
|
this.prevAll('.menuTab').not(":last").each(function() {
|
||||||
|
if ($(this).hasClass('active')) {
|
||||||
|
setActiveTab(this);
|
||||||
|
}
|
||||||
|
$('.RuoYi_iframe[data-id="' + $(this).data('id') + '"]').remove();
|
||||||
|
$(this).remove();
|
||||||
|
});
|
||||||
|
$('.page-tabs-content').css("margin-left", "0");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"close_right": {
|
||||||
|
name: "关闭右侧",
|
||||||
|
icon: "fa-share",
|
||||||
|
callback: function(key, opt) {
|
||||||
|
setActiveTab(this);
|
||||||
|
this.nextAll('.menuTab').each(function() {
|
||||||
|
$('.menuTab[data-id="' + $(this).data('id') + '"]').remove();
|
||||||
|
$(this).remove();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
"close_all": {
|
"close_all": {
|
||||||
name: "全部关闭",
|
name: "全部关闭",
|
||||||
icon: "fa-close",
|
icon: "fa-window-close",
|
||||||
callback: function(key, opt) {
|
callback: function(key, opt) {
|
||||||
tabCloseAll();
|
tabCloseAll();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"step": "---------",
|
||||||
"full": {
|
"full": {
|
||||||
name: "全屏显示",
|
name: "全屏显示",
|
||||||
icon: "fa-arrows-alt",
|
icon: "fa-arrows-alt",
|
||||||
callback: function(key, opt) {
|
callback: function(key, opt) {
|
||||||
activeTabMax();
|
setActiveTab(this);
|
||||||
|
opt.$trigger.find('i').trigger("dblclick");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"refresh": {
|
"refresh": {
|
||||||
name: "刷新页面",
|
name: "刷新页面",
|
||||||
icon: "fa-refresh",
|
icon: "fa-refresh",
|
||||||
callback: function(key, opt) {
|
callback: function(key, opt) {
|
||||||
refreshTab();
|
setActiveTab(this);
|
||||||
|
var target = $('.RuoYi_iframe[data-id="' + this.data('id') + '"]');
|
||||||
|
var url = target.attr('src');
|
||||||
|
target.attr('src', url).ready();
|
||||||
|
$.modal.loading("数据加载中,请稍后...");
|
||||||
|
target.attr('src', url).load(function () {
|
||||||
|
$.modal.closeLoading();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"open": {
|
||||||
|
name: "新窗口打开",
|
||||||
|
icon: "fa-link",
|
||||||
|
callback: function(key, opt) {
|
||||||
|
var target = $('.RuoYi_iframe[data-id="' + this.data('id') + '"]');
|
||||||
|
window.open(target.attr('src'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue