diff --git a/app/components/DocumentList.vue b/app/components/DocumentList.vue index 0061070..bffe955 100644 --- a/app/components/DocumentList.vue +++ b/app/components/DocumentList.vue @@ -4,6 +4,7 @@ v-for="(doc, index) in documents" :key="index" class="document-card" + @click="handleClick(doc.fileId)" >

{{ doc.title }}

@@ -15,13 +16,6 @@ >格式: {{ formatFileExtension(getFileExtension(doc.filename)) }} - - 下载 -
@@ -36,6 +30,15 @@ }, }); + const localePath = useLocalePath(); + + const handleClick = (id: string) => { + // 获取路由参数 + if (id) { + navigateTo(localePath(`/download/${id}`)); + } + }; + const handleDownload = async (fileName: string, fileUrl: string) => { const response = await fetch(fileUrl); const blob = await response.blob(); @@ -59,6 +62,16 @@ width: 100%; } + .document-card { + cursor: pointer; + transition: all 0.3s ease; + } + + .document-card:hover { + transform: translateY(-1px); + box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); + } + .document-meta { font-size: 0.8rem; color: var(--el-text-color-secondary); diff --git a/app/components/FilePreviewer.vue b/app/components/FilePreviewer.vue new file mode 100644 index 0000000..fded256 --- /dev/null +++ b/app/components/FilePreviewer.vue @@ -0,0 +1,177 @@ +