feat:【antd】【ai】chat 的样式 review 修复
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
// TODO @gjd:https://t.zsxq.com/pmNb1 AI 对话、绘图底部没对齐,特别是样式方面
|
|
||||||
import type { AiChatConversationApi } from '#/api/ai/chat/conversation';
|
import type { AiChatConversationApi } from '#/api/ai/chat/conversation';
|
||||||
import type { AiChatMessageApi } from '#/api/ai/chat/message';
|
import type { AiChatMessageApi } from '#/api/ai/chat/message';
|
||||||
|
|
||||||
@@ -101,8 +100,7 @@ async function handleConversationClick(
|
|||||||
// 刷新 message 列表
|
// 刷新 message 列表
|
||||||
await getMessageList();
|
await getMessageList();
|
||||||
// 滚动底部
|
// 滚动底部
|
||||||
// TODO @AI:看看要不要 await
|
await scrollToBottom(true);
|
||||||
scrollToBottom(true);
|
|
||||||
prompt.value = '';
|
prompt.value = '';
|
||||||
// 清空输入框
|
// 清空输入框
|
||||||
prompt.value = '';
|
prompt.value = '';
|
||||||
@@ -156,7 +154,7 @@ async function handleConversationCreateSuccess() {
|
|||||||
// 创建新的对话,清空输入框
|
// 创建新的对话,清空输入框
|
||||||
prompt.value = '';
|
prompt.value = '';
|
||||||
// 清空文件列表
|
// 清空文件列表
|
||||||
uploadFiles.value = []
|
uploadFiles.value = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
// =========== 【消息列表】相关 ===========
|
// =========== 【消息列表】相关 ===========
|
||||||
@@ -363,8 +361,7 @@ async function doSendMessageStream(userMessage: AiChatMessageApi.ChatMessage) {
|
|||||||
await nextTick();
|
await nextTick();
|
||||||
await scrollToBottom(); // 底部
|
await scrollToBottom(); // 底部
|
||||||
// 1.3 开始滚动
|
// 1.3 开始滚动
|
||||||
// TODO @AI:要不要 await
|
textRoll().then();
|
||||||
textRoll();
|
|
||||||
|
|
||||||
// 2. 发送 event stream
|
// 2. 发送 event stream
|
||||||
let isFirstChunk = true; // 是否是第一个 chunk 消息段
|
let isFirstChunk = true; // 是否是第一个 chunk 消息段
|
||||||
@@ -538,11 +535,6 @@ onMounted(async () => {
|
|||||||
activeMessageListLoading.value = true;
|
activeMessageListLoading.value = true;
|
||||||
await getMessageList();
|
await getMessageList();
|
||||||
});
|
});
|
||||||
// TODO @芋艿:深度思考
|
|
||||||
// TODO @芋艿:联网搜索
|
|
||||||
// TODO @芋艿:附件支持
|
|
||||||
// TODO @芋艿:mcp 相关
|
|
||||||
// TODO @芋艿:异常消息的处理
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -352,9 +352,11 @@ onMounted(async () => {
|
|||||||
class="mt-1"
|
class="mt-1"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="mb-2 flex cursor-pointer flex-row items-center justify-between rounded-lg px-2 leading-10"
|
class="mb-2 flex cursor-pointer flex-row items-center justify-between rounded-lg px-2 leading-10 transition-colors hover:bg-gray-100 dark:hover:bg-gray-800"
|
||||||
:class="[
|
:class="[
|
||||||
conversation.id === activeConversationId ? 'bg-success' : '',
|
conversation.id === activeConversationId
|
||||||
|
? 'bg-primary/10 dark:bg-primary/20'
|
||||||
|
: '',
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
@@ -371,7 +373,6 @@ onMounted(async () => {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- TODO @AI:目前选中的颜色有点丑,好像是绿色,看看怎么优化下! -->
|
|
||||||
<div
|
<div
|
||||||
v-show="hoverConversationId === conversation.id"
|
v-show="hoverConversationId === conversation.id"
|
||||||
class="relative right-0.5 flex items-center text-gray-400"
|
class="relative right-0.5 flex items-center text-gray-400"
|
||||||
|
|||||||
Reference in New Issue
Block a user