问题: Property 'isTomorrow' does not exist on type 'EmployeeCalendarDay'
修复文件:
yss-project/src/app/pages/team-leader/employee-detail-panel/employee-detail-panel.ts修改内容:
// 在 EmployeeCalendarDay 接口中添加
isTomorrow?: boolean; // ⭐ 新增:标记明天
文件: yss-project/src/app/pages/admin/employees/employees.ts
恢复的方法:
onChangeMonth(direction: number) - 切换日历月份onCalendarDayClick(day: any) - 日历日期点击onProjectClick(projectId: string) - 项目点击onRefreshSurvey() - 刷新问卷数据添加的属性:
currentEmployeeProjects: Array<...> - 保存项目数据用于月份切换文件: yss-project/src/app/pages/admin/employees/employees.ts
关键改进:
targetMonth?: Date✅ 智能处理三种日期场景:
createdAt 和 deadlinedeadline(往前推 30 天)只有 createdAt(往后推 30 天)
private buildCalendarData(
projects: Array<...>,
targetMonth?: Date // ⭐ 支持指定月份
): { currentMonth: Date; days: any[] } {
const now = targetMonth || new Date();
// ⭐ 计算"今天"和"明天"
const today = new Date();
today.setHours(0, 0, 0, 0);
const tomorrow = new Date(today);
tomorrow.setDate(today.getDate() + 1);
// ... 日历生成逻辑
days.push({
date,
projectCount: dayProjects.length,
projects: dayProjects.map(...),
isToday: sameDay(date, today),
isTomorrow: sameDay(date, tomorrow), // ⭐ 标记明天
isCurrentMonth: true
});
}
文件:
yss-project/src/app/pages/team-leader/employee-detail-panel/employee-detail-panel.htmlyss-project/src/app/pages/team-leader/employee-detail-panel/employee-detail-panel.scssHTML 修改:
<div class="calendar-day"
[class.today]="day.isToday"
[class.tomorrow]="day.isTomorrow" <!-- ⭐ 新增 -->
[class.other-month]="!day.isCurrentMonth"
...>
SCSS 新增样式:
&.tomorrow {
border-color: #f59e0b; // 橙色边框
border-width: 2px;
background: #fffbeb; // 淡黄色背景
.day-number {
color: #f59e0b; // 橙色数字
font-weight: 700;
}
.day-badge {
background: #fef3c7; // 淡黄色徽章背景
color: #d97706; // 深橙色文字
}
}
文件: yss-project/docs/PROJECT-RETROSPECTIVE-DATA-ANALYSIS.md
文档内容 (1279 行):
文件: yss-project/SURVEY-DATA-DEBUG-GUIDE.md
文档内容:
employees.ts: viewEmployee()
↓
loadEmployeeSurvey()
↓
selectedEmployeeForPanel
↓
employee-info-panel.component.html
↓
employeeDetailForTeamLeader getter
↓
<app-employee-detail-panel>
↓
employee-detail-panel.html
employee-detail-panel 组件的核心逻辑
getCapabilitySummary() - 能力摘要生成toggleSurveyDisplay() - 问卷显示切换onRefreshSurvey() - 问卷刷新(仅触发事件)getLeaveTypeText() - 请假类型文本能力问卷显示模板
@if (employeeDetail.surveyCompleted && employeeDetail.surveyData)问卷相关样式
.survey-section 的所有样式.survey-content 的所有样式.capability-summary 的所有样式.survey-answers 的所有样式TypeScript:
isTomorrow?: boolean 字段(EmployeeCalendarDay 接口)onChangeMonth(), onCalendarDayClick(), onProjectClick(), onRefreshSurvey() 方法(员工页面)currentEmployeeProjects 属性(员工页面)HTML:
[class.tomorrow]="day.isTomorrow" 绑定SCSS:
&.tomorrow { ... } 样式块// 1. 管理端查询问卷
employees.ts: loadEmployeeSurvey()
→ Profile 查询: ✅ 找到 1 个
→ surveyCompleted: ✅ true
→ SurveyLog 查询: ✅ 找到 1 条
→ 返回: { completed: true, data: {...}, profileId: xxx }
// 2. 数据赋值
employees.ts: selectedEmployeeForPanel = {
...baseData,
surveyCompleted: true, // ✅
surveyData: {...}, // ✅
profileId: xxx // ✅
}
// 3. 数据转换
employee-info-panel.ts: employeeDetailForTeamLeader = {
surveyCompleted: this.employee.surveyCompleted, // ✅ true
surveyData: this.employee.surveyData, // ✅ {...}
profileId: this.employee.profileId // ✅ xxx
}
// 4. 组件接收
<app-employee-detail-panel
[employeeDetail]="employeeDetailForTeamLeader">
// employeeDetail.surveyCompleted = true ✅
// employeeDetail.surveyData = {...} ✅
// 5. 模板渲染
@if (employeeDetail.surveyCompleted && employeeDetail.surveyData) {
// ✅ 条件满足,显示问卷内容
<div class="survey-content">...</div>
}
查找以下关键日志:
// ⚠️ 问题诊断
🔍 [loadEmployeeSurvey] 查找员工 徐福静,找到 X 个结果
// 如果 X = 0 → 问题在 Profile 查询
📋 [loadEmployeeSurvey] Profile ID: xxx, surveyCompleted: true/false
// 如果 false → 问题在 Profile.surveyCompleted 字段
📝 [loadEmployeeSurvey] 找到 X 条问卷记录
// 如果 X = 0 → 问题在 SurveyLog 查询
✅ [employeeDetailForTeamLeader] 转换完成: {
surveyCompleted: true/false,
hasSurveyData: true/false
}
// 如果任一为 false → 问题在数据传递
参考 SURVEY-DATA-DEBUG-GUIDE.md 文档,按照详细步骤逐一排查。
✅ yss-project/src/app/pages/admin/employees/employees.ts
currentEmployeeProjects 属性buildCalendarData 方法(支持月份切换、添加明天标记)viewEmployee 方法(保存项目数据)✅ yss-project/src/app/pages/team-leader/employee-detail-panel/employee-detail-panel.ts
isTomorrow?: boolean 到 EmployeeCalendarDay 接口yss-project/src/app/pages/team-leader/employee-detail-panel/employee-detail-panel.html
[class.tomorrow] 绑定yss-project/src/app/pages/team-leader/employee-detail-panel/employee-detail-panel.scss
&.tomorrow { ... } 样式块yss-project/docs/PROJECT-RETROSPECTIVE-DATA-ANALYSIS.md (新建)yss-project/SURVEY-DATA-DEBUG-GUIDE.md (新建)yss-project/CALENDAR-DATA-FIX-COMPLETE.md (之前创建)yss-project/COMPLETE-SUMMARY.md (本文档)✅ No linter errors found.
✅ 所有类型检查通过
✅ 编译成功
http://localhost:4200/admin/employeeshttp://localhost:4200/team-leader/dashboard如果能力问卷仍未显示,请提供:
Profile.surveyCompleted 值是什么?文档版本: v1.0
完成时间: 2025-11-10
状态: ✅ 所有功能已实现,等待测试反馈