From 99b029377ad636c4a868bcbf4299fdad7c159adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=A1=E5=A4=8D=E4=B9=A0?= <2353956224@qq.com> Date: Thu, 12 Mar 2026 18:03:30 +0800 Subject: [PATCH] =?UTF-8?q?2.3.9=20=E5=8E=86=E5=8F=B2=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Sidebar.vue | 50 ++++++++++++++++++++++++++++++++++++-- src/types/electron.d.ts | 1 + 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue index bacd992..7f3d497 100644 --- a/src/components/Sidebar.vue +++ b/src/components/Sidebar.vue @@ -123,7 +123,7 @@ 未启动任务 -
+
已打招呼 {{ greetingStats.greetingCount }} 位 @@ -134,7 +134,33 @@
已回复 - {{ greetingStats.replyCount || 0 }} 条 +
+ + {{ greetingStats.replyCount || 0 }} 条 +
+
+ +
+
+ 历史回复列表 + +
+
+
+ 暂无回复记录 +
+
+
+ {{ name }} +
+
+
@@ -160,6 +186,26 @@ const props = defineProps({ const emit = defineEmits(['tabSwitch', 'goBack', 'stopAll']) +// 回复列表相关 +const replyListVisible = ref(false) +/** @type {import('vue').Ref} */ +const repliedSessions = ref([]) + +// 显示回复列表 +const showReplyList = async () => { + replyListVisible.value = !replyListVisible.value + if (replyListVisible.value && window.electronAPI?.getRepliedSessions) { + try { + const result = await window.electronAPI.getRepliedSessions() + // 最新的在最后,前端展示时保持原顺序(最下边是最新的) + repliedSessions.value = result || [] + } catch (e) { + console.error('获取回复列表失败:', e) + repliedSessions.value = [] + } + } +} + // Event handlers const onTabSwitch = (id) => emit('tabSwitch', id) const onGoBack = () => emit('goBack') diff --git a/src/types/electron.d.ts b/src/types/electron.d.ts index bd6a59e..03c7790 100644 --- a/src/types/electron.d.ts +++ b/src/types/electron.d.ts @@ -126,6 +126,7 @@ export interface ElectronAPI { // 打招呼统计 getGreetingStats: () => Promise + getRepliedSessions: () => Promise // 获取打招呼内容 fetchPrologue: () => Promise<{ success: boolean; data?: string[]; error?: string }>