From 5371e09c23e2cd980e80caa82a7e723723feb486 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Tue, 25 Feb 2020 18:34:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=8C=89=E7=85=A7=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E5=B7=A5=E4=BD=9C=E7=A9=BA=E9=97=B4=E9=9A=94=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/service/WorkspaceService.java | 4 +- .../src/performance/components/HeaderUser.vue | 3 + .../performance/components/router/router.js | 5 + .../components/settings/Member.vue | 16 +- .../settings/OrganizationMember.vue | 8 +- .../settings/OrganizationWorkspace.vue | 181 ++++++++++++++++++ .../components/settings/SettingMenu.vue | 2 +- 7 files changed, 208 insertions(+), 11 deletions(-) create mode 100644 frontend/src/performance/components/settings/OrganizationWorkspace.vue diff --git a/backend/src/main/java/io/metersphere/service/WorkspaceService.java b/backend/src/main/java/io/metersphere/service/WorkspaceService.java index d32c4c1c98..9ac36e13b6 100644 --- a/backend/src/main/java/io/metersphere/service/WorkspaceService.java +++ b/backend/src/main/java/io/metersphere/service/WorkspaceService.java @@ -113,7 +113,9 @@ public class WorkspaceService { userRoles.forEach(userRole -> { workspaces.forEach(workspace -> { if (StringUtils.equals(userRole.getSourceId(),workspace.getId())) { - resultWorkspaceList.add(workspace); + if (!resultWorkspaceList.contains(workspace)) { + resultWorkspaceList.add(workspace); + } } }); }); diff --git a/frontend/src/performance/components/HeaderUser.vue b/frontend/src/performance/components/HeaderUser.vue index 1537acf5a3..6706e69f66 100644 --- a/frontend/src/performance/components/HeaderUser.vue +++ b/frontend/src/performance/components/HeaderUser.vue @@ -102,6 +102,9 @@ }); } if (roles.indexOf(ROLE_TEST_MANAGER) > -1 || roles.indexOf(ROLE_TEST_USER) > -1 || roles.indexOf(ROLE_TEST_VIEWER) > -1) { + if (this.currentUser.lastOrganizationId === null) { + return false; + } this.$get("/workspace/list/orgworkspace/", response => { let data = response.data; if (data.length == 0) { diff --git a/frontend/src/performance/components/router/router.js b/frontend/src/performance/components/router/router.js index eae8293484..691c201c8f 100644 --- a/frontend/src/performance/components/router/router.js +++ b/frontend/src/performance/components/router/router.js @@ -11,6 +11,7 @@ import OrganizationMember from "../settings/OrganizationMember"; import Member from "../settings/Member"; import TestResourcePool from "../settings/TestResourcePool"; import MsProject from "../project/MsProject"; +import OrganizationWorkspace from "../settings/OrganizationWorkspace"; Vue.use(VueRouter); @@ -53,6 +54,10 @@ const router = new VueRouter({ path: 'organizationmember', component: OrganizationMember, }, + { + path: 'organizationworkspace', + component: OrganizationWorkspace, + }, { path: 'member', component: Member diff --git a/frontend/src/performance/components/settings/Member.vue b/frontend/src/performance/components/settings/Member.vue index 53dcec6046..a622f09f5b 100644 --- a/frontend/src/performance/components/settings/Member.vue +++ b/frontend/src/performance/components/settings/Member.vue @@ -63,6 +63,8 @@ + + + diff --git a/frontend/src/performance/components/settings/SettingMenu.vue b/frontend/src/performance/components/settings/SettingMenu.vue index ce0efbea08..ba126256a9 100644 --- a/frontend/src/performance/components/settings/SettingMenu.vue +++ b/frontend/src/performance/components/settings/SettingMenu.vue @@ -17,7 +17,7 @@ 组织 成员 - 工作空间 + 工作空间