diff --git a/frontend/src/components/pure/ms-tag/ms-tag.vue b/frontend/src/components/pure/ms-tag/ms-tag.vue index 5434af4043..a3c4265718 100644 --- a/frontend/src/components/pure/ms-tag/ms-tag.vue +++ b/frontend/src/components/pure/ms-tag/ms-tag.vue @@ -113,4 +113,18 @@ }); - + diff --git a/frontend/src/components/pure/ms-upload/index.vue b/frontend/src/components/pure/ms-upload/index.vue index 44fddd2652..a1d77ee444 100644 --- a/frontend/src/components/pure/ms-upload/index.vue +++ b/frontend/src/components/pure/ms-upload/index.vue @@ -64,6 +64,7 @@ iconType: string; maxSize: number; // 文件大小限制,单位 MB sizeUnit: 'MB' | 'KB'; // 文件大小单位 + isLimit: boolean; // 是否限制文件大小 }> & { accept: UploadType; fileList: FileItem[]; @@ -71,6 +72,7 @@ const props = withDefaults(defineProps(), { showSubText: true, + isLimit: true, }); const emit = defineEmits(['update:fileList']); @@ -114,7 +116,7 @@ } const maxSize = props.maxSize || defaultMaxSize; const _maxSize = props.sizeUnit === 'MB' ? maxSize * 1024 * 1024 : maxSize * 1024; - if (file.size > _maxSize) { + if (props.isLimit && file.size > _maxSize) { Message.warning(t('ms.upload.overSize')); return Promise.resolve(false); } diff --git a/frontend/src/models/projectManagement/projectAndPermission.ts b/frontend/src/models/projectManagement/projectAndPermission.ts index d3ef30d483..3e4446623b 100644 --- a/frontend/src/models/projectManagement/projectAndPermission.ts +++ b/frontend/src/models/projectManagement/projectAndPermission.ts @@ -39,8 +39,8 @@ export interface ProjectMemberItem { export interface ActionProjectMember { userId?: string; projectId?: string; // 项目ID - userIds?: (string | number)[]; // 用户ID集合 - roleIds?: string[]; // 用户组ID集合 + userIds?: (string | number)[] | string; // 用户ID集合 + roleIds?: (string | number)[] | string; // 用户组ID集合 } export interface ProjectUserOption { @@ -55,3 +55,9 @@ export interface SearchParams { projectId: string; keyword: ''; } + +export interface AddProjectMember { + projectId?: string; + userIds: string[] | string; + roleIds: string[] | string; +} diff --git a/frontend/src/models/setting/member.ts b/frontend/src/models/setting/member.ts index 9f1333a7bc..1ae084ba32 100644 --- a/frontend/src/models/setting/member.ts +++ b/frontend/src/models/setting/member.ts @@ -47,13 +47,14 @@ export interface AddorUpdateMemberModel { export interface BatchAddProjectModel { organizationId?: string; memberIds?: Array; - projectIds?: string[]; - userRoleIds?: string[]; + projectIds?: string[] | string; + userRoleIds?: string[] | string; } // 用户组下拉列表 export interface LinkItem { id: string; name: string; + disabled?: boolean; } export type LinkList = LinkItem[]; diff --git a/frontend/src/utils/index.ts b/frontend/src/utils/index.ts index 8608823652..7fe218c49c 100644 --- a/frontend/src/utils/index.ts +++ b/frontend/src/utils/index.ts @@ -231,3 +231,29 @@ export function findNodeByKey(trees: TreeNode[], targetKey: string, custom return null; // 如果在整个树形数组中都没有找到匹配的节点,则返回 null } + +/** + * 查找一个数组里边的每一项是否在另外一个数组里边,如果存在返回[],否则返回不存在项的新数组 + * @param nameMap 目标项 + * @param dataMap 查找项 + * @returns 返回不存在项的新数组 + */ +export function filterItem(nameMap: Record[], dataMap: Record[]) { + // 对数组 nameMap 中的每一项进行判断 + const isExist = nameMap.every((item) => { + return dataMap.some((otherItem) => { + return item.id === otherItem.id; + }); + }); + + if (isExist) { + return []; + } + // 找出不在数组 dataMap 中的项放入新数组 + const filterNotExistOptions = dataMap.filter((item) => { + return !nameMap.some((otherItem) => { + return item.id === otherItem.id; + }); + }); + return filterNotExistOptions; +} diff --git a/frontend/src/views/project-management/projectAndPermission/basicInfos/index.vue b/frontend/src/views/project-management/projectAndPermission/basicInfos/index.vue index 62c986b87d..00ff63bc4e 100644 --- a/frontend/src/views/project-management/projectAndPermission/basicInfos/index.vue +++ b/frontend/src/views/project-management/projectAndPermission/basicInfos/index.vue @@ -29,7 +29,7 @@
{{ t('project.basicInfo.organization') }} - 疯狂的刚子 + 疯狂的刚子疯狂的刚子疯狂的刚子疯狂的刚子疯狂的刚子疯狂的刚子
{{ t('project.basicInfo.createTime') }} @@ -46,6 +46,7 @@ import { useI18n } from '@/hooks/useI18n'; import useModal from '@/hooks/useModal'; import UpdateProjectModal from './components/updateProjectModal.vue'; + import MsTag from '@/components/pure/ms-tag/ms-tag.vue'; const { t } = useI18n(); const { openModal } = useModal(); diff --git a/frontend/src/views/project-management/projectAndPermission/member/index.vue b/frontend/src/views/project-management/projectAndPermission/member/index.vue index f5e32cd5dd..a36ded917e 100644 --- a/frontend/src/views/project-management/projectAndPermission/member/index.vue +++ b/frontend/src/views/project-management/projectAndPermission/member/index.vue @@ -4,7 +4,7 @@ >{{ t('project.member.addMember') }}
- + {{ t(item.name) }}