From 2d93f31be75f6aec723f6d98d70a3a9f813c8b28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Tue, 25 Aug 2026 11:59:30 +0800 Subject: [PATCH] =?UTF-8?q?docs(spec):=20=E5=90=B8=E6=94=B6=E8=AF=84?= =?UTF-8?q?=E5=AE=A1=E5=BB=BA=E8=AE=AE(=E6=97=B6=E9=97=B4s=E2=86=92ms?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2/msg=5Ftype=E6=98=A0=E5=B0=84=E6=8E=A8?= =?UTF-8?q?=E5=AF=BC=E6=B3=A8=E6=98=8E/moments=E5=A4=B4=E9=83=A8=E6=9D=A5?= =?UTF-8?q?=E6=BA=90/=E7=BB=9F=E8=AE=A1=E5=85=A8tab=E6=98=8E=E7=BB=86/WIP?= =?UTF-8?q?=E8=BF=98=E5=8E=9F=E6=98=8E=E7=A1=AE/=E7=A9=BA=E6=80=81?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- .../2026-08-25-yunke-staff-chat-window-design.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/superpowers/specs/2026-08-25-yunke-staff-chat-window-design.md b/docs/superpowers/specs/2026-08-25-yunke-staff-chat-window-design.md index 487964c..8fcf9e5 100644 --- a/docs/superpowers/specs/2026-08-25-yunke-staff-chat-window-design.md +++ b/docs/superpowers/specs/2026-08-25-yunke-staff-chat-window-design.md @@ -75,7 +75,8 @@ StaffChat.vue (页面骨架) ``` - `SessionPane`/`ChatMain` 从 `ChatSidebar`/`ChatTimeline` 复制改造(非原地重构);`MessageBubble`、`buildMessageSections` 直接复用 -- `ChatTimeline.vue`/`ChatSidebar.vue` 不动,WA 继续用;未提交 WIP(`sidebarProfile` 传参、`delete_flag` query 类型)随本设计消化:ChatTimeline 还原 WIP,`delete_flag` 参数由新 sessions API 取代 +- `ChatTimeline.vue`/`ChatSidebar.vue` 不动,WA 继续用。**当前未提交 WIP 直接还原(git checkout),不迁移**:`ChatTimeline.vue` 的 `sidebarProfile`/`ownerPhone`/`ownerAvatar` 三处、`api/index.ts` 的 `delete_flag` 参数——新页面自建,旧文件回到干净状态 +- `talkerId` 为空(账号级入口,从员工列表昵称点入):右列显示空态「选择左侧会话查看消息」(与现有 ChatTimeline 行为一致),中列正常展示会话列表 - 入口改造:`StaffList.vue` 微信行昵称/主badge → `/staff-chat/{account_id}/single`;modal 内点客户微信带日期窗 query;`CustomerList.vue` 微信行「查看聊天记录」同步切新页 ## 4. 数据层 @@ -96,7 +97,7 @@ StaffChat.vue (页面骨架) ### 4.2 新抓取实体 `moments`(页面 fetch 方式) -- 浏览器 `fetch POST getFriendsterInfo`,`pageSize=100` 逐员工翻页到 `hashNext=false` +- 浏览器 `fetch POST getFriendsterInfo`,`pageSize=100` 逐员工翻页到 `hashNext=false`;**`createTime` 云客返回秒,入库前 ×1000 统一转 ms**(否则渲染 1970、水位逻辑错位) - 接入 `scrape_via_page.py` 实体注册、`full_sync_all.sh` 加一步、调度 4h 增量(水位=本地 max(create_time),仅扫有新朋友圈的员工——云客接口无 per-员工增量标记,简化为全量浅扫第一页有新才继续) - 图片接入现有 media 本地化批处理(OSS URL 型) @@ -106,9 +107,9 @@ StaffChat.vue (页面骨架) |---|---| | `GET /api/accounts` | `AccountOut` + `avatar`(从 `raw_json.headImageUrl` 提取,WA 侧无此键则 null) | | `GET /api/sessions` | + `is_del` 参数(join `customer.delete_flag`,NULL 视为 0);行 + `pinned`(`talker_id='filehelper'`) | -| `GET /api/moments` 新 | `?wechat_id=&page=&page_size=` 帖子 desc + 头部 `{nickname, avatar, alias}` | -| `GET /api/staff-stats` 新 | `?wechat_id=&start=&end=` 计数;`&kind=` 明细行 | -| `GET /api/messages` | + `msg_type` 过滤(映射云客 10 类)+ `q` 全文关键词(聊天记录模式用) | +| `GET /api/moments` 新 | `?wechat_id=&page=&page_size=` 帖子 desc + 头部 `{nickname, avatar, alias}`(头部取自 `wechat_account` 表/nick_name + `raw_json.headImageUrl`,不在 moments_post 存) | +| `GET /api/staff-stats` 新 | `?wechat_id=&start=&end=` 计数;`&kind=` 明细行(**除敏感词外全部 tab 都出明细行**,本地表聚合) | +| `GET /api/messages` | + `msg_type` 过滤 + `q` 全文关键词(聊天记录模式用)。**msg_type→本地 type_raw 映射在 plan 第一阶段从 message 表实数据推导并记录**(如 语音消息/语音通话/视频通话 需不同 raw 签名,47/50/类型分布待实测) | ### 4.4 统计口径(现有表本地聚合)