🐛 修复历史文件过期状态显示

This commit is contained in:
2026-06-05 16:18:17 +08:00
parent 36fe4a7f24
commit 21a17012c8
2 changed files with 8 additions and 1 deletions
+1
View File
@@ -114,6 +114,7 @@ export interface AnalyticsFileRow {
upload_count?: number
upload_traffic?: number | string
current: boolean
expired?: boolean
deleted?: boolean
created_at?: string
uploaded_at?: string
+7 -1
View File
@@ -703,7 +703,7 @@
{{ formatHistoryBytes(file.download_traffic) }}
</td>
<td class="px-4 py-3 text-sm" :class="[mutedTextClass]">
{{ file.deleted ? '已删除' : file.current ? '现存' : '历史' }}
{{ getHistoryStatusLabel(file) }}
</td>
</tr>
</template>
@@ -1613,6 +1613,12 @@ const handleHistoryPageSizeChange = (size: number) => {
const formatHistoryBytes = (value: number | string | undefined) =>
formatFileSize(Number(value || 0), 1)
const formatHistoryDate = (value?: string) => (value ? formatTimestamp(value) : '-')
const getHistoryStatusLabel = (file: AnalyticsFileRow) => {
if (file.deleted) return '已删除'
if (file.expired) return '已过期'
if (file.current) return '现存'
return '历史'
}
const primaryTextClass = computed(() => (isDarkMode.value ? 'text-white' : 'text-gray-900'))
const mutedTextClass = computed(() => (isDarkMode.value ? 'text-gray-400' : 'text-gray-500'))