diff --git a/frontend/src/components/upload/index.vue b/frontend/src/components/upload/index.vue index 4052ff72f..c1efa85b6 100644 --- a/frontend/src/components/upload/index.vue +++ b/frontend/src/components/upload/index.vue @@ -17,7 +17,15 @@
- +
{{ $t('database.dropHelper') }} @@ -48,7 +56,7 @@
- + {{ $t('commons.button.upload') }} @@ -128,7 +136,7 @@ import { reactive, ref } from 'vue'; import { computeSize } from '@/utils/util'; import i18n from '@/lang'; -import { UploadFile, UploadFiles, UploadInstance } from 'element-plus'; +import { UploadFile, UploadFiles, UploadInstance, genFileId } from 'element-plus'; import { File } from '@/api/interface/file'; import DrawerHeader from '@/components/drawer-header/index.vue'; import { BatchDeleteFile, CheckFile, ChunkUploadFileData, GetUploadList } from '@/api/modules/files'; @@ -280,6 +288,13 @@ const handleClose = () => { upVisible.value = false; }; +const handleExceed: UploadProps['onExceed'] = (files) => { + uploadRef.value!.clearFiles(); + const file = files[0] as UploadRawFile; + file.uid = genFileId(); + uploadRef.value!.handleStart(file); +}; + const onSubmit = async () => { if (uploaderFiles.value.length !== 1) { return;