分行业趋势分析

This commit is contained in:
yy
2025-05-26 13:35:01 +08:00
parent fa577431b8
commit 0c791e7e15
4 changed files with 248 additions and 136 deletions

View File

@@ -1,20 +1,63 @@
declare namespace API.Analysis {
export interface IndustryResult {
data: TrendItem[];
code: number;
msg: string;
}
export interface TrendItem {
date: string;
category: string;
value: number;
}
export interface IndustryParams {
timeDimension: '月' | '季度' | '年';
type: '岗位发布数量' | '招聘增长率';
startTime: string;
endTime: string;
}
}
import dayjs from 'dayjs';
export type TimeDimension = '月' | '季度' | '年';
export type AnalysisType = '岗位发布数量' | '招聘增长率';
export type QuarterFormat = `${number}-${'Q1'|'Q2'|'Q3'|'Q4'|'第一季度'|'第二季度'|'第三季度'|'第四季度'}`;
export interface IndustryDataItem {
date: string;
category: string;
value: number;
}
export interface IndustryTrendParams {
timeDimension: TimeDimension;
type: AnalysisType;
startTime: string;
endTime: string;
}
export interface IndustryTrendState extends IndustryTrendParams {
selectedIndustry: string;
}
export interface IndustryTrendApiResult {
data: IndustryDataItem[];
code: number;
msg: string;
}
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: false;
point: {
size: number;
shape: string;
};
animation: {
appear: {
animation: string;
duration: number;
};
};
smooth: boolean;
}
export type DateFormatter = (dateStr: string, dimension: TimeDimension) => string;
export type QuarterFormatter = (dateStr: string) => QuarterFormat;
export type ApiDataConverter = (apiData: any) => IndustryDataItem[];