diff --git a/app/components/DocumentList.vue b/app/components/DocumentList.vue new file mode 100644 index 0000000..26487e5 --- /dev/null +++ b/app/components/DocumentList.vue @@ -0,0 +1,65 @@ + + + + + {{ doc.caption || doc.name }} + + 大小: {{ formatFileSize(doc.size) }} + 格式: {{ formatFileExtension(doc.ext) }} + + 下载 + + + + + + + + + + \ No newline at end of file diff --git a/app/pages/productions/[...slug].vue b/app/pages/productions/[...slug].vue index 975e106..62485d5 100644 --- a/app/pages/productions/[...slug].vue +++ b/app/pages/productions/[...slug].vue @@ -36,22 +36,7 @@ - - - - {{ doc.caption || doc.name }} - - 大小: {{ formatFileSize(doc.size) }} - 格式: {{ formatFileExtension(doc.ext) }} - - 下载 - - - - - + @@ -94,20 +79,6 @@ const activeName = ref('details') // 默认选中概览标签 // 获取路由参数(slug 或 id) const documentId = computed(() => route.params.slug as string) -const downloadFile = async (filename: string, url: string) => { - const response = await fetch(url) - const blob = await response.blob() - const fileUrl = window.URL.createObjectURL(blob) - - const link = document.createElement('a') - link.href = fileUrl - link.download = filename - document.body.appendChild(link) - link.click() - document.body.removeChild(link) - window.URL.revokeObjectURL(fileUrl) -} - onMounted(async () => { try { const response = await findOne('productions', documentId.value, { @@ -203,28 +174,6 @@ useHead({ margin: 0; } -.document-list { - display: flex; - flex-direction: column; - gap: 1rem; - margin-top: 1rem; -} - -.document-meta { - color: var(--el-text-color-secondary); - font-size: 0.8rem; -} - -.download-button { - margin-left: auto; -} - -.document-content { - display: flex; - align-items: center; - gap: 1rem; -} - .loading { display: flex; justify-content: center;