From b0923409fb3f419a4dbb3f7d5e55af6012105f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Mon, 24 Aug 2026 15:42:20 +0800 Subject: [PATCH] =?UTF-8?q?fix(wa):=20viewCustomers=E5=B8=A6channel=20quer?= =?UTF-8?q?y(=E5=8E=9F=E7=BC=BAwhatsapp=E8=87=B4WA=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E9=A1=B5=E9=BB=98=E8=AE=A4=E5=BE=AE=E4=BF=A1tab)+tab=20query?= =?UTF-8?q?=20watch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- yunkes/src/views/CustomerList.vue | 12 ++++++++++++ yunkes/src/views/StaffList.vue | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) 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 }, }) }