✨ 优化发送上传状态与移动端界面
This commit is contained in:
1 parent
c2f0bf1675
commit
84ddf92b20
4 files changed
+52
-5
No files matched your search
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div
|
||||
class="rounded-2xl p-8 flex flex-col items-center justify-center border-2 border-dashed transition-all duration-300 group cursor-pointer relative min-h-72 overflow-hidden"
|
||||
class="rounded-2xl p-5 sm:p-8 flex flex-col items-center justify-center border-2 border-dashed transition-all duration-300 group cursor-pointer relative min-h-56 sm:min-h-72 overflow-hidden"
|
||||
:class="[
|
||||
isDarkMode
|
||||
? 'bg-gray-800/60 border-gray-600 hover:border-indigo-400'
|
||||
@@ -64,7 +64,7 @@
|
||||
]"
|
||||
>
|
||||
<span v-if="selectedFiles && selectedFiles.length > 1" class="block">
|
||||
<span v-for="(f, i) in selectedFiles" :key="i" class="block truncate">{{ f.name }}</span>
|
||||
<span v-for="f in uniqueFiles.slice(0, 3)" :key="fileKey(f)" class="block truncate">{{ f.name }}</span>
|
||||
</span>
|
||||
<span v-else class="block break-words line-clamp-2">
|
||||
{{ displayText }}
|
||||
@@ -214,6 +214,17 @@ const displayText = computed(() => {
|
||||
return placeholderText.value
|
||||
})
|
||||
|
||||
const uniqueFiles = computed(() => {
|
||||
const seen = new Set<string>()
|
||||
return props.selectedFiles.filter((file) => {
|
||||
const key = `${file.name}-${file.size}-${file.lastModified}`
|
||||
if (seen.has(key)) return false
|
||||
seen.add(key)
|
||||
return true
|
||||
})
|
||||
})
|
||||
const fileKey = (file: File) => `${file.name}-${file.size}-${file.lastModified}`
|
||||
|
||||
const statusIcon = computed(() => {
|
||||
if (isUploading.value) return LoaderIcon
|
||||
if (isSuccess.value) return CheckCircleIcon
|
||||
|
||||
Reference in new issue
Block a user