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
+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">
<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(() => {