Features - User Management (Phase 4.1): - Database: Add user_modules table for fine-grained module permissions - Database: Add 4 user permissions (view/create/edit/delete) to role_permissions - Backend: UserService (780 lines) - CRUD with tenant isolation - Backend: UserController + UserRoutes (648 lines) - 13 API endpoints - Backend: Batch import users from Excel - Frontend: UserListPage (412 lines) - list/filter/search/pagination - Frontend: UserFormPage (341 lines) - create/edit with module config - Frontend: UserDetailPage (393 lines) - details/tenant/module management - Frontend: 3 modal components (592 lines) - import/assign/configure - API: GET/POST/PUT/DELETE /api/admin/users/* endpoints Architecture Upgrade - Module Permission System: - Backend: Add getUserModules() method in auth.service - Backend: Login API returns modules array in user object - Frontend: AuthContext adds hasModule() method - Frontend: Navigation filters modules based on user.modules - Frontend: RouteGuard checks requiredModule instead of requiredVersion - Frontend: Remove deprecated version-based permission system - UX: Only show accessible modules in navigation (clean UI) - UX: Smart redirect after login (avoid 403 for regular users) Fixes: - Fix UTF-8 encoding corruption in ~100 docs files - Fix pageSize type conversion in userService (String to Number) - Fix authUser undefined error in TopNavigation - Fix login redirect logic with role-based access check - Update Git commit guidelines v1.2 with UTF-8 safety rules Database Changes: - CREATE TABLE user_modules (user_id, tenant_id, module_code, is_enabled) - ADD UNIQUE CONSTRAINT (user_id, tenant_id, module_code) - INSERT 4 permissions + role assignments - UPDATE PUBLIC tenant with 8 module subscriptions Technical: - Backend: 5 new files (~2400 lines) - Frontend: 10 new files (~2500 lines) - Docs: 1 development record + 2 status updates + 1 guideline update - Total: ~4900 lines of code Status: User management 100% complete, module permission system operational
248 lines
7.2 KiB
Markdown
248 lines
7.2 KiB
Markdown
# 模块配置更新报告
|
||
|
||
> **更新时间:** 2025-11-12
|
||
> **更新内容:** 按照平台架构文档调整模块配置
|
||
> **参考文档:** `docs/01-平台基础层/06-前端架构/01-前端总体架构设计.md`
|
||
|
||
---
|
||
|
||
## ✅ 更新内容
|
||
|
||
### 1. 模块数量和顺序调整
|
||
|
||
**调整前(5个模块):**
|
||
1. AI智能文献 (asl) - `/literature`
|
||
2. AI智能问答 (aia) - `/ai-qa`
|
||
3. 知识库 (pkb) - `/knowledge`
|
||
4. 审稿系统 (rvw) - `/review` ❌
|
||
5. 数据清洗 (dc) - `/data-cleaning`
|
||
|
||
**调整后(6个模块):**
|
||
1. **AI问答** (ai-qa) - `/ai-qa` ✅
|
||
2. **AI智能文献** (literature-platform) - `/literature` ✅
|
||
3. **知识库** (knowledge-base) - `/knowledge-base` ✅
|
||
4. **智能数据清洗** (data-cleaning) - `/data-cleaning` ✅
|
||
5. **智能统计分析** (statistical-analysis) - `/intelligent-analysis` ✨ 新增
|
||
6. **统计分析工具** (statistical-tools) - `/statistical-tools` ✨ 新增
|
||
|
||
---
|
||
|
||
## 🔧 修改详情
|
||
|
||
### 1. 模块注册中心 (moduleRegistry.ts)
|
||
|
||
#### 修改的模块
|
||
|
||
| 项目 | 修改前 | 修改后 | 说明 |
|
||
|------|--------|--------|------|
|
||
| **模块1** | AI智能文献(首位) | AI问答(首位) | 调整顺序 |
|
||
| **模块ID** | `aia` | `ai-qa` | 统一命名规范 |
|
||
| **模块ID** | `asl` | `literature-platform` | 统一命名规范 |
|
||
| **模块ID** | `pkb` | `knowledge-base` | 统一命名规范 |
|
||
| **路由路径** | `/knowledge` | `/knowledge-base` | 按文档规范 |
|
||
|
||
#### 新增的模块
|
||
|
||
**模块5:智能统计分析**
|
||
```typescript
|
||
{
|
||
id: 'statistical-analysis',
|
||
name: '智能统计分析',
|
||
path: '/intelligent-analysis',
|
||
icon: BarChartOutlined,
|
||
component: lazy(() => import('@/modules/ssa')),
|
||
placeholder: true,
|
||
requiredVersion: 'premium',
|
||
description: '智能统计分析系统(Java团队开发)',
|
||
isExternal: true,
|
||
}
|
||
```
|
||
|
||
**模块6:统计分析工具**
|
||
```typescript
|
||
{
|
||
id: 'statistical-tools',
|
||
name: '统计分析工具',
|
||
path: '/statistical-tools',
|
||
icon: LineChartOutlined,
|
||
component: lazy(() => import('@/modules/st')),
|
||
placeholder: true,
|
||
requiredVersion: 'premium',
|
||
description: '统计分析工具集(Java团队开发)',
|
||
isExternal: true,
|
||
}
|
||
```
|
||
|
||
#### 删除的模块
|
||
|
||
- ❌ **审稿系统** (rvw) - 架构文档中未定义此模块
|
||
|
||
---
|
||
|
||
### 2. 类型定义 (types.ts)
|
||
|
||
**新增属性:**
|
||
```typescript
|
||
/** 是否为外部模块(如Java团队开发) */
|
||
isExternal?: boolean
|
||
```
|
||
|
||
---
|
||
|
||
### 3. 模块目录结构
|
||
|
||
**新增目录:**
|
||
- ✅ `src/modules/ssa/index.tsx` - 智能统计分析模块
|
||
- ✅ `src/modules/st/index.tsx` - 统计分析工具模块
|
||
|
||
**删除目录:**
|
||
- ❌ `src/modules/rvw/index.tsx` - 审稿系统模块
|
||
|
||
---
|
||
|
||
### 4. 首页 (HomePage.tsx)
|
||
|
||
**统计数据更新:**
|
||
- 业务模块数量:5 → **6**
|
||
|
||
**状态标签逻辑优化:**
|
||
```typescript
|
||
// AI智能文献(开发中)
|
||
{!module.placeholder && module.id === 'literature-platform' && (
|
||
<span className="text-green-600 bg-green-50">Week 3 开发</span>
|
||
)}
|
||
|
||
// 外部模块(Java团队)
|
||
{module.placeholder && module.isExternal && (
|
||
<span className="text-purple-600 bg-purple-50">外部集成</span>
|
||
)}
|
||
|
||
// 其他占位模块
|
||
{module.placeholder && !module.isExternal && (
|
||
<span className="text-orange-500 bg-orange-50">规划中</span>
|
||
)}
|
||
```
|
||
|
||
---
|
||
|
||
## 📊 模块对照表
|
||
|
||
| 序号 | 模块名称 | 模块ID | 路由路径 | 开发状态 | 权限要求 | 特殊标记 |
|
||
|------|---------|--------|---------|---------|---------|---------|
|
||
| 1 | AI问答 | `ai-qa` | `/ai-qa` | 规划中 | 基础版+ | - |
|
||
| 2 | AI智能文献 | `literature-platform` | `/literature` | Week 3开发 | 高级版+ | 支持独立运行 |
|
||
| 3 | 知识库 | `knowledge-base` | `/knowledge-base` | 规划中 | 基础版+ | - |
|
||
| 4 | 智能数据清洗 | `data-cleaning` | `/data-cleaning` | 规划中 | 高级版+ | - |
|
||
| 5 | 智能统计分析 | `statistical-analysis` | `/intelligent-analysis` | 外部集成 | 旗舰版 | Java团队开发 |
|
||
| 6 | 统计分析工具 | `statistical-tools` | `/statistical-tools` | 外部集成 | 旗舰版 | Java团队开发 |
|
||
|
||
---
|
||
|
||
## 🎨 UI 显示效果
|
||
|
||
### 顶部导航(从左到右)
|
||
|
||
```
|
||
🏥 AI临床研究平台 💬AI问答(规划中) 📄AI智能文献 📁知识库(规划中)
|
||
🧹智能数据清洗(规划中) 📊智能统计分析(规划中)
|
||
📈统计分析工具(规划中) 👤研究员▼
|
||
```
|
||
|
||
### 首页模块卡片
|
||
|
||
```
|
||
┌────────────┐ ┌────────────┐ ┌────────────┐
|
||
│ 💬 │ │ 📄 │ │ 📁 │
|
||
│ AI问答 │ │ AI智能文献 │ │ 知识库 │
|
||
│ 规划中 │ │ Week 3开发 │ │ 规划中 │
|
||
└────────────┘ └────────────┘ └────────────┘
|
||
|
||
┌────────────┐ ┌────────────┐ ┌────────────┐
|
||
│ 🧹 │ │ 📊 │ │ 📈 │
|
||
│智能数据清洗 │ │智能统计分析 │ │统计分析工具 │
|
||
│ 规划中 │ │ 外部集成 │ │ 外部集成 │
|
||
└────────────┘ └────────────┘ └────────────┘
|
||
|
||
📊 系统统计
|
||
[ 6 业务模块 ] [ 10 Schema ] [ 4 LLM ]
|
||
```
|
||
|
||
---
|
||
|
||
## ✅ 验收标准
|
||
|
||
- [x] 顶部导航显示6个模块,顺序正确
|
||
- [x] 模块命名与架构文档一致
|
||
- [x] 路由路径与架构文档一致
|
||
- [x] 首页统计数据显示"6个业务模块"
|
||
- [x] AI智能文献显示"Week 3 开发"(绿色)
|
||
- [x] Java团队模块显示"外部集成"(紫色)
|
||
- [x] 其他模块显示"规划中"(橙色)
|
||
- [x] 删除了架构文档中未定义的审稿系统模块
|
||
|
||
---
|
||
|
||
## 📁 修改的文件清单
|
||
|
||
1. ✅ `src/framework/modules/moduleRegistry.ts` - 模块注册配置
|
||
2. ✅ `src/framework/modules/types.ts` - 类型定义
|
||
3. ✅ `src/pages/HomePage.tsx` - 首页统计和标签逻辑
|
||
4. ✅ `src/modules/ssa/index.tsx` - 新增智能统计分析模块
|
||
5. ✅ `src/modules/st/index.tsx` - 新增统计分析工具模块
|
||
6. ❌ `src/modules/rvw/index.tsx` - 删除审稿系统模块
|
||
|
||
---
|
||
|
||
## 🎯 与架构文档的一致性
|
||
|
||
| 项目 | 架构文档要求 | 当前实现 | 状态 |
|
||
|------|-------------|---------|------|
|
||
| 模块数量 | 6个 | 6个 | ✅ |
|
||
| 模块顺序 | AI问答→AI智能文献→知识库→... | 一致 | ✅ |
|
||
| 模块ID命名 | `ai-qa`, `literature-platform`等 | 一致 | ✅ |
|
||
| 路由路径 | `/ai-qa`, `/literature`等 | 一致 | ✅ |
|
||
| 权限配置 | 基础版/高级版/旗舰版 | 一致 | ✅ |
|
||
| 外部模块标记 | Java团队模块需标记 | 已标记 | ✅ |
|
||
|
||
---
|
||
|
||
## 🚀 后续工作
|
||
|
||
1. **Week 3 Day 1-2:** AI智能文献模块开发前准备
|
||
- 数据库设计(asl_schema)
|
||
- API设计
|
||
- 前端页面设计
|
||
|
||
2. **未来:** 外部模块集成
|
||
- 智能统计分析(Java团队)
|
||
- 统计分析工具(Java团队)
|
||
- 前端仅做导航集成和iframe嵌入
|
||
|
||
3. **未来:** 其他模块开发
|
||
- AI问答模块重写
|
||
- 知识库模块重写
|
||
- 智能数据清洗模块开发
|
||
|
||
---
|
||
|
||
**更新完成!** ✅
|
||
|
||
所有模块配置已与平台架构文档保持一致。
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|