diff --git a/web/src/views/CompanyDashboard.vue b/web/src/views/CompanyDashboard.vue index 55e2c5d..b9bbc01 100644 --- a/web/src/views/CompanyDashboard.vue +++ b/web/src/views/CompanyDashboard.vue @@ -430,7 +430,7 @@ {{ msg.role === 'user' ? '收到指令' : '产出回复' }} - {{ formatTimeline(msg.timestamp) }} + 🕐 {{ formatTimelineAbsolute(msg.timestamp) }} 📌 {{ msg.taskId }}
{{ msg.conversationTitle }}
@@ -950,6 +950,20 @@ function formatTimeline(ts) { return d.toLocaleString('zh-CN', { month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' }) } +function formatTimelineAbsolute(ts) { + if (!ts) return '' + const d = new Date(ts) + const time = d.toLocaleString('zh-CN', { month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' }) + const now = new Date() + const diffMs = now.getTime() - d.getTime() + let relative = '' + if (diffMs < 60000) relative = '刚刚' + else if (diffMs < 3600000) relative = `${Math.floor(diffMs / 60000)}分钟前` + else if (diffMs < 86400000) relative = `${Math.floor(diffMs / 3600000)}小时前` + else relative = `${Math.floor(diffMs / 86400000)}天前` + return `${time}(${relative})` +} + onMounted(() => { loadCompanies() loadTemplates() @@ -1641,7 +1655,11 @@ function closeDropdown() { .timeline-role-badge.user { background: rgba(59,130,246,0.12); color: var(--blue-text, #60a5fa); } .timeline-role-badge.assistant { background: rgba(16,185,129,0.12); color: var(--accent-light); } -.timeline-time { font-size: 10px; color: var(--text-faint); } +.timeline-time { + font-size: 11px; color: var(--text-secondary); font-weight: 500; + padding: 1px 6px; border-radius: 4px; + background: var(--bg-surface-hover); +} .timeline-task-badge { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: rgba(251,191,36,0.1); color: var(--yellow-text, #fbbf24);