施工管理支持已完成项目+修复状态显示逻辑

This commit is contained in:
a273825743
2026-05-17 01:24:37 +08:00
parent 86a4cc65ee
commit 9d8f741771
4 changed files with 22 additions and 8 deletions
@@ -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>
)}
+1 -1
View File
@@ -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>