From 56f3a7bca1ad6909b9146602f4d44e8f576c5d63 Mon Sep 17 00:00:00 2001 From: teukkk Date: Thu, 23 May 2024 17:08:32 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E8=BF=87=E6=9C=9F=E7=94=A8=E6=88=B7=E7=82=B9=E5=87=BB=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E7=BB=84=E7=BB=87=E7=9A=84=E8=BF=9B=E5=85=A5=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E8=B7=B3=E8=BD=AC=E5=88=B0=E6=97=A0=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2&=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../setting/organization/project/orgProject.vue | 12 ++++++++++-- .../components/systemProject.vue | 12 ++++++++++-- frontend/src/views/setting/utils.ts | 10 +++++++++- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/frontend/src/views/setting/organization/project/orgProject.vue b/frontend/src/views/setting/organization/project/orgProject.vue index af982f7491..bfe3d1dacc 100644 --- a/frontend/src/views/setting/organization/project/orgProject.vue +++ b/frontend/src/views/setting/organization/project/orgProject.vue @@ -149,7 +149,15 @@ ); const keyword = ref(''); - + const operationWidth = computed(() => { + if (hasOperationPermission.value) { + return 250; + } + if (hasAnyPermission(['PROJECT_BASE_INFO:READ'])) { + return 100; + } + return 50; + }); const organizationColumns: MsTableColumn = [ { title: 'system.organization.ID', @@ -210,7 +218,7 @@ slotName: 'operation', dataIndex: 'operation', fixed: 'right', - width: hasOperationPermission.value ? 250 : 50, + width: operationWidth.value, }, ]; diff --git a/frontend/src/views/setting/system/organizationAndProject/components/systemProject.vue b/frontend/src/views/setting/system/organizationAndProject/components/systemProject.vue index 17549006d3..e455153b2e 100644 --- a/frontend/src/views/setting/system/organizationAndProject/components/systemProject.vue +++ b/frontend/src/views/setting/system/organizationAndProject/components/systemProject.vue @@ -133,7 +133,15 @@ 'SYSTEM_ORGANIZATION_PROJECT:READ+DELETE', ]) ); - + const operationWidth = computed(() => { + if (hasOperationPermission.value) { + return 250; + } + if (hasAnyPermission(['PROJECT_BASE_INFO:READ'])) { + return 100; + } + return 50; + }); const organizationColumns: MsTableColumn = [ { title: 'system.organization.ID', @@ -189,7 +197,7 @@ slotName: 'operation', dataIndex: 'operation', fixed: 'right', - width: hasOperationPermission.value ? 250 : 50, + width: operationWidth.value, }, ]; diff --git a/frontend/src/views/setting/utils.ts b/frontend/src/views/setting/utils.ts index 70cb066502..8662b0011e 100644 --- a/frontend/src/views/setting/utils.ts +++ b/frontend/src/views/setting/utils.ts @@ -9,6 +9,7 @@ import router from '@/router'; import { NO_PROJECT_ROUTE_NAME } from '@/router/constants'; import { useUserStore } from '@/store'; import useAppStore from '@/store/modules/app'; +import useLicenseStore from '@/store/modules/setting/license'; import { hasAnyPermission } from '@/utils/permission'; import { ProjectManagementRouteEnum } from '@/enums/routeEnum'; @@ -16,12 +17,19 @@ import { ProjectManagementRouteEnum } from '@/enums/routeEnum'; const { t } = useI18n(); const userStore = useUserStore(); const appStore = useAppStore(); +const licenseStore = useLicenseStore(); export async function enterProject(projectId: string, organizationId?: string) { try { appStore.showLoading(); // 切换组织 - if (organizationId) { + if (organizationId && appStore.currentOrgId !== organizationId) { + if (!licenseStore.hasLicense()) { + router.push({ + name: NO_PROJECT_ROUTE_NAME, + }); + return; + } await switchUserOrg(organizationId, userStore.id || ''); } await userStore.isLogin(true);