mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
feat: 增加打开标签时追加tab前缀标题;优化代码结构
This commit is contained in:
@@ -203,6 +203,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return menu;
|
||||
},
|
||||
|
||||
@@ -261,6 +262,7 @@
|
||||
href = $(this).attr('layuimini-content-href'),
|
||||
title = $(this).attr('data-title'),
|
||||
back = $(this).attr('data-back') || 0,
|
||||
prefixTitle = $(this).attr('data-prefix-title') || 1,
|
||||
external = $(this).attr('data-external') || false,
|
||||
target = $(this).attr('target');
|
||||
|
||||
@@ -286,14 +288,17 @@
|
||||
|
||||
if (!checkTab) {
|
||||
if (!title) {
|
||||
title = tabId;
|
||||
ua.findIndexPage(function (window) {
|
||||
var menu = window.miniTab.searchMenu(tabId);
|
||||
|
||||
if (menu) {
|
||||
title = menu.title;
|
||||
}
|
||||
});
|
||||
title = ua.getMenuTitleByTabId(tabId, tabId)
|
||||
}
|
||||
console.log(prefixTitle);
|
||||
|
||||
if(prefixTitle == 1) {
|
||||
let prefixTabTitle = ua.getMenuTitleByTabId(ua.getCurrentPageId());
|
||||
console.log(prefixTabTitle);
|
||||
|
||||
if(prefixTabTitle){
|
||||
title = prefixTabTitle + '-' + title;
|
||||
}
|
||||
}
|
||||
miniTab.create({
|
||||
tabId: tabId,
|
||||
|
||||
@@ -2281,9 +2281,9 @@
|
||||
} else {
|
||||
admin.findIndexPage(function (w) {
|
||||
var menu = w.miniTab.searchMenu(option.backHref);
|
||||
var title = option.backHref
|
||||
var title = option.backHref;
|
||||
|
||||
if(menu){
|
||||
if (menu) {
|
||||
title = menu.title;
|
||||
}
|
||||
w.miniTab.create({
|
||||
@@ -3172,6 +3172,25 @@
|
||||
});
|
||||
return iframeWindow;
|
||||
},
|
||||
getMenuInfoByTabId(tabId) {
|
||||
var menuValue = null;
|
||||
this.findIndexPage(function (w) {
|
||||
var menu = w.miniTab.searchMenu(tabId);
|
||||
if (menu) {
|
||||
menuValue = menu;
|
||||
}
|
||||
});
|
||||
return menuValue;
|
||||
},
|
||||
getMenuTitleByTabId(tabId, defaultValue) {
|
||||
var menuTitle = defaultValue;
|
||||
var menu = this.getMenuInfoByTabId(tabId);
|
||||
|
||||
if (menu) {
|
||||
menuTitle = menu.title;
|
||||
}
|
||||
return menuTitle;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user