Skip to content

Commit 14d011d

Browse files
fix: Firefox browser compatibility with drag and drop upload issues
1 parent 753bf5f commit 14d011d

File tree

2 files changed

+9
-1
lines changed
  • ui/src
    • components/ai-chat/component/chat-input-operate
    • views/application-workflow

2 files changed

+9
-1
lines changed

ui/src/components/ai-chat/component/chat-input-operate/index.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@
182182
@keydown.enter="sendChatHandle($event)"
183183
@paste="handlePaste"
184184
@drop="handleDrop"
185+
@dragover.prevent="handleDragOver"
185186
/>
186187

187188
<div class="operate flex align-center">
@@ -488,6 +489,7 @@ const handlePaste = (event: ClipboardEvent) => {
488489
// 阻止默认粘贴行为
489490
event.preventDefault()
490491
}
492+
491493
// 新增拖拽处理
492494
const handleDrop = (event: DragEvent) => {
493495
if (!props.applicationDetails.file_upload_enable) return
@@ -507,6 +509,12 @@ const handleDrop = (event: DragEvent) => {
507509
uploadFile(elFile, [elFile])
508510
})
509511
}
512+
513+
const handleDragOver = (event: DragEvent) => {
514+
if (event.dataTransfer) {
515+
event.dataTransfer.dropEffect = 'copy' // Firefox需要这一行来允许放置操作
516+
}
517+
}
510518
// 语音录制任务id
511519
const intervalId = ref<any | null>(null)
512520
// 语音录制开始秒数

ui/src/views/application-workflow/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="header border-b flex-between p-12-24">
44
<div class="flex align-center">
55
<back-button @click="back"></back-button>
6-
<h4 class="ellipsis-1" style="width: 50%" :title="detail?.name">{{ detail?.name }}</h4>
6+
<h4 class="ellipsis" style="max-width: 270px" :title="detail?.name">{{ detail?.name }}</h4>
77
<div v-if="showHistory && disablePublic">
88
<el-text type="info" class="ml-16 color-secondary"
99
>{{ $t('views.applicationWorkflow.info.previewVersion') }}

0 commit comments

Comments
 (0)