feat(staff): action buttons → filtered customer/group list
Adds groups.user_id filter; viewCustomers/viewGroups push owner_account_id query; CustomerList/GroupList read it. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -171,19 +171,26 @@ function waSerial(index: number): number {
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Action buttons (WhatsApp 操作 column) — jump to the corresponding list and
|
||||
// preset the global channel filter to WhatsApp. Per-staff filtering is not yet
|
||||
// supported by CustomerList/GroupList, so we land on the channel-wide list.
|
||||
// Action buttons (操作 column) — jump to the corresponding list scoped to the
|
||||
// row's account, presetting the global channel filter to the row's channel.
|
||||
// owner_account_id is the staff's account_id (wxId for WeChat, uid for WA),
|
||||
// which both CustomerList and GroupList already filter on server-side.
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function viewCustomers(): void {
|
||||
channelStore.setChannel('whatsapp')
|
||||
router.push('/customers')
|
||||
function viewCustomers(row: Account): void {
|
||||
channelStore.setChannel(row.channel)
|
||||
router.push({
|
||||
path: '/customers',
|
||||
query: { owner_account_id: row.account_id },
|
||||
})
|
||||
}
|
||||
|
||||
function viewGroups(): void {
|
||||
channelStore.setChannel('whatsapp')
|
||||
router.push('/groups')
|
||||
function viewGroups(row: Account): void {
|
||||
channelStore.setChannel(row.channel)
|
||||
router.push({
|
||||
path: '/groups',
|
||||
query: { owner_account_id: row.account_id },
|
||||
})
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -607,11 +614,11 @@ onMounted(() => {
|
||||
|
||||
<!-- 操作 -->
|
||||
<el-table-column label="操作" width="150" fixed="right" align="center">
|
||||
<template #default>
|
||||
<el-button link type="primary" size="small" @click.stop="viewCustomers">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" size="small" @click.stop="viewCustomers(row)">
|
||||
好友列表
|
||||
</el-button>
|
||||
<el-button link type="primary" size="small" @click.stop="viewGroups">
|
||||
<el-button link type="primary" size="small" @click.stop="viewGroups(row)">
|
||||
群聊
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user