diff --git a/core/cockpit/renderer.py b/core/cockpit/renderer.py index ee3c200..4f1c44c 100644 --- a/core/cockpit/renderer.py +++ b/core/cockpit/renderer.py @@ -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 }, } diff --git a/templates/resin/dashboard/cockpit.resin.yaml b/templates/resin/dashboard/cockpit.resin.yaml index f4edd93..4e0dc97 100644 --- a/templates/resin/dashboard/cockpit.resin.yaml +++ b/templates/resin/dashboard/cockpit.resin.yaml @@ -7,7 +7,8 @@ # alarm_panel(告警面板)/ nl_query(NL查询入口)。 $schema: iAOP-cockpit-layout-v1 title: 吸附树脂车间驾驶舱 -theme: dark +# 2026-08 全站 Ant Design Pro 风格重构:dark → light(与 ti-cl4 一致) +theme: light widgets: - type: process_view src: resin_four_state.svg diff --git a/templates/ti-cl4/dashboard/alarm_panel.ti.yaml b/templates/ti-cl4/dashboard/alarm_panel.ti.yaml index ea712ea..fac4cba 100644 --- a/templates/ti-cl4/dashboard/alarm_panel.ti.yaml +++ b/templates/ti-cl4/dashboard/alarm_panel.ti.yaml @@ -12,20 +12,21 @@ $schema: iAOP-cockpit-alarm-panel-v1 # severityColors:P0/P1/P2 三级展示配色(覆盖主题默认告警色)。 # P0=红色(驾驶舱红色告警,PRD 场景A)、P1=黄色(加强监控)、P2=蓝色(提示)。 +# 2026-08 对齐 Ant Design 5 色板:error #ff4d4f / warning #faad14 / primary #1677ff。 severityColors: - severity: P0 - fg: "#ff3b30" # 红色前景(告警文本 / 图标) - bg: "rgba(255,59,48,0.12)" + fg: "#ff4d4f" # AntD error 红(告警文本 / 图标) + bg: "rgba(255,77,79,0.10)" icon: alert-octagon - border: "#ff3b30" + border: "#ff4d4f" - severity: P1 - fg: "#f5a623" # 黄色 - bg: "rgba(245,166,35,0.12)" + fg: "#faad14" # AntD warning 黄 + bg: "rgba(250,173,20,0.10)" icon: alert-triangle - border: "#f5a623" + border: "#faad14" - severity: P2 - fg: "#3aa0ff" # 蓝色(提示) - bg: "rgba(58,160,255,0.10)" + fg: "#1677ff" # AntD primary 蓝(提示) + bg: "rgba(22,119,255,0.08)" icon: info # rulesSource:告警面板订阅哪份规则资产(阈值/规则外置)。 # 指向 issue #72 落地的炉层杂质预警规则模板(templates/ti-cl4/impurity-forecast/ diff --git a/templates/ti-cl4/dashboard/cockpit.ti.yaml b/templates/ti-cl4/dashboard/cockpit.ti.yaml index adcf963..bade8c9 100644 --- a/templates/ti-cl4/dashboard/cockpit.ti.yaml +++ b/templates/ti-cl4/dashboard/cockpit.ti.yaml @@ -16,7 +16,9 @@ # bind 的 point_id 对齐 templates/ti-cl4/point-dict/point_dict.default.csv。 $schema: iAOP-cockpit-layout-v1 title: 海绵钛车间驾驶舱 -theme: dark +# 2026-08 全站 Ant Design Pro 风格重构:dark → light(Ant Design 5 色板, +# token 见 core/cockpit/renderer.py THEME_TOKENS["light"]) +theme: light widgets: # ---- 四状态工艺流程主视图(首屏立即加载) --------------------------- - type: process_view diff --git a/web/admin/index.html b/web/admin/index.html index 6b33519..01a2c78 100644 --- a/web/admin/index.html +++ b/web/admin/index.html @@ -5,8 +5,9 @@