0235711 пре 2 дана
родитељ
комит
b5a7d2d542
1 измењених фајлова са 46 додато и 0 уклоњено
  1. 46 0
      src/app/pages/team-leader/dashboard/dashboard.ts

+ 46 - 0
src/app/pages/team-leader/dashboard/dashboard.ts

@@ -196,6 +196,52 @@ export class Dashboard implements OnInit {
       }
     ];
 
+    // ===== 追加生成示例数据:保证总量达到100条 =====
+    const stageIds = this.projectStages.map(s => s.id);
+    const designers = ['张三','李四','王五','赵六','钱七','孙八','周九','吴十','郑一','冯二','陈三','褚四'];
+    const statusMap: Record<string, string> = {
+      pendingApproval: '待确认',
+      pendingAssignment: '待分配',
+      requirement: '进行中',
+      planning: '进行中',
+      modeling: '进行中',
+      rendering: '进行中',
+      postProduction: '进行中',
+      review: '进行中',
+      revision: '进行中',
+      delivery: '已完成'
+    };
+
+    for (let i = 8; i <= 100; i++) {
+      const stageIndex = (i - 1) % stageIds.length;
+      const currentStage = stageIds[stageIndex];
+      const type: 'soft' | 'hard' = i % 2 === 0 ? 'soft' : 'hard';
+      const urgency: 'high' | 'medium' | 'low' = i % 5 === 0 ? 'high' : (i % 3 === 0 ? 'medium' : 'low');
+      const isOverdue = ['planning','modeling','rendering','postProduction','review','revision','delivery'].includes(currentStage) ? i % 7 === 0 : false;
+      const overdueDays = isOverdue ? (i % 10) + 1 : 0;
+      const hasDesigner = !['pendingApproval', 'pendingAssignment'].includes(currentStage);
+      const designerName = hasDesigner ? designers[i % designers.length] : '';
+      const status = statusMap[currentStage] || '进行中';
+      const expectedEndDate = new Date();
+      const daysOffset = isOverdue ? - (overdueDays + (i % 5)) : ((i % 20) + 3);
+      expectedEndDate.setDate(expectedEndDate.getDate() + daysOffset);
+
+      this.projects.push({
+        id: `proj-${String(i).padStart(3, '0')}`,
+        name: `${type === 'soft' ? '软装' : '硬装'}示例项目 ${i}`,
+        type,
+        designerName,
+        status,
+        expectedEndDate,
+        isOverdue,
+        overdueDays,
+        urgency,
+        currentStage,
+        phases: []
+      });
+    }
+    // ===== 示例数据生成结束 =====
+
     // 筛选超期项目
     this.overdueProjects = this.projects.filter(project => project.isOverdue);
     this.filteredProjects = [...this.projects];