import { useState } from "react"; import { Database, Download, History, RefreshCw, Save, Settings2, Users } from "lucide-react"; import { toast } from "sonner"; import { Button } from "~/components/ui/button"; import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle } from "~/components/ui/card"; import { Input } from "~/components/ui/input"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "~/components/ui/table"; import { exportRowsToExcel } from "~/lib/exportExcel"; import { usePersistentState } from "~/hooks/use-persistent-state"; import { FilterSelect, OperationsPageHeader } from "./OperationsUi"; import { BANK_REPORT_CONFIG, TEMPLATE_VERSIONS } from "./governanceData"; function nextGeneration(frequency: string, day: number): string { const formattedDay = String(day).padStart(2, "0"); if (frequency === "月度") return `2026-09-${formattedDay}`; if (frequency === "季度") return `2026-10-${formattedDay}`; return `2027-01-${formattedDay}`; } export default function SystemConfigPage() { const [readDay, setReadDay] = usePersistentState("a-card-config-read-day", "15 日"); const [readPeriod, setReadPeriod] = usePersistentState("a-card-config-read-period", "上一周期(月)"); const [templates, setTemplates] = usePersistentState("a-card-template-versions", TEMPLATE_VERSIONS); const [selectedBank, setSelectedBank] = useState("江城银行"); const [bankConfigs, setBankConfigs] = usePersistentState("a-card-bank-report-config", BANK_REPORT_CONFIG); const currentBankConfig = bankConfigs[selectedBank] ?? { frequency: "月度", day: 15 }; const notificationRows = [ ["通知通道", "短信 + 平台通知"], ["报告未阅读催办", "模型团队 5 个工作日 · 业务团队 5 个工作日"], ["监控结果未处理催办", "1 个月未选择处理建议"], ["开发评审环节停滞", "1 个月未更新记录"], ["B/C 等级预警", "每月汇总,短信 + 平台通知"], ]; const publishTemplate = () => { const version = `T${Number(templates[0]?.version.slice(1) ?? 4) + 1}`; setTemplates((current) => [{ version, author: "管理员 王芳", createdAt: "2026-08-31 11:30", current: true, note: "手动发布(Mock)" }, ...current.map((item) => ({ ...item, current: false }))]); toast.success(`报告模板 ${version} 已模拟发布`); }; const updateBankConfig = (updates: Partial<{ frequency: string; day: number }>) => { setBankConfigs((current) => ({ ...current, [selectedBank]: { ...currentBankConfig, ...updates } })); }; return (
toast.success("配置已保存至前端 Mock 状态")}>保存配置} />
指标读取配置从共享数据库读取模型平台计算结果

读取排序性、KS、PSI、IV、CSI。本平台不重算指标,只读取模型平台计算结果;共享表名和字段映射待接口设计阶段确定。

报告模板版本管理监控报告与诊断报告共用版本体系 {templates.map((template) =>
{template.version}{template.note}{template.author} · {template.createdAt}{template.current ? 当前生效 : }
)}
通知与催办邮件通道已取消 {notificationRows.map(([item, value]) => {item}{value})}
登录角色来源角色及权限由统一权限模块维护
运维前端不提供角色或权限配置功能。登录成功后只读取统一认证返回的 role_code,用于适配业务团队、模型团队和管理员三种界面。
{[["业务团队", "business / business_team"], ["模型团队", "developer / model_team"], ["管理员", "admin"]].map(([label, code]) =>
{label}{code}
)}

服务端授权和权限管理由独立模块负责;本页不保存、不修改任何权限数据。

报告时间维度与输出日期按银行单独配置,不强制统一为每月 15 日 updateBankConfig({ frequency })} /> 银行报告时间维度输出日期下次生成{Object.entries(bankConfigs).map(([bank, config]) => {bank}{config.frequency}每月 {config.day} 日{nextGeneration(config.frequency, config.day)})}
模型平台新增页面依赖非本平台交付范围待模型平台提供
需求明确由模型平台侧新增模型信息页面,本平台只读消费。该页面是模型大类概览、已上线模型详情和监控明细的数据底座。
主键:银行 × 模型ID
字段:模型名称 / 模型版本 / 开发日期 / 开发人员 / 上线日期 / 陪跑开始日期 / 陪跑结束日期 / 最近迭代日期 / 迭代原因 / 迭代人员 / 下线日期
); }