first commit
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:
chenshaohua
2025-11-10 16:28:01 +08:00
commit 30c8a7e8cf
465 changed files with 102912 additions and 0 deletions

103
src/types/analysis/industry.d.ts vendored Normal file
View File

@@ -0,0 +1,103 @@
import dayjs from 'dayjs';
import { ReactNode } from 'react';
export type TimeDimension = '月' | '季度' | '年';
export type AnalysisType = '岗位发布数量' | '招聘增长率';
export type QuarterFormat = `${number}-${'Q1'|'Q2'|'Q3'|'Q4'|'第一季度'|'第二季度'|'第三季度'|'第四季度'}`;
export type AnalysisCategory = 'industry' | 'area' | 'salary';
export type SalaryRange = '3k-5k' | '5k-8k' | '8k-10k' | '10k+';
export type WorkYearRange = '应届' | '1-3年' | '3-5年' | '5年以上';
export type EducationLevel = '大专' | '本科' | '硕士' | '博士' | '不限';
export interface IndustryDataItem {
date: string;
category: string;
value: number;
}
export interface AreaDataItem {
name: string;
value: number;
time: string;
}
export interface IndustryTrendParams {
timeDimension: TimeDimension;
type: AnalysisType;
startTime: string;
endTime: string;
selectedIndustry: string;
}
export interface IndustryTrendState extends IndustryTrendParams {
selectedWorkYearRange(): unknown;
selectedIndustry: string;
}
export interface IndustryTrendApiResult {
data: IndustryDataItem[];
code: number;
msg: string;
}
export interface TooltipItem {
name: string;
value: number;
color: string;
data: {
date: string;
category: string;
value: number;
};
}
export interface ChartConfig {
data: IndustryDataItem[];
height: number;
xField: string;
yField: string;
seriesField: string;
xAxis: {
type: string;
label: {
formatter: (text: string) => string;
};
};
yAxis: {
label: {
formatter: (val: string) => string;
};
};
tooltip: {
showTitle?: boolean;
title?: string | ((title: string, data?: TooltipItem[]) => string);
customContent?: (title: string, items: TooltipItem[]) => ReactNode;
};
point: {
size: number;
shape: string;
};
animation: {
appear: {
animation: string;
duration: number;
};
};
smooth: boolean;
interactions?: Array<{
type: string;
cfg: {
render: (event: any, { title, items }: { title: string; items: TooltipItem[] }) => ReactNode;
};
}>;
legend?: boolean;
}
export interface IndustryTrendState {
timeDimension: TimeDimension;
type: AnalysisType;
startTime: string;
endTime: string;
selectedIndustry: string;
selectedSalaryRange: string;
analysisCategory: AnalysisCategory; // 新增分析类别
}
export type DateFormatter = (dateStr: string, dimension: TimeDimension) => string;
export type QuarterFormatter = (dateStr: string) => QuarterFormat;
export type ApiDataConverter = (apiData: any) => IndustryDataItem[];