Commit Graph

38 Commits

Author SHA1 Message Date
浅念 2e526cd056 feat(staff-friends): 员工客户列表独立页——对齐云客员工详情,好友数/微信群数下钻
员工列表点「好友数」原先跳全局 /customers?owner_account_id=x,布局与全局
列表无异且计数/分页绑全局声明口径(同日 dfa4fdd 修的显示 bug),与云客
「员工名下客户列表」体验割裂。新页 /staff-friends/:ownerId/:tab:

- 微信客户/微信群两 tab(对齐云客截图);标题=员工显示名(入口直带,
  直链经 /api/accounts 解析),返回箭头回员工列表
- 搜索(昵称/微信号/备注名/手机号,服务端 q)+ 查询/导出 CSV
- 发送/接收条数=Customer.send_num/receive_num 累计值(CustomerOut 补
  两列,同步自云客 friend 记录,与截图同源)
- 勾选批量「导出聊天记录」:新端点 GET /api/export/chat-html-zip,复用
  chat-html 渲染器每会话一个 HTML 打 zip(文件名=备注>昵称>friend_id,
  非法字符清洗;单会话 5000 行截断告警;一次上限 50 会话防误选打爆)
- 行内:查看聊天记录→staff-chat;导出HTML聊天记录(时间范围弹窗)
- WA 行保持原入口(该页暂仅微信)

