fix(group-stats): 群统计「查看详情」进纯聊天窗——无会话侧栏,操作列单按钮
用户反馈:微信群统计列表点查看聊天记录进入的页面带「好友列表/群列表」 侧栏不合适——云客该入口是专注的群详情聊天页(截图验证:无会话侧栏, 仅系统菜单+群名+工具栏+消息流)。 - ChatTimeline 增 bare 专注模式(?bare=1 隐藏会话侧栏);员工聊天窗口 入口(不带 bare)侧栏常驻——昨天 WA 侧栏修复的场景不受影响 - GroupList 微信 tab 操作列精简为单按钮「查看详情」(=查看聊天记录, 跳 bare 模式;导出HTML移除——聊天页头部本有导出),WA tab 不动 本地双路径验证:bare 无好友列表/有群聊标题;无 bare 侧栏在;列表点击 跳转 ?bare=1 正常。 Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -53,6 +53,13 @@ const channelTyped = computed(() => props.channel as Channel)
|
|||||||
/** True when this timeline is a group chat (drives the query + title). */
|
/** True when this timeline is a group chat (drives the query + title). */
|
||||||
const isGroup = computed(() => !!props.roomId)
|
const isGroup = computed(() => !!props.roomId)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 专注模式(?bare=1):群统计等列表入口的「查看详情」——隐藏会话侧栏,
|
||||||
|
* 对齐云客群详情页(无好友/群列表,纯聊天记录窗)。员工聊天窗口入口
|
||||||
|
* (不带 bare)侧栏常驻(2026-09-09 修复保持)。
|
||||||
|
*/
|
||||||
|
const isBare = computed(() => route.query.bare === '1')
|
||||||
|
|
||||||
/** 当前会话类型(高亮 sidebar + 驱动空态)。账号级入口(无 talkerId/roomId)→ null。 */
|
/** 当前会话类型(高亮 sidebar + 驱动空态)。账号级入口(无 talkerId/roomId)→ null。 */
|
||||||
const activeType = computed<'friend' | 'group' | null>(() =>
|
const activeType = computed<'friend' | 'group' | null>(() =>
|
||||||
isGroup.value ? 'group' : props.talkerId ? 'friend' : null,
|
isGroup.value ? 'group' : props.talkerId ? 'friend' : null,
|
||||||
@@ -344,8 +351,11 @@ onMounted(() => {
|
|||||||
<div class="yk-chat__body">
|
<div class="yk-chat__body">
|
||||||
<!-- 侧栏常驻(含群聊路由):好友/群列表随时可切,对齐云客聊天窗体验。
|
<!-- 侧栏常驻(含群聊路由):好友/群列表随时可切,对齐云客聊天窗体验。
|
||||||
旧版 v-if="!isGroup" 在群路由下藏侧栏,点群后「好友列表/群列表」
|
旧版 v-if="!isGroup" 在群路由下藏侧栏,点群后「好友列表/群列表」
|
||||||
消失(2026-09-09 用户报);onSelectSession 本就双类型导航。 -->
|
消失(2026-09-09 用户报);onSelectSession 本就双类型导航。
|
||||||
|
bare 模式(群统计「查看详情」入口)例外——纯聊天记录窗无侧栏,
|
||||||
|
对齐云客群详情页(2026-09-10 用户反馈)。 -->
|
||||||
<ChatSidebar
|
<ChatSidebar
|
||||||
|
v-if="!isBare"
|
||||||
:channel="channelTyped"
|
:channel="channelTyped"
|
||||||
:owner-id="props.ownerId"
|
:owner-id="props.ownerId"
|
||||||
:active-type="activeType"
|
:active-type="activeType"
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { useRoute, useRouter } from 'vue-router'
|
|||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { Download } from '@element-plus/icons-vue'
|
import { Download } from '@element-plus/icons-vue'
|
||||||
import { getAccounts, getGroups } from '@/api'
|
import { getAccounts, getGroups } from '@/api'
|
||||||
import { downloadBlob } from '@/api/client'
|
|
||||||
import type { Account, Channel, Group } from '@/api/types'
|
import type { Account, Channel, Group } from '@/api/types'
|
||||||
import { useChannelStore } from '@/stores/channel'
|
import { useChannelStore } from '@/stores/channel'
|
||||||
import { channelLabel, formatTime } from '@/utils/format'
|
import { channelLabel, formatTime } from '@/utils/format'
|
||||||
@@ -190,6 +189,9 @@ function viewChat(row: Group): void {
|
|||||||
router.push({
|
router.push({
|
||||||
name: 'group-chat',
|
name: 'group-chat',
|
||||||
params: { channel: row.channel, ownerId: row.owner_account_id, roomId: row.room_id },
|
params: { channel: row.channel, ownerId: row.owner_account_id, roomId: row.room_id },
|
||||||
|
// bare=专注模式:无会话侧栏,对齐云客群详情页(2026-09-10)。
|
||||||
|
// 员工聊天窗口入口不带 bare,侧栏常驻。
|
||||||
|
query: row.channel === 'wechat' ? { bare: '1' } : undefined,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
/** drawer 内「查看聊天记录」入口:drawerGroup 是 ref<Group|null>,模板嵌套不保证窄化,用 wrapper 守卫。 */
|
/** drawer 内「查看聊天记录」入口:drawerGroup 是 ref<Group|null>,模板嵌套不保证窄化,用 wrapper 守卫。 */
|
||||||
@@ -199,28 +201,6 @@ function viewChatFromDrawer(): void {
|
|||||||
viewChat(row)
|
viewChat(row)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 微信群「导出HTML聊天记录」→ 后端 /api/export/chat-html(room_id)。
|
|
||||||
* 云客群列表导出按钮直接导出,无时间选择 modal(仅微信客户有「请选择时间」)。
|
|
||||||
* WA 群 tab 无此操作(云客 WA 群列表无导出)。
|
|
||||||
*/
|
|
||||||
async function exportGroupHtml(row: Group): Promise<void> {
|
|
||||||
if (!row.owner_account_id || !row.room_id) {
|
|
||||||
ElMessage.warning('该群缺少归属账号/群标识,无法导出')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
await downloadBlob('/export/chat-html', {
|
|
||||||
channel: row.channel,
|
|
||||||
owner_account_id: row.owner_account_id,
|
|
||||||
room_id: row.room_id,
|
|
||||||
})
|
|
||||||
ElMessage.success('导出已开始')
|
|
||||||
} catch (e) {
|
|
||||||
ElMessage.error(`导出失败,请稍后重试:${(e as Error).message}`)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---- header 导出:当前 tab 渠道全量群 CSV(含当前员工筛选) ----
|
// ---- header 导出:当前 tab 渠道全量群 CSV(含当前员工筛选) ----
|
||||||
const exporting = ref(false)
|
const exporting = ref(false)
|
||||||
|
|
||||||
@@ -444,11 +424,9 @@ onMounted(() => {
|
|||||||
<el-table-column label="沟通消息数" width="105" align="right">
|
<el-table-column label="沟通消息数" width="105" align="right">
|
||||||
<template #default="{ row }">{{ row.window_msg_count ?? '-' }}</template>
|
<template #default="{ row }">{{ row.window_msg_count ?? '-' }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="220" fixed="right" align="center">
|
<el-table-column label="操作" width="110" fixed="right" align="center">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button link type="primary" size="small" @click.stop="openDrawer(row)">查看详情</el-button>
|
<el-button link type="primary" size="small" @click.stop="viewChat(row)">查看详情</el-button>
|
||||||
<el-button link type="primary" size="small" @click.stop="viewChat(row)">查看聊天记录</el-button>
|
|
||||||
<el-button link type="primary" size="small" @click.stop="exportGroupHtml(row)">导出HTML</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|||||||
Reference in New Issue
Block a user