From 7fb94f09779eba4f4b83d4fc4dc79984c9322439 Mon Sep 17 00:00:00 2001 From: RubyLiu Date: Thu, 17 Aug 2023 18:44:38 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E9=A1=B9=E7=9B=AE=E5=90=AF=E7=94=A8=E7=A6=81?= =?UTF-8?q?=E7=94=A8=E6=B7=BB=E5=8A=A0=E6=88=90=E5=91=98&=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../setting/system/organizationAndProject.ts | 12 +++- .../setting/system/organizationAndProject.ts | 4 ++ frontend/src/router/routes/modules/apiTest.ts | 2 +- .../router/routes/modules/bugManagement.ts | 2 +- .../src/router/routes/modules/featureTest.ts | 2 +- .../router/routes/modules/performanceTest.ts | 2 +- .../routes/modules/projectManagement.ts | 2 +- .../src/router/routes/modules/testPlan.ts | 2 +- frontend/src/router/routes/modules/uiTest.ts | 2 +- .../src/router/routes/modules/workplace.ts | 2 +- frontend/src/store/modules/setting/types.ts | 2 + .../src/store/modules/setting/usergroup.ts | 5 ++ .../components/addUserModal.vue | 2 +- .../components/projectDrawer.vue | 1 + .../components/systemOrganization.vue | 4 +- .../components/systemProject.vue | 70 +++++++++++-------- .../components/userDrawer.vue | 18 ++++- .../organizationAndProject/locale/en-US.ts | 5 ++ .../organizationAndProject/locale/zh-CN.ts | 5 ++ .../usergroup/components/addUserModal.vue | 12 +++- .../system/usergroup/components/authTable.vue | 12 ++-- .../system/usergroup/components/userTable.vue | 16 ++--- .../views/setting/system/usergroup/index.vue | 62 +++++++++++++--- .../setting/system/usergroup/locale/en-US.ts | 2 + .../setting/system/usergroup/locale/zh-CN.ts | 2 + 25 files changed, 179 insertions(+), 71 deletions(-) diff --git a/frontend/src/api/modules/setting/system/organizationAndProject.ts b/frontend/src/api/modules/setting/system/organizationAndProject.ts index 17f5c26573..5476fdaa8c 100644 --- a/frontend/src/api/modules/setting/system/organizationAndProject.ts +++ b/frontend/src/api/modules/setting/system/organizationAndProject.ts @@ -19,11 +19,21 @@ export function deleteOrg(id: string) { return MSR.get({ url: `${orgUrl.getDeleteOrgUrl}${id}` }); } +// 删除项目 +export function deleteProject(id: string) { + return MSR.get({ url: `${orgUrl.getDeleteProjectUrl}${id}` }); +} + // 撤销删除组织 export function revokeDeleteOrg(id: string) { return MSR.get({ url: `${orgUrl.getRecoverOrgUrl}${id}` }); } +// 撤销删除项目 +export function revokeDeleteProject(id: string) { + return MSR.get({ url: `${orgUrl.getRevokeProjectUrl}${id}` }); +} + // 启用或禁用组织 export function enableOrDisableOrg(id: string, isEnable = true) { return MSR.get({ url: `${isEnable ? orgUrl.getEnableOrgUrl : orgUrl.getDisableOrgUrl}${id}` }); @@ -60,5 +70,5 @@ export function deleteUserFromOrgOrProject(sourceId: string, userId: string, isO // TODO: 等待后端同学的接口 启用或禁用项目 export function enableOrDisableProject(id: string, isEnable = true) { - return MSR.get({ url: `${isEnable ? orgUrl.getEnableOrgUrl : orgUrl.getDisableOrgUrl}${id}` }); + return MSR.get({ url: `${isEnable ? orgUrl.getEnableProjectUrl : orgUrl.getDisableProjectUrl}${id}` }); } diff --git a/frontend/src/api/requrls/setting/system/organizationAndProject.ts b/frontend/src/api/requrls/setting/system/organizationAndProject.ts index d35e63f74e..0bf4e3619c 100644 --- a/frontend/src/api/requrls/setting/system/organizationAndProject.ts +++ b/frontend/src/api/requrls/setting/system/organizationAndProject.ts @@ -46,3 +46,7 @@ export const getProjectInfoUrl = '/system/project/get/'; export const getDeleteProjectUrl = '/system/project/delete/'; // 系统-组织及项目,获取用户下拉选项 export const getUserByOrgOrProjectUrl = '/system/user/get-option/'; +// 启用项目 +export const getEnableProjectUrl = '/system/project/enable/'; +// 禁用项目 +export const getDisableProjectUrl = '/system/project/disable/'; diff --git a/frontend/src/router/routes/modules/apiTest.ts b/frontend/src/router/routes/modules/apiTest.ts index 0d3195f8a2..9c23a06c5d 100644 --- a/frontend/src/router/routes/modules/apiTest.ts +++ b/frontend/src/router/routes/modules/apiTest.ts @@ -9,7 +9,7 @@ const ApiTest: AppRouteRecordRaw = { component: DEFAULT_LAYOUT, meta: { locale: 'menu.apiTest', - icon: 'icon_api-test-filled', + icon: 'icon-icon_api-test-filled', order: 4, hideChildrenInMenu: true, }, diff --git a/frontend/src/router/routes/modules/bugManagement.ts b/frontend/src/router/routes/modules/bugManagement.ts index 4f4300186e..62c681804f 100644 --- a/frontend/src/router/routes/modules/bugManagement.ts +++ b/frontend/src/router/routes/modules/bugManagement.ts @@ -9,7 +9,7 @@ const BugManagement: AppRouteRecordRaw = { component: DEFAULT_LAYOUT, meta: { locale: 'menu.bugManagement', - icon: 'icon_defect', + icon: 'icon-icon_defect', order: 2, hideChildrenInMenu: true, }, diff --git a/frontend/src/router/routes/modules/featureTest.ts b/frontend/src/router/routes/modules/featureTest.ts index a27721eb27..ed2dea9e40 100644 --- a/frontend/src/router/routes/modules/featureTest.ts +++ b/frontend/src/router/routes/modules/featureTest.ts @@ -9,7 +9,7 @@ const FeatureTest: AppRouteRecordRaw = { component: DEFAULT_LAYOUT, meta: { locale: 'menu.featureTest', - icon: 'icon_functional_testing', + icon: 'icon-icon_functional_testing', order: 3, hideChildrenInMenu: true, }, diff --git a/frontend/src/router/routes/modules/performanceTest.ts b/frontend/src/router/routes/modules/performanceTest.ts index eb792666b9..d009b40709 100644 --- a/frontend/src/router/routes/modules/performanceTest.ts +++ b/frontend/src/router/routes/modules/performanceTest.ts @@ -9,7 +9,7 @@ const PerformanceTest: AppRouteRecordRaw = { component: DEFAULT_LAYOUT, meta: { locale: 'menu.performanceTest', - icon: 'icon_performance-test-filled', + icon: 'icon-icon_performance-test-filled', order: 6, hideChildrenInMenu: true, }, diff --git a/frontend/src/router/routes/modules/projectManagement.ts b/frontend/src/router/routes/modules/projectManagement.ts index 1d44b8b50a..6c33e5509e 100644 --- a/frontend/src/router/routes/modules/projectManagement.ts +++ b/frontend/src/router/routes/modules/projectManagement.ts @@ -9,7 +9,7 @@ const ProjectManagement: AppRouteRecordRaw = { component: DEFAULT_LAYOUT, meta: { locale: 'menu.projectManagement', - icon: 'icon_project-settings-filled', + icon: 'icon-icon_project-settings-filled', order: 7, hideChildrenInMenu: true, }, diff --git a/frontend/src/router/routes/modules/testPlan.ts b/frontend/src/router/routes/modules/testPlan.ts index d67694f127..47d5c572d7 100644 --- a/frontend/src/router/routes/modules/testPlan.ts +++ b/frontend/src/router/routes/modules/testPlan.ts @@ -9,7 +9,7 @@ const TestPlan: AppRouteRecordRaw = { component: DEFAULT_LAYOUT, meta: { locale: 'menu.testPlan', - icon: 'icon_test-tracking_filled', + icon: 'icon-icon_test-tracking_filled', order: 1, hideChildrenInMenu: true, }, diff --git a/frontend/src/router/routes/modules/uiTest.ts b/frontend/src/router/routes/modules/uiTest.ts index 2df0255bff..bb8ab541fc 100644 --- a/frontend/src/router/routes/modules/uiTest.ts +++ b/frontend/src/router/routes/modules/uiTest.ts @@ -9,7 +9,7 @@ const UiTest: AppRouteRecordRaw = { component: DEFAULT_LAYOUT, meta: { locale: 'menu.uiTest', - icon: 'icon_ui-test-filled', + icon: 'icon-icon_ui-test-filled', order: 5, hideChildrenInMenu: true, }, diff --git a/frontend/src/router/routes/modules/workplace.ts b/frontend/src/router/routes/modules/workplace.ts index e2ffad9bbc..97d9222783 100644 --- a/frontend/src/router/routes/modules/workplace.ts +++ b/frontend/src/router/routes/modules/workplace.ts @@ -9,7 +9,7 @@ const WorkPlace: AppRouteRecordRaw = { component: DEFAULT_LAYOUT, meta: { locale: 'menu.workplace', - icon: 'icon_pc_filled', + icon: 'icon-icon_pc_filled', order: 0, hideChildrenInMenu: true, }, diff --git a/frontend/src/store/modules/setting/types.ts b/frontend/src/store/modules/setting/types.ts index 383893ab70..0a2dcaf20b 100644 --- a/frontend/src/store/modules/setting/types.ts +++ b/frontend/src/store/modules/setting/types.ts @@ -5,4 +5,6 @@ export interface UserGroupState { currentId: string; // 当前用户类型 currentType: string; + // 菜单开启关闭 + collapse: boolean; } diff --git a/frontend/src/store/modules/setting/usergroup.ts b/frontend/src/store/modules/setting/usergroup.ts index a90a11c50d..6c01bc7e05 100644 --- a/frontend/src/store/modules/setting/usergroup.ts +++ b/frontend/src/store/modules/setting/usergroup.ts @@ -7,6 +7,7 @@ const useUserGroupStore = defineStore('userGroup', { currentTitle: '', currentId: '', currentType: '', + collapse: true, }), getters: { userGroupInfo(state: UserGroupState): UserGroupState { @@ -18,6 +19,10 @@ const useUserGroupStore = defineStore('userGroup', { setInfo(partial: Partial) { this.$patch(partial); }, + // 设置用户组菜单开启关闭 + setCollapse(collapse: boolean) { + this.collapse = collapse; + }, }, }); diff --git a/frontend/src/views/setting/system/organizationAndProject/components/addUserModal.vue b/frontend/src/views/setting/system/organizationAndProject/components/addUserModal.vue index 9bc63e242f..d4686c4f70 100644 --- a/frontend/src/views/setting/system/organizationAndProject/components/addUserModal.vue +++ b/frontend/src/views/setting/system/organizationAndProject/components/addUserModal.vue @@ -75,7 +75,7 @@ const { organizationId, projectId } = props; try { loading.value = true; - await addUserToOrgOrProject({ memberIds: form.name, organizationId, projectId }); + await addUserToOrgOrProject({ userIds: form.name, organizationId, projectId }); Message.success(t('system.organization.addSuccess')); handleCancel(); } catch (error) { diff --git a/frontend/src/views/setting/system/organizationAndProject/components/projectDrawer.vue b/frontend/src/views/setting/system/organizationAndProject/components/projectDrawer.vue index 80770de9c2..b1ce467ca8 100644 --- a/frontend/src/views/setting/system/organizationAndProject/components/projectDrawer.vue +++ b/frontend/src/views/setting/system/organizationAndProject/components/projectDrawer.vue @@ -1,5 +1,6 @@ - - - + +