- 新增 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
124 lines
6.1 KiB
CSS
124 lines
6.1 KiB
CSS
/* iAOP 配置化驾驶舱样式(issue #131 / PRD 5.5)。
|
|
* 调色全部由 plan JSON 的 themeTokens 注入(--cockpit-* CSS 变量),
|
|
* 这里只写默认值(= #51 THEME_TOKENS 的 light 方案,Ant Design 5 色板,
|
|
* 2026-08 全站 Ant Design Pro 风格重构),切主题 = 换一套变量。 */
|
|
:root {
|
|
--cockpit-bg: #f0f2f5;
|
|
--cockpit-surface: #ffffff;
|
|
--cockpit-fg: rgba(0, 0, 0, 0.88);
|
|
--cockpit-fg-muted: rgba(0, 0, 0, 0.45);
|
|
--cockpit-accent: #1677ff;
|
|
--cockpit-warn: #faad14;
|
|
--cockpit-grid-line: rgba(5, 5, 5, 0.06);
|
|
}
|
|
|
|
* { box-sizing: border-box; }
|
|
body {
|
|
margin: 0;
|
|
font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
|
|
background: var(--cockpit-bg);
|
|
color: var(--cockpit-fg);
|
|
}
|
|
|
|
/* ---- 顶栏 -------------------------------------------------------------- */
|
|
#topbar {
|
|
display: flex; align-items: center; justify-content: space-between;
|
|
padding: 10px 16px; background: var(--cockpit-surface);
|
|
border-bottom: 1px solid var(--cockpit-grid-line);
|
|
}
|
|
#cockpit-title { font-size: 18px; margin: 0; color: var(--cockpit-accent); }
|
|
#topbar-right { display: flex; align-items: center; gap: 8px; font-size: 13px;
|
|
color: var(--cockpit-fg-muted); }
|
|
#template-select { padding: 6px 10px; border-radius: 6px; border: 1px solid var(--cockpit-grid-line);
|
|
background: var(--cockpit-bg); color: var(--cockpit-fg); }
|
|
.status-dot { font-size: 14px; }
|
|
.status-dot.ok { color: #2ecc71; }
|
|
.status-dot.down { color: #ff3b30; }
|
|
|
|
/* ---- 驾驶舱栅格(12 列基线,行高固定,widget 按 plan 的 grid.style 落位) -- */
|
|
#cockpit-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(12, 1fr);
|
|
grid-auto-rows: 90px;
|
|
gap: 10px;
|
|
padding: 12px 16px;
|
|
}
|
|
|
|
/* ---- 通用 widget 卡片 --------------------------------------------------- */
|
|
.widget {
|
|
background: var(--cockpit-surface);
|
|
border: 1px solid var(--cockpit-grid-line);
|
|
border-radius: 8px;
|
|
padding: 10px 12px;
|
|
overflow: hidden;
|
|
display: flex; flex-direction: column;
|
|
min-width: 0; min-height: 0;
|
|
}
|
|
.widget .w-title { font-size: 13px; color: var(--cockpit-fg-muted); margin-bottom: 8px;
|
|
white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
.widget .w-body { flex: 1; min-height: 0; }
|
|
|
|
/* ---- ProcessView:四状态工艺流程 ---------------------------------------- */
|
|
.process-flow { display: flex; align-items: stretch; gap: 8px; height: 100%; }
|
|
.stage {
|
|
flex: 1; border-radius: 8px; padding: 10px;
|
|
display: flex; flex-direction: column; justify-content: center; align-items: center;
|
|
border: 1px solid var(--cockpit-grid-line); text-align: center;
|
|
}
|
|
.stage .stage-name { font-size: 16px; font-weight: 600; }
|
|
.stage .stage-device { font-size: 11px; color: var(--cockpit-fg-muted); margin-top: 4px; }
|
|
.stage .stage-state { font-size: 11px; margin-top: 6px; padding: 2px 8px; border-radius: 10px; }
|
|
.stage-arrow { align-self: center; color: var(--cockpit-fg-muted); font-size: 18px; }
|
|
/* 四状态配色(running/warning/alarm/offline,对齐 #51 states 语义) */
|
|
.state-running { box-shadow: inset 0 0 0 1px #2ecc71; }
|
|
.state-running .stage-state { background: rgba(46,204,113,.15); color: #2ecc71; }
|
|
.state-warning { box-shadow: inset 0 0 0 1px var(--cockpit-warn); }
|
|
.state-warning .stage-state { background: rgba(245,166,35,.15); color: var(--cockpit-warn); }
|
|
.state-alarm { box-shadow: inset 0 0 0 1px #ff3b30; }
|
|
.state-alarm .stage-state { background: rgba(255,59,48,.15); color: #ff3b30; }
|
|
.state-offline { opacity: .55; }
|
|
.state-offline .stage-state { background: rgba(138,160,189,.15); color: var(--cockpit-fg-muted); }
|
|
|
|
/* ---- TrendChart --------------------------------------------------------- */
|
|
.trend-bind { font-size: 11px; color: var(--cockpit-fg-muted); margin-bottom: 4px; }
|
|
.trend-canvas { width: 100%; height: calc(100% - 18px); display: block; }
|
|
|
|
/* ---- KpiCard ------------------------------------------------------------ */
|
|
.kpi-value { font-size: 28px; font-weight: 700; color: var(--cockpit-accent); }
|
|
.kpi-label { font-size: 13px; color: var(--cockpit-fg); margin-top: 2px; }
|
|
.kpi-desc { font-size: 11px; color: var(--cockpit-fg-muted); margin-top: 6px; }
|
|
|
|
/* ---- AlarmPanel ---------------------------------------------------------- */
|
|
.alarm-list { overflow-y: auto; height: 100%; display: flex; flex-direction: column; gap: 6px; }
|
|
.alarm-item { border-radius: 6px; padding: 6px 10px; font-size: 12px;
|
|
display: flex; align-items: center; gap: 8px; border-left: 3px solid transparent; }
|
|
.alarm-item .sev { font-weight: 700; }
|
|
.alarm-item .msg { flex: 1; }
|
|
.alarm-item .ack-btn { padding: 2px 10px; border: none; border-radius: 4px; cursor: pointer;
|
|
background: var(--cockpit-accent); color: #04202a; font-size: 11px; }
|
|
.alarm-item .acked { color: var(--cockpit-fg-muted); font-size: 11px; }
|
|
.alarm-sop { font-size: 11px; color: var(--cockpit-fg-muted); margin-top: 2px; }
|
|
|
|
/* ---- NlQuery ------------------------------------------------------------- */
|
|
.nl-answer { flex: 1; overflow-y: auto; font-size: 12px; color: var(--cockpit-fg);
|
|
background: var(--cockpit-bg); border-radius: 6px; padding: 8px; margin-bottom: 8px;
|
|
white-space: pre-wrap; min-height: 0; }
|
|
.nl-input-row { display: flex; gap: 6px; }
|
|
.nl-input-row input { flex: 1; padding: 6px 8px; border-radius: 6px; font-size: 12px;
|
|
border: 1px solid var(--cockpit-grid-line);
|
|
background: var(--cockpit-bg); color: var(--cockpit-fg); }
|
|
.nl-input-row button { padding: 6px 12px; border: none; border-radius: 6px; cursor: pointer;
|
|
background: var(--cockpit-accent); color: #04202a; font-size: 12px; }
|
|
.nl-input-row button:disabled { opacity: .5; }
|
|
|
|
/* ---- 底栏 ---------------------------------------------------------------- */
|
|
#bottombar { display: flex; justify-content: space-between; padding: 8px 16px;
|
|
font-size: 11px; color: var(--cockpit-fg-muted);
|
|
border-top: 1px solid var(--cockpit-grid-line); }
|
|
|
|
/* 窄屏降级:保持栅格语义,列宽过小时允许横向滚动而非挤压变形 */
|
|
@media (max-width: 900px) {
|
|
#cockpit-grid { grid-auto-rows: 80px; min-width: 860px; }
|
|
body { overflow-x: auto; }
|
|
}
|