From 3eab4409e562a873d9bd7b047b3d0590901a6654 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期三, 11 三月 2026 11:06:49 +0800
Subject: [PATCH] #
---
src/main/webapp/views/index.html | 67 +++++++++++++++++++++++++++------
1 files changed, 54 insertions(+), 13 deletions(-)
diff --git a/src/main/webapp/views/index.html b/src/main/webapp/views/index.html
index 4e4ba07..37d8d39 100644
--- a/src/main/webapp/views/index.html
+++ b/src/main/webapp/views/index.html
@@ -858,7 +858,7 @@
</div>
<script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script>
-<script type="text/javascript" src="../static/js/common.js?v=20260309_i18n_fix1"></script>
+<script type="text/javascript" src="../static/js/common.js"></script>
<script type="text/javascript" src="../static/vue/js/vue.min.js"></script>
<script type="text/javascript" src="../static/vue/element/element.js"></script>
<script>
@@ -1136,17 +1136,7 @@
PROFILE_TAB_CONFIG.title = profileConfig.title;
PROFILE_TAB_CONFIG.group = profileConfig.group;
for (i = 0; i < this.tabs.length; i++) {
- if (this.isHomeTabUrl(this.tabs[i].url)) {
- this.tabs[i].title = homeConfig.title;
- this.tabs[i].group = homeConfig.group;
- this.tabs[i].home = true;
- } else if (this.resolveViewSrc(this.tabs[i].url) === this.resolveViewSrc(profileConfig.url)) {
- this.tabs[i].title = profileConfig.title;
- this.tabs[i].group = profileConfig.group;
- } else {
- this.tabs[i].title = this.translateTabTitle(this.tabs[i].title);
- this.tabs[i].group = this.tl(this.tabs[i].group);
- }
+ this.syncTabMeta(this.tabs[i], homeConfig, profileConfig);
}
this.updateDocumentTitle(this.activeTabTitle);
this.persistTabs();
@@ -1183,6 +1173,56 @@
},
translateTabTitle: function (title) {
return this.tl(title);
+ },
+ findMenuMeta: function (tab) {
+ var normalizedUrl;
+ var i;
+ var j;
+ var group;
+ var item;
+ if (!tab) {
+ return null;
+ }
+ normalizedUrl = this.resolveViewSrc(tab.url);
+ for (i = 0; i < this.menus.length; i++) {
+ group = this.menus[i];
+ for (j = 0; j < group.subMenu.length; j++) {
+ item = group.subMenu[j];
+ if ((tab.menuKey && item.tabKey === tab.menuKey) || item.url === normalizedUrl) {
+ return {
+ group: group,
+ item: item
+ };
+ }
+ }
+ }
+ return null;
+ },
+ syncTabMeta: function (tab, homeConfig, profileConfig) {
+ var menuMeta;
+ if (!tab) {
+ return;
+ }
+ if (this.isHomeTabUrl(tab.url)) {
+ tab.title = homeConfig.title;
+ tab.group = homeConfig.group;
+ tab.home = true;
+ return;
+ }
+ if (this.resolveViewSrc(tab.url) === this.resolveViewSrc(profileConfig.url)) {
+ tab.title = profileConfig.title;
+ tab.group = profileConfig.group;
+ return;
+ }
+ menuMeta = this.findMenuMeta(tab);
+ if (menuMeta) {
+ tab.title = menuMeta.item.name;
+ tab.group = menuMeta.group.menu;
+ tab.menuKey = menuMeta.item.tabKey || tab.menuKey;
+ return;
+ }
+ tab.title = this.translateTabTitle(tab.title);
+ tab.group = this.tl(tab.group);
},
updateDocumentTitle: function (title) {
document.title = title + " - " + this.t("app.title");
@@ -1473,7 +1513,7 @@
script = frameDocument.createElement("script");
script.id = "wcs-i18n-bridge-script";
script.type = "text/javascript";
- script.src = baseUrl + "/static/js/common.js?v=20260309_i18n_fix1";
+ script.src = baseUrl + "/static/js/common.js";
script.onload = applyFrameI18n;
frameDocument.head.appendChild(script);
},
@@ -1742,6 +1782,7 @@
that.menuLoading = false;
if (res.code === 200) {
that.menus = that.normalizeMenuData(res.data || []);
+ that.refreshI18nState();
that.syncMenuStateByUrl(that.activeTabUrl);
} else if (res.code === 403) {
top.location.href = baseUrl + "/login";
--
Gitblit v1.9.1