From f35f88a0cfd81ee97c50749c06339a154658f955 Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Thu, 11 Apr 2024 14:37:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=94=A8=E4=BE=8B=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=A1=86=E4=B8=8A=E9=87=8D=E6=96=B0=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E5=90=8C=E5=90=8D=E6=96=87=E4=BB=B6=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1038960 --user=王旭 【用例管理】用例导入,重新上传不会覆盖原文件,导致上传失败; https://www.tapd.cn/55049933/s/1494609 --- frontend/src/components/pure/ms-upload/index.vue | 12 ++++++++---- .../components/export/exportCaseModal.vue | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/pure/ms-upload/index.vue b/frontend/src/components/pure/ms-upload/index.vue index 1d8395ba3a..6e001495cd 100644 --- a/frontend/src/components/pure/ms-upload/index.vue +++ b/frontend/src/components/pure/ms-upload/index.vue @@ -95,6 +95,7 @@ cutHeight: number; // 被剪切高度 fileTypeTip?: string; // 上传文件类型错误提示 limit: number; // 限制上传文件数量 + allowRepeat?: boolean; // 自定义上传文件框,是否允许重复文件名替换 }> & { accept: UploadType; }; @@ -104,6 +105,7 @@ isLimit: true, isAllScreen: false, cutHeight: 110, + allowRepeat: false, }); const emit = defineEmits(['update:fileList', 'change']); @@ -126,10 +128,12 @@ async function beforeUpload(file: File) { if (innerFileList.value.length > 0) { // 附件上传校验名称重复 - const isRepeat = innerFileList.value.filter((item) => item.name === file.name && item.local).length >= 1; - if (isRepeat) { - Message.warning(t('ms.add.attachment.repeatFileTip')); - return Promise.resolve(false); + if (!props.allowRepeat) { + const isRepeat = innerFileList.value.filter((item) => item.name === file.name && item.local).length >= 1; + if (isRepeat) { + Message.warning(t('ms.add.attachment.repeatFileTip')); + return Promise.resolve(false); + } } if (!props.multiple) { // 单文件上传时,清空之前的文件 diff --git a/frontend/src/views/case-management/caseManagementFeature/components/export/exportCaseModal.vue b/frontend/src/views/case-management/caseManagementFeature/components/export/exportCaseModal.vue index 234c8c25c0..2570fb45e2 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/export/exportCaseModal.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/export/exportCaseModal.vue @@ -41,6 +41,7 @@ " :show-file-list="false" :auto-upload="false" + :allow-repeat="true" :disabled="confirmLoading" :file-type-tip="fileTypeTip" >