feat: add attendee and device management tabs, and implement outdoor fair statistics
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled

This commit is contained in:
2026-06-26 11:26:08 +08:00
parent d942d77fdc
commit 7b9e8426de
8 changed files with 928 additions and 0 deletions

View File

@@ -129,6 +129,53 @@ export async function getOutdoorFairInfo(id: number) {
});
}
/** 招聘会统计-时间桶序列项(曲线图用) */
export interface OutdoorFairStatisticsSeriesItem {
time: string;
fairCount: number;
companyCount: number;
jobCount: number;
}
/** 招聘会数同比/环比 */
export interface OutdoorFairStatisticsRate {
fairCount: number;
previousFairCount: number;
/** 增长率:(current-previous)/previous上期为 0 时为 null */
rate?: number | null;
}
/** 招聘会统计结果dashboard */
export interface OutdoorFairStatisticsResult {
granularity: 'day' | 'week' | 'month' | 'year';
totals: { fairCount: number; companyCount: number; jobCount: number };
yoy: OutdoorFairStatisticsRate;
mom: OutdoorFairStatisticsRate;
series: OutdoorFairStatisticsSeriesItem[];
}
/** 招聘会统计查询参数 */
export interface OutdoorFairStatisticsParams {
/** 粒度day/week/month/year */
granularity?: 'day' | 'week' | 'month' | 'year';
/** 起始时间 yyyy-MM-dd HH:mm:ss */
startTime?: string;
/** 截止时间 yyyy-MM-dd HH:mm:ss */
endTime?: string;
}
/**
* 招聘会数据统计
* GET /api/cms/outdoor-fair/statistics
* skipErrorHandler: 由调用方自行处理错误,避免全局弹窗把 null msg 显示成 "null"
*/
export async function getOutdoorFairStatistics(params: OutdoorFairStatisticsParams) {
return request<{ code: number; msg?: string; data: OutdoorFairStatisticsResult }>(
`${CMS_OUTDOOR_FAIR_BASE}/statistics`,
{ method: 'GET', params, skipErrorHandler: true },
);
}
/**
* 新增户外招聘会
* POST /api/cms/outdoor-fair

View File

@@ -0,0 +1,106 @@
import { request } from '@umijs/max';
/** 户外招聘会签到人员列表项 */
export interface OutdoorFairAttendeeItem {
id: number;
fairId: number;
/** 人员姓名 */
name: string;
/** 手机号 */
phone?: string;
/** 住址 */
address?: string;
/** 签到时间 */
checkInTime?: string;
createBy?: string;
createTime?: string;
updateBy?: string;
updateTime?: string;
remark?: string;
}
/** 签到人员查询参数 */
export interface OutdoorFairAttendeeListParams {
fairId?: number;
name?: string;
phone?: string;
current?: number;
pageSize?: number;
}
/** 签到人员列表响应 */
export interface OutdoorFairAttendeeListResult {
code: number;
msg?: string;
total: number;
rows: OutdoorFairAttendeeItem[];
}
/** 签到人员新增/编辑表单 */
export interface OutdoorFairAttendeeForm {
id?: number;
fairId: number;
name: string;
phone?: string;
address?: string;
checkInTime?: string;
}
/** 通用响应 */
export interface OutdoorFairAttendeeCommonResult {
code: number;
msg?: string;
data?: OutdoorFairAttendeeItem;
}
const BASE = '/api/cms/outdoor-fair-attendee';
const formatDateTime = (value: any) => {
if (value && typeof value.format === 'function') {
return value.format('YYYY-MM-DD HH:mm:ss');
}
return value;
};
/**
* 获取签到人员列表
* GET /api/cms/outdoor-fair-attendee/list
*/
export async function getOutdoorFairAttendeeList(params?: OutdoorFairAttendeeListParams) {
return request<OutdoorFairAttendeeListResult>(`${BASE}/list`, {
method: 'GET',
params,
});
}
/**
* 新增签到人员
* POST /api/cms/outdoor-fair-attendee
*/
export async function addOutdoorFairAttendee(data: OutdoorFairAttendeeForm) {
return request<OutdoorFairAttendeeCommonResult>(BASE, {
method: 'POST',
data: { ...data, checkInTime: formatDateTime(data.checkInTime) },
});
}
/**
* 修改签到人员
* PUT /api/cms/outdoor-fair-attendee
*/
export async function updateOutdoorFairAttendee(data: OutdoorFairAttendeeForm) {
return request<OutdoorFairAttendeeCommonResult>(BASE, {
method: 'PUT',
data: { ...data, checkInTime: formatDateTime(data.checkInTime) },
});
}
/**
* 删除签到人员
* DELETE /api/cms/outdoor-fair-attendee/{ids}
*/
export async function deleteOutdoorFairAttendee(ids: number | string) {
return request<OutdoorFairAttendeeCommonResult>(`${BASE}/${ids}`, {
method: 'DELETE',
});
}

