From 204ce5fe8ddc33320d59d155244dfd3b55ca25a8 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期四, 26 三月 2026 09:59:57 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/index.html |  250 +++++++++++++++++++++++++++++++++++++------------
 1 files changed, 189 insertions(+), 61 deletions(-)

diff --git a/src/main/webapp/views/index.html b/src/main/webapp/views/index.html
index 4e4ba07..7f4c3e4 100644
--- a/src/main/webapp/views/index.html
+++ b/src/main/webapp/views/index.html
@@ -474,11 +474,24 @@
     }
 
     .page-frame {
+      position: absolute;
+      inset: 0;
       width: 100%;
       height: 100%;
       border: 0;
       display: block;
       background: #fff;
+      opacity: 0;
+      visibility: hidden;
+      pointer-events: none;
+      z-index: 0;
+    }
+
+    .page-frame.is-active {
+      opacity: 1;
+      visibility: visible;
+      pointer-events: auto;
+      z-index: 1;
     }
 
     .page-loading {
@@ -792,7 +805,7 @@
 
       <el-main class="content-main">
         <div class="frame-wrapper">
-          <div class="page-loading" v-if="pageLoading">
+          <div key="page-loading" class="page-loading" v-show="pageLoading">
             <i class="el-icon-loading"></i>
             <span>{{ loadingText }}</span>
           </div>
@@ -800,9 +813,8 @@
           <iframe
               v-for="tab in tabs"
               :key="'frame-' + tab.name"
-              class="page-frame"
+              :class="['page-frame', { 'is-active': activeTab === tab.name }]"
               :data-tab-name="tab.name"
-              v-show="activeTab === tab.name"
               :src="tab.currentSrc"
               @load="handleFrameLoad(tab.name)">
           </iframe>
@@ -858,17 +870,19 @@
 </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>
+  var DASHBOARD_VIEW_VERSION = "20260317-dashboard-stop-password-mask";
   var HOME_TAB_CONFIG = {
-    title: "鎺у埗涓績",
-    url: baseUrl + "/views/watch/console.html",
+    title: "绯荤粺浠〃鐩�",
+    url: baseUrl + "/views/dashboard/dashboard.html?layoutVersion=" + encodeURIComponent(DASHBOARD_VIEW_VERSION),
     home: true,
-    group: "瀹炴椂鐩戞帶",
+    group: "绯荤粺姒傝",
     menuKey: ""
   };
+  var LEGACY_HOME_TAB_URL = baseUrl + "/views/watch/console.html";
   var PROFILE_TAB_CONFIG = {
     title: "鍩烘湰璧勬枡",
     url: baseUrl + "/views/detail.html?resourceId=8",
@@ -891,7 +905,7 @@
     "common.profile": "鍩烘湰璧勬枡",
     "common.logout": "閫�鍑虹櫥褰�",
     "common.closeOtherTabs": "鍏抽棴鍏朵粬椤电",
-    "common.backHome": "杩斿洖鎺у埗涓績",
+    "common.backHome": "杩斿洖浠〃鐩�",
     "common.aiAssistant": "AI鍔╂墜",
     "common.workPage": "宸ヤ綔椤甸潰",
     "common.businessPage": "涓氬姟椤甸潰",
@@ -902,8 +916,8 @@
     "index.fakeRunning": "浠跨湡杩愯涓�",
     "index.fakeStopped": "浠跨湡鏈繍琛�",
     "index.licenseExpiring": "璁稿彲璇佸嵆灏嗚繃鏈�",
-    "index.homeTab": "鎺у埗涓績",
-    "index.homeGroup": "瀹炴椂鐩戞帶",
+    "index.homeTab": "绯荤粺浠〃鐩�",
+    "index.homeGroup": "绯荤粺姒傝",
     "index.profileGroup": "璐︽埛涓績",
     "index.versionLoading": "Version loading...",
     "index.licenseExpireAt": "璁稿彲璇佸皢浜� {0} 杩囨湡锛屽墿浣欐湁鏁堟湡锛歿1} 澶┿��",
@@ -1136,17 +1150,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();
@@ -1184,6 +1188,105 @@
       translateTabTitle: function (title) {
         return this.tl(title);
       },
+      findMenuMeta: function (tab) {
+        var menuEntry;
+        var i;
+        var j;
+        var group;
+        var item;
+        if (!tab) {
+          return null;
+        }
+        if (tab.menuKey) {
+          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 (item.tabKey === tab.menuKey) {
+                return {
+                  group: group,
+                  item: item
+                };
+              }
+            }
+          }
+        }
+        menuEntry = this.findMenuEntryByUrl(tab.url);
+        if (menuEntry) {
+          return menuEntry;
+        }
+        return null;
+      },
+      normalizeMenuMatchUrl: function (url, stripQuery) {
+        var normalized = this.resolveViewSrc(url || "");
+        var hashIndex = normalized.indexOf("#");
+        var queryIndex;
+        if (hashIndex > -1) {
+          normalized = normalized.substring(0, hashIndex);
+        }
+        if (stripQuery) {
+          queryIndex = normalized.indexOf("?");
+          if (queryIndex > -1) {
+            normalized = normalized.substring(0, queryIndex);
+          }
+        }
+        return normalized;
+      },
+      findMenuEntryByUrl: function (url) {
+        var normalized = this.normalizeMenuMatchUrl(url, false);
+        var normalizedBase = this.normalizeMenuMatchUrl(url, true);
+        var fallback = null;
+        var i;
+        var j;
+        var group;
+        var item;
+
+        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 (item.url === normalized) {
+              return {
+                group: group,
+                item: item
+              };
+            }
+            if (!fallback && this.normalizeMenuMatchUrl(item.url, true) === normalizedBase) {
+              fallback = {
+                group: group,
+                item: item
+              };
+            }
+          }
+        }
+        return fallback;
+      },
+      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");
       },
