Parcourir la source

切换版本地址跳转为空报错Bug

金隅分支
edy il y a 3 ans
Parent
révision
a6e702ac6c
1 fichiers modifiés avec 101 ajouts et 86 suppressions
  1. +101
    -86
      Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-tabs.js

+ 101
- 86
Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-tabs.js Voir le fichier

@@ -26,98 +26,113 @@
var $frameMain = $('#lr_frame_main');

if (iframeIdList[module.F_ModuleId] == undefined || iframeIdList[module.F_ModuleId] == null) {
// 隐藏之前的tab和窗口
if (learun.frameTab.iframeId != '') {
$tabsUl.find('#lr_tab_' + learun.frameTab.iframeId).removeClass('active');
$frameMain.find('#lr_iframe_' + learun.frameTab.iframeId).removeClass('active');
iframeIdList[learun.frameTab.iframeId] = 0;
}
var parentId = learun.frameTab.iframeId;
learun.frameTab.iframeId = module.F_ModuleId;
iframeIdList[learun.frameTab.iframeId] = 1;

// 打开一个功能模块tab_iframe页面
var $tabItem = $('<li class="lr-frame-tabItem active" id="lr_tab_' + module.F_ModuleId + '" parent-id="' + parentId + '" ><span>' + module.F_FullName + '</span></li>');
// 翻译
learun.language.get(module.F_FullName, function (text) {
$tabItem.find('span').text(text);
if (!notAllowClosed) {
$tabItem.append('<span class="reomve" title="关闭窗口"></span>');
if (module.F_UrlAddress != null && module.F_UrlAddress != "" && module.F_UrlAddress != undefined) {
// 隐藏之前的tab和窗口
if (learun.frameTab.iframeId != '') {
$tabsUl.find('#lr_tab_' + learun.frameTab.iframeId).removeClass('active');
$frameMain.find('#lr_iframe_' + learun.frameTab.iframeId).removeClass('active');
iframeIdList[learun.frameTab.iframeId] = 0;
}
});
var parentId = learun.frameTab.iframeId;
learun.frameTab.iframeId = module.F_ModuleId;
iframeIdList[learun.frameTab.iframeId] = 1;

// 打开一个功能模块tab_iframe页面
var $tabItem = $('<li class="lr-frame-tabItem active" id="lr_tab_' +
module.F_ModuleId +
'" parent-id="' +
parentId +
'" ><span>' +
module.F_FullName +
'</span></li>');
// 翻译
learun.language.get(module.F_FullName,
function (text) {
$tabItem.find('span').text(text);
if (!notAllowClosed) {
$tabItem.append('<span class="reomve" title="关闭窗口"></span>');
}
});

var $iframe = $('<iframe class="lr-frame-iframe active" id="lr_iframe_' + module.F_ModuleId + '" frameborder="0" src="' + $.rootUrl + module.F_UrlAddress + '"></iframe>');
$tabsUl.append($tabItem);
$frameMain.append($iframe);

var w = 0;
var width = $tabsUl.children().each(function () {
w += $(this).outerWidth();
});
$tabsUl.css({ 'width': w });
$tabsUl.parent().css({ 'width': w });
var $iframe = $('<iframe class="lr-frame-iframe active" id="lr_iframe_' +
module.F_ModuleId +
'" frameborder="0" src="' +
$.rootUrl +
module.F_UrlAddress +
'"></iframe>');
$tabsUl.append($tabItem);
$frameMain.append($iframe);

var w = 0;
var width = $tabsUl.children().each(function () {
w += $(this).outerWidth();
});
$tabsUl.css({ 'width': w });
$tabsUl.parent().css({ 'width': w });

$(".lr-frame-tabs-wrap").lrscrollSet('moveRight');

$(".lr-frame-tabs-wrap").lrscrollSet('moveRight');

//绑定一个点击事件
$tabItem.on('click', function () {
var id = $(this).attr('id').replace('lr_tab_', '');
learun.frameTab.focus(id);
});
$tabItem.find('.reomve').on('click', function () {
var id = $(this).parent().attr('id').replace('lr_tab_', '');
learun.frameTab.close(id);
return false;
});

if (!!learun.frameTab.opencallback) {
learun.frameTab.opencallback();
}
if (!notAllowClosed) {
var loginInfo = learun.clientdata.get(['userinfo']);
var account = '';
if (loginInfo) {
account = loginInfo.account;
//绑定一个点击事件
$tabItem.on('click',
function () {
var id = $(this).attr('id').replace('lr_tab_', '');
learun.frameTab.focus(id);
});
$tabItem.find('.reomve').on('click',
function () {
var id = $(this).parent().attr('id').replace('lr_tab_', '');
learun.frameTab.close(id);
return false;
});

if (!!learun.frameTab.opencallback) {
learun.frameTab.opencallback();
}
if (!notAllowClosed) {
var loginInfo = learun.clientdata.get(['userinfo']);
var account = '';
if (loginInfo) {
account = loginInfo.account;
}

$.ajax({
url: top.$.rootUrl + "/Home/VisitModule",
headers: { account: account },
data: { moduleName: module.F_FullName, moduleUrl: module.F_UrlAddress },
type: "post",
dataType: "json",
success: function (res) {
if (res.code == learun.httpCode.nologin) {
var _topUrl = top.$.rootUrl + '/Login/Index';
switch (res.info) {
case 'nologin':
break;
case 'noip':
_topUrl += '?error=ip';
break;
case 'notime':
_topUrl += '?error=time';
break;
case 'other':
_topUrl += '?error=other';
break;
$.ajax({
url: top.$.rootUrl + "/Home/VisitModule",
headers: { account: account },
data: { moduleName: module.F_FullName, moduleUrl: module.F_UrlAddress },
type: "post",
dataType: "json",
success: function (res) {
if (res.code == learun.httpCode.nologin) {
var _topUrl = top.$.rootUrl + '/Login/Index';
switch (res.info) {
case 'nologin':
break;
case 'noip':
_topUrl += '?error=ip';
break;
case 'notime':
_topUrl += '?error=time';
break;
case 'other':
_topUrl += '?error=other';
break;
}
top.window.location.href = _topUrl;
return;
}
top.window.location.href = _topUrl;
return;
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
top.window.location.href = top.$.rootUrl + '/Login/Index';
},
beforeSend: function () {
},
complete: function () {
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
top.window.location.href = top.$.rootUrl + '/Login/Index';
},
beforeSend: function () {
},
complete: function () {
}
});
});
}
}
}
else {
@@ -184,7 +199,7 @@
}
}
// 获取当前窗口
,currentIframe: function () {
, currentIframe: function () {
var ifameId = 'lr_iframe_' + learun.frameTab.iframeId;
if (top.frames[ifameId].contentWindow != undefined) {
return top.frames[ifameId].contentWindow;
@@ -193,8 +208,8 @@
return top.frames[ifameId];
}
}
,parentIframe: function () {
var ifameId = 'lr_iframe_' + top.$('#lr_tab_'+learun.frameTab.iframeId).attr('parent-id');
, parentIframe: function () {
var ifameId = 'lr_iframe_' + top.$('#lr_tab_' + learun.frameTab.iframeId).attr('parent-id');
if (top.frames[ifameId].contentWindow != undefined) {
return top.frames[ifameId].contentWindow;
}
@@ -202,7 +217,7 @@
return top.frames[ifameId];
}
}
, wfFormIframe: function () {
, wfFormIframe: function () {
var currentIframe = learun.frameTab.currentIframe();
var iframeId = currentIframe.$('#form_list_iframes .form-list-iframe.active').attr('id');
return learun.iframe(iframeId, currentIframe.frames);
@@ -210,8 +225,8 @@
, closeByParam: function (name, value) {
$('#lr_frame_tabs_ul li').each(function () {
var id = $(this).attr('id').replace('lr_tab_', '');
var frameObj = top.frames[ 'lr_iframe_' + id];
var frameObj = top.frames['lr_iframe_' + id];
if (frameObj.contentWindow != undefined) {
frameObj = frameObj.contentWindow;
}


Chargement…
Annuler
Enregistrer