60 lines
3.9 KiB
TypeScript
60 lines
3.9 KiB
TypeScript
import { MODELS, gradeOf, type ModelGrade } from "./modelData";
|
|
|
|
export type ReportStatus = "待模型团队阅读" | "编辑中" | "已发送业务团队";
|
|
export type ReportType = "监控报告" | "诊断报告";
|
|
|
|
export type MonitoringReport = {
|
|
reportId: string;
|
|
bank: string;
|
|
modelName: string;
|
|
modelId: string;
|
|
version: string;
|
|
monitorMonth: string;
|
|
type: ReportType;
|
|
status: ReportStatus;
|
|
generatedAt: string;
|
|
outputDate: string;
|
|
unreadDays: number;
|
|
synced: boolean;
|
|
};
|
|
|
|
function reportType(grade: ModelGrade): ReportType {
|
|
return grade === "A" ? "监控报告" : "诊断报告";
|
|
}
|
|
|
|
export const REPORTS: MonitoringReport[] = [
|
|
{ reportId: "R1", bank: "江城银行", modelName: "标准A卡", modelId: "JC-STD-001", version: "v2.3", monitorMonth: "2026-07", type: "诊断报告", status: "待模型团队阅读", generatedAt: "2026-08-15 06:12", outputDate: "2026-08-15", unreadDays: 4, synced: false },
|
|
{ reportId: "R2", bank: "通汇银行", modelName: "标准A卡", modelId: "TH-STD-001", version: "v2.0", monitorMonth: "2026-07", type: "诊断报告", status: "已发送业务团队", generatedAt: "2026-08-15 06:12", outputDate: "2026-08-15", unreadDays: 0, synced: true },
|
|
{ reportId: "R3", bank: "华东银行", modelName: "反欺诈评分", modelId: "HD-AFD-001", version: "v2.0", monitorMonth: "2026-07", type: "诊断报告", status: "待模型团队阅读", generatedAt: "2026-08-18 06:16", outputDate: "2026-08-18", unreadDays: 6, synced: false },
|
|
{ reportId: "R4", bank: "南岭银行", modelName: "白户A卡", modelId: "NL-BAI-001", version: "v1.5", monitorMonth: "2026-07", type: "诊断报告", status: "编辑中", generatedAt: "2026-08-15 06:12", outputDate: "2026-08-15", unreadDays: 0, synced: true },
|
|
{ reportId: "R5", bank: "云岭银行", modelName: "标准A卡", modelId: "YL-STD-001", version: "v2.1", monitorMonth: "2026-07", type: "监控报告", status: "已发送业务团队", generatedAt: "2026-08-20 06:08", outputDate: "2026-08-20", unreadDays: 0, synced: true },
|
|
{ reportId: "R6", bank: "华东银行", modelName: "标准A卡", modelId: "HD-STD-001", version: "v2.2", monitorMonth: "2026-07", type: "监控报告", status: "已发送业务团队", generatedAt: "2026-08-18 06:16", outputDate: "2026-08-18", unreadDays: 0, synced: true },
|
|
{ reportId: "H1", bank: "江城银行", modelName: "标准A卡", modelId: "JC-STD-001", version: "v2.3", monitorMonth: "2026-06", type: "诊断报告", status: "已发送业务团队", generatedAt: "2026-07-15 06:11", outputDate: "2026-07-15", unreadDays: 0, synced: true },
|
|
{ reportId: "H2", bank: "南岭银行", modelName: "标准A卡", modelId: "NL-STD-001", version: "v1.6", monitorMonth: "2026-06", type: "诊断报告", status: "已发送业务团队", generatedAt: "2026-07-15 06:11", outputDate: "2026-07-15", unreadDays: 0, synced: true },
|
|
{ reportId: "H3", bank: "滨海银行", modelName: "大额A卡", modelId: "BH-BIG-001", version: "v1.1", monitorMonth: "2026-05", type: "诊断报告", status: "已发送业务团队", generatedAt: "2026-06-15 06:09", outputDate: "2026-06-15", unreadDays: 0, synced: true },
|
|
];
|
|
|
|
export function latestReports(source: MonitoringReport[] = REPORTS): MonitoringReport[] {
|
|
const latestMonth = source.reduce((latest, report) => report.monitorMonth > latest ? report.monitorMonth : latest, "");
|
|
return source.filter((report) => report.monitorMonth === latestMonth);
|
|
}
|
|
|
|
export function createReportForModel(modelId: string): MonitoringReport | null {
|
|
const model = MODELS.find((item) => item.modelId === modelId);
|
|
if (!model) return null;
|
|
return {
|
|
reportId: `AUTO-${model.modelId}`,
|
|
bank: model.bank,
|
|
modelName: model.name,
|
|
modelId: model.modelId,
|
|
version: model.version,
|
|
monitorMonth: "2026-07",
|
|
type: reportType(gradeOf(model)),
|
|
status: "待模型团队阅读",
|
|
generatedAt: "2026-08-15 06:12",
|
|
outputDate: "2026-08-15",
|
|
unreadDays: 0,
|
|
synced: false,
|
|
};
|
|
}
|