feat: 会话详情

This commit is contained in:
rd
2025-08-27 18:07:36 +08:00
parent 0406dea56f
commit 892704c592
4 changed files with 36 additions and 15 deletions

View File

@ -6,10 +6,10 @@ import RightView from './components/right-view/index.vue';
import { useRoute } from 'vue-router';
import { useChatStore } from '@/stores/modules/chat';
import { getConversationList } from '@/api/all/chat';
import querySSE from '@/utils/querySSE';
import useChatHandler from './useChatHandler';
import { QUESTION_ROLE, LOADING_ROLE } from './constants';
import { QUESTION_ROLE, LOADING_ROLE, REMOTE_ROLE } from './constants';
export default {
props: {
@ -47,7 +47,7 @@ export default {
const handleCancel = () => {
// 中止当前正在输出的回答
console.log('handleCancel', currentTaskId.value)
console.log('handleCancel', currentTaskId.value);
if (generateLoading.value) {
bubbleListRef.value?.abortTypingByKey(currentTaskId.value);
sseController.value?.abort?.();
@ -115,6 +115,18 @@ export default {
{ deep: true },
);
onMounted(async () => {
if (conversationId.value) {
const { data, code } = await getConversationList({
session_id: conversationId.value,
agent_id: chatStore.agentInfo.agent_id,
});
if (code === 200) {
conversationList.value = data.list?.flat(1) ?? []
}
}
});
return () => (
<div class="chat-view-wrap w-full h-full flex">
<section class="flex-1 flex flex-col pt-20px justify-center relative px-16px">