From 15711f3a31c28e9fd8df638236af39a7f7f4ff41 Mon Sep 17 00:00:00 2001 From: RubyLiu Date: Fri, 22 Sep 2023 18:33:53 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=A2=9E=E5=8A=A0=E8=B5=84=E6=BA=90=E6=B1=A0?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/setting/organizationAndProject.ts | 8 ++++ .../requrls/setting/organizationAndProject.ts | 2 + .../business/ms-system-pool/MsSystemPool.vue | 40 +++++++++++++++++++ .../models/setting/system/orgAndProject.ts | 4 ++ .../project/components/addProjectModal.vue | 17 +++++++- .../organization/project/locale/en-US.ts | 1 + .../organization/project/locale/zh-CN.ts | 1 + .../organization/project/orgProject.vue | 3 +- .../components/addProjectModal.vue | 22 +++++++--- .../components/systemProject.vue | 8 ++-- 10 files changed, 93 insertions(+), 13 deletions(-) create mode 100644 frontend/src/components/business/ms-system-pool/MsSystemPool.vue diff --git a/frontend/src/api/modules/setting/organizationAndProject.ts b/frontend/src/api/modules/setting/organizationAndProject.ts index df46d47dbd..5e50f3851d 100644 --- a/frontend/src/api/modules/setting/organizationAndProject.ts +++ b/frontend/src/api/modules/setting/organizationAndProject.ts @@ -167,3 +167,11 @@ export function getUserByProjectByOrg(organizationId: string, projectId: string, params: { keyword }, }); } + +// 系统或组织-获取项目下的资源池options +export function getPoolOptionsByOrgOrSystem(organizationId?: string) { + return MSR.get({ + url: orgUrl.getProjectPoolByOrgOrSystemUrl, + params: { organizationId }, + }); +} diff --git a/frontend/src/api/requrls/setting/organizationAndProject.ts b/frontend/src/api/requrls/setting/organizationAndProject.ts index a8848bd39e..b611c96011 100644 --- a/frontend/src/api/requrls/setting/organizationAndProject.ts +++ b/frontend/src/api/requrls/setting/organizationAndProject.ts @@ -86,3 +86,5 @@ export const getDeleteProjectByOrgUrl = '/organization/project/delete/'; export const getUserByOrganizationOrProjectUrl = '/organization/project/user-member-list/'; // 获取管理员下拉选项 export const getAdminByOrganizationOrProjectUrl = '/organization/project/user-admin-list/'; +// 系统或组织-获取项目资源池下拉选项 +export const getProjectPoolByOrgOrSystemUrl = '/system/project/pool-options'; diff --git a/frontend/src/components/business/ms-system-pool/MsSystemPool.vue b/frontend/src/components/business/ms-system-pool/MsSystemPool.vue new file mode 100644 index 0000000000..dda038ade6 --- /dev/null +++ b/frontend/src/components/business/ms-system-pool/MsSystemPool.vue @@ -0,0 +1,40 @@ + + + diff --git a/frontend/src/models/setting/system/orgAndProject.ts b/frontend/src/models/setting/system/orgAndProject.ts index 28e23f4315..cb1b25946f 100644 --- a/frontend/src/models/setting/system/orgAndProject.ts +++ b/frontend/src/models/setting/system/orgAndProject.ts @@ -21,6 +21,8 @@ export interface CreateOrUpdateSystemProjectParams { moduleIds?: string[]; // 所属组织 organizationId?: string; + // 资源池 + resourcePoolIds: string[]; // 列表里的 } @@ -31,6 +33,7 @@ export interface CreateOrUpdateOrgProjectParams { enable?: boolean; userIds?: string[]; organizationId?: string; + resourcePoolIds?: string[]; } export interface SystemOrgOption { @@ -54,4 +57,5 @@ export interface OrgProjectTableItem { createTime: number; memberCount: number; userIds: string[]; + resourcePoolIds: string[]; } diff --git a/frontend/src/views/setting/organization/project/components/addProjectModal.vue b/frontend/src/views/setting/organization/project/components/addProjectModal.vue index f30e341883..ab792bb63e 100644 --- a/frontend/src/views/setting/organization/project/components/addProjectModal.vue +++ b/frontend/src/views/setting/organization/project/components/addProjectModal.vue @@ -23,13 +23,14 @@ :label="t('system.project.name')" :rules="[{ required: true, message: t('system.project.projectNameRequired') }]" > - + + + + - + @@ -93,6 +102,7 @@ import useLicenseStore from '@/store/modules/setting/license'; import { useAppStore } from '@/store'; import { UserRequesetTypeEnum } from '@/components/business/ms-user-selector/utils'; + import MsSystemPool from '@/components/business/ms-system-pool/MsSystemPool.vue'; const { t } = useI18n(); const props = defineProps<{ @@ -127,6 +137,7 @@ userIds: [], organizationId: currentOrgId.value, description: '', + resourcePoolIds: [], enable: true, moduleIds: [], }); @@ -148,6 +159,7 @@ form.description = ''; form.enable = true; form.moduleIds = []; + form.resourcePoolIds = []; }; const handleCancel = (shouldSearch: boolean) => { formReset(); @@ -193,6 +205,7 @@ form.userIds = props.currentProject.userIds; form.organizationId = props.currentProject.organizationId; form.moduleIds = props.currentProject.moduleIds; + form.resourcePoolIds = props.currentProject.resourcePoolIds; } }); diff --git a/frontend/src/views/setting/organization/project/locale/en-US.ts b/frontend/src/views/setting/organization/project/locale/en-US.ts index b826e346d4..f179d191fb 100644 --- a/frontend/src/views/setting/organization/project/locale/en-US.ts +++ b/frontend/src/views/setting/organization/project/locale/en-US.ts @@ -73,4 +73,5 @@ export default { 'system.project.affiliatedOrgRequired': 'Affiliated organization cannot be empty', 'system.project.createProjectSuccess': 'Create project success', 'system.project.updateProjectSuccess': 'Update project success', + 'system.project.resourcePool': 'Resource pool', }; diff --git a/frontend/src/views/setting/organization/project/locale/zh-CN.ts b/frontend/src/views/setting/organization/project/locale/zh-CN.ts index db38a044f5..9b925994e8 100644 --- a/frontend/src/views/setting/organization/project/locale/zh-CN.ts +++ b/frontend/src/views/setting/organization/project/locale/zh-CN.ts @@ -68,4 +68,5 @@ export default { 'system.project.affiliatedOrgRequired': '所属组织不能为空', 'system.project.createProjectSuccess': '创建项目成功', 'system.project.updateProjectSuccess': '更新项目成功', + 'system.project.resourcePool': '资源池', }; diff --git a/frontend/src/views/setting/organization/project/orgProject.vue b/frontend/src/views/setting/organization/project/orgProject.vue index 5d68f7e1ab..840ce28f50 100644 --- a/frontend/src/views/setting/organization/project/orgProject.vue +++ b/frontend/src/views/setting/organization/project/orgProject.vue @@ -250,7 +250,7 @@ }; const showAddProjectModal = (record: any) => { - const { id, name, description, enable, adminList, organizationId, moduleIds } = record; + const { id, name, description, enable, adminList, organizationId, moduleIds, resourcePoolList } = record; currentUpdateProject.value = { id, name, @@ -259,6 +259,7 @@ userIds: adminList.map((item: UserItem) => item.id), organizationId, moduleIds, + resourcePoolIds: resourcePoolList.map((item: { id: string }) => item.id), }; addProjectVisible.value = true; }; diff --git a/frontend/src/views/setting/system/organizationAndProject/components/addProjectModal.vue b/frontend/src/views/setting/system/organizationAndProject/components/addProjectModal.vue index 63ebb10605..e5f1d6e463 100644 --- a/frontend/src/views/setting/system/organizationAndProject/components/addProjectModal.vue +++ b/frontend/src/views/setting/system/organizationAndProject/components/addProjectModal.vue @@ -1,7 +1,6 @@
- + - - - + + + + + +