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 @@
- + - - - + + + + + +