feat: 全站 Ant Design Pro 风格重构 + 登录守卫与角色门户(issue #131/#134)

- 新增 web/shared:pro.css(AntD 5 设计系统,旧 CSS 变量统一映射 AntD 色板)、
  session.js(后端优先+本地账号降级双轨会话,IAOP_AUTH 兼容层)、
  pro-header.js(全站统一 Pro 导航条:logo/页题/用户角色 Tag/退出)
- 门户 web/index.html:未登录跳登录页(next 回跳),登录后按角色过滤
  可见模块(readonly→驾驶舱/助手/移动端;engineer→+配置台;admin→全部)
- 登录页 auth/login.html 重写为 Ant Design Pro 风格,本地降级模式自动
  播种演示账号(admin/engineer/viewer),保留 OIDC SSO 双轨入口
- user_store.js 新增 verify() + seedDefaults() 默认账号播种
- 六模块页统一接入 pro.css + 统一导航条 + 登录守卫(PRD 8.2)
- 驾驶舱主题 dark→light(Ant Design 5 色板):renderer.py THEME_TOKENS、
  ti-cl4/resin 模板 theme、告警三级配色对齐 AntD(P0 #ff4d4f/P1 #faad14/
  P2 #1677ff),渲染计划已重编(build_plans.py)
- 验证:core/cockpit 86 单测通过;JS 语法检查通过;静态冒烟全 200
This commit is contained in:
2026-08-05 14:17:37 +08:00
parent b53e71c85d
commit 7a2e45e7c4
21 changed files with 1224 additions and 204 deletions
+10 -9
View File
@@ -37,8 +37,9 @@ from .layout import ( # 复用 #50 已定义的布局模型与常量
# 主题 token(PRD 5.5「配置点:主题」dark / light 两套调色)
# ---------------------------------------------------------------------------
# 工业驾驶舱约定配色:dark 偏深蓝底 + 青绿强调(车间大屏常用);
# light 偏白底 + 蓝色强调(白天值班室)。前端按这些 CSS 变量渲染,
# 切换主题 = 切一套变量,组件代码不动。
# light 采用 Ant Design 5 官方色板(2026-08 全站 Ant Design Pro 风格重构:
# 白底卡片 + #1677ff 主色 + 灰底 #f0f2f5,与门户/配置台/管理台统一)。
# 前端按这些 CSS 变量渲染,切换主题 = 切一套变量,组件代码不动。
THEME_TOKENS: Dict[str, Dict[str, str]] = {
"dark": {
"--cockpit-bg": "#0b1220",
@@ -50,13 +51,13 @@ THEME_TOKENS: Dict[str, Dict[str, str]] = {
"--cockpit-grid-line": "rgba(255,255,255,0.06)",
},
"light": {
"--cockpit-bg": "#f5f7fb",
"--cockpit-surface": "#ffffff",
"--cockpit-fg": "#1f2d3d",
"--cockpit-fg-muted": "#6b7c93",
"--cockpit-accent": "#2f7af2", # 蓝
"--cockpit-warn": "#e08600",
"--cockpit-grid-line": "rgba(0,0,0,0.06)",
"--cockpit-bg": "#f0f2f5", # AntD colorBgLayout
"--cockpit-surface": "#ffffff", # AntD colorBgContainer
"--cockpit-fg": "rgba(0,0,0,0.88)", # AntD colorText
"--cockpit-fg-muted": "rgba(0,0,0,0.45)", # AntD colorTextTertiary
"--cockpit-accent": "#1677ff", # AntD 5 主色蓝(KPI / 趋势主线)
"--cockpit-warn": "#faad14", # AntD warning(告警强调)
"--cockpit-grid-line": "rgba(5,5,5,0.06)", # AntD colorSplit
},
}