diff --git a/frontend/src/pages/ProjectDetail.tsx b/frontend/src/pages/ProjectDetail.tsx index 483373c..ab09ab5 100644 --- a/frontend/src/pages/ProjectDetail.tsx +++ b/frontend/src/pages/ProjectDetail.tsx @@ -12,15 +12,20 @@ import { Tag, Empty, List, + Tabs, } from 'antd'; import { ArrowLeftOutlined, ReloadOutlined, + ApartmentOutlined, + ProfileOutlined, } from '@ant-design/icons'; -import { useNavigate, useParams } from 'react-router-dom'; +import { useNavigate, useParams, useSearchParams } from 'react-router-dom'; import { projectApi, taskApi, artifactApi } from '@/api'; import type { Project, ProjectStats, Task, Artifact } from '@/types'; import { ProjectStatusTag, TaskStatusTag } from '@/components/constants'; +import DagCanvas from '@/pages/DagCanvas'; +import TaskDetailModal from '@/components/TaskDetailModal'; import dayjs from 'dayjs'; const { Title, Text } = Typography; @@ -28,11 +33,20 @@ const { Title, Text } = Typography; export default function ProjectDetail() { const { id } = useParams<{ id: string }>(); const navigate = useNavigate(); + const [searchParams, setSearchParams] = useSearchParams(); + const activeTab = searchParams.get('tab') || 'overview'; const [loading, setLoading] = useState(true); const [project, setProject] = useState(null); const [stats, setStats] = useState(null); const [tasks, setTasks] = useState([]); const [artifacts, setArtifacts] = useState([]); + const [detailTaskId, setDetailTaskId] = useState(null); + const [detailOpen, setDetailOpen] = useState(false); + + const openTaskDetail = (taskId: number) => { + setDetailTaskId(taskId); + setDetailOpen(true); + }; useEffect(() => { if (!id) return; @@ -75,36 +89,8 @@ export default function ProjectDetail() { ].filter((item) => item.count > 0) : []; - return ( -
-
- - - - {project.name} - - - - -
- + const overviewTab = ( + <> {project.name} @@ -198,7 +184,7 @@ export default function ProjectDetail() { > navigate('/tasks')}>{task.title} + openTaskDetail(task.id)}>{task.title} } description={dayjs(task.created_at).format('MM-DD HH:mm')} /> @@ -231,6 +217,73 @@ export default function ProjectDetail() { + + ); + + return ( +
+
+ + + + {project.name} + + + + +
+ + setSearchParams({ tab: key })} + items={[ + { + key: 'overview', + label: ( + + 概览 + + ), + children: overviewTab, + }, + { + key: 'dag', + label: ( + + DAG 编排 + + ), + children: ( + + + + ), + }, + ]} + /> + + setDetailOpen(false)} + />
); }