import { requestClient } from '#/api/request';
|
|
export namespace HrmStatisticsApi {
|
/** 分布项 */
|
export interface Item {
|
name: string;
|
value: number;
|
}
|
|
/** 部门工龄统计 */
|
export interface DeptTenure {
|
deptId?: number;
|
deptName: string;
|
count: number;
|
averageTenureYears: number;
|
}
|
|
/** 员工工龄明细 */
|
export interface TenureEmployee {
|
id: number;
|
name: string;
|
deptName: string;
|
hireDate: string;
|
tenureYears: number;
|
}
|
|
/** 入职 / 离职趋势项 */
|
export interface Trend {
|
month: string; // yyyy-MM
|
hireCount: number; // 入职人数
|
resignCount: number; // 离职人数
|
}
|
|
/** 员工人力统计 */
|
export interface EmployeeStatistics {
|
totalCount: number; // 在岗人数(在职 + 试用)
|
activeCount: number; // 在职人数
|
probationCount: number; // 试用人数
|
resignedCount: number; // 离职人数
|
averageTenureYears: number; // 平均工龄(年)
|
averageAge: number; // 平均年龄(岁)
|
thisYearHireCount: number; // 本年入职人数
|
thisYearResignCount: number; // 本年离职人数
|
tenureDistribution: Item[]; // 工龄分布
|
ageDistribution: Item[]; // 年龄分布
|
educationDistribution: Item[]; // 学历分布
|
genderDistribution: Item[]; // 性别分布
|
statusDistribution: Item[]; // 人员状态构成(在职 / 试用 / 离职)
|
deptDistribution: Item[]; // 部门人数分布
|
postDistribution: Item[]; // 岗位分布
|
marriageDistribution: Item[]; // 婚姻状况分布
|
politicalDistribution: Item[]; // 政治面貌分布
|
hireResignTrend: Trend[]; // 近 12 个月入职 / 离职趋势
|
contractWarning: Item[]; // 合同到期预警
|
noContractCount: number; // 在岗未签有效合同人数
|
deptTenureList: DeptTenure[]; // 部门工龄统计
|
topTenureEmployees: TenureEmployee[]; // 工龄排行
|
}
|
}
|
|
/** 获得员工人力统计 */
|
export function getTenureStatistics() {
|
return requestClient.get<HrmStatisticsApi.EmployeeStatistics>(
|
'/hrm/employee/tenure-statistics',
|
);
|
}
|