@@ -1217,12 +1320,16 @@
         };
       },
       normalizeStoredTab: function (tab) {
+        var homeConfig = this.resolveHomeConfig();
+        var resolvedUrl = this.resolveViewSrc(tab.url);
+        var isLegacyHome = resolvedUrl === this.resolveViewSrc(LEGACY_HOME_TAB_URL);
+        var isHome = !!tab.home || isLegacyHome;
         var created = this.createTab({
-          title: this.translateTabTitle(tab.title),
-          url: this.resolveViewSrc(tab.url),
-          home: !!tab.home,
-          group: this.tl(tab.group || ""),
-          menuKey: tab.menuKey || ""
+          title: isHome ? homeConfig.title : this.translateTabTitle(tab.title),
+          url: isHome ? homeConfig.url : resolvedUrl,
+          home: isHome,
+          group: isHome ? homeConfig.group : this.tl(tab.group || ""),
+          menuKey: isHome ? homeConfig.menuKey : (tab.menuKey || "")
         });
         created.loaded = false;
         return created;
@@ -1245,6 +1352,9 @@
               }
             }
             active = parsed ? parsed.activeTab : "";
+            if (this.resolveViewSrc(active) === this.resolveViewSrc(LEGACY_HOME_TAB_URL)) {
+              active = homeTab.name;
+            }
           } catch (e) {
             tabs = [];
             active = "";
@@ -1473,7 +1583,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);
       },
