feat(staffchat): CallList/SearchView 微信行切新员工聊天窗口(入口改造收尾)
与 StaffList/CustomerList 同口径:微信行→staff-chat 新窗(单聊=single tab, 群语音/@chatroom 消息=group tab),WA 行保留旧 ChatTimeline(ChatTimeline 保留给 WA)。通话行跳转带「通话当天」整天下窗——语音通话本身是消息流里的 voice_call 行,当天窗必含该通通话,等价实现旧页 ?start= 滚动定位(新窗 rangeFromQuery 需 start+end 成对)。SearchView 客户抽屉同 CustomerList。 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -277,40 +277,54 @@ function viewCallCustomer(row: PhoneCall): void {
|
||||
const talker = cell(row, 'talker')
|
||||
if (!owner || !talker) return
|
||||
const t = String(talker)
|
||||
// 群语音的 talker 是 @chatroom ID → 走群聊路由(1:1 路由按 talker_id 查会
|
||||
const ch = chatChannel(row.channel) ?? 'wechat'
|
||||
// 对齐云客「通话时间定位」:新窗 rangeFromQuery 需 start+end 成对,取通话
|
||||
// 当天整天下窗——语音通话本身是消息流里的 voice_call 行,当天窗必含该通
|
||||
// 通话(旧页 ?start= 滚动定位的等价实现)。
|
||||
let dayQuery: { start: string; end: string } | undefined
|
||||
if (row.start_call_time) {
|
||||
const s = new Date(row.start_call_time)
|
||||
s.setHours(0, 0, 0, 0)
|
||||
const e = new Date(row.start_call_time)
|
||||
e.setHours(23, 59, 59, 999)
|
||||
dayQuery = { start: String(s.getTime()), end: String(e.getTime()) }
|
||||
}
|
||||
// 群语音的 talker 是 @chatroom ID → 群路由(1:1 路由按 talker_id 查会
|
||||
// 查空,同 chat_group owner 错位类问题,2026-08-22)
|
||||
if (t.endsWith('@chatroom')) {
|
||||
router.push({
|
||||
router.push(
|
||||
ch === 'wechat'
|
||||
? { name: 'staff-chat', params: { ownerId: String(owner), tab: 'group', talkerId: t }, query: dayQuery }
|
||||
: {
|
||||
name: 'group-chat',
|
||||
params: {
|
||||
channel: chatChannel(row.channel) ?? 'wechat',
|
||||
ownerId: String(owner),
|
||||
roomId: t,
|
||||
},
|
||||
params: { channel: ch, ownerId: String(owner), roomId: t },
|
||||
query: row.start_call_time ? { start: String(row.start_call_time) } : undefined,
|
||||
})
|
||||
},
|
||||
)
|
||||
return
|
||||
}
|
||||
router.push({
|
||||
// 微信 1:1 → 新员工聊天窗口;WA 保留旧 ChatTimeline(新窗口仅微信)。
|
||||
router.push(
|
||||
ch === 'wechat'
|
||||
? { name: 'staff-chat', params: { ownerId: String(owner), tab: 'single', talkerId: t }, query: dayQuery }
|
||||
: {
|
||||
name: 'chat',
|
||||
params: {
|
||||
channel: chatChannel(row.channel) ?? 'wechat',
|
||||
ownerId: String(owner),
|
||||
talkerId: t,
|
||||
},
|
||||
// 对齐云客:带通话时间定位(?start=),聊天窗滚动到该通通话附近
|
||||
params: { channel: ch, ownerId: String(owner), talkerId: t },
|
||||
query: row.start_call_time ? { start: String(row.start_call_time) } : undefined,
|
||||
})
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
/** 员工微信昵称 → 账号级聊天窗(复用 step 5 导航)。 */
|
||||
function viewCallStaff(row: PhoneCall): void {
|
||||
const owner = cell(row, 'weChatId')
|
||||
if (!owner) return
|
||||
router.push({
|
||||
name: 'chat',
|
||||
params: { channel: chatChannel(row.channel) ?? 'wechat', ownerId: String(owner) },
|
||||
})
|
||||
const ch = chatChannel(row.channel) ?? 'wechat'
|
||||
if (ch === 'wechat') {
|
||||
router.push({ name: 'staff-chat', params: { ownerId: String(owner), tab: 'single' } })
|
||||
return
|
||||
}
|
||||
router.push({ name: 'chat', params: { channel: ch, ownerId: String(owner) } })
|
||||
}
|
||||
|
||||
const callDrawerTitle = computed(() =>
|
||||
|
||||
@@ -207,6 +207,18 @@ function openMessage(m: Message): void {
|
||||
ElMessage.warning('该消息缺少归属账号,无法定位会话')
|
||||
return
|
||||
}
|
||||
// 微信 → 新员工聊天窗口(群消息=group tab 按 room_id);WA 保留旧 ChatTimeline。
|
||||
if (m.channel === 'wechat') {
|
||||
router.push({
|
||||
name: 'staff-chat',
|
||||
params: {
|
||||
ownerId: m.owner_account_id,
|
||||
tab: m.room_id ? 'group' : 'single',
|
||||
talkerId: (m.room_id ?? m.talker_id) as string,
|
||||
},
|
||||
})
|
||||
return
|
||||
}
|
||||
router.push({
|
||||
name: 'chat',
|
||||
params: {
|
||||
@@ -233,6 +245,14 @@ function goChatFromDrawer(): void {
|
||||
ElMessage.warning('该客户缺少归属账号,无法查看聊天记录')
|
||||
return
|
||||
}
|
||||
// 微信 → 新员工聊天窗口;WA 保留旧 ChatTimeline(与 CustomerList.viewChat 一致)。
|
||||
if (row.channel === 'wechat') {
|
||||
router.push({
|
||||
name: 'staff-chat',
|
||||
params: { ownerId: row.owner_account_id, tab: 'single', talkerId: row.friend_id },
|
||||
})
|
||||
return
|
||||
}
|
||||
router.push({
|
||||
name: 'chat',
|
||||
params: {
|
||||
|
||||
Reference in New Issue
Block a user