后端 605 测试绿(zip 新 4 例);本地浏览器端到端验证:过滤 9 条/勾选
激活/群 tab/返回箭头;zip 产物 application/zip 双会话双气泡。

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-08 16:14:44 +08:00
浅念 9ba8063ca8 feat(chat): 跳转入口全部改为全时段进入(用户定调:聊天记录不做时间限制)
排查全部聊天展示路径后清掉最后的两处带窗跳转:CallList 通话行的「通话
当天」定位窗(当日早些时候为对齐云客 ?start= 加的)与 StaffList 统计弹窗
的统计时段窗;WA 分支的 ?start= 本就被 ChatTimeline 的 start+end 成对
校验忽略,属死代码一并移除。现状:所有聊天视图默认全部时间(会话列表/
消息接口本就无时间下限),日期过滤只保留聊天窗内的手动日期选择器。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-27 16:30:52 +08:00
浅念 50635d0df8 feat(staffchat): 入口改造(StaffList/CustomerList微信行切新页)+useStaffProfile缓存+StatsPane固定列/金额格式+vitest依赖化
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-25 19:56:22 +08:00
浅念 65ddcf988f fix(staff): \u5f39\u6846\u8865\u56de\u5458\u5de5\u4fe1\u606f\u5217(\u8bef\u5220)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-25 10:57:47 +08:00
浅念 c96f638bab fix(staff): 弹框富单元格TS修(Col加type字段+删unused staffInfo)+后端staff-chat-stats补head_image_url/real_name 2026-08-25 10:27:29 +08:00
浅念 b6eea3070a feat(staff): 弹框客户微信/员工微信列改富单元格(头像+昵称+ID+真实姓名,对齐云客)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-25 10:24:07 +08:00
浅念 0d19289fba feat(staff): 沟通数弹框加汇总说明(对齐云客:总X人次,重复Y,剩余Z条,玉绿左边框)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-25 10:08:44 +08:00
浅念 b0923409fb fix(wa): viewCustomers带channel query(原缺whatsapp致WA客户页默认微信tab)+tab query watch
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-24 15:42:20 +08:00
浅念 dcd1c2d178 feat(wa): WA客户列表加群列表子tab(好友/群两tab对齐云客)+员工列表群聊按钮跳子tab
- CustomerList whatsapp tab 加子tab切换(好友列表|群列表)
- 群列表内嵌 WA 群表格(序号/员工/群名/消息数/查看聊天)
- StaffList WA viewGroups 跳 /customers?tab=groups(不再跳 /groups)
- WA 群数据 317 个(wa-groups 重扫)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-24 15:28:39 +08:00
浅念 01842a0abf feat(ui): 可点击元素统一玉绿示意(链接悬停下划线+行悬停首列染玉绿+会话侧栏玉绿激活;修StaffList灰色覆盖把link按钮染灰的bug)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-22 15:54:05 +08:00
浅念 aa90d9d8f2 feat(ui): 列表页移除tab结构(每渠道独立页面,由侧栏菜单驱动)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-15 13:41:49 +08:00
浅念 9b21584e9a feat(ui): 左侧菜单改分组式(微信管理/WhatsApp管理+下拉子菜单,对齐云客布局)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-15 12:09:55 +08:00
浅念 02f95af279 fix(ui): 所有列表页默认分页改为10条(原20条)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-15 11:32:33 +08:00
浅念 edd6a27371 feat(ui): 所有列表页加CSV导出按钮(全量拉取+中文BOM兼容Excel)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-15 10:31:21 +08:00
浅念 20cf2c51f0 feat(staff): 员工详情独立页(StaffDetail.vue,替代 drawer 降级,对齐云客 userDetailNew)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-11 17:05:01 +08:00
浅念 0cc9408371 feat(staff): WA员工 modal 列对齐云客(序号/员工信息/员工WhatsApp/客户WhatsApp/添加时间/最后沟通)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-11 14:58:38 +08:00
浅念 05d1e41d31 fix(staff): 默认统计窗改近30天(覆盖smoke.db数据范围,数字不再全0) 2026-08-11 13:53:55 +08:00
浅念 4ee19cb9d9 chore(ui): 删除冗余 AccountList 页,/accounts 重定向 /staff(总 spec 收尾)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-08 17:16:26 +08:00
浅念 8f166a9c18 feat(chat): ChatTimeline 双栏化(左会话列表)+ 路由可选参 + badge 账号级入口
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-08 15:23:26 +08:00
浅念 7405ac5fc9 feat(staff): stat modal 列对齐云客(序号/员工信息/员工微信) + 客户微信可点带窗跳聊天
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-08 13:46:59 +08:00
浅念 5fd9878c38 fix(staff): on-demand modal 拉取仅在日期窗未变时回写缓存
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-07 18:58:30 +08:00
浅念 f51623d652 feat(staff): 微信 5 数字 modal 换本地数据源(metric 过滤 + 合成分页)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-07 18:52:07 +08:00
浅念 cab8ab95dc fix(staff): loadWechatStats 加载竞态守卫(token)+ 重查时清空旧窗数字
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-07 18:50:02 +08:00
浅念 876767cd68 feat(staff): StaffList 微信 5 数字改读本地 summary + 日期选择器(Phase A 接线)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-07 18:42:19 +08:00
浅念 b63b71bf68 feat(staff): 微信员工明细 modal 内客户微信 → 聊天记录(二级操作)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-06 17:47:02 +08:00
浅念 6a30bef21b feat(staff): 微信员工 主badge→聊天 + 员工姓名→drawer(纠正手机号误判)
云客跳详情页的是员工姓名(button+history),非手机号;手机号不可点。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-06 17:43:45 +08:00
浅念 b9055b5714 feat(staff): 微信员工及时回复 2 数字 → 明细 modal(回复率不可点)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-06 17:40:24 +08:00
浅念 c00522fc07 feat(staff): 微信员工沟通数 3 数字 → 明细 modal(补 Plan1 误判漏做的操作)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-06 17:37:08 +08:00
浅念 20b01ab849 fix(staff): review fixes — CSS ellipsis, owner_account_id scoping, viewChat guard
1. .yk-staffinfo__nick display:block (ellipsis now applies to WA inline span). 2. openAdded/openTalked modal use owner_account_id (always present) instead of user_id! (null would leak whole customer table). 3. viewChat guards null talker+room + awaits router.push. 4. WA 添加人数 title → 客户列表 (honest: WA has no add_time, shows all).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-05 19:25:24 +08:00
浅念 5bf43fc67b feat(staff): wechat stat-number/nickname → navigation
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-05 19:15:05 +08:00
浅念 16149fd499 feat(staff): WhatsApp nickname → chat timeline
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-05 19:09:24 +08:00
浅念 dfdd0595d2 feat(staff): action buttons → filtered customer/group list
Adds groups.user_id filter; viewCustomers/viewGroups push owner_account_id query; CustomerList/GroupList read it.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-05 19:06:27 +08:00
浅念 02a709ba93 fix(staff): format time columns in detail modal
YkStaffDetailModal Col gains optional formatter; baseCustomerCols time cols render via formatTime instead of raw epoch.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-05 18:58:06 +08:00
浅念 55578cf299 feat(staff): WhatsApp stat-number click → detail modal
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-05 18:56:27 +08:00
浅念 5336431025 feat(staff): align StaffList columns to 云客 backend
WeChat tab: 6 compound columns mirroring wechatlist (员工信息/数据更新·最新消息时间/好友数/消息数/沟通数/及时回复). WhatsApp tab: 10 columns incl 操作 mirroring waBusiness/userlist. Fixes string-time bug (lastUpdate/uploadTime parsed as number showed --; cellTimeText renders strings).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-05 18:30:12 +08:00
浅念 62dc663294 feat: employee page with channel tabs (WeChat/WhatsApp account lists)
Replace the sparse staff-record table on /staff with a channel-tabbed
employee account view mirroring the 云客 backend's 员工微信列表 +
WhatsApp 员工列表. Each tab loads /api/accounts?channel=<channel> with
its own pagination state; rows open the existing account all-fields
drawer (reused from AccountList via accountFields.ts).

