...
|
...
|
@@ -101,6 +101,13 @@ layui.extend({ |
|
|
}
|
|
|
//请求视图渲染
|
|
|
view().render(path.join('/')).then(function (res) {
|
|
|
let pageId = pathURL;
|
|
|
|
|
|
// 如果地址是通用页面,business/index/redirectUrl
|
|
|
if(router.href.indexOf('business/index/redirectUrl') != -1){
|
|
|
pageId = router.href;
|
|
|
}
|
|
|
|
|
|
//遍历页签选项卡
|
|
|
var matchTo
|
|
|
, tabs = $('#LAY_app_tabsheader>li');
|
...
|
...
|
@@ -108,7 +115,7 @@ layui.extend({ |
|
|
tabs.each(function (index) {
|
|
|
var li = $(this)
|
|
|
, layid = li.attr('lay-id');
|
|
|
if (layid === pathURL) {
|
|
|
if (layid === pageId) {
|
|
|
matchTo = true;
|
|
|
tabsPage.index = index;
|
|
|
}
|
...
|
...
|
@@ -130,10 +137,14 @@ layui.extend({ |
|
|
} catch (e) {
|
|
|
}
|
|
|
if (!tabName) {
|
|
|
// 获取路由页面名称
|
|
|
let name = router.search.name;
|
|
|
//lsq 页面刷新后名称改变 2022-03-30
|
|
|
if (routerPath.indexOf('ajConfig') != -1 && routerPath.indexOf('view') != -1) {
|
|
|
tabName = localStorage.getItem(router.search.ajConfig);
|
|
|
} else {
|
|
|
} else if(name){
|
|
|
tabName = name;
|
|
|
}else {
|
|
|
tabName = res.title
|
|
|
|
|
|
}
|
...
|
...
|
@@ -144,9 +155,10 @@ layui.extend({ |
|
|
if (!matchTo) {
|
|
|
$(APP_BODY).append('<div class="layadmin-tabsbody-item layui-show"></div>');
|
|
|
tabsPage.index = tabs.length;
|
|
|
|
|
|
element.tabAdd(FILTER_TAB_TBAS, {
|
|
|
title: '<span>' + (tabName || '新标签页') + '</span>'
|
|
|
, id: pathURL
|
|
|
, id: pageId
|
|
|
, attr: router.href
|
|
|
});
|
|
|
}
|
...
|
...
|
@@ -156,9 +168,9 @@ layui.extend({ |
|
|
setter.pageTabs || this.container.scrollTop(0); //如果不开启标签页,则跳转时重置滚动条
|
|
|
|
|
|
//定位当前tabs
|
|
|
element.tabChange(FILTER_TAB_TBAS, pathURL);
|
|
|
element.tabChange(FILTER_TAB_TBAS, pageId);
|
|
|
// 修改为当前菜单名称
|
|
|
$('* [lay-id="' + pathURL + '"] span').text(tabName)
|
|
|
$('* [lay-id="' + pageId + '"] span').text(tabName)
|
|
|
admin.tabsBodyChange(tabsPage.index);
|
|
|
|
|
|
}).done(function () {
|
...
|
...
|
|