@@ -1553,40 +1663,55 @@
         });
       },
       findMenuKeyByUrl: function (url) {
-        var normalized = this.resolveViewSrc(url);
-        var i;
-        var j;
-        var group;
-        var item;
-
-        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 (item.url === normalized) {
-              return item.tabKey;
-            }
-          }
+        var entry = this.findMenuEntryByUrl(url);
+        if (entry && entry.item) {
+          return entry.item.tabKey || "";
         }
         return "";
       },
       findMenuGroupIndexByUrl: function (url) {
-        var normalized = this.resolveViewSrc(url);
+        var entry = this.findMenuEntryByUrl(url);
+        if (entry && entry.group) {
+          return "group-" + entry.group.menuId;
+        }
+        return "";
+      },
+      injectDashboardMenu: function (menus) {
+        var homeConfig = this.resolveHomeConfig();
+        var dashboardUrl = this.resolveViewSrc(homeConfig.url);
         var i;
         var j;
         var group;
         var item;
 
-        for (i = 0; i < this.menus.length; i++) {
-          group = this.menus[i];
+        for (i = 0; i < menus.length; i++) {
+          group = menus[i];
           for (j = 0; j < group.subMenu.length; j++) {
             item = group.subMenu[j];
-            if (item.url === normalized) {
-              return "group-" + group.menuId;
+            if (item.url === dashboardUrl) {
+              item.name = homeConfig.title;
+              group.menu = homeConfig.group;
+              group.menuCode = group.menuCode || "index";
+              HOME_TAB_CONFIG.menuKey = item.tabKey || dashboardUrl;
+              return menus;
             }
           }
         }
-        return "";
+
+        HOME_TAB_CONFIG.menuKey = dashboardUrl;
+        menus.unshift({
+          menuId: "dashboard-home",
+          menu: homeConfig.group,
+          menuCode: "index",
+          subMenu: [{
+            id: "dashboard-home-tab",
+            name: homeConfig.title,
+            code: "dashboard/dashboard.html",
+            url: dashboardUrl,
+            tabKey: dashboardUrl
+          }]
+        });
+        return menus;
       },
       normalizeMenuData: function (data) {
         var result = [];
@@ -1619,7 +1744,7 @@
           });
         }
 
-        return result;
+        return this.injectDashboardMenu(result);
       },
       buildMenuSrc: function (code, resourceId) {
         var normalized = code || "";
@@ -1680,11 +1805,9 @@
         var syncVersion;
         var applyMenuState;
 
-        if (!this.isHomeTabUrl(targetUrl)) {
-          activeMenuKey = this.findMenuKeyByUrl(targetUrl);
-          if (activeMenuKey) {
-            groupIndex = this.findMenuGroupIndexByUrl(targetUrl);
-          }
+        activeMenuKey = this.findMenuKeyByUrl(targetUrl);
+        if (activeMenuKey) {
+          groupIndex = this.findMenuGroupIndexByUrl(targetUrl);
         }
 
         this.activeMenuKey = activeMenuKey;
@@ -1742,6 +1865,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";
@@ -1942,31 +2066,35 @@
         window.index = window.index || {};
         window.index.loadView = function (param) {
           var url;
+          var menuEntry;
           if (!param || !param.menuPath) {
             return;
           }
           url = that.resolveViewSrc(param.menuPath);
+          menuEntry = that.findMenuEntryByUrl(url);
           that.addOrActivateTab({
-            title: that.stripTags(param.menuName) || that.t("common.workPage"),
-            url: url,
+            title: that.stripTags(param.menuName) || (menuEntry && menuEntry.item ? menuEntry.item.name : that.t("common.workPage")),
+            url: menuEntry && menuEntry.item ? menuEntry.item.url : url,
             home: false,
-            group: that.t("common.businessPage"),
-            menuKey: that.findMenuKeyByUrl(url)
+            group: menuEntry && menuEntry.group ? menuEntry.group.menu : that.t("common.businessPage"),
+            menuKey: menuEntry && menuEntry.item ? menuEntry.item.tabKey : that.findMenuKeyByUrl(url)
           });
         };
         window.index.loadHome = function (param) {
           var url;
+          var menuEntry;
           if (!param || !param.menuPath) {
             that.openHomeTab();
             return;
           }
           url = that.resolveViewSrc(param.menuPath);
+          menuEntry = that.findMenuEntryByUrl(url);
           that.addOrActivateTab({
-            title: that.stripTags(param.menuName) || that.resolveHomeConfig().title,
-            url: url,
+            title: that.stripTags(param.menuName) || (menuEntry && menuEntry.item ? menuEntry.item.name : that.resolveHomeConfig().title),
+            url: menuEntry && menuEntry.item ? menuEntry.item.url : url,
             home: true,
-            group: that.resolveHomeConfig().group,
-            menuKey: that.findMenuKeyByUrl(url)
+            group: menuEntry && menuEntry.group ? menuEntry.group.menu : that.resolveHomeConfig().group,
+            menuKey: menuEntry && menuEntry.item ? menuEntry.item.tabKey : that.findMenuKeyByUrl(url)
           });
         };
 

--
Gitblit v1.9.1