interfaces.ts 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. import { IssueStatus, IssuePriority, IssueType } from '../../../../modules/project/services/project-issue.service';
  2. export interface ProjectStage {
  3. id: string;
  4. name: string;
  5. order: number;
  6. }
  7. export interface ProjectPhase {
  8. name: string;
  9. percentage: number;
  10. startPercentage: number;
  11. isCompleted: boolean;
  12. isCurrent: boolean;
  13. }
  14. export interface Project {
  15. id: string;
  16. name: string;
  17. type: 'soft' | 'hard';
  18. memberType: 'vip' | 'normal';
  19. designerName: string;
  20. status: string;
  21. expectedEndDate: Date;
  22. deadline: Date;
  23. createdAt?: Date;
  24. isOverdue: boolean;
  25. overdueDays: number;
  26. dueSoon: boolean;
  27. urgency: 'high' | 'medium' | 'low';
  28. phases: ProjectPhase[];
  29. currentStage: string;
  30. qualityRating?: 'excellent' | 'qualified' | 'unqualified' | 'pending';
  31. // 新增:项目状态标记
  32. isStalled?: boolean; // 停滞期
  33. isModification?: boolean; // 改图期
  34. lastCustomerFeedback?: string;
  35. // 🆕 停滞/改图原因相关字段
  36. stagnationReasonType?: 'designer' | 'customer' | 'custom';
  37. stagnationCustomReason?: string;
  38. modificationReasonType?: 'designer' | 'customer' | 'custom';
  39. modificationCustomReason?: string;
  40. estimatedResumeDate?: Date;
  41. reasonNotes?: string;
  42. markedAt?: Date;
  43. markedBy?: string;
  44. searchIndex?: string;
  45. // 可选扩展字段
  46. contact?: any;
  47. customer?: string;
  48. designerId?: string;
  49. designerIds?: string[];
  50. space?: string;
  51. demoday?: Date;
  52. updatedAt?: Date | string;
  53. data?: any;
  54. }
  55. export interface TodoTask {
  56. id: string;
  57. title: string;
  58. description: string;
  59. deadline: Date;
  60. priority: 'high' | 'medium' | 'low';
  61. type: 'review' | 'assign' | 'performance';
  62. targetId: string;
  63. }
  64. export interface TodoTaskFromIssue {
  65. id: string;
  66. title: string;
  67. description?: string;
  68. priority: IssuePriority;
  69. type: IssueType;
  70. status: IssueStatus;
  71. projectId: string;
  72. projectName: string;
  73. relatedSpace?: string;
  74. relatedStage?: string;
  75. assigneeName?: string;
  76. creatorName?: string;
  77. createdAt: Date;
  78. updatedAt: Date;
  79. dueDate?: Date;
  80. tags?: string[];
  81. }
  82. export interface UrgentEvent {
  83. id: string;
  84. title: string;
  85. description: string;
  86. eventType: 'review' | 'delivery' | 'phase_deadline' | 'customer_alert';
  87. phaseName?: string;
  88. deadline: Date;
  89. projectId: string;
  90. projectName: string;
  91. designerName?: string;
  92. urgencyLevel: 'critical' | 'high' | 'medium';
  93. overdueDays?: number;
  94. completionRate?: number;
  95. category?: 'customer' | 'phase' | 'review' | 'delivery';
  96. statusType?: 'dueSoon' | 'overdue' | 'stagnant' | 'modification';
  97. followUpNeeded?: boolean;
  98. allowConfirmOnTime?: boolean;
  99. allowMarkHandled?: boolean;
  100. allowCreateTodo?: boolean;
  101. stagnationDays?: number;
  102. customerIssueType?: 'feedback_pending' | 'complaint' | 'idle';
  103. labels?: string[];
  104. isMuted?: boolean;
  105. // 🆕 停滞/改图原因相关字段
  106. isMarkedAsStagnant?: boolean;
  107. isMarkedAsModification?: boolean;
  108. stagnationReasonType?: 'designer' | 'customer' | 'custom';
  109. stagnationCustomReason?: string;
  110. modificationReasonType?: 'designer' | 'customer' | 'custom';
  111. modificationCustomReason?: string;
  112. estimatedResumeDate?: Date;
  113. reasonNotes?: string;
  114. markedAt?: Date;
  115. markedBy?: string;
  116. priorityWeight?: number;
  117. }
  118. export interface LeaveRecord {
  119. id: string;
  120. employeeName: string;
  121. date: string;
  122. isLeave: boolean;
  123. leaveType?: 'sick' | 'personal' | 'annual' | 'other';
  124. reason?: string;
  125. }
  126. export interface EmployeeDetail {
  127. name: string;
  128. currentProjects: number;
  129. projectNames: string[];
  130. projectData: Array<{ id: string; name: string }>;
  131. leaveRecords: LeaveRecord[];
  132. redMarkExplanation: string;
  133. calendarData?: EmployeeCalendarData;
  134. surveyCompleted?: boolean;
  135. surveyData?: any;
  136. profileId?: string;
  137. }
  138. export interface EmployeeCalendarData {
  139. currentMonth: Date;
  140. days: EmployeeCalendarDay[];
  141. }
  142. export interface EmployeeCalendarDay {
  143. date: Date;
  144. projectCount: number;
  145. projects: Array<{ id: string; name: string; deadline?: Date }>;
  146. isToday: boolean;
  147. isCurrentMonth: boolean;
  148. }