WeChat tab columns: 头像/微信昵称/微信号/手机号/员工姓名/好友数/群数/
发送/接收/数据库大小/在职/在线状态/最后更新. WhatsApp tab columns:
头像(el-avatar initials)/昵称/员工姓名/手机/销售手机/好友数/群数/
联系人数/新增好友/在职/最后更新. Reads raw_json via the structured-first
readField helper; tolerates boolean and 1/0 forms of isOnJob/onlineStatus.

Also fix the avatar field key in accountFields.ts (headImageUrl, with
headImgUrl as a legacy alias) so the WeChat drawer avatar renders — the
upstream wxUser record uses headImageUrl.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-05 14:13:21 +08:00
浅念 6ac47a1203 feat: full-field display for message/staff/accounts (raw_json + drawers)
Replicates the Customer all-fields pattern across the remaining three
entities. Backend now exposes `raw_json` on MessageOut / StaffOut /
AccountOut so the frontend can render every 云客 source field without a
second endpoint. Each entity gains a Chinese-label field utility + an
el-drawer surfacing all fields (structured-first, raw_json fallback,
unknown keys under 其他).

Backend:
- schemas.py: add `raw_json: dict | None` to MessageOut / StaffOut /
  AccountOut. MessageOut/StaffOut pick the column up via from_attributes;
  AccountOut is built explicitly in the router, which now threads
  `raw_json` through from both WechatAccount and WhatsappAccount rows.
- tests: new raw_json serialization tests for messages, staff, accounts
  (assert populated dict round-trips verbatim + NULL serializes as null).

Frontend (yunkes/):
- New utils: messageFields.ts, staffFields.ts, accountFields.ts — each
  with a 中文 label map, ordered groups, structured-column preference,
  and an 其他 fallback for unknown raw_json keys.
- Message: clicking a chat bubble opens an all-fields drawer (referMsg
  renders as pretty-printed JSON). Image preview + file download links
  stopPropagation so their own interactions still work.
- Staff: row click → drawer; columns relabeled (员工ID, 销售手机).
- Accounts: new AccountList.vue at /accounts with a 账号 nav item,
  unified WeChat/WhatsApp table (渠道/账号ID/昵称/微信号/归属员工/好友数/
  群数/收发/在职/最后更新), channel filter, pagination, row-click drawer.
- api: add Account type + getAccounts(); add raw_json to Message/Staff.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-01 17:47:50 +08:00
浅念 0df53c6b1a fix: wechat account scrape (form-data+dates) + frontend staff page
Backend (scrape_wechat_accounts):
- Send wxUser/list as form-urlencoded (not JSON) with the REQUIRED filters
  isOnJob / departmentId / startdate / enddate + empty userId/salesname/
  weChatNickName, matching the live request (empty fails with code -90000).
- scrape_wechat_accounts now takes department_id (the company-root dept id)
  plus optional start/end defaulting to a recent 7-day UTC window.
- paginate_by_page gains a form=True mode (data= + form content-type).
- Orchestrator sync_wechat_accounts resolves the root dept from the
  Department table (or accepts one) and skips with a warning when unknown.
- seed_accounts.py resolves the root via scrape_departments.

Frontend (yunkes):
- Add StaffList.vue (/staff) with is_on_job filter + pagination.
- Add /staff route and a 员工 nav item between 客户 and 群.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-01 17:11:17 +08:00