diff --git a/yunkes/src/components/staffchat/ChatMain.vue b/yunkes/src/components/staffchat/ChatMain.vue index ec7b740..996cc0f 100644 --- a/yunkes/src/components/staffchat/ChatMain.vue +++ b/yunkes/src/components/staffchat/ChatMain.vue @@ -1,6 +1,6 @@ @@ -101,18 +101,12 @@ const conversationTitle = computed(() => { return isGroup.value ? `群聊记录 · ${displayName}` : `与 ${displayName} 的聊天记录` }) -// ── 日期窗:云客对齐,默认近 14 天;清空 = 全部时间(null) ───────────────────── +// ── 日期窗:默认全部时间(null);选窗后按窗过滤,清空回到全部 ────────────────── // route.query 合法 ms start/end 仍优先(带日期窗的跳转入口,如红包明细)。 - -/** 近 14 天窗:今天往前 13 天的 00:00:00 ~ 今天 23:59:59.999。 */ -function defaultRange(): [Date, Date] { - const end = new Date() - end.setHours(23, 59, 59, 999) - const start = new Date() - start.setDate(start.getDate() - 13) - start.setHours(0, 0, 0, 0) - return [start, end] -} +// 2026-08-27 前 defaultRange() 默认近 14 天——实测 78% 群/89% 单聊的最新消息 +// 在任意 14 天窗之外,这些会话打开即全空(用户报「很多聊天记录都是空的」); +// 云客默认直接展示最近消息不限窗,故对齐改为默认全部。前端本就「首屏跳到 +// 最后一页看最新 + 上翻加载更旧」,全量窗下首屏仍只拉一页,性能无忧。 function rangeFromQuery(): [Date, Date] | null { const s = route.query.start, @@ -125,7 +119,7 @@ function rangeFromQuery(): [Date, Date] | null { return null } -const dateRange = ref<[Date, Date] | null>(rangeFromQuery() ?? defaultRange()) +const dateRange = ref<[Date, Date] | null>(rangeFromQuery() ?? null) const winStart = computed(() => dateRange.value?.[0].getTime()) const winEnd = computed(() => dateRange.value?.[1].getTime()) const keyword = ref('') @@ -442,7 +436,10 @@ const drawerTitle = computed(() => {