feat(系统&组织): 替换创建项目增加默认资源池字段

This commit is contained in:
xinxin.wu 2024-10-08 14:44:20 +08:00 committed by Craftsman
parent ff94d2f49e
commit 1904145444
5 changed files with 16 additions and 14 deletions

View File

@ -26,7 +26,7 @@ export interface CreateOrUpdateSystemProjectParams {
// 资源池
resourcePoolIds: string[];
// 列表里的
all: boolean; // 默认全部资源池
allResourcePool: boolean; // 默认全部资源池
}
export interface CreateOrUpdateOrgProjectParams {
@ -64,5 +64,5 @@ export interface OrgProjectTableItem {
orgAdmins: Record<string, any>;
moduleIds: string[];
resourcePoolList: ResourcePoolItem[];
all: boolean;
allResourcePool: boolean;
}

View File

@ -75,14 +75,14 @@
</a-form-item>
<a-form-item
v-if="showPool"
field="all"
field="allResourcePool"
class="!mb-0"
:label="t('system.project.resourcePool')"
asterisk-position="end"
:rules="[{ required: showPool, message: t('system.project.poolIsNotNull') }]"
>
<!-- TOTO 等待联调 -->
<a-radio-group v-model="form.all" class="mb-[16px]">
<a-radio-group v-model="form.allResourcePool" class="mb-[16px]">
<a-radio :value="true">
{{ t('system.project.allResPool') }}
</a-radio>
@ -90,7 +90,7 @@
</a-radio-group>
</a-form-item>
<a-form-item
v-if="!form.all"
v-if="!form.allResourcePool"
field="resourcePoolIds"
hide-asterisk
hide-label
@ -216,7 +216,7 @@
resourcePoolIds: [],
enable: true,
moduleIds: allModuleIds,
all: true,
allResourcePool: true,
});
const currentVisible = defineModel<boolean>('visible', {

View File

@ -315,7 +315,8 @@
}
const showAddProjectModal = (record: OrgProjectTableItem) => {
const { id, name, description, enable, adminList, organizationId, moduleIds, resourcePoolList, all } = record;
const { id, name, description, enable, adminList, organizationId, moduleIds, resourcePoolList, allResourcePool } =
record;
currentUpdateProject.value = {
id,
name,
@ -325,7 +326,7 @@
organizationId,
moduleIds,
resourcePoolIds: resourcePoolList.map((item: { id: string }) => item.id),
all,
allResourcePool,
};
addProjectVisible.value = true;
};

View File

@ -73,14 +73,14 @@
</a-form-item>
<a-form-item
v-if="showPool"
field="all"
field="allResourcePool"
asterisk-position="end"
:label="t('system.project.resourcePool')"
:rules="[{ required: showPool, message: t('system.project.poolIsNotNull') }]"
class="!mb-0"
>
<!-- TOTO 等待联调 -->
<a-radio-group v-model="form.all" class="mb-[16px]">
<a-radio-group v-model="form.allResourcePool" class="mb-[16px]">
<a-radio :value="true">
{{ t('system.project.allResPool') }}
</a-radio>
@ -88,7 +88,7 @@
</a-radio-group>
</a-form-item>
<a-form-item
v-if="!form.all"
v-if="!form.allResourcePool"
field="resourcePoolIds"
hide-asterisk
hide-label
@ -213,7 +213,7 @@
enable: true,
moduleIds: allModuleIds,
resourcePoolIds: [],
all: true,
allResourcePool: true,
});
const currentVisible = defineModel<boolean>('visible', {

View File

@ -265,7 +265,8 @@
}
const showAddProjectModal = (record: OrgProjectTableItem) => {
const { id, name, description, enable, adminList, organizationId, moduleIds, resourcePoolList, all } = record;
const { id, name, description, enable, adminList, organizationId, moduleIds, resourcePoolList, allResourcePool } =
record;
addProjectVisible.value = true;
currentUpdateProject.value = {
id,
@ -276,7 +277,7 @@
organizationId,
moduleIds,
resourcePoolIds: resourcePoolList.map((item: { id: string }) => item.id),
all,
allResourcePool,
};
};