mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
feat: 回退页面时,如果页面不存在,则创建并从菜单读取标题
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
(function () {
|
||||
var element = layui.element;
|
||||
$ = layui.$;
|
||||
|
||||
|
||||
var miniTab = {
|
||||
renderOptions:{},
|
||||
/**
|
||||
* 初始化tab
|
||||
* @param options
|
||||
*/
|
||||
render: function (options) {
|
||||
this.renderOptions = options;
|
||||
|
||||
options.filter = options.filter || null;
|
||||
options.urlHashLocation = options.urlHashLocation || false;
|
||||
options.maxTabNum = options.maxTabNum || 20;
|
||||
@@ -180,6 +184,10 @@
|
||||
* @param menuList
|
||||
*/
|
||||
searchMenu: function (href, menuList) {
|
||||
if(!menuList){
|
||||
menuList = this.renderOptions.menuList
|
||||
}
|
||||
|
||||
var menu;
|
||||
for (key in menuList) {
|
||||
var item = menuList[key];
|
||||
@@ -393,6 +401,7 @@
|
||||
listenSwitch: function (options) {
|
||||
options.filter = options.filter || null;
|
||||
options.urlHashLocation = options.urlHashLocation || false;
|
||||
|
||||
options.listenSwichCallback = options.listenSwichCallback || function () { };
|
||||
element.on('tab(' + options.filter + ')', function (data) {
|
||||
var tabId = $(this).attr('lay-id');
|
||||
|
||||
@@ -1141,7 +1141,6 @@
|
||||
var titleEndfix = '';
|
||||
|
||||
if (typeof operat.titleField == 'function') {
|
||||
console.log(operat.titleField(data, operat));
|
||||
titleEndfix = operat.titleField(data, operat);
|
||||
|
||||
} else if (data[operat.titleField]) {
|
||||
@@ -2281,10 +2280,16 @@
|
||||
backWindow.layui.table.reloadData(option.refreshTable);
|
||||
} else {
|
||||
admin.findIndexPage(function (window) {
|
||||
var menu = window.miniTab.searchMenu(option.backHref);
|
||||
var title = option.backHref
|
||||
|
||||
if(menu){
|
||||
title = menu.title;
|
||||
}
|
||||
window.miniTab.create({
|
||||
tabId: option.backHref,
|
||||
href: option.backHref,
|
||||
title: 'xxx',
|
||||
title: title,
|
||||
isIframe: true,
|
||||
});
|
||||
});
|
||||
@@ -3124,8 +3129,6 @@
|
||||
return oldValue;
|
||||
},
|
||||
isCurrentIndex() {
|
||||
console.log(window.pageType);
|
||||
|
||||
if (window.pageType && window.pageType == 'index') {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user