| | |
| | | <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 = "20260316-hero-two-rows-flat-compact"; |
| | | 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", |
| | |
| | | "common.profile": "基本资料", |
| | | "common.logout": "退出登录", |
| | | "common.closeOtherTabs": "关闭其他页签", |
| | | "common.backHome": "返回控制中心", |
| | | "common.backHome": "返回仪表盘", |
| | | "common.aiAssistant": "AI助手", |
| | | "common.workPage": "工作页面", |
| | | "common.businessPage": "业务页面", |
| | |
| | | "index.fakeRunning": "仿真运行中", |
| | | "index.fakeStopped": "仿真未运行", |
| | | "index.licenseExpiring": "许可证即将过期", |
| | | "index.homeTab": "控制中心", |
| | | "index.homeGroup": "实时监控", |
| | | "index.homeTab": "系统仪表盘", |
| | | "index.homeGroup": "系统概览", |
| | | "index.profileGroup": "账户中心", |
| | | "index.versionLoading": "Version loading...", |
| | | "index.licenseExpireAt": "许可证将于 {0} 过期,剩余有效期:{1} 天。", |
| | |
| | | }; |
| | | }, |
| | | 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; |
| | |
| | | } |
| | | } |
| | | active = parsed ? parsed.activeTab : ""; |
| | | if (this.resolveViewSrc(active) === this.resolveViewSrc(LEGACY_HOME_TAB_URL)) { |
| | | active = homeTab.name; |
| | | } |
| | | } catch (e) { |
| | | tabs = []; |
| | | active = ""; |
| | |
| | | } |
| | | 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 < menus.length; i++) { |
| | | group = menus[i]; |
| | | for (j = 0; j < group.subMenu.length; j++) { |
| | | item = group.subMenu[j]; |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | | |
| | | 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 = []; |
| | | var i; |
| | |
| | | }); |
| | | } |
| | | |
| | | return result; |
| | | return this.injectDashboardMenu(result); |
| | | }, |
| | | buildMenuSrc: function (code, resourceId) { |
| | | var normalized = code || ""; |
| | |
| | | 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; |