feat(frontend): Day 21 knowledge base management frontend completed

This commit is contained in:
AI Clinical Dev Team
2025-10-11 12:48:26 +08:00
parent 5bacdc1768
commit 186ae55302
9 changed files with 1459 additions and 221 deletions

View File

@@ -1,6 +1,6 @@
import { useParams } from 'react-router-dom'
import { useState, useEffect } from 'react'
import { Card, Typography, Space, Alert, Spin, message } from 'antd'
import { Space, Alert, Spin, message } from 'antd'
import { RobotOutlined } from '@ant-design/icons'
import { agentApi, type AgentConfig } from '../api/agentApi'
import conversationApi, { type Conversation, type Message } from '../api/conversationApi'
@@ -9,8 +9,6 @@ import MessageInput from '../components/chat/MessageInput'
import ModelSelector, { type ModelType } from '../components/chat/ModelSelector'
import { useProjectStore } from '../stores/useProjectStore'
const { Title, Paragraph } = Typography
const AgentChatPage = () => {
const { agentId } = useParams()
const { currentProject } = useProjectStore()
@@ -71,10 +69,8 @@ const AgentChatPage = () => {
title: `${agent.name}的对话`,
})
if (response.success && response.data) {
setConversation(response.data)
setMessages([])
}
setConversation(response.data.data || null)
setMessages([])
} catch (err) {
console.error('Failed to create conversation:', err)
message.error('创建对话失败')