mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: Firefox browser compatibility with drag and drop upload issues
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
This commit is contained in:
parent
753bf5f777
commit
14d011d61d
|
|
@ -182,6 +182,7 @@
|
|||
@keydown.enter="sendChatHandle($event)"
|
||||
@paste="handlePaste"
|
||||
@drop="handleDrop"
|
||||
@dragover.prevent="handleDragOver"
|
||||
/>
|
||||
|
||||
<div class="operate flex align-center">
|
||||
|
|
@ -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<any | null>(null)
|
||||
// 语音录制开始秒数
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<div class="header border-b flex-between p-12-24">
|
||||
<div class="flex align-center">
|
||||
<back-button @click="back"></back-button>
|
||||
<h4 class="ellipsis-1" style="width: 50%" :title="detail?.name">{{ detail?.name }}</h4>
|
||||
<h4 class="ellipsis" style="max-width: 270px" :title="detail?.name">{{ detail?.name }}</h4>
|
||||
<div v-if="showHistory && disablePublic">
|
||||
<el-text type="info" class="ml-16 color-secondary"
|
||||
>{{ $t('views.applicationWorkflow.info.previewVersion') }}
|
||||
|
|
|
|||
Loading…
Reference in New Issue