feat(pkb): implement complete batch processing workflow and frontend optimization

- Frontend V3 architecture migration to modules/pkb
- Implement three work modes: full-text reading, deep reading, batch processing
- Complete batch processing: template selection, progress display, result export (CSV)
- Integrate Ant Design X Chat component with streaming support
- Add document upload modal with drag-and-drop support
- Optimize UI: multi-line table display, citation formatting, auto-scroll
- Fix 10+ technical issues: API mapping, state sync, form clearing
- Update documentation: development records and module status

Performance: 3 docs batch processing ~17-28s
Status: PKB module now production-ready (90% complete)
This commit is contained in:
2026-01-07 18:23:43 +08:00
parent e59676342a
commit 06028c6952
195 changed files with 1405 additions and 272 deletions

View File

@@ -37,3 +37,4 @@ Status: Day 1 complete (11/11 tasks), ready for Day 2

View File

@@ -265,5 +265,6 @@

View File

@@ -213,3 +213,4 @@ https://iit.xunzhengyixue.com/api/v1/iit/health

View File

@@ -142,3 +142,4 @@ https://iit.xunzhengyixue.com/api/v1/iit/health

View File

@@ -43,3 +43,4 @@

View File

@@ -303,3 +303,4 @@ npx tsx src/modules/iit-manager/test-patient-wechat-url-verify.ts

View File

@@ -165,3 +165,4 @@ npm run dev

View File

@@ -60,5 +60,6 @@ WHERE table_schema = 'dc_schema'

View File

@@ -98,5 +98,6 @@ ORDER BY ordinal_position;

View File

@@ -111,5 +111,6 @@ runMigration()

View File

@@ -45,5 +45,6 @@ COMMENT ON COLUMN "dc_schema"."dc_tool_c_sessions"."column_mapping" IS '列名

View File

@@ -72,5 +72,6 @@ COMMENT ON COLUMN dc_schema.dc_tool_c_sessions.expires_at IS '过期时间(创

View File

@@ -114,3 +114,4 @@ Write-Host ""

View File

