diff --git a/yunkes/src/views/CustomerList.vue b/yunkes/src/views/CustomerList.vue index 767281d..d3261be 100644 --- a/yunkes/src/views/CustomerList.vue +++ b/yunkes/src/views/CustomerList.vue @@ -367,6 +367,18 @@ const drawerAvatarSrc = computed(() => { }) 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」的入口,这里补的 diff --git a/yunkes/src/views/StaffList.vue b/yunkes/src/views/StaffList.vue index 869f82f..ec89492 100644 --- a/yunkes/src/views/StaffList.vue +++ b/yunkes/src/views/StaffList.vue @@ -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 }, }) }