From a6e702ac6c123525c887b24de3c4ea958e5bc6c7 Mon Sep 17 00:00:00 2001 From: edy Date: Wed, 1 Dec 2021 09:56:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=87=E6=8D=A2=E7=89=88=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E8=B7=B3=E8=BD=AC=E4=B8=BA=E7=A9=BA=E6=8A=A5=E9=94=99?= =?UTF-8?q?Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/LR_Content/script/lr-tabs.js | 187 ++++++++++-------- 1 file changed, 101 insertions(+), 86 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-tabs.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-tabs.js index 4fe480818..b7c60472c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-tabs.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-tabs.js @@ -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 = $('
  • ' + module.F_FullName + '
  • '); - // 翻译 - learun.language.get(module.F_FullName, function (text) { - $tabItem.find('span').text(text); - if (!notAllowClosed) { - $tabItem.append(''); + 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 = $('
  • ' + + module.F_FullName + + '
  • '); + // 翻译 + learun.language.get(module.F_FullName, + function (text) { + $tabItem.find('span').text(text); + if (!notAllowClosed) { + $tabItem.append(''); + } + }); - - var $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 = $(''); + $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; }