|
|
@@ -394,30 +394,51 @@ export class ProjectTimelineComponent implements OnInit, OnDestroy {
|
|
|
|
|
|
// 继续添加剩余阶段:渲染 -> 后期
|
|
|
if (project.phaseDeadlines) {
|
|
|
- const remainingPhases: PhaseName[] = ['rendering', 'postProcessing'];
|
|
|
+ // 渲染阶段
|
|
|
+ const renderingInfo = project.phaseDeadlines['rendering'];
|
|
|
+ if (renderingInfo && renderingInfo.deadline) {
|
|
|
+ const renderingDeadline = new Date(renderingInfo.deadline);
|
|
|
+ if (this.isEventInFuture(renderingDeadline)) {
|
|
|
+ const renderingConfig = PHASE_INFO['rendering'];
|
|
|
+ const isDelayed = isPhaseDelayed(renderingInfo);
|
|
|
+ events.push({
|
|
|
+ date: renderingDeadline,
|
|
|
+ label: `${renderingConfig.label}截止`,
|
|
|
+ type: 'phase_deadline',
|
|
|
+ phase: 'rendering',
|
|
|
+ projectId: project.projectId,
|
|
|
+ color: isDelayed ? '#dc2626' : renderingConfig.color,
|
|
|
+ icon: renderingConfig.label.charAt(0)
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- remainingPhases.forEach(phaseName => {
|
|
|
- const phaseInfo = project.phaseDeadlines?.[phaseName];
|
|
|
- if (phaseInfo && phaseInfo.deadline) {
|
|
|
- const deadline = new Date(phaseInfo.deadline);
|
|
|
+ // 🔥 后期阶段(始终显示在时间范围内的后期截止,并确保不与交付重合)
|
|
|
+ const postProcessingInfo = project.phaseDeadlines['postProcessing'];
|
|
|
+ if (postProcessingInfo && postProcessingInfo.deadline) {
|
|
|
+ const postDeadline = new Date(postProcessingInfo.deadline);
|
|
|
+
|
|
|
+ // 检查是否与交付日期重合(误差在12小时以内视为重合)
|
|
|
+ const isNearDelivery = project.deliveryDate &&
|
|
|
+ Math.abs(postDeadline.getTime() - project.deliveryDate.getTime()) < 12 * 60 * 60 * 1000;
|
|
|
+
|
|
|
+ // 只要在时间范围内就显示,除非与交付日期太接近
|
|
|
+ if (this.isEventInRange(postDeadline) && !isNearDelivery) {
|
|
|
+ const postConfig = PHASE_INFO['postProcessing'];
|
|
|
+ const isDelayed = isPhaseDelayed(postProcessingInfo);
|
|
|
+ const isPast = postDeadline.getTime() < this.currentTime.getTime();
|
|
|
|
|
|
- // 只显示未来的阶段截止事件
|
|
|
- if (this.isEventInFuture(deadline)) {
|
|
|
- const phaseConfig = PHASE_INFO[phaseName];
|
|
|
- const isDelayed = isPhaseDelayed(phaseInfo);
|
|
|
-
|
|
|
- events.push({
|
|
|
- date: deadline,
|
|
|
- label: `${phaseConfig.label}截止`,
|
|
|
- type: 'phase_deadline',
|
|
|
- phase: phaseName,
|
|
|
- projectId: project.projectId,
|
|
|
- color: isDelayed ? '#dc2626' : phaseConfig.color,
|
|
|
- icon: phaseConfig.label.charAt(0)
|
|
|
- });
|
|
|
- }
|
|
|
+ events.push({
|
|
|
+ date: postDeadline,
|
|
|
+ label: `${postConfig.label}截止`,
|
|
|
+ type: 'phase_deadline',
|
|
|
+ phase: 'postProcessing',
|
|
|
+ projectId: project.projectId,
|
|
|
+ color: isPast ? '#94a3b8' : (isDelayed ? '#dc2626' : postConfig.color),
|
|
|
+ icon: postConfig.label.charAt(0)
|
|
|
+ });
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 交付事件
|