fix(wa): viewCustomers带channel query(原缺whatsapp致WA客户页默认微信tab)+tab query watch
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -367,6 +367,18 @@ const drawerAvatarSrc = computed<string | undefined>(() => {
|
||||
})
|
||||
const drawerCanChat = computed(() => !!drawerCustomer.value?.owner_account_id)
|
||||
|
||||
// 路由 query tab 变化 → waSubTab 跟随(员工列表群聊按钮跳入时)
|
||||
watch(
|
||||
() => route.query.tab,
|
||||
(t) => {
|
||||
const next = t === 'groups' ? 'groups' : 'friends'
|
||||
if (next !== waSubTab.value) {
|
||||
waSubTab.value = next
|
||||
if (next === 'groups') loadWaGroups()
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
// 全局 channel 变化(别处 setChannel)→ activeTab 跟随 + lazy-load。
|
||||
// 当前所有外部 setChannel 入口(StaffList.viewCustomers/viewGroups)都同时带 owner_account_id query,
|
||||
// watch(dept/owner) 会 fire 兜底加载;但若未来出现「只 setChannel 不带 query」的入口,这里补的
|
||||
|
||||
@@ -242,7 +242,7 @@ function viewCustomers(row: Account): void {
|
||||
channelStore.setChannel(row.channel)
|
||||
router.push({
|
||||
path: '/customers',
|
||||
query: { owner_account_id: row.account_id },
|
||||
query: { owner_account_id: row.account_id, channel: row.channel },
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user