| | |
| | | </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> |
| | |
| | | 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(); |
| | |
| | | }, |
| | | 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"); |
| | |
| | | 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); |
| | | }, |
| | |
| | | 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"; |