fix: use uploadTime instead of reportDate for display timestamps
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
<h3 class="font-semibold text-slate-800 text-lg">{{ report.fileName }}</h3>
|
||||
<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="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-500">{{ report.size }}</span>
|
||||
</div>
|
||||
@@ -135,6 +135,13 @@ const renderedMarkdown = computed(() => {
|
||||
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(() => props.report, async (newReport) => {
|
||||
pdfUrl.value = null
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
<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" />
|
||||
</svg>
|
||||
{{ report.reportDate || '未知时间' }}
|
||||
{{ formatDate(report.uploadTime) }}
|
||||
</div>
|
||||
|
||||
<!-- 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 iconClass = computed(() => {
|
||||
|
||||
Reference in New Issue
Block a user