From 14d011d61d80f2f87f9dd471996d0fa99dbbc3ac Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Tue, 22 Jul 2025 17:36:54 +0800 Subject: [PATCH] fix: Firefox browser compatibility with drag and drop upload issues --- .../ai-chat/component/chat-input-operate/index.vue | 8 ++++++++ ui/src/views/application-workflow/index.vue | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) 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 de3c86b88..0df6a1658 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 @@ -182,6 +182,7 @@ @keydown.enter="sendChatHandle($event)" @paste="handlePaste" @drop="handleDrop" + @dragover.prevent="handleDragOver" />
@@ -488,6 +489,7 @@ const handlePaste = (event: ClipboardEvent) => { // 阻止默认粘贴行为 event.preventDefault() } + // 新增拖拽处理 const handleDrop = (event: DragEvent) => { if (!props.applicationDetails.file_upload_enable) return @@ -507,6 +509,12 @@ const handleDrop = (event: DragEvent) => { uploadFile(elFile, [elFile]) }) } + +const handleDragOver = (event: DragEvent) => { + if (event.dataTransfer) { + event.dataTransfer.dropEffect = 'copy' // Firefox需要这一行来允许放置操作 + } +} // 语音录制任务id const intervalId = ref(null) // 语音录制开始秒数 diff --git a/ui/src/views/application-workflow/index.vue b/ui/src/views/application-workflow/index.vue index d623968a9..e6a95cbf0 100644 --- a/ui/src/views/application-workflow/index.vue +++ b/ui/src/views/application-workflow/index.vue @@ -3,7 +3,7 @@
-

{{ detail?.name }}

+

{{ detail?.name }}

{{ $t('views.applicationWorkflow.info.previewVersion') }}