import { useState } from "react"; import { Database, Download, History, RefreshCw, Save } 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 { 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] = useState(""); const [readPeriod, setReadPeriod] = useState(""); const [templates] = useState(TEMPLATE_VERSIONS); const [selectedBank, setSelectedBank] = useState(""); const [bankConfigs] = useState(BANK_REPORT_CONFIG); const currentBankConfig = selectedBank ? bankConfigs[selectedBank] : undefined; const notificationRows: string[][] = []; const publishTemplate = () => { toast.info("报告模板接口尚未接入"); }; const updateBankConfig = (updates: Partial<{ frequency: string; day: number }>) => { void updates; toast.info("报告周期配置接口尚未接入"); }; return (
toast.info("系统配置接口尚未接入")}>保存配置} />
指标读取配置从共享数据库读取模型平台计算结果

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

报告模板版本管理监控报告与诊断报告共用版本体系 {templates.length ? templates.map((template) =>
{template.version}{template.note}{template.author} · {template.createdAt}{template.current ? 当前生效 : }
) :
暂无报告模板版本数据
}
通知与催办邮件通道已取消 {notificationRows.map(([item, value]) => {item}{value})}
报告时间维度与输出日期按银行单独配置,不强制统一为每月 15 日 updateBankConfig({ frequency })} /> 银行报告时间维度输出日期下次生成{Object.entries(bankConfigs).length ? Object.entries(bankConfigs).map(([bank, config]) => {bank}{config.frequency}每月 {config.day} 日{nextGeneration(config.frequency, config.day)}) : 暂无银行报告周期数据}
); }