From f6f786f1b6020eb2d20fb1ad9f76f6c7e00238ab Mon Sep 17 00:00:00 2001 From: cherishsince Date: Fri, 17 May 2024 17:11:23 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91AI=20?= =?UTF-8?q?=E8=81=8A=E5=A4=A9=E5=8F=91=E9=80=81=EF=BC=8C=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8=E5=AF=B9=E8=AF=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ai/chat/index.vue | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/views/ai/chat/index.vue b/src/views/ai/chat/index.vue index 2d61132a..9c4c0e95 100644 --- a/src/views/ai/chat/index.vue +++ b/src/views/ai/chat/index.vue @@ -175,6 +175,13 @@ const onSend = async (val?: string) => { }) return } + if (activeConversationId.value == null) { + ElMessage({ + message: '还没创建对话,不能发送!', + type: 'error' + }) + return + } // TODO 芋艿:这块交互要在优化;应该是先插入到 UI 界面,里面会有当前的消息,和正在思考中;之后发起请求; // 清空输入框 prompt.value = '' @@ -346,21 +353,6 @@ onMounted(async () => { } // 获取列表数据 await getMessageList() - // scrollToBottom(); - // await nextTick - // 监听滚动事件,判断用户滚动状态 - // messageContainer.value.addEventListener('scroll', handleScroll) - // 添加 copy 监听 - // messageContainer.value.addEventListener('click', (e: any) => { - // console.log(e) - // if (e.target.id === 'copy') { - // copy(e.target?.dataset?.copy) - // ElMessage({ - // message: '复制成功!', - // type: 'success' - // }) - // } - // }) })