From ca40047f0b51026bf46cf03666c54faa26627da5 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 24 May 2024 20:58:31 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91AI=EF=BC=9A?= =?UTF-8?q?=E6=96=B0=E5=BB=BA=E5=AF=B9=E8=AF=9D=E6=97=B6=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E9=BB=98=E8=AE=A4=E8=A7=92=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ai/chat/index.vue | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/views/ai/chat/index.vue b/src/views/ai/chat/index.vue index 353733e6..d4ca76a8 100644 --- a/src/views/ai/chat/index.vue +++ b/src/views/ai/chat/index.vue @@ -36,10 +36,11 @@
- - + @@ -102,14 +103,13 @@ import MessageLoading from './MessageLoading.vue' import MessageNewChat from './MessageNewChat.vue' import {ChatMessageApi, ChatMessageVO} from '@/api/ai/chat/message' import {ChatConversationApi, ChatConversationVO} from '@/api/ai/chat/conversation' -import {getUserProfile, ProfileVO} from '@/api/system/user/profile' +import { getUserProfile, ProfileVO } from '@/api/system/user/profile' import {useClipboard} from '@vueuse/core' import ChatConversationUpdateForm from "@/views/ai/chat/components/ChatConversationUpdateForm.vue"; import {Download, Top} from "@element-plus/icons-vue"; const route = useRoute() // 路由 const message = useMessage() // 消息弹窗 -const {copy} = useClipboard() // 初始化 copy 到粘贴板 // ref 属性定义 const activeConversationId = ref(null) // 选中的对话编号 @@ -396,6 +396,23 @@ const stopStream = async () => { // ============== message 数据 ================= +/** 消息列表 */ +const messageList = computed(() => { + if (list.value.length > 0) { + return list.value + } + // 没有消息时,如果有 systemMessage 则展示它 + // TODO add by 芋艿:这个消息下面,不能有复制、删除按钮 + if (activeConversation.value?.systemMessage) { + return [{ + id: 0, + type: 'system', + content: activeConversation.value.systemMessage + }] + } + return [] +}) + /** * 获取 - message 列表 */