From 768210ef865396afa0268130c6ff439fd1ce343a Mon Sep 17 00:00:00 2001 From: zhaojisen <1301338853@qq.com> Date: Wed, 19 Nov 2025 15:30:12 +0800 Subject: [PATCH] Fixed: Fix the issue where the global organization text is not displayed completely in the organization dropdown. --- .../components/NavHeader/Organization.vue | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/layout/components/NavHeader/Organization.vue b/src/layout/components/NavHeader/Organization.vue index 46d7d76d6..eed838c3e 100644 --- a/src/layout/components/NavHeader/Organization.vue +++ b/src/layout/components/NavHeader/Organization.vue @@ -65,6 +65,17 @@ export default { 'usingOrgs', 'currentViewRoute' ]), + currentOrgDisplayName() { + const currentOrgId = this.currentOrg?.id + if (!currentOrgId) { + return this.$tc('Select') + } + const matchedOrg = this.usingOrgs.find(item => item.id === currentOrgId) + if (matchedOrg?.name) { + return matchedOrg.name + } + return this.currentOrg.name || this.$tc('Select') + }, orgActionsGroup() { const orgActions = { label: this.$t('OrganizationList'), @@ -110,11 +121,8 @@ export default { } }, watch: { - currentOrg: { - handler() { - this.updateWidth() - }, - deep: true + currentOrgDisplayName() { + this.updateWidth() } }, mounted() { @@ -133,8 +141,9 @@ export default { tempSpan.style.fontWeight = 'normal' tempSpan.style.letterSpacing = 'normal' - // 获取当前组织名称 - const orgName = this.currentOrg.name || this.$tc('Select') + // 获取当前组织显示名称 + const orgName = this.currentOrgDisplayName + tempSpan.textContent = orgName document.body.appendChild(tempSpan)