diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 7a5525ea..e7949167 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,14 +1,18 @@ import { Routes, Route, Navigate } from 'react-router-dom' import MainLayout from './layouts/MainLayout' import HomePage from './pages/HomePage' -import AgentPage from './pages/AgentPage' +import AgentChatPage from './pages/AgentChatPage' +import KnowledgePage from './pages/KnowledgePage' +import HistoryPage from './pages/HistoryPage' function App() { return ( }> } /> - } /> + } /> + } /> + } /> } /> diff --git a/frontend/src/components/CreateProjectDialog.tsx b/frontend/src/components/CreateProjectDialog.tsx new file mode 100644 index 00000000..1b66dcc2 --- /dev/null +++ b/frontend/src/components/CreateProjectDialog.tsx @@ -0,0 +1,96 @@ +import { Modal, Form, Input, Radio, message } from 'antd'; +import { useProjectStore, Project } from '../stores/useProjectStore'; + +const { TextArea } = Input; + +export const CreateProjectDialog = () => { + const [form] = Form.useForm(); + const { showCreateDialog, setShowCreateDialog, addProject } = useProjectStore(); + + const handleOk = async () => { + try { + const values = await form.validateFields(); + + // 模拟创建项目(后续会调用真实API) + const newProject: Project = { + id: `proj-${Date.now()}`, + name: values.name, + background: values.background || '', + researchType: values.researchType, + createdAt: new Date().toISOString(), + updatedAt: new Date().toISOString(), + }; + + addProject(newProject); + message.success('项目创建成功'); + form.resetFields(); + setShowCreateDialog(false); + } catch (error) { + console.error('表单验证失败:', error); + } + }; + + const handleCancel = () => { + form.resetFields(); + setShowCreateDialog(false); + }; + + return ( + +
+ + + + + + + 观察性研究 + 干预性研究 + + + + +