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);