自动化立体仓库 - WMS系统
lty
2026-01-22 35b1b26f1fe16550b4ee2881a26d599456fe59b4
src/main/webapp/static/layui/lay/modules/index.js
@@ -31,8 +31,21 @@
                    return admin.activeNav(index.mTabPosition);
                }
                mIsAddTab = true;
                var titleHtml = param.menuName || '';
                if (!param.i18nKey && param.menuPath) {
                    var $menuItem = $(sideDOM).find('a[lay-href="' + param.menuPath + '"]');
                    if ($menuItem.length > 0) {
                        param.i18nKey = $menuItem.attr('data-i18n-key');
                    }
                }
                if (param.i18nKey && typeof I18n !== 'undefined') {
                    titleHtml = I18n.t(param.i18nKey);
                }
                if (param.i18nKey) {
                    titleHtml = '<span data-i18n="' + param.i18nKey + '">' + titleHtml + '</span>';
                }
                element.tabAdd(tabFilter, {
                    id: param.menuPath, title: '<span class="title">' + (param.menuName || '') + '</span>',
                    id: param.menuPath, title: '<span class="title">' + titleHtml + '</span>',
                    content: '<iframe class="admin-iframe" lay-id="' + param.menuPath + '" src="' + param.menuPath +
                        '" onload="layui.index.hideLoading(this);" frameborder="0"></iframe>'
                });
@@ -63,11 +76,16 @@
            index.mTabList.splice(0, index.mTabList.length);
            if (param.menuPath === index.homeUrl) {
                index.mTabPosition = undefined;
                index.setTabTitle($(param.menuName).text() || $(sideDOM + ' [lay-href="' + index.homeUrl + '"]').text() || '主页');
                var homeTitle = $(param.menuName).text() || $(sideDOM + ' [lay-href="' + index.homeUrl + '"]').text() || '<span data-i18n="home">主页</span>';
                index.setTabTitle(homeTitle);
            } else {
                index.mTabPosition = param.menuPath;
                index.mTabList.push(param);
                index.setTabTitle(param.menuName);
                var titleHtml = param.menuName || '';
                if (param.i18nKey) {
                    titleHtml = '<span data-i18n="' + param.i18nKey + '">' + titleHtml + '</span>';
                }
                index.setTabTitle(titleHtml);
            }
            if (!setter.cacheTab) return;
            admin.putTempData('indexTabs', index.mTabList);
@@ -97,7 +115,7 @@
    index.openTab = function (param) {
        if (window !== top && !admin.isTop() && top.layui && top.layui.index) return top.layui.index.openTab(param);
        if (param.end) tabEndCall[param.url] = param.end;
        index.loadView({menuPath: param.url, menuName: param.title});
        index.loadView({menuPath: param.url, menuName: param.title, i18nKey: param.i18nKey});
    };
    /** 关闭tab */
@@ -196,9 +214,9 @@
            '   <ul class="layui-nav" lay-filter="admin-pagetabs-nav">',
            '      <li class="layui-nav-item" lay-unselect>',
            '         <dl class="layui-nav-child layui-anim-fadein">',
            '            <dd ew-event="closeThisTabs" lay-unselect><a>关闭当前标签页</a></dd>',
            '            <dd ew-event="closeOtherTabs" lay-unselect><a>关闭其它标签页</a></dd>',
            '            <dd ew-event="closeAllTabs" lay-unselect><a>关闭全部标签页</a></dd>',
            '            <dd ew-event="closeThisTabs" lay-unselect><a data-i18n="关闭当前标签页">关闭当前标签页</a></dd>',
            '            <dd ew-event="closeOtherTabs" lay-unselect><a data-i18n="关闭其他标签页">关闭其它标签页</a></dd>',
            '            <dd ew-event="closeAllTabs" lay-unselect><a data-i18n="关闭所有标签页">关闭全部标签页</a></dd>',
            '         </dl>',
            '      </li>',
            '   </ul>',
@@ -214,6 +232,7 @@
        if (!href || href === '#') return;
        if (href.indexOf('javascript:') === 0) return new Function(href.substring(11))();
        var name = $that.attr('ew-title') || $that.text().replace(/(^\s*)|(\s*$)/g, '');
        var i18nKey = $that.attr('data-i18n-key');
        var end = $that.attr('ew-end');
        try {
            if (end) end = new Function(end);
@@ -221,7 +240,7 @@
        } catch (e) {
            console.error(e);
        }
        index.openTab({url: href, title: name, end: end});
        index.openTab({url: href, title: name, end: end, i18nKey: i18nKey});
        layui.event.call(this, 'admin', 'side({*})', {href: href});
    });
@@ -269,26 +288,26 @@
                var layId = $(this).attr('lay-id');
                layui.contextMenu.show([{
                    icon: 'layui-icon layui-icon-refresh',
                    name: '刷新当前',
                    name: typeof I18n !== 'undefined' ? I18n.t('刷新') : '刷新当前',
                    click: function () {
                        element.tabChange(tabFilter, layId);
                        if ('true' != $(tabDOM).attr('lay-autoRefresh')) admin.refresh(layId);
                    }
                }, {
                    icon: 'layui-icon layui-icon-close-fill ctx-ic-lg',
                    name: '关闭当前',
                    name: typeof I18n !== 'undefined' ? I18n.t('关闭当前') : '关闭当前',
                    click: function () {
                        admin.closeThisTabs(layId);
                    }
                }, {
                    icon: 'layui-icon layui-icon-unlink',
                    name: '关闭其他',
                    name: typeof I18n !== 'undefined' ? I18n.t('关闭其他') : '关闭其他',
                    click: function () {
                        admin.closeOtherTabs(layId);
                    }
                }, {
                    icon: 'layui-icon layui-icon-close ctx-ic-lg',
                    name: '关闭全部',
                    name: typeof I18n !== 'undefined' ? I18n.t('关闭所有') : '关闭全部',
                    click: function () {
                        admin.closeAllTabs();
                    }