feat(admin): Add user management and upgrade to module permission system
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
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
# SSA - 智能统计分析
|
||||
|
||||
> **妯″潡浠e彿锛?* SSA (Smart Statistical Analysis)
|
||||
> **寮€鍙戠姸鎬侊細** 鈴?瑙勫垝涓?
|
||||
> **鍟嗕笟浠峰€硷細** 猸愨瓙猸愨瓙猸?鍒氶渶
|
||||
> **模块代号:** SSA (Smart Statistical Analysis)
|
||||
> **开发状态:** ⏳ 规划中
|
||||
> **商业价值:** ⭐⭐⭐⭐⭐ 刚需
|
||||
> **独立性:** ⭐⭐⭐⭐
|
||||
> **优先级:** P2
|
||||
|
||||
@@ -10,24 +10,24 @@
|
||||
|
||||
## 📋 模块概述
|
||||
|
||||
鏅鸿兘缁熻<EFBFBD>鍒嗘瀽妯″潡鎻愪緵3鏉℃牳蹇冨垎鏋愯矾寰勶紝瀹炵幇浠庢暟鎹<EFBFBD>笂浼犲埌鎶ュ憡瀵煎嚭鐨勫畬鏁存祦绋嬨€?
|
||||
智能统计分析模块提供3条核心分析路径,实现从数据上传到报告导出的完整流程。
|
||||
|
||||
---
|
||||
|
||||
## 馃幆 鏍稿績鍔熻兘锛?鏉¤矾寰勶級
|
||||
## 🎯 核心功能(3条路径)
|
||||
|
||||
### 1. 队列研究分析
|
||||
- 基线特征分析
|
||||
- 鐢熷瓨鍒嗘瀽锛圞aplan-Meier锛?
|
||||
- 生存分析(Kaplan-Meier)
|
||||
- Cox回归
|
||||
|
||||
### 2. 预测模型构建
|
||||
- 鍙橀噺绛涢€?
|
||||
- 变量筛选
|
||||
- 模型构建(Logistic回归、随机森林)
|
||||
- 妯″瀷楠岃瘉锛圧OC鏇茬嚎锛?
|
||||
- 模型验证(ROC曲线)
|
||||
|
||||
### 3. RCT研究分析
|
||||
- 闅忔満鍖栨<EFBFBD>鏌?
|
||||
- 随机化检查
|
||||
- 疗效分析
|
||||
- 亚组分析
|
||||
|
||||
@@ -37,10 +37,10 @@
|
||||
|
||||
```
|
||||
SSA-智能统计分析/
|
||||
鈹溾攢鈹€ [AI瀵规帴] SSA蹇<EFBFBD>€熶笂涓嬫枃.md # 鈴?寰呭垱寤?
|
||||
├── [AI对接] SSA快速上下文.md # ⏳ 待创建
|
||||
├── 00-项目概述/
|
||||
鈹? 鈹斺攢鈹€ 01-浜у搧闇€姹傛枃妗?PRD).md # 鈴?寰呭垱寤?
|
||||
鈹斺攢鈹€ README.md # 鉁?褰撳墠鏂囨。
|
||||
│ └── 01-产品需求文档(PRD).md # ⏳ 待创建
|
||||
└── README.md # ✅ 当前文档
|
||||
```
|
||||
|
||||
---
|
||||
@@ -48,15 +48,15 @@ SSA-智能统计分析/
|
||||
## 🔗 依赖的通用能力
|
||||
|
||||
- **文档处理引擎** - 数据导入
|
||||
- **ETL寮曟搸** - 鏁版嵁棰勫<EFBFBD>鐞?
|
||||
- **ETL引擎** - 数据预处理
|
||||
|
||||
---
|
||||
|
||||
## 馃彈锔?鎶€鏈<E282AC>爤
|
||||
## 🏗️ 技术栈
|
||||
|
||||
- **R语言** - 统计分析核心
|
||||
- **Plumber** - R暴露为API
|
||||
- **Node.js** - 绮樺悎灞?
|
||||
- **Node.js** - 粘合层
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user