施工管理支持已完成项目+修复状态显示逻辑
This commit is contained in:
@@ -50,12 +50,12 @@ const ConstructionOverview: React.FC = () => {
|
||||
};
|
||||
|
||||
const getStatusColor = (status: string) => {
|
||||
const map: Record<string, string> = { active: 'green', planning: 'blue', completed: 'default', suspended: 'orange' };
|
||||
const map: Record<string, string> = { active: 'green', in_progress: 'processing', planning: 'blue', completed: 'default', suspended: 'orange' };
|
||||
return map[status] || 'default';
|
||||
};
|
||||
|
||||
const getStatusText = (status: string) => {
|
||||
const map: Record<string, string> = { active: '施工中', planning: '待开工', completed: '已完工', suspended: '暂停' };
|
||||
const map: Record<string, string> = { active: '施工中', in_progress: '施工中', planning: '待开工', completed: '已完工', suspended: '暂停' };
|
||||
return map[status] || status;
|
||||
};
|
||||
|
||||
|
||||
@@ -221,10 +221,24 @@ const ConstructionProgress: React.FC = () => {
|
||||
{!currentPhase && pendingPhases.length === 0 && completedPhases.length === 0 && (
|
||||
<Card>
|
||||
<div style={{ textAlign: 'center', padding: 24 }}>
|
||||
<Text type="secondary">此项目尚未初始化施工阶段</Text>
|
||||
<div style={{ marginTop: 16 }}>
|
||||
<Button type="primary" onClick={() => navigate(`/projects/${id}`)}>返回项目详情</Button>
|
||||
</div>
|
||||
{project?.status === 'completed' ? (
|
||||
<>
|
||||
<CheckCircleOutlined style={{ fontSize: 48, color: '#52c41a', marginBottom: 16 }} />
|
||||
<Title level={4} style={{ color: '#52c41a' }}>项目已完成</Title>
|
||||
<Paragraph type="secondary">此项目已完工,无需施工阶段推进</Paragraph>
|
||||
<div style={{ marginTop: 16 }}>
|
||||
<Button onClick={() => navigate(`/projects/${id}`)}>查看项目详情</Button>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Text type="secondary">此项目尚未初始化施工阶段</Text>
|
||||
<Paragraph type="secondary" style={{ marginTop: 8 }}>请在项目详情中选择工程模板来初始化施工阶段</Paragraph>
|
||||
<div style={{ marginTop: 16 }}>
|
||||
<Button type="primary" onClick={() => navigate(`/projects/${id}`)}>前往项目详情</Button>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</Card>
|
||||
)}
|
||||
|
||||
@@ -310,7 +310,7 @@ const ProjectsPage: React.FC = () => {
|
||||
<Select options={[
|
||||
{ value: 'planning', label: '规划中' },
|
||||
{ value: 'in_progress', label: '进行中' },
|
||||
{ value: 'completed', label: '已完成' },
|
||||
{ value: 'completed', label: '已完成(补录历史项目)' },
|
||||
]} />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
|
||||
Reference in New Issue
Block a user