Files
AIclinicalresearch/frontend/src/pages/rvw/styles.css
HaHafeng 66255368b7 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
2026-01-16 13:42:10 +08:00

245 lines
4.1 KiB
CSS

/**
* RVW模块样式
* 基于原型图 V7 的高保真还原
*/
/* ==================== 状态标签 ==================== */
.tag {
display: inline-flex;
align-items: center;
padding: 2px 8px;
border-radius: 4px;
font-size: 11px;
font-weight: 600;
line-height: 1.5;
border: 1px solid transparent;
}
.tag-blue {
background: #eff6ff;
color: #1d4ed8;
border-color: #dbeafe;
}
.tag-purple {
background: #f5f3ff;
color: #6d28d9;
border-color: #ede9fe;
}
.tag-green {
background: #f0fdf4;
color: #15803d;
border-color: #dcfce7;
}
.tag-amber {
background: #fffbeb;
color: #b45309;
border-color: #fef3c7;
}
.tag-red {
background: #fef2f2;
color: #dc2626;
border-color: #fecaca;
}
.tag-gray {
background: #f8fafc;
color: #64748b;
border-color: #e2e8f0;
}
/* ==================== 筛选 Chips ==================== */
.filter-chip {
padding: 4px 12px;
border-radius: 9999px;
font-size: 13px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
border: 1px solid transparent;
color: #64748b;
background: transparent;
}
.filter-chip:hover {
background-color: #f1f5f9;
color: #0f172a;
}
.filter-chip.active {
background-color: #eff6ff;
color: #2563eb;
border-color: #bfdbfe;
font-weight: 600;
}
/* ==================== 侧边栏 Tooltip ==================== */
.sidebar-tooltip {
position: absolute;
left: 100%;
top: 50%;
transform: translateY(-50%);
margin-left: 12px;
background: #1e293b;
color: white;
padding: 6px 10px;
border-radius: 6px;
font-size: 12px;
white-space: nowrap;
z-index: 50;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
opacity: 0;
visibility: hidden;
transition: opacity 0.2s, visibility 0.2s;
pointer-events: none;
}
.sidebar-btn:hover .sidebar-tooltip {
opacity: 1;
visibility: visible;
}
/* ==================== 动画 ==================== */
.fade-in {
animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.slide-up {
animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* ==================== 表格悬停效果 ==================== */
.task-table tbody tr {
transition: background-color 0.15s ease;
}
.task-table tbody tr:hover {
background-color: #f8fafc;
}
.task-table tbody tr.selected {
background-color: #eff6ff;
}
/* ==================== 评分环 ==================== */
.score-circle {
width: 80px;
height: 80px;
border-radius: 50%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.score-circle.pass {
border-color: #22c55e;
background: #f0fdf4;
color: #15803d;
}
.score-circle.warn {
border-color: #f59e0b;
background: #fffbeb;
color: #b45309;
}
.score-circle.fail {
border-color: #ef4444;
background: #fef2f2;
color: #dc2626;
}
/* ==================== 按钮样式 ==================== */
.btn-primary {
background-color: #4f46e5;
color: white;
font-weight: 600;
padding: 8px 16px;
border-radius: 8px;
transition: all 0.2s;
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.btn-primary:hover {
background-color: #4338ca;
transform: translateY(-1px);
}
.btn-secondary {
background-color: white;
color: #374151;
font-weight: 500;
padding: 8px 16px;
border-radius: 8px;
border: 1px solid #d1d5db;
transition: all 0.2s;
}
.btn-secondary:hover {
background-color: #f9fafb;
border-color: #9ca3af;
}
/* ==================== 滚动条美化 ==================== */
.overflow-auto::-webkit-scrollbar {
width: 8px;
height: 8px;
}
.overflow-auto::-webkit-scrollbar-track {
background: #f1f5f9;
border-radius: 4px;
}
.overflow-auto::-webkit-scrollbar-thumb {
background: #cbd5e1;
border-radius: 4px;
}
.overflow-auto::-webkit-scrollbar-thumb:hover {
background: #94a3b8;
}
/* ==================== 响应式调整 ==================== */
@media (max-width: 1024px) {
.sidebar-tooltip {
display: none;
}
}