成功将员工能力问卷功能整合到现有的企业微信身份激活流程和组长端设计师详情查看功能中。
实施日期: 2025-10-31 实施人员: AI助手 用户需求: 员工进入系统时需要填写身份激活信息和能力问卷,组长/管理员可以在详情弹窗中查看问卷答案
src/app/pages/designer/dashboard/dashboard.ts新增属性:
// 新增:问卷相关属性
showSurveyGuide: boolean = false;
surveyCompleted: boolean = false;
新增方法:
checkSurveyStatus(): 检查当前员工的问卷完成状态goToSurvey(): 跳转到员工问卷页面closeSurveyGuide(): 关闭问卷引导弹窗修改逻辑:
authenticateAndLoadData() 方法中,成功认证后调用 checkSurveyStatus()src/app/pages/designer/dashboard/dashboard.html新增内容:
src/app/pages/designer/dashboard/dashboard.scss新增样式类:
.survey-guide-overlay: 全屏遮罩层.survey-guide-modal: 弹窗主体.modal-header: 弹窗头部.modal-content: 弹窗内容区.benefit-list / .benefit-item: 优势列表.modal-footer: 弹窗底部按钮区src/app/pages/team-leader/dashboard/dashboard.ts修改接口:
interface EmployeeDetail {
// ... 原有字段
// 新增:问卷相关
surveyCompleted?: boolean; // 是否完成问卷
surveyData?: any; // 问卷答案数据
profileId?: string; // Profile ID
}
修改方法:
onEmployeeClick() 改为异步方法generateEmployeeDetail() 改为异步方法generateEmployeeDetail() 中添加问卷数据加载逻辑:
ProfilesurveyCompleted 字段SurveyLog 表加载问卷答案数据查询逻辑:
// 1. 查找Profile
const profileQuery = new Parse.Query('Profile');
profileQuery.equalTo('realname', employeeName);
// 2. 查找问卷记录
const surveyQuery = new Parse.Query('SurveyLog');
surveyQuery.equalTo('profile', profile.toPointer());
surveyQuery.equalTo('type', 'survey-profile');
src/app/pages/team-leader/dashboard/dashboard.html新增内容:
src/app/pages/team-leader/dashboard/dashboard.scss新增样式类:
.survey-section: 问卷部分容器.survey-content: 问卷内容区.survey-status: 完成状态显示.survey-answers: 答案列表.answer-item: 单个答案项.answer-tag: 答案标签(单选/多选).answer-scale: 评分进度条.survey-empty: 未完成状态显示设计特点:
1. 设计师登录 → authenticateAndLoadData()
2. 认证成功 → checkSurveyStatus()
3. 查询Profile.surveyCompleted
4. 如果未完成 → showSurveyGuide = true
5. 点击"立即填写" → 跳转到 /wxwork/:cid/survey/profile
6. 填写完成 → 保存到SurveyLog表
7. 更新Profile.surveyCompleted = true
8. 返回工作台 → 不再显示引导
1. 组长点击甘特图员工 → onEmployeeClick(employeeName)
2. 调用 generateEmployeeDetail(employeeName)
3. 通过realname查找Profile
4. 读取Profile.surveyCompleted
5. 如果已完成 → 查询SurveyLog
6. 加载问卷答案数据
7. 在详情面板中展示
{
realname: string, // 员工真实姓名
surveyCompleted: boolean, // 是否完成问卷
surveyCompletedAt: Date, // 问卷完成时间
surveyLogId: string // 关联的SurveyLog ID
}
{
type: 'survey-profile', // 问卷类型
profile: Pointer<Profile>, // 关联的Profile
answers: Array<{
question: string, // 问题文本
type: 'single' | 'multiple' | 'scale', // 题型
answer: string | string[] | number // 答案
}>,
createdAt: Date,
updatedAt: Date
}
http://localhost:4200/wxwork/test/survey/profileProfile.surveyCompleted 应为 trueSurveyLog 应有新记录无
src/app/pages/designer/dashboard/dashboard.ts - 设计师工作台TSsrc/app/pages/designer/dashboard/dashboard.html - 设计师工作台HTMLsrc/app/pages/designer/dashboard/dashboard.scss - 设计师工作台样式src/app/pages/team-leader/dashboard/dashboard.ts - 组长工作台TSsrc/app/pages/team-leader/dashboard/dashboard.html - 组长工作台HTMLsrc/app/pages/team-leader/dashboard/dashboard.scss - 组长工作台样式docs/员工身份激活与问卷整合方案.md - 整合方案(已存在)docs/员工问卷整合方案-简化版.md - 简化方案(已存在)EMPLOYEE-SURVEY-INTEGRATION-SUMMARY.md - 本实施总结(新建)Profile 表有 surveyCompleted 字段(Boolean)Profile 表有 surveyCompletedAt 字段(Date)Profile 表有 surveyLogId 字段(String)SurveyLog 表已创建并配置好权限/wxwork/:cid/survey/profileWxworkAuthGuardlimit(1) 和 descending('createdAt')try-catch 错误处理,避免崩溃性能优化
功能增强
用户体验
数据安全
如有问题或需要进一步优化,请联系开发团队。
文档版本: v1.0 最后更新: 2025-10-31