From 4f651e54fe89602603f275a7d45b44d54d0f0ec6 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 Date: Tue, 3 Nov 2026 19:13:26 +0800 Subject: [PATCH] feat: Defining Data for Conversation Sharing --- .../components/header/chat/index.vue | 6 ++---- .../components/message-list/index.vue | 20 +++++++++---------- .../left-sidebar/conversation-list/index.ts | 7 ++++++- .../main/chat-panel/index.vue | 3 +++ 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/ui/src/conversation-panel/components/header/chat/index.vue b/ui/src/conversation-panel/components/header/chat/index.vue index 3490d1b6c1a..d9b1d3f4a4f 100644 --- a/ui/src/conversation-panel/components/header/chat/index.vue +++ b/ui/src/conversation-panel/components/header/chat/index.vue @@ -9,10 +9,8 @@ const props = defineProps<{ /** 显示分享入口;仅对话端传入 */ shareable?: boolean }>() - -const emit = defineEmits<{ share: [] }>() - const list = useConversationListStore() + const msgs = useMessageListStore() // 回答生成中或没有消息时不可分享 const canShare = computed(() => msgs.messages.value.length > 0 && !msgs.streamLoading.value) @@ -43,7 +41,7 @@ const handleNewConversation = () => (props.newConversation ? props.newConversati - + diff --git a/ui/src/conversation-panel/components/message-list/index.vue b/ui/src/conversation-panel/components/message-list/index.vue index 93396a3f8e0..2bf0ecf3159 100644 --- a/ui/src/conversation-panel/components/message-list/index.vue +++ b/ui/src/conversation-panel/components/message-list/index.vue @@ -6,10 +6,15 @@ import PrologueContent from '../prologue-content/index.vue' import { formatPrologue } from '../prologue-content/index' import ReverseInfiniteScroll from '../../core/reverse-infinite-scroll/index.vue' import { useMessageListStore } from './index' - +import { useConversationListStore } from '../../left-sidebar/conversation-list/index' defineProps<{ appName?: string }>() const { appInfo, messages, loading, streamLoading, hasMore, loadMore, onStreamProgress } = useMessageListStore() +const { + // 是否分享 + isShared, + // 切换分享 + switchShared } = useConversationListStore() const scrollRef = ref>() // 开场白随智能体信息变化(debug 保存后为最新草稿) @@ -25,14 +30,8 @@ const showUserAvatar = computed(() => appInfo.value?.show_user_avatar)