From bbf321fc96797b4918e2aa5dbff696c3e87ca929 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Mon, 4 Aug 2025 17:28:25 +0800 Subject: [PATCH] fix: improve file list management by limiting to max files and filtering oversized files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1059967 --user=刘瑞斌 【应用】高级编排上传文件最大数量设置为100,上传101个文件,不显示上传的文件,对话时上传文件为空 https://www.tapd.cn/62980211/s/1748567 --- .../ai-chat/component/chat-input-operate/index.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/src/components/ai-chat/component/chat-input-operate/index.vue b/ui/src/components/ai-chat/component/chat-input-operate/index.vue index 7560e549f..dcdb8aa9f 100644 --- a/ui/src/components/ai-chat/component/chat-input-operate/index.vue +++ b/ui/src/components/ai-chat/component/chat-input-operate/index.vue @@ -423,13 +423,14 @@ const uploadFile = async (file: any, fileList: any) => { uploadOtherList.value.length if (file_limit_once >= maxFiles) { MsgWarning(t('chat.uploadFile.limitMessage1') + maxFiles + t('chat.uploadFile.limitMessage2')) - fileList.splice(0, fileList.length) + fileList.splice(0, fileList.length, ...fileList.slice(0, maxFiles)) return } if (fileList.filter((f: any) => f.size > fileLimit * 1024 * 1024).length > 0) { // MB MsgWarning(t('chat.uploadFile.sizeLimit') + fileLimit + 'MB') - fileList.splice(0, fileList.length) + // 只保留未超出大小限制的文件 + fileList.splice(0, fileList.length, ...fileList.filter((f: any) => f.size <= fileLimit * 1024 * 1024)) return } const inner = reactive(file)