docs(plan): step5 plan 评审修复(删 getMessages import + Task4 显式替换说明)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
- `ChatGroup` 模型([models.py:259](../../../yunke-server/app/db/models.py)):`room_id`(PK)/`channel`/`room_name`/`owner_account_id`/`head_image_url`/`last_chat_time`;索引 `ix_chat_group_owner(channel, owner_account_id, room_id)`。
|
||||
- `Customer`:`friend_id`(PK)/`channel`/`owner_account_id`/`friend_remark`/`friend_nickname`/`real_name`/`head_image_url`。
|
||||
- `Message`:`channel`/`owner_account_id`/`talker_id`/`room_id`(NULL/空=私聊)/`timestamp`(ms-epoch);索引 `ix_message_channel_owner_talker_time`。
|
||||
- staff_chat_stats 先例([staff_chat_stats.py](../../../yunke-server/app/api/routers/staff_chat_stats.py)):`session.bind.name` 方言检测、`GROUP BY`、`sa.case` 计数、`_customer_names` **Python 侧 IN 查询合并**(非 SQL join)。本 plan /api/sessions 照此。
|
||||
- staff_chat_stats 先例([staff_chat_stats.py](../../../yunke-server/app/api/routers/staff_chat_stats.py)):`GROUP BY` + `sa.case` 计数 + `_customer_names` **Python 侧 IN 查询合并**(非 SQL join)。本 plan /api/sessions 照此。注:today_count 用数值 `timestamp >= today_start` 比较,**无需** staff_chat_stats 的跨库日期方言分支(更简单)。
|
||||
- Python 3.12 → `zoneinfo.ZoneInfo("Asia/Shanghai")` 可用。
|
||||
- ChatTimeline 现状([ChatTimeline.vue](../../../yunkes/src/views/ChatTimeline.vue)):`defineProps<{channel,ownerId,talkerId?,roomId?}>`;Task2 加的 `windowStart/windowEnd`(computed from `route.query`)、`queryFor`(带 `hasWindow` 成对 start/end)、`watch([props..., windowStart, windowEnd])`、`onMounted(loadInitial)`;模板 header(返回+title+subtitle)+ stream + drawer。
|
||||
- 路由 [router/index.ts:61-75](../../../yunkes/src/router/index.ts):`/chat/:channel/:ownerId/:talkerId` + `/group/:channel/:ownerId/:roomId`,`name:'chat'`/`'group-chat'`,`props:true`。
|
||||
@@ -471,7 +471,7 @@ async function viewChat(row: Account) {
|
||||
}
|
||||
```
|
||||
|
||||
> `getMessages` import 若仅 viewChat 用则保留(其它地方可能用);onMounted/其它不动。删除 viewChat 内的 ElMessage 提示(账号级总有效)。
|
||||
> **删 import**:`getMessages` 现仅 viewChat 用(StaffList.vue:254);改账号级后无消费者——**必须从 line 5 import 移除**(`getAccounts, getCustomers, getStaffChatStats`),否则 `noUnusedLocals` 报 vue-tsc 错。`getCustomers`(WA openAdded/openTalked 用)保留。onMounted/其它不动;删 viewChat 内的 `ElMessage` 提示(账号级总有效)。
|
||||
|
||||
- [ ] **Step 3: ChatTimeline 双栏化(模板 + script)**
|
||||
|
||||
@@ -576,6 +576,7 @@ const keyword = ref('')
|
||||
|
||||
function onDateChange() { loadInitial() } // 改窗 → 重查当前会话
|
||||
```
|
||||
**重要替换**:删除 Task2 的 `windowStart`/`windowEnd`(route.query computed)与 `hasWindow` 逻辑——本 step 的 `winStart`/`winEnd`(上面 computed)取代之;`subtitle`(Task2 用 windowStart/windowEnd)**改用 winStart/winEnd**;`queryFor`/`watch` 见 Step2/Step5。
|
||||
|
||||
- [ ] **Step 2: `queryFor` 用 winStart/winEnd**(替换 Task2 的 hasWindow/windowStart/windowEnd)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user