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 }>