import type { ModelCategoryId } from "./modelData"; export type WorkflowStage = { stage: number; title: string; businessDuty: string; modelDuty: string; }; export type WorkflowFile = { name: string; uploadedBy: string; uploadedAt: string; confirmed: boolean; }; export type WorkflowInstance = { workflowId: string; title: string; bank: string; category: ModelCategoryId; modelId: string; initiatedBy: string; initiatedAt: string; currentStage: number; completedAt?: string; reusedModel?: string; deadline?: string; plannedTestAt?: string; plannedOnlineAt?: string; stalledDays?: number; files: Partial>; }; export type KnowledgeDocument = WorkflowFile & { workflowId: string; workflowTitle: string; bank: string; modelName: string; modelVersion: string; modelId: string; stage: string; commonModel: boolean; }; export type UsageRecord = { person: string; team: "业务团队" | "模型团队" | "管理员"; logins: number; requests: number; reportsRead: number; reportsDownloaded: number; lastLoginAt: string; }; export const WORKFLOW_STAGES: WorkflowStage[] = [ { stage: 1, title: "需求提出", businessDuty: "通过平台提出需求,平台通知模型团队", modelDuty: "首次响应需求" }, { stage: 2, title: "方案设计", businessDuty: "在最晚反馈时间前反馈模型设计方案意见", modelDuty: "提交模型设计方案并设置最晚反馈时间" }, { stage: 3, title: "开发迭代", businessDuty: "无需确认开发材料", modelDuty: "通过模型平台开发或迭代,提交最终开发结果材料" }, { stage: 4, title: "模型验证", businessDuty: "支持上传业务验证材料", modelDuty: "提交新老模型对比数据及预计评审时间" }, { stage: 5, title: "评审决议", businessDuty: "确认最终评审材料并设置测试或陪跑预计日期", modelDuty: "提交会议结论、修改意见结果与最终材料" }, { stage: 6, title: "测试陪跑", businessDuty: "确认测试文件和一致性报告", modelDuty: "提交模型测试文件、一致性报告等材料" }, { stage: 7, title: "部署上线", businessDuty: "确认后设置预计上线时间", modelDuty: "确认模型正式上线并登记是否为通用模型" }, ]; export const WORKFLOWS: WorkflowInstance[] = []; export const USAGE_RECORDS: UsageRecord[] = []; export function workflowDocuments(): KnowledgeDocument[] { return WORKFLOWS.flatMap((workflow) => Object.entries(workflow.files).flatMap(([stage, files]) => { const stageName = WORKFLOW_STAGES.find((item) => item.stage === Number(stage))?.title ?? "未知环节"; return (files ?? []).map((file) => ({ ...file, workflowId: workflow.workflowId, workflowTitle: workflow.title, bank: workflow.bank, modelName: "—", modelVersion: "—", modelId: workflow.modelId, stage: stageName, commonModel: false, })); })); }