本次实现了完整的员工问卷组件(ProfileSurveyComponent),用于收集员工的专业特长及偏好信息,为智能订单分配提供数据支撑。
[欢迎页] → [答题页] → [结果页]
↑ ↓
└──── 重新填写 ────────┘
src/modules/profile/pages/profile-survey/
├── profile-survey.component.ts # TypeScript逻辑(690行)
├── profile-survey.component.html # HTML模板(完整UI)
└── profile-survey.component.scss # SCSS样式(蓝色/橙色主题)
src/app/
└── app.routes.ts # 路由配置(新增员工问卷路由)
docs/
├── prd/组件-员工问卷.md # 完整PRD文档(1240行)
├── 员工问卷组件测试指南.md # 详细测试指南
└── task/task_state_20251030_员工问卷组件设计.md # 任务状态跟踪
http://localhost:4200/wxwork/{公司ID}/survey/profile
需要通过企业微信登录,或在开发环境中模拟员工身份。
// 支持"最多选3项"这类限制
if (question.maxSelections &&
this.answers[question.id].length >= question.maxSelections) {
window?.fmode?.alert(`最多只能选择 ${question.maxSelections} 项`);
return;
}
提交后自动生成能力摘要,包括:
所有17道题目已根据您提供的调研表完整实现:
一、核心技术能力
二、项目经验与案例
三、项目承接偏好
四、协作与交付习惯
五、问题应对与风险预警
六、补充说明
{
"q1_expertise_styles": ["奶油风", "极简风", "新中式"],
"q2_expertise_spaces": ["常规住宅空间", "特殊功能空间"],
"q3_technical_advantages": ["渲染精度高", "方案深化能力"],
"q4_case_1_type": "140㎡极简风四居室",
"q4_case_1_highlight": "高还原度材质渲染...",
"q5_project_difficulty": "中等难度",
"q6_prefer_project_types": ["擅长风格的常规项目", "新风格探索项目"],
"q7_weekly_capacity": "1-2个(中等难度)",
"q8_urgent_willingness": "愿意承接",
"q8_urgent_limit": "2",
"q9_progress_feedback": "关键节点同步",
"q10_delivery_confirmation": ["交付前必同步客服/组长"],
"q11_requirement_clarity": "基础需求+核心偏好",
"q12_communication_methods": ["群内文字同步", "短语音快速沟通"],
"q13_sensitive_words_awareness": "可识别部分敏感词",
"q14_problem_handling": "先尝试自行调整",
"q15_task_notification": ["工作群@+私信提醒"],
"q16_cannot_accept": "暂无法承接大型商业空间...",
"q17_additional_notes": "擅长使用SU建模..."
}
在 employee-detail-modal.component 中增加"能力问卷"Tab,显示员工填写的问卷答案。
参考代码:
async loadEmployeeSurvey() {
const query = new Parse.Query('SurveyLog');
query.equalTo('profile', this.employee.toPointer());
query.equalTo('type', 'survey-profile');
query.equalTo('isCompleted', true);
const surveyLog = await query.first();
if (surveyLog) {
this.surveyData = surveyLog.get('data');
this.surveyCompleted = true;
}
}
在员工列表中显示问卷填写状态。
参考代码:
<td>
<span class="survey-badge" [class.completed]="employee.surveyCompleted">
{{ employee.surveyCompleted ? '✓ 已填写' : '未填写' }}
</span>
</td>
在企微端工作台增加问卷引导弹窗,引导新员工填写问卷。
参考代码:
async checkSurveyStatus() {
const query = new Parse.Query('SurveyLog');
query.equalTo('profile', this.currentProfile.toPointer());
query.equalTo('type', 'survey-profile');
query.equalTo('isCompleted', true);
const surveyLog = await query.first();
if (!surveyLog) {
this.showSurveyGuide = true;
}
}
基于问卷数据优化订单分配算法,自动匹配合适的设计师。
参考逻辑:
PRD文档:docs/prd/组件-员工问卷.md
测试指南:docs/员工问卷组件测试指南.md
任务状态:docs/task/task_state_20251030_员工问卷组件设计.md
type SurveyState = 'welcome' | 'questionnaire' | 'result';
currentState: SurveyState = 'welcome';
this.wxAuth = new WxworkAuth({ cid: this.cid, appId: 'crm' });
this.currentProfile = await this.wxAuth.currentProfile();
// 每答一题自动保存
async saveAnswer(questionId: string, answer: any) {
const data = this.surveyLog.get('data') || {};
data[questionId] = answer;
this.surveyLog.set('data', data);
await this.surveyLog.save();
}
// 查询未完成的问卷
const surveyLog = await query.first();
if (surveyLog && !surveyLog.get('isCompleted')) {
this.answers = surveyLog.get('data') || {};
this.currentState = 'questionnaire';
}
# 启动开发服务器
ng serve
# 访问问卷页面
# http://localhost:4200/wxwork/test/survey/profile
// 浏览器控制台
const Parse = window.Parse;
const query = new Parse.Query('SurveyLog');
query.equalTo('type', 'survey-profile');
const results = await query.find();
console.log('员工问卷:', results);
本次实现了一个完整、美观、功能强大的员工问卷组件,包含:
组件已可独立测试运行,可通过URL直接访问并完整体验所有功能!
开发完成时间:2025-10-30
组件状态:✅ 已完成,可测试
文档完整度:✅ 100%
代码质量:✅ 无linter错误