feat: add recruitment fair participant export
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
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:
@@ -1,5 +1,6 @@
|
||||
import { request } from '@umijs/max';
|
||||
import { downLoadXlsx } from '@/utils/downloadfile';
|
||||
import type { RecruitmentFairExportParams } from './recruitmentFairExport';
|
||||
|
||||
const BASE_URL = '/api/cms/publicJobFair';
|
||||
|
||||
@@ -227,6 +228,10 @@ export async function getJobFairCompanies(jobFairId: string) {
|
||||
}
|
||||
|
||||
/** 导出招聘会 */
|
||||
export async function exportPublicJobFair(params?: API.PublicJobFair.ListParams) {
|
||||
return downLoadXlsx(`${BASE_URL}/export`, { params }, `job_fair_${new Date().getTime()}.xlsx`);
|
||||
export async function exportPublicJobFair(params: RecruitmentFairExportParams) {
|
||||
return downLoadXlsx(
|
||||
`${BASE_URL}/export`,
|
||||
{ params },
|
||||
`online_fair_participants_${new Date().getTime()}.xlsx`,
|
||||
);
|
||||
}
|
||||
|
||||
37
src/services/jobfair/recruitmentFairExport.ts
Normal file
37
src/services/jobfair/recruitmentFairExport.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { downLoadXlsx } from '@/utils/downloadfile';
|
||||
|
||||
export type RecruitmentFairExportType = 'companies' | 'jobs' | 'companyJobs';
|
||||
|
||||
export interface RecruitmentFairExportParams {
|
||||
exportType: RecruitmentFairExportType;
|
||||
title?: string;
|
||||
hostUnit?: string;
|
||||
fairType?: string;
|
||||
region?: string;
|
||||
venueId?: number;
|
||||
venueName?: string;
|
||||
address?: string;
|
||||
startTime?: string;
|
||||
endTime?: string;
|
||||
applyStartTime?: string;
|
||||
applyEndTime?: string;
|
||||
createStartTime?: string;
|
||||
createEndTime?: string;
|
||||
fairStatus?: 'NOT_STARTED' | 'ONGOING' | 'ENDED';
|
||||
isCrossDomain?: string;
|
||||
onlineApply?: boolean;
|
||||
reviewStatus?: '0' | '1' | '2';
|
||||
}
|
||||
|
||||
export type RecruitmentFairExportChannel = 'online' | 'outdoor';
|
||||
|
||||
/** 下载线上/户外招聘会参会数据 Excel。 */
|
||||
export function exportRecruitmentFair(
|
||||
channel: RecruitmentFairExportChannel,
|
||||
params: RecruitmentFairExportParams,
|
||||
) {
|
||||
const endpoint =
|
||||
channel === 'online' ? '/api/cms/publicJobFair/export' : '/api/cms/outdoor-fair/export';
|
||||
const filePrefix = channel === 'online' ? 'online_fair' : 'outdoor_fair';
|
||||
return downLoadXlsx(endpoint, { params }, `${filePrefix}_participants_${Date.now()}.xlsx`);
|
||||
}
|
||||
Reference in New Issue
Block a user