View File

@@ -0,0 +1,130 @@
import { request } from '@umijs/max';
/** 户外招聘会设备码列表项 */
export interface OutdoorFairDeviceItem {
id: number;
fairId: number;
/** 设备码UUID */
deviceCode: string;
/** 绑定的参会企业ID */
companyId?: number;
/** 绑定的参会企业名称 */
companyName?: string;
/** 绑定时间 */
bindTime?: string;
createBy?: string;
createTime?: string;
updateBy?: string;
updateTime?: string;
remark?: string;
}
/** 设备码查询参数 */
export interface OutdoorFairDeviceListParams {
fairId?: number;
deviceCode?: string;
companyName?: string;
companyId?: number;
current?: number;
pageSize?: number;
}
/** 设备码列表响应 */
export interface OutdoorFairDeviceListResult {
code: number;
msg?: string;
total: number;
rows: OutdoorFairDeviceItem[];
}
/** 批量生成参数 */
export interface OutdoorFairDeviceBatchParams {
fairId: number;
quantity: number;
}
/** 批量生成响应 */
export interface OutdoorFairDeviceBatchResult {
code: number;
msg?: string;
data?: OutdoorFairDeviceItem[];
}
/** 通用响应 */
export interface OutdoorFairDeviceCommonResult {
code: number;
msg?: string;
data?: OutdoorFairDeviceItem;
}
/** 参会企业下拉选项 */
export interface OutdoorFairCompanyOption {
companyId: number;
companyName: string;
}
const BASE = '/api/cms/outdoor-fair-device';
/**
* 获取设备码列表
* GET /api/cms/outdoor-fair-device/list
*/
export async function getOutdoorFairDeviceList(params?: OutdoorFairDeviceListParams) {
return request<OutdoorFairDeviceListResult>(`${BASE}/list`, {
method: 'GET',
params,
});
}
/**
* 批量生成设备码UUID
* POST /api/cms/outdoor-fair-device/batch
*/
export async function batchGenerateOutdoorFairDevice(data: OutdoorFairDeviceBatchParams) {
return request<OutdoorFairDeviceBatchResult>(`${BASE}/batch`, {
method: 'POST',
data,
});
}
/**
* 绑定/解绑参会企业companyId 为空表示解绑)
* PUT /api/cms/outdoor-fair-device/{id}/bind
*/
export async function bindOutdoorFairDevice(id: number, companyId?: number) {
return request<OutdoorFairDeviceCommonResult>(`${BASE}/${id}/bind`, {
method: 'PUT',
data: { companyId: companyId ?? null },
});
}
/**
* 删除设备码
* DELETE /api/cms/outdoor-fair-device/{ids}
*/
export async function deleteOutdoorFairDevice(ids: number | string) {
return request<OutdoorFairDeviceCommonResult>(`${BASE}/${ids}`, {
method: 'DELETE',
});
}
/**
* 获取招聘会参会企业下拉(复用主招聘会参会企业接口)
*/
export async function getOutdoorFairCompanyOptions(
fairId: number,
): Promise<OutdoorFairCompanyOption[]> {
const res = await request<{ code: number; rows?: any[]; total?: number }>(
`/api/cms/outdoor-fair/${fairId}/companies`,
{ method: 'GET', params: { current: 1, pageSize: 1000 } },
);
if (res.code === 200 && Array.isArray(res.rows)) {
return res.rows
.filter((item) => item && item.companyId != null)
.map((item) => ({
companyId: item.companyId,
companyName: item.companyName,
}));
}
return [];
}