新增选项卡是否刷新属性

This commit is contained in:
RuoYi
2020-12-14 15:08:10 +08:00
parent f0e4e1a1a6
commit 9c92d8f87d
3 changed files with 19 additions and 3 deletions

View File

@ -264,7 +264,7 @@ var closeItem = function(dataId){
}
/** 创建选项卡 */
function createMenuItem(dataUrl, menuName) {
function createMenuItem(dataUrl, menuName, isRefresh) {
var panelUrl = window.frameElement.getAttribute('data-id');
dataIndex = $.common.random(1, 100),
flag = true;
@ -285,6 +285,9 @@ function createMenuItem(dataUrl, menuName) {
}
});
}
if (isRefresh) {
refreshTab();
}
flag = false;
return false;
}
@ -310,6 +313,15 @@ function createMenuItem(dataUrl, menuName) {
return false;
}
// 刷新iframe
function refreshTab() {
var topWindow = $(window.parent.document);
var currentId = $('.page-tabs-content', topWindow).find('.active').attr('data-id');
var target = $('.RuoYi_iframe[data-id="' + currentId + '"]', topWindow);
var url = target.attr('src');
target.attr('src', url).ready();
}
// 滚动到指定选项卡
function scrollToTab(element) {
var topWindow = $(window.parent.document);