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> </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; iconType: string;
maxSize: number; // MB maxSize: number; // MB
sizeUnit: 'MB' | 'KB'; // sizeUnit: 'MB' | 'KB'; //
isLimit: boolean; //
}> & { }> & {
accept: UploadType; accept: UploadType;
fileList: FileItem[]; fileList: FileItem[];
@ -71,6 +72,7 @@
const props = withDefaults(defineProps<UploadProps>(), { const props = withDefaults(defineProps<UploadProps>(), {
showSubText: true, showSubText: true,
isLimit: true,
}); });
const emit = defineEmits(['update:fileList']); const emit = defineEmits(['update:fileList']);
@ -114,7 +116,7 @@
} }
const maxSize = props.maxSize || defaultMaxSize; const maxSize = props.maxSize || defaultMaxSize;
const _maxSize = props.sizeUnit === 'MB' ? maxSize * 1024 * 1024 : maxSize * 1024; 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')); Message.warning(t('ms.upload.overSize'));
return Promise.resolve(false); return Promise.resolve(false);
} }

View File

@ -39,8 +39,8 @@ export interface ProjectMemberItem {
export interface ActionProjectMember { export interface ActionProjectMember {
userId?: string; userId?: string;
projectId?: string; // 项目ID projectId?: string; // 项目ID
userIds?: (string | number)[]; // 用户ID集合 userIds?: (string | number)[] | string; // 用户ID集合
roleIds?: string[]; // 用户组ID集合 roleIds?: (string | number)[] | string; // 用户组ID集合
} }
export interface ProjectUserOption { export interface ProjectUserOption {
@ -55,3 +55,9 @@ export interface SearchParams {
projectId: string; projectId: string;
keyword: ''; keyword: '';
} }
export interface AddProjectMember {
projectId?: string;
userIds: string[] | string;
roleIds: string[] | string;
}

View File

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

View File

@ -231,3 +231,29 @@ export function findNodeByKey<T>(trees: TreeNode<T>[], targetKey: string, custom
return null; // 如果在整个树形数组中都没有找到匹配的节点,则返回 null 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>
<div class="label-item"> <div class="label-item">
<span class="label">{{ t('project.basicInfo.organization') }}</span> <span class="label">{{ t('project.basicInfo.organization') }}</span>
<span class="rounded bg-[--color-text-n8] px-2 py-[2px]">疯狂的刚子</span> <MsTag>疯狂的刚子疯狂的刚子疯狂的刚子疯狂的刚子疯狂的刚子疯狂的刚子</MsTag>
</div> </div>
<div class="label-item"> <div class="label-item">
<span class="label">{{ t('project.basicInfo.createTime') }}</span> <span class="label">{{ t('project.basicInfo.createTime') }}</span>
@ -46,6 +46,7 @@
import { useI18n } from '@/hooks/useI18n'; import { useI18n } from '@/hooks/useI18n';
import useModal from '@/hooks/useModal'; import useModal from '@/hooks/useModal';
import UpdateProjectModal from './components/updateProjectModal.vue'; import UpdateProjectModal from './components/updateProjectModal.vue';
import MsTag from '@/components/pure/ms-tag/ms-tag.vue';
const { t } = useI18n(); const { t } = useI18n();
const { openModal } = useModal(); 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 ><a-button class="mr-3" type="primary" @click="addMember">{{ t('project.member.addMember') }}</a-button></div
> >
<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> <a-option v-for="item of userGroupAll" :key="item.id" :value="item.id">{{ t(item.name) }}</a-option>
<template #prefix <template #prefix
><span>{{ t('project.member.tableColumnUserGroup') }}</span></template ><span>{{ t('project.member.tableColumnUserGroup') }}</span></template
@ -84,7 +84,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onBeforeMount, onMounted } from 'vue'; import { ref, onBeforeMount } from 'vue';
import { useI18n } from '@/hooks/useI18n'; import { useI18n } from '@/hooks/useI18n';
import MsBaseTable from '@/components/pure/ms-table/base-table.vue'; import MsBaseTable from '@/components/pure/ms-table/base-table.vue';
import useTable from '@/components/pure/ms-table/useTable'; import useTable from '@/components/pure/ms-table/useTable';
@ -106,7 +106,6 @@
import MSBatchModal from '@/components/business/ms-batch-modal/index.vue'; import MSBatchModal from '@/components/business/ms-batch-modal/index.vue';
import { Message } from '@arco-design/web-vue'; import { Message } from '@arco-design/web-vue';
import type { import type {
ProjectTreeData,
ProjectUserOption, ProjectUserOption,
ActionProjectMember, ActionProjectMember,
ProjectMemberItem, ProjectMemberItem,
@ -133,6 +132,8 @@
title: 'project.member.tableColumnName', title: 'project.member.tableColumnName',
dataIndex: 'name', dataIndex: 'name',
showInTable: true, showInTable: true,
width: 200,
showTooltip: true,
}, },
{ {
title: 'project.member.tableColumnPhone', title: 'project.member.tableColumnPhone',
@ -258,7 +259,6 @@
const batchVisible = ref<boolean>(false); const batchVisible = ref<boolean>(false);
const selectData = ref<string[]>([]); const selectData = ref<string[]>([]);
const batchAction = ref(''); const batchAction = ref('');
const treeData = ref<ProjectTreeData[]>([]);
const userGroupOptions = ref<ProjectUserOption[]>([]); const userGroupOptions = ref<ProjectUserOption[]>([]);
const batchModalRef = ref(); const batchModalRef = ref();

View File

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