Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions web/src/components/DragUploadZone.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ const props = defineProps({
default: 'traditional',
validator: (value) => ['traditional', 'direct'].includes(value),
},
showSelected: {
type: Boolean,
default: false,
},
disabled: {
type: Boolean,
default: false,
Expand Down Expand Up @@ -282,7 +286,7 @@ defineExpose({

<!-- 上传按钮浮动层(仅在非拖拽和非上传状态显示) -->
<div
v-if="!isDragging && !uploading && !disabled"
v-if="!isDragging && !uploading && !disabled && showSelected"
class="absolute top-4 right-4 z-40 flex gap-2"
>
<button
Expand All @@ -298,7 +302,7 @@ defineExpose({
d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
></path>
</svg>
选择文件
上传文件
</button>
<button
@click.stop="triggerFolderInput"
Expand All @@ -313,7 +317,7 @@ defineExpose({
d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"
></path>
</svg>
选择文件夹
上传文件夹
</button>
</div>

Expand Down
1 change: 1 addition & 0 deletions web/src/components/FileFolderSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ onMounted(() => {

<!-- 内容区域 -->
<DragUploadZone
:showSelected="true"
:folder-id="currentFolderId"
:upload-mode="uploadMode"
@upload-complete="handleDragUploadComplete"
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/FileUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ const uploadFiles = async (filesWithPaths) => {
<div class="text-4xl mb-4">📂</div>
<p class="text-lg font-medium mb-4">拖放文件或文件夹到这里</p>
<div class="flex gap-3 justify-center">
<button @click="triggerFileInput" class="btn btn-primary btn-sm">📄 选择文件</button>
<button @click="triggerFolderInput" class="btn btn-secondary btn-sm">📁 选择文件夹</button>
<button @click="triggerFileInput" class="btn btn-primary btn-sm">📄 上传文件</button>
<button @click="triggerFolderInput" class="btn btn-secondary btn-sm">📁 上传文件夹</button>
</div>
<p class="text-xs text-base-content/60 mt-3">
支持拖拽上传,自动保留文件夹结构
Expand Down
1 change: 1 addition & 0 deletions web/src/views/files/FilesView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@ onMounted(async () => {
</div>

<DragUploadZone
:showSelected="false"
v-else
:folder-id="currentFolderId"
:upload-mode="uploadMode"
Expand Down