- 新增 model_deploy 与 model_operations 双库查询,支持模型列表、模型详情、单月监控结果和运维工作台真实接口。 - 关闭运维模块生产 Mock 数据,补充缺表/空数据降级、工作台空状态和首条纵向链路测试。 - 按业务团队、模型团队、管理员权限矩阵接入菜单、页面、操作按钮和后端接口权限校验,支持 business_team 角色。 - 更新工作台布局、深色欢迎卡片、全宽页面适配、顶部回退,以及权限分组展示。 - 新增架构实现基线、周目标完成情况和角色权限矩阵初始化 SQL 文档。
86 lines
2.9 KiB
TypeScript
86 lines
2.9 KiB
TypeScript
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<Record<number, WorkflowFile[]>>;
|
|
};
|
|
|
|
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,
|
|
}));
|
|
}));
|
|
}
|