fix: use uploadTime instead of reportDate for display timestamps

This commit is contained in:
2026-05-25 23:45:50 +08:00
parent df29e13c26
commit f2172fcef6
2 changed files with 17 additions and 2 deletions
+8 -1
View File
@@ -14,7 +14,7 @@
<h3 class="font-semibold text-slate-800 text-lg">{{ report.fileName }}</h3> <h3 class="font-semibold text-slate-800 text-lg">{{ report.fileName }}</h3>
<div class="mt-1 flex items-center space-x-3 text-sm"> <div class="mt-1 flex items-center space-x-3 text-sm">
<span class="px-2.5 py-1 bg-orange-100 text-orange-600 rounded-full font-medium">{{ fileTypeLabel }}</span> <span class="px-2.5 py-1 bg-orange-100 text-orange-600 rounded-full font-medium">{{ fileTypeLabel }}</span>
<span class="text-slate-500">{{ report.reportDate }}</span> <span class="text-slate-500">{{ formatUploadTime(report.uploadTime) }}</span>
<span class="text-slate-400">·</span> <span class="text-slate-400">·</span>
<span class="text-slate-500">{{ report.size }}</span> <span class="text-slate-500">{{ report.size }}</span>
</div> </div>
@@ -135,6 +135,13 @@ const renderedMarkdown = computed(() => {
return marked(props.content) return marked(props.content)
}) })
const formatUploadTime = (isoString) => {
if (!isoString) return ''
const d = new Date(isoString)
const pad = n => String(n).padStart(2, '0')
return `${d.getFullYear()}-${pad(d.getMonth()+1)}-${pad(d.getDate())}`
}
// Watch for report changes and load PDF preview for PPTX // Watch for report changes and load PDF preview for PPTX
watch(() => props.report, async (newReport) => { watch(() => props.report, async (newReport) => {
pdfUrl.value = null pdfUrl.value = null
+9 -1
View File
@@ -59,7 +59,7 @@
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" /> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" />
</svg> </svg>
{{ report.reportDate || '未知时间' }} {{ formatDate(report.uploadTime) }}
</div> </div>
<!-- Arrow indicator --> <!-- Arrow indicator -->
@@ -113,6 +113,14 @@ const FileIcon = {
} }
} }
// Format uploadTime to display date
const formatDate = (isoString) => {
if (!isoString) return '未知时间'
const d = new Date(isoString)
const pad = n => String(n).padStart(2, '0')
return `${d.getFullYear()}-${pad(d.getMonth()+1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}`
}
const fileIconComponent = computed(() => FileIcon) const fileIconComponent = computed(() => FileIcon)
const iconClass = computed(() => { const iconClass = computed(() => {