新增里程碑
+ +暂无里程碑
+点击右上角"+ 新增里程碑"创建第一个里程碑
+{milestone.name}
+ + {milestone.completed ? '已完成' : '进行中'} + ++ {milestone.description} +
+ )} +diff --git a/apps/web/app/components/EditTaskForm.tsx b/apps/web/app/components/EditTaskForm.tsx new file mode 100644 index 000000000..69a913ccd --- /dev/null +++ b/apps/web/app/components/EditTaskForm.tsx @@ -0,0 +1,160 @@ +'use client'; + +import { useState, useEffect } from 'react'; +import { useRouter } from 'next/navigation'; + +const API_BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8000'; + +interface EditTaskFormProps { + taskId: string; + initialData: { + name: string; + description: string; + priority: string; + assignee_user_id: string; + }; + onSuccess?: () => void; + onCancel?: () => void; +} + +export default function EditTaskForm({ taskId, initialData, onSuccess, onCancel }: EditTaskFormProps) { + const router = useRouter(); + const [loading, setLoading] = useState(false); + const [error, setError] = useState(''); + const [formData, setFormData] = useState(initialData); + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault(); + setLoading(true); + setError(''); + + try { + // 注意:这里需要后端补充 PATCH /tasks/{id} 接口 + alert('任务编辑功能需要后端补充 PATCH /tasks/{id} 接口'); + if (onSuccess) onSuccess(); + } catch (err: any) { + setError(err.message); + } finally { + setLoading(false); + } + }; + + return ( +
+ ); +} diff --git a/apps/web/app/milestones/page.tsx b/apps/web/app/milestones/page.tsx new file mode 100644 index 000000000..e8ae1cd51 --- /dev/null +++ b/apps/web/app/milestones/page.tsx @@ -0,0 +1,234 @@ +'use client'; + +import { useEffect, useState } from 'react'; +import Link from 'next/link'; + +interface Milestone { + id: string; + name: string; + description: string; + target_date: string | null; + completed: boolean; + completed_at: string | null; + created_at: string; +} + +const API_BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8000'; + +export default function MilestonesPage() { + const [milestones, setMilestones] = useState加载中...
+暂无里程碑
+点击右上角"+ 新增里程碑"创建第一个里程碑
++ {milestone.description} +
+ )} +- 项目管理模块开发中... +
+ 完整的项目管理与任务跟踪系统
{task.description || '暂无描述'}
++ {task.description || '暂无描述'} +
+ +{task.status}
+{task.priority}
+{task.priority}
{task.progress}%
+