feat(admin): 访客详情跨天时间线

- 覆写 detail.vue 占位:档案卡(ID/在线/地理/IP/语言时区/设备/首触来源 utm 标签/
  落地页截断 tooltip)+ 统计 4 项 + 轨迹/会话 Tab
- 轨迹 Tab:按日倒序分组(日期头含会话数)、会话块(时间·来源·active_ms 求和停留)、
  el-timeline 事件行(page_view/page_stay 独立条目/sdk_loaded 图标区分)、
  7/30/90 天切换(reqSeq 守卫)、truncated 提示条、空态
- 会话 Tab:全量会话表,行点击开抽屉看单会话事件序列(getSession)
- keepAlive:onMounted/onActivated/query-watch 三入口统一 ensureLoad,
  loadedVid 去重(query 清空时重置令牌),切访客必刷新
- 顺车 Minor:formatStay 注释与代码对齐;useTable 背对背 if 改 if/else

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-15 21:05:52 +08:00
parent ba31670095
commit ea561c974a
3 changed files with 618 additions and 10 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ export const formatStay = (ms?: number | null): string => {
if (days) parts.push(`${days}天`)
if (hours) parts.push(`${hours}小时`)
if (minutes) parts.push(`${minutes}分`)
// 秒恒显示(含 0),避免"0秒/不足 1 秒"整行变空
// 仅当非零或无更高单位时显示秒(与下方条件表达式语义一致)
if (seconds || !parts.length) parts.push(`${seconds}秒`)
return parts.join('')
}