diff --git a/pages_tool/ai-chat/ai-chat-message.vue b/pages_tool/ai-chat/ai-chat-message.vue index 2c937c8..6b902ee 100644 --- a/pages_tool/ai-chat/ai-chat-message.vue +++ b/pages_tool/ai-chat/ai-chat-message.vue @@ -1464,6 +1464,22 @@ export default { this.$emit('location-selected', locationMessage) } }) + }, + + // 清空聊天记录 + clearMessages() { + // 清空消息数组 + this.messages = [] + // 重置消息 ID + this.messageId = 0 + // 清除会话 ID + this.currentConversationId = null + aiService.clearConversationId() + this.clearConversationIdFromLocal() + // 重置历史偏移量 + this.historyOffset = 0 + // 触发清空事件 + this.$emit('messages-cleared') } } }