fix(项目管理): 微调样式和类型修改license文件上传不限制大小bug

This commit is contained in:
xinxin.wu 2023-09-05 18:10:03 +08:00 committed by 刘瑞斌
parent bdcc5854a2
commit 4557504b0a
8 changed files with 62 additions and 11 deletions

View File

@ -113,4 +113,18 @@
});
</script>
<style scoped lang="less"></style>
<style lang="less">
.arco-tag {
.arco-icon {
font-size: 14px !important;
color: var(--color-text-4) !important;
&:hover {
font-size: 14px;
color: var(--color-text-1) !important;
}
}
.arco-icon-hover.arco-tag-icon-hover::before {
background: none !important;
}
}
</style>

View File

@ -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<UploadProps>(), {
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);
}

View File

@ -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;
}

View File

@ -47,13 +47,14 @@ export interface AddorUpdateMemberModel {
export interface BatchAddProjectModel {
organizationId?: string;
memberIds?: Array<string | number>;
projectIds?: string[];
userRoleIds?: string[];
projectIds?: string[] | string;
userRoleIds?: string[] | string;
}
// 用户组下拉列表
export interface LinkItem {
id: string;
name: string;
disabled?: boolean;
}
export type LinkList = LinkItem[];

View File

@ -231,3 +231,29 @@ export function findNodeByKey<T>(trees: TreeNode<T>[], targetKey: string, custom
return null; // 如果在整个树形数组中都没有找到匹配的节点,则返回 null
}
/**
* [],
* @param nameMap
* @param dataMap
* @returns
*/
export function filterItem(nameMap: Record<string, any>[], dataMap: Record<string, any>[]) {
// 对数组 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;
}

View File

@ -29,7 +29,7 @@
</div>
<div class="label-item">
<span class="label">{{ t('project.basicInfo.organization') }}</span>
<span class="rounded bg-[--color-text-n8] px-2 py-[2px]">疯狂的刚子</span>
<MsTag>疯狂的刚子疯狂的刚子疯狂的刚子疯狂的刚子疯狂的刚子疯狂的刚子</MsTag>
</div>
<div class="label-item">
<span class="label">{{ t('project.basicInfo.createTime') }}</span>
@ -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();

View File

@ -4,7 +4,7 @@
><a-button class="mr-3" type="primary" @click="addMember">{{ t('project.member.addMember') }}</a-button></div
>
<div>
<a-select v-model="roleIds" allow-search @change="changeSelect">
<a-select v-model="roleIds" @change="changeSelect">
<a-option v-for="item of userGroupAll" :key="item.id" :value="item.id">{{ t(item.name) }}</a-option>
<template #prefix
><span>{{ t('project.member.tableColumnUserGroup') }}</span></template
@ -84,7 +84,7 @@
</template>
<script setup lang="ts">
import { ref, onBeforeMount, onMounted } from 'vue';
import { ref, onBeforeMount } from 'vue';
import { useI18n } from '@/hooks/useI18n';
import MsBaseTable from '@/components/pure/ms-table/base-table.vue';
import useTable from '@/components/pure/ms-table/useTable';
@ -106,7 +106,6 @@
import MSBatchModal from '@/components/business/ms-batch-modal/index.vue';
import { Message } from '@arco-design/web-vue';
import type {
ProjectTreeData,
ProjectUserOption,
ActionProjectMember,
ProjectMemberItem,
@ -133,6 +132,8 @@
title: 'project.member.tableColumnName',
dataIndex: 'name',
showInTable: true,
width: 200,
showTooltip: true,
},
{
title: 'project.member.tableColumnPhone',
@ -258,7 +259,6 @@
const batchVisible = ref<boolean>(false);
const selectData = ref<string[]>([]);
const batchAction = ref('');
const treeData = ref<ProjectTreeData[]>([]);
const userGroupOptions = ref<ProjectUserOption[]>([]);
const batchModalRef = ref();

View File

@ -87,6 +87,7 @@
<MsUpload
v-model:file-list="fileList"
accept="none"
:is-limit="false"
:show-sub-text="false"
:show-file-list="false"
:auto-upload="false"