From ff143f980a179a167279b695fc51350882b88968 Mon Sep 17 00:00:00 2001 From: R2m1liA <15258427350@163.com> Date: Tue, 28 Oct 2025 14:35:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0preview=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E7=94=A8=E4=BA=8E=E6=96=87=E4=BB=B6=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - preview路由预览文件 - FilePreviewer组件 - 删除Document卡片的下载按钮,使用单独的页面用于文件下载 - preview布局 --- app/components/DocumentList.vue | 7 -- app/components/FilePreviewer.vue | 177 +++++++++++++++++++++++++++++++ app/layouts/preview.vue | 5 + app/pages/preview/[id].vue | 13 +++ 4 files changed, 195 insertions(+), 7 deletions(-) create mode 100644 app/components/FilePreviewer.vue create mode 100644 app/layouts/preview.vue create mode 100644 app/pages/preview/[id].vue diff --git a/app/components/DocumentList.vue b/app/components/DocumentList.vue index 22bb95a..bffe955 100644 --- a/app/components/DocumentList.vue +++ b/app/components/DocumentList.vue @@ -16,13 +16,6 @@ >格式: {{ formatFileExtension(getFileExtension(doc.filename)) }} - - 下载 - 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 @@ + + + + + + + {{ fileMeta.filename_download }} + + + {{ fileMeta.type }} · {{ formatedSize }} · {{ formatedDate }} + + + + + + 在新标签打开 + + + 下载 + + + + + + + + 正在加载... + + + {{ errorText }} + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/layouts/preview.vue b/app/layouts/preview.vue new file mode 100644 index 0000000..56a8b72 --- /dev/null +++ b/app/layouts/preview.vue @@ -0,0 +1,5 @@ + + + + + diff --git a/app/pages/preview/[id].vue b/app/pages/preview/[id].vue new file mode 100644 index 0000000..379ac47 --- /dev/null +++ b/app/pages/preview/[id].vue @@ -0,0 +1,13 @@ + + + + +
+ {{ fileMeta.type }} · {{ formatedSize }} · {{ formatedDate }} +