@@ -222,5 +222,6 @@ function extractCodeBlocks(obj, blocks = []) {

View File

@@ -241,5 +241,6 @@ checkDCTables();

View File

@@ -193,5 +193,6 @@ createAiHistoryTable()

View File

@@ -180,5 +180,6 @@ createToolCTable()

View File

@@ -177,5 +177,6 @@ createToolCTable()

View File

@@ -326,3 +326,4 @@ runTests().catch(error => {

View File

@@ -291,3 +291,4 @@ verifySchemas()

View File

@@ -309,5 +309,6 @@ export function getBatchItems<T>(

View File

@@ -345,5 +345,6 @@ runTests().catch((error) => {

View File

@@ -324,5 +324,6 @@ Content-Type: application/json

View File

@@ -260,5 +260,6 @@ export const conflictDetectionService = new ConflictDetectionService();

View File

@@ -210,5 +210,6 @@ curl -X POST http://localhost:3000/api/v1/dc/tool-c/test/execute \

View File

@@ -264,5 +264,6 @@ export const streamAIController = new StreamAIController();

View File

@@ -175,3 +175,4 @@ logger.info('[SessionMemory] 会话记忆管理器已启动', {

View File

@@ -109,3 +109,4 @@ checkTableStructure();

View File

@@ -96,3 +96,4 @@ checkProjectConfig().catch(console.error);

View File

@@ -78,3 +78,4 @@ main();

View File

@@ -535,3 +535,4 @@ URL: https://iit.xunzhengyixue.com/api/v1/iit/patient-wechat/callback

View File

@@ -170,3 +170,4 @@ console.log('');

View File

@@ -487,3 +487,4 @@ export const patientWechatService = new PatientWechatService();

View File

@@ -132,3 +132,4 @@ testDifyIntegration().catch(error => {

View File

@@ -161,3 +161,4 @@ testIitDatabase()

View File

@@ -147,3 +147,4 @@ if (hasError) {

View File

@@ -173,3 +173,4 @@ async function testUrlVerification() {

View File

@@ -254,3 +254,4 @@ main().catch((error) => {

View File

@@ -138,3 +138,4 @@ Write-Host ""

View File

@@ -231,3 +231,4 @@ export interface CachedProtocolRules {

View File

@@ -44,3 +44,4 @@ export default async function healthRoutes(fastify: FastifyInstance) {

View File

@@ -410,5 +410,6 @@ SET session_replication_role = 'origin';

View File

@@ -112,5 +112,6 @@ WHERE key = 'verify_test';

View File

@@ -255,5 +255,6 @@ verifyDatabase()

View File

@@ -45,5 +45,6 @@ export {}

View File

@@ -68,5 +68,6 @@ Write-Host "✅ 完成!" -ForegroundColor Green

View File

@@ -158,3 +158,4 @@ DELETE {{baseUrl}}/api/v2/pkb/knowledge/knowledge-bases/{{testKbId}}

View File

@@ -355,5 +355,6 @@ runAdvancedTests().catch(error => {

View File

@@ -421,5 +421,6 @@ runAllTests()

View File

@@ -379,5 +379,6 @@ runAllTests()

View File

@@ -163,5 +163,6 @@ Set-Location ..

View File

@@ -1,10 +1,10 @@
# AIclinicalresearch 系统当前状态与开发指南
> **文档版本:** v2.7
> **文档版本:** v2.8
> **创建日期:** 2025-11-28
> **维护者:** 开发团队
> **最后更新:** 2026-01-07
> **重大进展:** 🎉 **PKB模块前端V3设计实现完成** - Dashboard + Workspace + 3种工作模式
> **重大进展:** 🎉 **PKB模块核心功能全部实现,具备生产可用性!** - 批处理完整流程验证通过
> **部署状态:** ✅ 生产环境运行中 | 公网地址http://8.140.53.236/
> **文档目的:** 快速了解系统当前状态为新AI助手提供上下文
@@ -39,7 +39,7 @@
| 模块代号 | 模块名称 | 核心功能 | 商业价值 | 当前状态 | 优先级 |
|---------|---------|---------|---------|---------|--------|
| **AIA** | AI智能问答 | 10+专业智能体选题评价、PICO梳理等 | ⭐⭐⭐⭐ | ✅ 已完成 | P1 |
| **PKB** | 个人知识库 | RAG问答、私人文献库 | ⭐⭐⭐ | ✅ **前端V3设计完成(75%** | P1 |
| **PKB** | 个人知识库 | RAG问答、私人文献库 | ⭐⭐⭐ | ✅ **核心功能完成(90%** | P1 |
| **ASL** | AI智能文献 | 文献筛选、Meta分析、证据图谱 | ⭐⭐⭐⭐⭐ | 🚧 **正在开发** | **P0** |
| **DC** | 数据清洗整理 | ETL + 医学NER百万行级数据 | ⭐⭐⭐⭐⭐ | ✅ **Tool B完成 + Tool C 99%(异步架构+性能优化-99%+多指标转换+7大功能** | **P0** |
| **IIT** | IIT Manager Agent | AI驱动IIT研究助手 - 智能质控+REDCap集成 | ⭐⭐⭐⭐⭐ | 🎉 **Phase 1.5完成60%- AI对话+REDCap数据集成** | **P0** |
@@ -658,8 +658,9 @@ AIclinicalresearch/
| **2025-12-31** | **IIT Agent启动** 🎯 | ✅ Day 1完成数据库+企微配置+模块骨架) |
| **2026-01-01** | **企微可信域名** 🌐 | ✅ iit.xunzhengyixue.com域名验证完成 |
| **2026-01-02** | **REDCap对接方案** 🏆 | ✅ REDCap环境部署 + DET+REST API方案确定 |
| **2026-01-07** | **PKB前端V3** 🎉 | ✅ PKB模块前端V3设计实现完成Dashboard+Workspace+3种工作模式 |
| **当前** | PKB优化中 | 🔧 批处理API调试 + UI精细化 |
| **2026-01-07 上午** | **PKB前端V3** 🎉 | ✅ PKB模块前端V3设计实现完成Dashboard+Workspace+3种工作模式 |
| **2026-01-07 下午** | **PKB批处理完善** 🏆 | 批处理完整流程调试通过(执行+进度+结果导出)+ 文档上传功能 + UI化 |
| **当前** | **PKB模块生产可用** | ✅ 核心功能全部实现90%),具备生产环境部署条件 |
---
@@ -951,9 +952,9 @@ if (items.length >= 50) {
---
**文档版本**v2.7
**文档版本**v2.8
**最后更新**2026-01-07
**下次更新**PKB批处理功能调试完成 或 IIT Manager Agent Phase 2
**下次更新**ASL智能文献筛选模块启动 或 IIT Manager Agent Phase 2
---
@@ -963,10 +964,32 @@ if (items.length >= 50) {
## 📝 最新更新2026-01-07
**PKB模块前端V3设计完成 🎉**
**PKB模块核心功能全部实现 🎉**
### 上午前端V3设计实现
1.**后端模块迁移**:迁移到 /modules/pkbv2 API路由注册
2.**Dashboard页面**基于知识库仪表盘V5原型实现
3.**Workspace页面**基于工作台V3原型实现
### 下午:批处理完整流程验证通过
4.**三种工作模式**:全文阅读、逐篇精读、批处理全部实现
5.**批处理功能**
- 模板选择临床研究信息提取8个字段
- 文档选择3-50篇
- 实时进度显示
- 结果表格(多行显示+Tooltip
- CSV导出
6.**Chat组件集成**Ant Design X支持流式响应和自定义渲染
7.**文档上传功能**:拖拽上传 + 进度显示 + Modal弹窗
8.**UI优化**:参考文献格式化、表格多行显示、输入框清除、自动滚动
### 技术亮点
- **问题解决**修复10+个技术问题API路径、字段映射、状态同步等
- **性能优化**批处理3篇文档~17-28秒
- **用户体验**:严格按照原型图实现,界面美观易用
### 里程碑意义
**PKB模块已具备生产环境可用性**,为后续功能扩展奠定坚实基础!
4.**3种工作模式**:全文阅读、逐篇精读、批处理
5.**Chat组件集成**复用Ant Design X通用Chat组件
6.**响应式布局**单层Header + 紧凑工作模式栏 + 最大化聊天区域

View File

@@ -605,5 +605,6 @@ async saveProcessedData(recordId, newData) {

View File

@@ -792,5 +792,6 @@ export const AsyncProgressBar: React.FC<AsyncProgressBarProps> = ({

View File

@@ -1285,5 +1285,6 @@ interface FulltextScreeningResult {

View File

@@ -399,5 +399,6 @@ GET /api/v1/asl/fulltext-screening/tasks/:taskId/export

View File

@@ -501,5 +501,6 @@ Failed to open file '\\tmp\\extraction_service\\temp_10000_test.pdf'

View File

@@ -567,5 +567,6 @@ df['creatinine'] = pd.to_numeric(df['creatinine'], errors='coerce')

View File

@@ -982,5 +982,6 @@ export const aiController = new AIController();

View File

@@ -1316,5 +1316,6 @@ npm install react-markdown

View File

@@ -224,5 +224,6 @@ FMA___基线 | FMA___1个月 | FMA___2个月

View File

@@ -382,5 +382,6 @@ formula = "FMA总分0-100 / 100"

View File

@@ -216,5 +216,6 @@ async handleFillnaMice(request, reply) {

View File

@@ -188,5 +188,6 @@ method: 'mean' | 'median' | 'mode' | 'constant' | 'ffill' | 'bfill'

View File

@@ -639,5 +639,6 @@ import { logger } from '../../../../common/logging/index.js';

View File

@@ -442,5 +442,6 @@ import { ChatContainer } from '@/shared/components/Chat';

View File

@@ -352,5 +352,6 @@ const initialMessages = defaultMessages.length > 0 ? defaultMessages : [{

View File

@@ -640,5 +640,6 @@ http://localhost:5173/data-cleaning/tool-c

View File

@@ -428,5 +428,6 @@ Docs: docs/03-业务模块/DC-数据清洗整理/06-开发记录/DC模块重建

View File

@@ -301,5 +301,6 @@ ConflictDetectionService // 冲突检测(字段级对比)

View File

@@ -465,5 +465,6 @@ Tool B后端代码**100%复用**了平台通用能力层,无任何重复开发

View File

@@ -242,5 +242,6 @@ $ node scripts/check-dc-tables.mjs

View File

@@ -475,5 +475,6 @@ ${fields.map((f, i) => `${i + 1}. ${f.name}${f.desc}`).join('\n')}

View File

@@ -682,3 +682,4 @@ private async processMessageAsync(xmlData: any) {

View File

@@ -1076,3 +1076,4 @@ async function testIntegration() {

View File

@@ -217,3 +217,4 @@ Content-Type: application/json

View File

@@ -637,3 +637,4 @@ REDCap API: exportRecords success { recordCount: 1 }

View File

@@ -643,3 +643,4 @@ backend/src/modules/iit-manager/

View File

@@ -793,3 +793,4 @@ CREATE TABLE iit_schema.wechat_tokens (

View File

@@ -550,3 +550,4 @@ Day 3 的开发工作虽然遇到了多个技术问题,但最终成功完成

View File

@@ -317,3 +317,4 @@ AI: "出生日期2017-01-04

View File

@@ -261,3 +261,4 @@ Day 4: REDCap EMWebhook推送← 作为增强,而非核心

View File

@@ -675,3 +675,4 @@ const answer = `根据研究方案[1]和CRF表格[2],纳入标准包括:

Some files were not shown because too many files have changed in this diff Show More