feat(iit): Complete CRA Agent V3.0 P0 milestone - autonomous QC pipeline

P0-1: Variable list sync from REDCap metadata
P0-2: QC rule configuration with JSON Logic + AI suggestion
P0-3: Scheduled QC + report generation + eQuery closed loop
P0-4: Unified dashboard + AI stream timeline + critical events

Backend:
- Add IitEquery, IitCriticalEvent Prisma models + migration
- Add cronEnabled/cronExpression to IitProject
- Implement eQuery service/controller/routes (CRUD + respond/review/close)
- Implement DailyQcOrchestrator (report -> eQuery -> critical events -> notify)
- Add AI rule suggestion service
- Register daily QC cron worker and eQuery auto-review worker
- Extend QC cockpit with timeline, trend, critical events APIs
- Fix timeline issues field compat (object vs array format)

Frontend:
- Create IIT business module with 6 pages (Dashboard, AI Stream, eQuery,
  Reports, Variable List + project config pages)
- Migrate IIT config from admin panel to business module
- Implement health score, risk heatmap, trend chart, critical event alerts
- Register IIT module in App router and top navigation

Testing:
- Add E2E API test script covering 7 modules (46 assertions, all passing)

Tested: E2E API tests 46/46 passed, backend and frontend verified
Made-with: Cursor
This commit is contained in:
2026-02-26 13:28:08 +08:00
parent 31b0433195
commit 203846968c
35 changed files with 7353 additions and 22 deletions

View File

@@ -0,0 +1,35 @@
import React from 'react';
import { Routes, Route, Navigate } from 'react-router-dom';
import IitLayout from './IitLayout';
const DashboardPage = React.lazy(() => import('./pages/DashboardPage'));
const AiStreamPage = React.lazy(() => import('./pages/AiStreamPage'));
const EQueryPage = React.lazy(() => import('./pages/EQueryPage'));
const ReportsPage = React.lazy(() => import('./pages/ReportsPage'));
const VariableListPage = React.lazy(() => import('./pages/VariableListPage'));
const ConfigProjectListPage = React.lazy(() => import('./config/ProjectListPage'));
const ConfigProjectDetailPage = React.lazy(() => import('./config/ProjectDetailPage'));
const IitModule: React.FC = () => {
return (
<Routes>
{/* CRA 质控平台主界面 */}
<Route element={<IitLayout />}>
<Route index element={<Navigate to="dashboard" replace />} />
<Route path="dashboard" element={<DashboardPage />} />
<Route path="stream" element={<AiStreamPage />} />
<Route path="equery" element={<EQueryPage />} />
<Route path="reports" element={<ReportsPage />} />
<Route path="variables" element={<VariableListPage />} />
</Route>
{/* 项目配置界面(独立布局,不使用 CRA 质控平台导航) */}
<Route path="config" element={<ConfigProjectListPage />} />
<Route path="config/:id" element={<ConfigProjectDetailPage />} />
</Routes>
);
};
export default IitModule;