diff --git a/src/utils/business/format.ts b/src/utils/business/format.ts index 50982bd..f3437f6 100644 --- a/src/utils/business/format.ts +++ b/src/utils/business/format.ts @@ -155,7 +155,7 @@ export function formatDateRange(startDate: string, endDate: string): string { /** * 格式化日期时间 - * @param date 日期字符串或时间戳 + * @param date 日期字符串或时间戳(支持Unix时间戳秒,自动检测) * @param format 格式化模板,默认 'YYYY-MM-DD HH:mm:ss' * @returns 格式化后的日期字符串 */ @@ -165,7 +165,14 @@ export function formatDateTime( ): string { if (!date) return '-' - const d = new Date(date) + let d: Date + const numDate = typeof date === 'string' ? Number(date) : date + if (typeof numDate === 'number' && numDate > 1000000000 && numDate < 2000000000) { + d = new Date(numDate * 1000) + } else { + d = new Date(date) + } + if (isNaN(d.getTime())) return '-' const year = d.getFullYear() diff --git a/src/views/asset-management/asset-information/components/CurrentPackageCard.vue b/src/views/asset-management/asset-information/components/CurrentPackageCard.vue index f7ebe39..ff44b54 100644 --- a/src/views/asset-management/asset-information/components/CurrentPackageCard.vue +++ b/src/views/asset-management/asset-information/components/CurrentPackageCard.vue @@ -32,69 +32,140 @@ + + + @@ -111,12 +182,12 @@ {{ getPackageTypeName(currentPackage.package_type) }} - - - - - - + + {{ currentPackage.virtual_ratio || '-' }} + {{ formatDateTime(currentPackage.start_time) || '-' }} @@ -212,6 +283,46 @@ border-radius: 8px; margin-bottom: 20px; + .flow-stats-container { + display: flex; + gap: 40px; + + .flow-stat-section { + flex: 1; + min-width: 0; + + .flow-stat-label { + font-size: 13px; + color: var(--el-text-color-secondary); + margin-bottom: 8px; + font-weight: 500; + } + + .flow-stat-row { + display: flex; + gap: 16px; + margin-bottom: 8px; + + .stat-item { + display: flex; + align-items: baseline; + gap: 4px; + + .stat-label { + font-size: 12px; + color: var(--el-text-color-secondary); + } + + .stat-value { + font-size: 14px; + font-weight: 600; + color: var(--el-text-color-primary); + } + } + } + } + } + .flow-stats-row { display: flex; gap: 32px; @@ -237,6 +348,12 @@ .flow-progress-bar { padding: 0 4px; + + .progress-label { + font-size: 12px; + color: var(--el-text-color-secondary); + margin-bottom: 4px; + } } } diff --git a/src/views/asset-management/asset-information/components/PackageListCard.vue b/src/views/asset-management/asset-information/components/PackageListCard.vue index ab91739..86d4da7 100644 --- a/src/views/asset-management/asset-information/components/PackageListCard.vue +++ b/src/views/asset-management/asset-information/components/PackageListCard.vue @@ -55,46 +55,117 @@ - + @@ -187,9 +258,16 @@ import { formatDateTime } from '@/utils/business/format' import type { AssetPackageUsageRecord } from '@/types/api' import { useAuth } from '@/composables/useAuth' + import { useUserStore } from '@/store/modules/user' + import { storeToRefs } from 'pinia' import CreateRefundDialog from '@/components/business/CreateRefundDialog.vue' const { hasAuth } = useAuth() + const userStore = useUserStore() + const { info: userInfo } = storeToRefs(userStore) + const isAdminOrPlatform = computed( + () => userInfo.value.user_type === 1 || userInfo.value.user_type === 2 + ) // 退款申请对话框 const createRefundDialogVisible = ref(false)