功能描述:展示各部门在4个维度的绩效对比
数据来源:需要对接真实项目数据
Project 表必要字段:
Project {
department: Pointer<Department> // 部门关联
currentStage: string // 当前阶段
status: string // 项目状态
data: {
timeline: {
expectedDate: Date // 预计完成日期
actualDate: Date // 实际完成日期
},
quality: {
score: number // 质量评分
isExcellent: boolean // 是否优秀作品
},
clientSatisfaction: number // 客户满意度
}
}
实现方案:
// 查询逻辑
async loadDepartmentPerformance() {
const departments = await new Parse.Query('Department').find();
const performance = await Promise.all(departments.map(async dept => {
const projectQuery = new Parse.Query('Project');
projectQuery.equalTo('department', dept);
projectQuery.greaterThan('createdAt', this.getLastMonthDate());
const projects = await projectQuery.find();
// 计算各维度数据
const total = projects.length;
const completed = projects.filter(p => p.get('status') === 'completed').length;
const excellent = projects.filter(p => p.get('data')?.quality?.isExcellent).length;
const overdue = projects.filter(p => {
const expected = p.get('data')?.timeline?.expectedDate;
const actual = p.get('data')?.timeline?.actualDate;
return actual && expected && actual > expected;
}).length;
const satisfactionAvg = projects.reduce((sum, p) =>
sum + (p.get('data')?.clientSatisfaction || 0), 0) / total;
return {
department: dept.get('name'),
completionRate: (completed / total) * 100,
excellentWorkRate: (excellent / total) * 100,
satisfactionRate: satisfactionAvg,
overdueRate: (overdue / total) * 100
};
}));
this.departmentPerformance = performance;
}
功能描述:展示设计师职级占比
数据来源:
Profile 表必要字段:
Profile {
roleName: string // 职位名称
isActivated: boolean // 是否已激活
isDeleted: boolean // 是否已删除
data: {
hrData: {
level: 'junior' | 'intermediate' | 'senior' // 职级
employmentStatus: string // 在职状态
}
}
}
实现方案:
async loadRankDistribution() {
const query = new Parse.Query('Profile');
query.equalTo('isActivated', true);
query.notEqualTo('isDeleted', true);
query.equalTo('data.hrData.employmentStatus', 'active');
const profiles = await query.find();
const distribution = {
junior: 0,
intermediate: 0,
senior: 0
};
profiles.forEach(profile => {
const level = profile.get('data')?.hrData?.level || 'junior';
distribution[level]++;
});
const total = profiles.length;
this.rankDistribution = [
{ level: '初级设计师', count: distribution.junior,
percentage: (distribution.junior / total * 100).toFixed(1),
color: '#4CAF50' },
{ level: '中级设计师', count: distribution.intermediate,
percentage: (distribution.intermediate / total * 100).toFixed(1),
color: '#2196F3' },
{ level: '高级设计师', count: distribution.senior,
percentage: (distribution.senior / total * 100).toFixed(1),
color: '#FF9800' }
];
}
功能描述:展示近6个月人员流动情况
数据来源:
Profile 表必要字段:
Profile {
createdAt: Date // 入职日期(创建时间)
data: {
hrData: {
hireDate: Date // 正式入职日期
resignationDate: Date // 离职日期
employmentStatus: string // 在职状态
}
}
}
实现方案:
async loadMonthlyTrend() {
const months = this.getLast6Months();
const monthlyData = await Promise.all(months.map(async month => {
const startDate = new Date(month.year, month.month, 1);
const endDate = new Date(month.year, month.month + 1, 0);
// 查询当月入职人数
const hireQuery = new Parse.Query('Profile');
hireQuery.greaterThanOrEqualTo('createdAt', startDate);
hireQuery.lessThanOrEqualTo('createdAt', endDate);
const hired = await hireQuery.count();
// 查询当月离职人数
const resignQuery = new Parse.Query('Profile');
resignQuery.greaterThanOrEqualTo('data.hrData.resignationDate', startDate);
resignQuery.lessThanOrEqualTo('data.hrData.resignationDate', endDate);
const left = await resignQuery.count();
return {
month: `${month.year}-${(month.month + 1).toString().padStart(2, '0')}`,
hired,
left,
notes: ''
};
}));
this.monthlyTrend = monthlyData;
}
功能描述:分析员工离职原因并提供改进建议
数据来源:需要新建 ResignationRecord 表
ResignationRecord必要字段:
ResignationRecord {
profile: Pointer<Profile> // 关联员工
resignationDate: Date // 离职日期
reason: string // 离职原因
reasonCategory: string // 原因分类(薪酬/发展/环境/个人/其他)
department: Pointer<Department> // 部门
exitInterview: {
satisfaction: number // 满意度评分
feedback: string // 反馈意见
wouldReturn: boolean // 是否愿意回归
recommendations: string[] // 改进建议
},
data: {
analysisReport: {
rootCause: string // 根本原因
improvementPlan: string[] // 改进计划
priority: 'high' | 'medium' | 'low'
}
}
}
实现方案:
async loadResignationAnalysis(timeRange: '3months' | '6months' | '1year') {
const startDate = this.getStartDateByRange(timeRange);
const query = new Parse.Query('ResignationRecord');
query.greaterThanOrEqualTo('resignationDate', startDate);
query.include('profile');
query.include('department');
const records = await query.find();
// 分析原因分布
const reasonDistribution = this.analyzeReasonDistribution(records);
// 生成改进建议
const improvements = this.generateImprovementPlan(records);
return {
distribution: reasonDistribution,
improvements,
totalCount: records.length
};
}
功能描述:使用豆包AI分析简历,进行多维度筛选
数据来源:需要新建 Resume 表和 ResumeAnalysis 表
新建表1:Resume
Resume {
candidateName: string // 候选人姓名
contact: {
phone: string // 手机号
email: string // 邮箱
wechat: string // 微信号
},
resumeText: string // 简历内容(文本)
resumeFileUrl: string // 简历文件URL
uploadDate: Date // 上传日期
status: 'pending' | 'analyzed' | 'rejected' | 'interview' | 'offer'
// 基本信息
education: {
degree: 'high_school' | 'junior_college' | 'bachelor' | 'master' | 'doctor'
school: string
major: string
graduationDate: Date
},
experience: {
totalYears: number // 总工作年数
relevantYears: number // 相关工作年数
companies: Array<{
name: string
position: string
duration: string
description: string
}>
},
skills: string[] // 技能列表
projects: Array<{
name: string
role: string
description: string
techStack: string[]
}>,
jobPosition: string // 应聘职位
expectedSalary: number // 期望薪资
}
新建表2:ResumeAnalysis
ResumeAnalysis {
resume: Pointer<Resume> // 关联简历
analysisDate: Date // 分析时间
overallScore: number // 综合评分 (0-100)
// 多维度评分
dimensions: {
education: {
score: number // 学历评分
level: 'high' | 'medium' | 'low'
detail: string
},
skills: {
score: number // 技能评分
level: 'high' | 'medium' | 'low'
matchedSkills: string[]
missingSkills: string[]
},
projectExperience: {
score: number // 项目经验评分
level: 'high' | 'medium' | 'low'
relevantProjects: number
projectTypes: string[] // 擅长项目类型
},
workExperience: {
score: number // 工作经验评分
level: 'high' | 'medium' | 'low'
yearsMatched: boolean
},
capability: {
score: number // 综合能力评分
level: 'high' | 'medium' | 'low'
strengths: string[] // 优势
weaknesses: string[] // 不足
},
cultureFit: {
score: number // 文化匹配度
level: 'high' | 'medium' | 'low'
analysis: string
}
},
// AI推荐结论
recommendation: {
level: 'recommend' | 'consider' | 'reject'
summary: string
reasons: string[]
concerns: string[]
confidence: number
},
// 筛选信息
screeningResults: Array<{
criterion: string // 筛选标准
status: 'pass' | 'warning' | 'fail'
detail: string
}>
}
AI分析实现方案:
async analyzeResumeWithAI(resumeId: string) {
// 1. 获取简历数据
const resumeQuery = new Parse.Query('Resume');
const resume = await resumeQuery.get(resumeId);
// 2. 准备AI分析请求
const analysisRequest: ResumeAnalysisRequest = {
resumeText: resume.get('resumeText'),
jobPosition: resume.get('jobPosition'),
jobRequirements: [
'本科及以上学历',
'3年以上设计经验',
'熟练使用 Photoshop, Illustrator, Sketch',
'有室内设计项目经验',
'良好的沟通能力和团队协作精神'
]
};
// 3. 调用豆包AI服务
const aiResponse = await this.doubaoAiService
.analyzeResume(analysisRequest)
.toPromise();
// 4. 保存分析结果到 ResumeAnalysis 表
const ResumeAnalysisClass = Parse.Object.extend('ResumeAnalysis');
const analysis = new ResumeAnalysisClass();
analysis.set('resume', resume);
analysis.set('analysisDate', new Date());
analysis.set('overallScore', aiResponse.overallScore);
// 多维度评分
analysis.set('dimensions', {
education: this.extractEducationDimension(aiResponse),
skills: this.extractSkillsDimension(aiResponse),
projectExperience: this.extractProjectDimension(aiResponse),
workExperience: this.extractWorkDimension(aiResponse),
capability: this.extractCapabilityDimension(aiResponse),
cultureFit: this.extractCultureDimension(aiResponse)
});
// AI推荐结论
analysis.set('recommendation', {
level: aiResponse.recommendation.level,
summary: aiResponse.recommendation.summary,
reasons: aiResponse.recommendation.reasons,
concerns: aiResponse.recommendation.concerns,
confidence: aiResponse.recommendation.confidence
});
// 筛选结果
analysis.set('screeningResults', aiResponse.screeningInfo.map(info => ({
criterion: info.title,
status: info.status,
detail: info.detail
})));
await analysis.save();
// 5. 更新简历状态
resume.set('status', 'analyzed');
await resume.save();
return analysis;
}
AI分析维度详解:
待续第2部分:招聘流程跟踪、绩效分析、新人管理...