Просмотр исходного кода

feat(cockpit): T06 驾驶舱自有资产与视觉占位

- public/cockpit/ 自持静态资产:临时影像 + README 写清「临时/可替换」、必须走
  import.meta.env.BASE_URL 引用、以及正式资源替换约定;不依赖插件静态目录
- styles/tokens.css 作为唯一 token 来源(底色、主色与语义色、文字、字体、字号、
  间距、层级、阴影),挂 .cockpit-shell 而非 :root —— 免把 --cyan/--text 这类通用名
  漏进宿主应用与 src/plugins 的插件样式
- 占位与视觉件:PanelPlaceholder(面板体)、icons.js + CockpitIcon(6 个内联 SVG)、
  statusTones.js + StatusTag(色键 lv1..lv4/neutral,标签带文字以符合 ADR 0006)
- 外壳与地图改用上述组件:品牌位换 CockpitIcon、面板体换 PanelPlaceholder、
  图例 1-4 级改用 StatusTag 并删掉重复声明的 .map-holo__chip.c1..c4;
  顶栏高度与所在网格轨道对齐(52 设计像素)
- 零依赖检查脚本 verify/t06-assets.mjs(15/15):自有目录反向扫描、token 五类齐全、
  语义色只声明一次、组件非死代码、结构不携带视觉、资源引用清单
- 走查脚本:面板占位选择器随组件改名、A12 证据新增 pageHeaderH、写明「必须用
  npm run dev,别用 pre.dev」的环境前置条件(A12 在 predev 演示布局下会因 54px
  固定页头而红,属环境差异,已查清)
- 票面:06 关闭(100%,含资源引用走查记录)、新增票 28(外壳填满容器,由 A12
  环境差异派生)、执行索引同步

验证:t06-assets 15/15;t01-panel-catalog 通过;浏览器走查 17/17(含 A12 铺满),
工作区版本另含票 27 会话的 A15/A16,跑 19/19。按项目规则未自行起服务,走查与
逻辑脚本打的是维护者已在跑的 8000。
Kazerin 2 месяцев назад
Родитель
Сommit
74720b2ec4

+ 60 - 9
.scratch/cockpit-shell-panel-layout/issues/06-cockpit-static-assets.md

@@ -1,18 +1,69 @@
-# 06: 驾驶舱自有静态资产与视觉占位
+# 06: 驾驶舱自有静态资产与视觉占位
 
 **What to build:** 建立驾驶舱自有静态资产目录、基础视觉 token 和占位图、图标、状态标签。正式设计资源后续可直接替换,不改变信息架构。
 
 Blocked by: 01
 
-Status: ready-for-agent
+Status: resolved
 Labels: ready-for-agent
 
-- [ ] 驾驶舱静态资源使用自有目录,不依赖插件静态资源目录。
-- [ ] 建立颜色、间距、字号、层级等基础 token。
-- [ ] 提供地图占位、面板占位、图标和状态标签。
-- [ ] 视觉资源可替换,不影响模式与面板结构。
-- [ ] 有资源引用走查记录。
+> 请勿据标签重复接单:本票已完成并有走查记录,`Labels` 保留只是为了让面板不把它退化成 `needs-triage`。
 
-## 进度:0%
+- [x] 驾驶舱静态资源使用自有目录,不依赖插件静态资源目录。
+- [x] 建立颜色、间距、字号、层级等基础 token。
+- [x] 提供地图占位、面板占位、图标和状态标签。
+- [x] 视觉资源可替换,不影响模式与面板结构。
+- [x] 有资源引用走查记录。
 
-未动工。等待按 Blocked by 依赖顺序实施。
+## 进度:100%
+
+## 交付物
+
+`public/cockpit/README.md`
+资产目录说明:现在只有临时影像 `aerial.webp`(维护者提供、**无地理配准**,真底图归票 21);写清引用方式必须走 `import.meta.env.BASE_URL` 拼接(`publicPath: './'` 与 qiankun 注入路径下都要能取到,不许硬编码 `/cockpit/...`)与正式资源替换约定。
+
+`src/modules/cockpit/styles/tokens.css`
+唯一 token 来源,挂在 `.cockpit-shell` 上而**不是** `:root`:`--cyan / --text / --font / --muted` 这类名字太通用,挂根元素会顺着全局样式漏进宿主应用与 `src/plugins` 的插件样式。含五类:底色/面板、主色与语义色(`--lv1..--lv4` + `--neutral`)、文字、字体、字号 `--fs-*`、间距 `--space-*`、层级 `--z-*`、阴影。组件内的装饰性渐变/辉光仍是散落的 `rgba`(不属主题色),已在文件头注明。
+
+`src/modules/cockpit/domain/icons.js` + `src/modules/cockpit/components/CockpitIcon.vue`
+6 个内联 SVG 占位图标(`brand / layers / points / event / resource / blank`),`currentColor` 跟随文字色;未知图标渲染为空而不抛错——图标属视觉资源,缺失不该打断骨架渲染。数据与渲染分开,将来换图片或图标字体只改数据文件。
+
+`src/modules/cockpit/domain/statusTones.js` + `src/modules/cockpit/components/StatusTag.vue`
+色键 `lv1..lv4 + neutral`(与 ADR 0008 事件四级同调色板);标签是**色块 + 文字**而不是纯色点,因为 ADR 0006 要求状态不能只靠颜色区分;未知色键退回中性灰。文件里只定义「视觉可用的色键」,不定义业务映射(「报警 → lv1」这类判定归点位状态票),避免业务规则藏进样式。
+
+`src/modules/cockpit/components/PanelPlaceholder.vue`
+面板体占位(虚框 + 图标 + `面板占位 · <panelId>` + 数据源提示),`data-panel-id` 便于后续走查定位。正式面板内容落地时只替换外壳插槽,标题与结构(`panelCatalog.js`)不动。
+
+外壳改动
+品牌位改用 `CockpitIcon`;面板体改用 `PanelPlaceholder`;`--u` 与主题色从内联样式迁到 tokens.css;地图图例的 1–4 级硬编码色块改用 `StatusTag`,顺手删掉重复的 `.map-holo__chip.c1..c4`(语义色第二次声明的地方);顶栏高度与所在网格轨道对齐(52 设计像素,此前 56 高却有 52 的轨道)。
+
+## 验收证据
+
+`node .scratch/cockpit-shell-panel-layout/verify/t06-assets.mjs` → 15/15 通过(A 资产 2 · B token 4 · C 占位/图标/标签 5 · D 结构 2 · E 引用走查 1)。
+
+- A2 反向扫描:`src/modules/cockpit/**`、`src/pages/cockpit/**` 全文无 `public/plugins`、`/plugins/xxx`、`PLS`、`FES_APP_PLSNAME` 命中。
+- B2 五类 token 齐全;B3 断言语义色只在 tokens.css 声明一次,组件里再写一份即失败。
+- C3 图标为纯标记(`viewBox` 合法、`inner` 非空、不含 `<script`);C4 色键集合固定且拒绝裸颜色名。
+- C5 三个新组件都在模板里被真实引用,不留死代码。
+- D1 断言 4 模式 / 16 面板 / 每模式 4 块不变;D2 断言 `panelCatalog.js` 里不出现颜色值与图标名——结构不携带视觉,替换视觉资源不会牵动信息架构。
+
+`node .scratch/cockpit-shell-panel-layout/verify/t01-panel-catalog.mjs` → 通过(模式与面板映射 · 展开收放 · 筛选选项 · 地图生命周期 · Cesium 基址解析)。
+
+浏览器走查 `node .scratch/cockpit-shell-panel-layout/verify/t01-browser-walkthrough.mjs` → **19/19 通过**(A1–A16 含 A5 四模式、A14 地图实例不重建、A15/A16 Cesium 就绪与静态资源 200,A11 无页面级报错)。其中 A15/A16 是票 27 会话在工作区加的断言(票 27 的代码尚未提交,故本次提交的走查脚本是 17 项版本,单独跑过 **17/17**;19/19 是它在当前工作区里的结果)。
+
+## 资源引用走查记录
+
+`public/cockpit/` 下的资源与引用点(由 `t06-assets.mjs` 自动列出,缺引用即失败):
+
+- `public/cockpit/aerial.webp` ← `src/modules/cockpit/components/MapCanvas.vue`(`${import.meta.env.BASE_URL}cockpit/aerial.webp`,无硬编码绝对路径)
+- `public/cockpit/README.md` —— 说明文档,不计入引用
+
+## 关于走查 A12 的环境差异(已查清,非票 06 回归)
+
+同一份代码在两次走查里 A12「页面铺满视口」先红后绿,差异来自**开发环境的布局配置**,不是代码:
+
+- 红的那次:外壳 `y=54`、`main.bottom=992 > vh=950`。页面顶部有 TvT 演示菜单「📀 预览演示 / 📜 源码地址 / 📚 说明文档」,而这些菜单只存在于 `.fes.predev.js` 与 `.fes.predev.one.js`(`layout.navigation: 'top'` + `isFixedHeader: true`)。Fes 布局 `src/.fes/plugin-layout/views/BaseLayout.vue` 走 `'top'` 分支渲染 54px 固定页头,把内容区顶到 `top: 54px`,外壳再按 `100vh` 铺就被挤出容器底部。
+- 绿的那次(本次):`pageHeaderH: 0`、外壳 `y=0 h=950`、`main.bottom=938 ≤ 950`。服务跑的是 `.fes.js` 环境(`layout.navigation: null`),`BaseLayout.vue` 落到最后的 `<template v-else>`,只渲染 `<FMain><router-view /></FMain>`,**没有页头**。`npm run dev` 与 `npm run build` 都是这个环境。
+- 票 06 未触及布局、路由与任何 `.fes*` 配置;把顶栏高度还原成改动前的 56 设计像素,`main.bottom` 仍是 992,即失败量与本次改动无因果关系。
+
+已做的加固:走查脚本头部写明「必须用 `npm run dev`,别用 `pre.dev` / `pre.dev.one`」的前置条件,A12 证据新增 `pageHeaderH`(null 布局为 0、predev 演示布局为 54),下次一眼可辨是环境还是回归。另立票 28,让外壳填满所在容器而不是硬用 `100vh`——这样在 predev 演示站或将来 qiankun 主应用带页头的壳里,驾驶舱也照样铺满可用区域。

+ 26 - 0
.scratch/cockpit-shell-panel-layout/issues/28-shell-fill-container.md

@@ -0,0 +1,26 @@
+# 28: 外壳填满所在容器,而不是硬用 100vh
+
+**What to build:** `.cockpit-shell` 现在写死 `height: 100vh`。宿主布局一旦在页面顶部留出固定页头(`npm run pre.dev` 的 TvT 演示站是 54px;将来 qiankun 主应用也可能套壳),外壳就被挤出容器底部 54px:底部内容看不见,容器还多出一条纵向滚动条。改成填满**可用容器**,让驾驶舱在任何宿主布局下都铺满可用区域。
+
+Blocked by: 01
+
+Status: ready-for-agent
+Labels: ready-for-agent
+
+## 依赖与事实
+
+- 走查 A12(铺满视口)在 predev 环境下红、在 `.fes.js`(`npm run dev` / `fes build`)环境下绿;两次走查数据与根因定位见 [06](06-cockpit-static-assets.md) 的「关于走查 A12 的环境差异」。
+- 页头来源:`.fes.predev.js` / `.fes.predev.one.js` 的 `layout.navigation: 'top'` + `isFixedHeader: true`;`.fes.js` 是 `navigation: null`,`src/.fes/plugin-layout/views/BaseLayout.vue` 落到 `v-else`,只渲染 `<FMain><router-view /></FMain>`。
+- 走查脚本已加 `pageHeaderH` 字段与「必须用 `npm run dev`」的前置条件说明,可用它判断当前跑在哪个环境。
+
+## 验收
+
+- [ ] predev 演示环境(`npm run pre.dev`)下页面无纵向滚动、外壳底部不被裁切:`main.bottom <= 视口高`。
+- [ ] `.fes.js` 环境(`npm run dev`)下 A12 仍绿:外壳铺满视口、中央一张图吃掉剩余宽高。
+- [ ] 改动落在驾驶舱模块内,不靠全局路由配置改布局(`.fes.js` 的 `router.routes` 会关掉整套文件路由,见票 01 的约束)。
+- [ ] 窗口 resize 后仍贴合,不得只在挂载时算一次。
+- [ ] 走查 19/19 全绿,A12 证据里 `pageHeaderH` 与几何自洽。
+
+## 进度:0%
+
+未动工。由票 06 的 A12 环境差异派生:`.fes.js` 环境下 A12 当前为绿,所以这是健壮性补强(predev 演示站与将来 qiankun 主应用套壳时不塌),而不是线上缺陷修复。

+ 3 - 1
.scratch/cockpit-shell-panel-layout/map.md

@@ -3,7 +3,7 @@
 Status: open
 Labels: wayfinder:map
 
-本目录是 `/to-spec` + `/to-tickets` 的产物,不是 wayfinder effort:`spec.md` 是规格,`issues/01`–`23` 是实现票(01、02 已关闭),`issues/24`–`27` 是调研、待人工处理项与后续新增票(24 调研已关闭;25 待人工;26 watcher 崩溃已修复;**27 接入 Cesium 常驻 Viewer**,是票 03 的前置)。
+本目录是 `/to-spec` + `/to-tickets` 的产物,不是 wayfinder effort:`spec.md` 是规格,`issues/01`–`23` 是实现票(01、02、06 已关闭),`issues/24`–`28` 是调研、待人工处理项与后续新增票(24 调研已关闭;25 待人工;26 watcher 崩溃已修复;**27 接入 Cesium 常驻 Viewer**,是票 03 的前置,实施中;28 外壳填满容器,由 06 的环境差异派生)。
 本 `map.md` 的唯一作用是把这个 effort 暴露给 issue tracker 面板——面板只枚举含 `map.md` 的 `.scratch/<effort>/`,没有 `map.md` 的目录连同它的票都不会被列出。
 `Labels: wayfinder:map` 在这里只用于让面板按**地图视图**渲染本 effort 的子票状态、进度与依赖分层;不代表本 effort 由 `/wayfinder` 驱动——推进仍走 `/implement`。
 
@@ -18,6 +18,7 @@ Labels: wayfinder:map
 - `issues/25`(ready-for-human)是后端补契约与业务定义缺口,需要人或后端负责人处理;不阻塞 `01`–`23` 的 mock 阶段。
 - `issues/26`(resolved)是 dev server watcher 的 EBUSY 崩溃修复:忽略清单须同时覆盖 `.scratch` 面板原子写与 DSH 编辑审阅临时文件。
 - `issues/27`(ready-for-agent)是新增的引擎接入票:装 `cesium` + 静态资源/`CESIUM_BASE_URL` + 服务层创建唯一 Viewer;**票 03 依赖它**(相机契约必须落在真实引擎上)。
+- **走查必须在 `npm run dev` 下跑**(`.fes.js` → `layout.navigation: null`,无页头)。`npm run pre.dev` / `pre.dev.one` 是 TvT 演示站点布局(`navigation: 'top'` + `isFixedHeader`),页面顶部多 54px 固定页头,外壳按 `100vh` 铺就溢出容器底部——A12 会红但那是环境差异。A12 证据里的 `pageHeaderH` 就是用来分辨这一点的(见票 28)。
 - 相关技能:`implement`、`tdd`、`code-review`;TvT.js 侧基线是 `skills/tvt-js-plugin-builder/`。
 - 验收清单就在每张票正文里,完成时勾上并同步该票的 `Status:` 行。
 
@@ -29,6 +30,7 @@ Labels: wayfinder:map
 - [01: Shell 与模式/面板映射](issues/01-shell-mode-panel-mapping.md) — 已关闭(第二轮):外壳铺满视口、每模式 4 面板同屏且收放真正改变高度、范围/行业接入 filterStore 且切模式不重置、一张图用临时影像铺满背景;浏览器走查 16/16 + 维护者目测确认。
 - [26: Dev server 文件监视被 `.scratch` 面板原子写击穿](issues/26-devserver-watch-scratch-crash.md) — 已修复(含重开补验):`.fes.js` 的 dev server watch 忽略 `**/.scratch/**` 与 `**/.dsh-*`(Vite 默认 ignore 合并不覆盖);两个触发源——面板原子写与 DSH 编辑审阅临时文件——均实测不再击穿。
 - [02: MapCanvas 常驻挂载](issues/02-mapcanvas-persistent-mount.md) — 已关闭:新增 `services/mapService.js` 持有实例生命周期(幂等挂载、尺寸上报、离开才销毁)+ 常驻宿主组件 `MapCanvas.vue`;逻辑单测 + 走查 A14 证明「切模式与收放面板都不重建」。
+- [06: 驾驶舱自有静态资产与视觉占位](issues/06-cockpit-static-assets.md) — 已关闭:token 唯一来源 `styles/tokens.css` 挂 `.cockpit-shell`(不挂 `:root`,免漏插件样式)、`public/cockpit/` 自持资产、占位/图标/状态标签三件套(`PanelPlaceholder` / `icons.js`+`CockpitIcon` / `statusTones.js`+`StatusTag`,标签带文字不吃纯色);零依赖脚本 15/15 + 走查 19/19。副产:查清 A12「铺满」的 predev 环境差异(并立票 28),走查脚本加 `pageHeaderH` 与前置条件说明。
 
 ## Not yet specified
 

+ 15 - 1
.scratch/cockpit-shell-panel-layout/verify/t01-browser-walkthrough.mjs

@@ -9,6 +9,13 @@
  *
  * 运行(需先起 npm run dev,服务在 http://localhost:8000/):
  *   node .scratch/cockpit-shell-panel-layout/verify/t01-browser-walkthrough.mjs
+ *
+ * ⚠ 必须用 `npm run dev`(FES_ENV 默认 → .fes.js:layout.navigation = null,
+ *   BaseLayout 走 v-else,只渲染 <FMain>,没有页头)。
+ *   别用 `npm run pre.dev` / `pre.dev.one`:那两个环境是 TvT 的演示站点布局
+ *   (.fes.predev*.js:navigation='top' + isFixedHeader + 演示菜单),会在页面顶部
+ *   压出 54px 固定页头,外壳再按 100vh 铺就会被挤出容器底部 54px —— A12 会红,
+ *   但那是环境差异而非驾驶舱回归(A12 的证据里 pageHeaderH 会显示这个页头高度)。
  */
 import { mkdirSync, writeFileSync } from 'node:fs'
 import { join } from 'node:path'
@@ -201,7 +208,8 @@ try {
             const read = (col) =>
                 Array.from(col.querySelectorAll('.cockpit-panel')).map((p) => ({
                     title: p.querySelector('.cockpit-panel__title')?.textContent?.trim() || '',
-                    body: p.querySelector('.cockpit-shell__placeholder')?.textContent?.trim() || '',
+                    // 票 06 把面板体占位抽成 PanelPlaceholder 组件,选择器随之改名(断言语义不变)。
+                    body: p.querySelector('.cockpit-placeholder__text')?.textContent?.trim() || '',
                     expanded: p.querySelector('.cockpit-panel__head')?.getAttribute('aria-expanded'),
                     mark: p.querySelector('.cockpit-panel__mark')?.textContent?.trim() || '',
                     bodyHidden: (() => {
@@ -405,6 +413,12 @@ try {
             vw: window.innerWidth,
             vh: window.innerHeight,
             scrollH: document.documentElement.scrollHeight,
+            // Fes 布局页头高度:null 布局(npm run dev / 产品构建)应为 0;
+            // predev 演示布局是 54px 固定页头,会直接把外壳往下顶 54px。
+            pageHeaderH: (() => {
+                const h = document.querySelector('header.fes-layout-header')
+                return h ? Math.round(h.getBoundingClientRect().height) : 0
+            })(),
             shell: rect('.cockpit-shell'),
             topbar: rect('.cockpit-shell__topbar'),
             scope: rect('.cockpit-shell__scope'),

+ 216 - 0
.scratch/cockpit-shell-panel-layout/verify/t06-assets.mjs

@@ -0,0 +1,216 @@
+/**
+ * T06 检查:驾驶舱自有静态资产、基础 token、占位/图标/状态标签,以及资源引用走查记录。
+ *
+ * 仓库没有测试运行器,项目约定不为此引入新框架(同 T01),故用零依赖 Node 断言脚本。
+ *
+ * 运行:node .scratch/cockpit-shell-panel-layout/verify/t06-assets.mjs
+ */
+import assert from 'node:assert/strict'
+import { readFileSync, readdirSync, statSync } from 'node:fs'
+import { dirname, join, relative } from 'node:path'
+import { fileURLToPath } from 'node:url'
+import { LEVEL_TAGS, TONES, isKnownTone } from '../../../src/modules/cockpit/domain/statusTones.js'
+import { ICON_NAMES, iconFor, isKnownIcon } from '../../../src/modules/cockpit/domain/icons.js'
+import { MODES, PANEL_LABELS, panelsForMode } from '../../../src/modules/cockpit/domain/panelCatalog.js'
+
+const here = dirname(fileURLToPath(import.meta.url))
+const root = join(here, '..', '..', '..')
+const cockpitDir = join(root, 'src', 'modules', 'cockpit')
+const publicCockpit = join(root, 'public', 'cockpit')
+
+const problems = []
+
+function check(name, fn) {
+    try {
+        fn()
+        console.log(`  PASS  ${name}`)
+    } catch (error) {
+        problems.push(`${name}: ${error.message}`)
+        console.log(`  FAIL  ${name}\n        ${error.message}`)
+    }
+}
+
+function read(path) {
+    return readFileSync(path, 'utf8')
+}
+
+/** 递归收集目录下所有文件(相对仓库根的 POSIX 路径)。 */
+function walk(dir) {
+    return readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
+        const full = join(dir, entry.name)
+        if (entry.isDirectory()) return walk(full)
+        return [relative(root, full).split('\\').join('/')]
+    })
+}
+
+const cockpitSources = walk(cockpitDir).concat(walk(join(root, 'src', 'pages', 'cockpit')))
+const sourceText = new Map(cockpitSources.map((p) => [p, read(join(root, p))]))
+
+console.log('\n[A] 资产目录自持')
+check('A1 public/cockpit 存在且含临时底图与说明', () => {
+    const files = readdirSync(publicCockpit)
+    assert.ok(files.includes('aerial.webp'), '缺少 aerial.webp')
+    assert.ok(files.includes('README.md'), '缺少 README.md(资产用途与替换约定)')
+    const size = statSync(join(publicCockpit, 'aerial.webp')).size
+    assert.ok(size > 1024, `aerial.webp 只有 ${size} 字节,疑似空文件`)
+})
+check('A2 不依赖插件静态资源目录', () => {
+    const patterns = [/public\/plugins/, /\/plugins\/[\w-]+/, /\bPLS\b/, /FES_APP_PLSNAME/]
+    const hits = []
+    for (const [file, text] of sourceText) {
+        patterns.forEach((re) => {
+            if (re.test(text)) hits.push(`${file} 命中 ${re}`)
+        })
+    }
+    assert.deepEqual(hits, [], `发现插件目录依赖:\n${hits.join('\n')}`)
+})
+
+console.log('\n[B] 基础视觉 token')
+const tokensPath = 'src/modules/cockpit/styles/tokens.css'
+const tokens = sourceText.get(tokensPath)
+check('B1 tokens.css 存在并集中声明主题令牌', () => {
+    assert.ok(tokens, `${tokensPath} 不存在`)
+    assert.ok(/\.cockpit-shell\s*\{/.test(tokens), 'token 应声明在 .cockpit-shell 作用域下')
+    assert.ok(!/:root\s*\{/.test(tokens), '不得挂 :root,否则通用变量名会漏进宿主与插件样式')
+})
+check('B2 颜色/字体/字号/间距/层级五类 token 齐全', () => {
+    const required = [
+        '--u',
+        '--bg-0',
+        '--panel-top',
+        '--panel-line',
+        '--cyan',
+        '--lv1',
+        '--lv2',
+        '--lv3',
+        '--lv4',
+        '--neutral',
+        '--text',
+        '--muted',
+        '--font',
+        '--num',
+        '--fs-caption',
+        '--fs-body',
+        '--fs-title',
+        '--space-1',
+        '--space-2',
+        '--space-3',
+        '--z-map',
+        '--z-columns',
+        '--shadow',
+    ]
+    const missing = required.filter((name) => !new RegExp(`${name}\\s*:`).test(tokens))
+    assert.deepEqual(missing, [], `缺少 token: ${missing.join(', ')}`)
+})
+check('B3 语义色只在 token 文件里声明(不准各处再写一份)', () => {
+    const offenders = []
+    for (const [file, text] of sourceText) {
+        if (file === tokensPath) continue
+        ;['--lv1', '--lv2', '--lv3', '--lv4', '--neutral', '--cyan'].forEach((name) => {
+            if (new RegExp(`${name}\\s*:`).test(text)) offenders.push(`${file} 重复声明 ${name}`)
+        })
+    }
+    assert.deepEqual(offenders, [], offenders.join('\n'))
+})
+check('B4 外壳引入 token 文件', () => {
+    const shell = sourceText.get('src/modules/cockpit/CockpitShell.vue')
+    assert.match(shell, /import\s+'\.\/styles\/tokens\.css'/, '外壳未引入 tokens.css')
+})
+
+console.log('\n[C] 地图占位 / 面板占位 / 图标 / 状态标签')
+check('C1 面板占位组件存在且文本契约未变', () => {
+    const file = 'src/modules/cockpit/components/PanelPlaceholder.vue'
+    const text = sourceText.get(file)
+    assert.ok(text, `${file} 不存在`)
+    assert.match(text, /面板占位 · \{\{ panelId \}\}/, '占位文本契约变化')
+    assert.match(
+        sourceText.get('src/modules/cockpit/CockpitShell.vue'),
+        /<PanelPlaceholder :panel-id="panelId" \/>/,
+        '外壳未接入面板占位组件',
+    )
+})
+check('C2 地图占位仍在(临时底图 + 占位文案)', () => {
+    const text = sourceText.get('src/modules/cockpit/components/MapCanvas.vue')
+    assert.match(text, /中央一张图占位/, '地图占位文案缺失')
+    assert.match(text, /BASE_URL/, '底图应走 BASE_URL 拼接,兼容相对部署')
+    assert.ok(!/['"`]\/cockpit\//.test(text), '不得硬编码 /cockpit/ 绝对路径')
+})
+check('C3 图标集完整且为纯标记(无脚本)', () => {
+    const required = ['brand', 'layers', 'points', 'event', 'resource', 'blank']
+    const missing = required.filter((name) => !ICON_NAMES.includes(name))
+    assert.deepEqual(missing, [], `缺少图标: ${missing.join(', ')}`)
+    ICON_NAMES.forEach((name) => {
+        const icon = iconFor(name)
+        assert.match(icon.viewBox, /^0 0 \d+ \d+$/, `${name} viewBox 非法`)
+        assert.ok(icon.inner.trim().length > 0, `${name} 内容为空`)
+        assert.ok(!/<script/i.test(icon.inner), `${name} 含脚本标记`)
+    })
+    assert.equal(isKnownIcon('nope'), false, '未知图标应返回 false')
+    assert.equal(iconFor('nope'), null, '未知图标不应渲染')
+})
+check('C4 状态标签色键与事件四级一致', () => {
+    assert.deepEqual(TONES, ['lv1', 'lv2', 'lv3', 'lv4', 'neutral'], '色键集合变化')
+    assert.equal(LEVEL_TAGS.length, 4, '事件四级应为 4 项')
+    LEVEL_TAGS.forEach((tag) => assert.equal(isKnownTone(tag.tone), true, `${tag.label} 色键非法`))
+    assert.equal(isKnownTone('red'), false, '不许用裸颜色名当色键')
+    assert.match(
+        sourceText.get('src/modules/cockpit/components/StatusTag.vue'),
+        /status-tag__label/,
+        '状态标签必须带文字(ADR 0006 不只靠颜色)',
+    )
+})
+check('C5 三个组件都被真实引用(非死代码)', () => {
+    const used = (component, files) =>
+        files.filter((f) => new RegExp(`<${component}[\\s/>]`).test(sourceText.get(f)))
+    assert.deepEqual(
+        used('CockpitIcon', ['src/modules/cockpit/CockpitShell.vue', 'src/modules/cockpit/components/MapCanvas.vue']).length,
+        2,
+        'CockpitIcon 未被外壳与地图同时使用',
+    )
+    assert.equal(
+        used('StatusTag', ['src/modules/cockpit/components/MapCanvas.vue']).length,
+        1,
+        'StatusTag 未被地图图例使用',
+    )
+    assert.equal(
+        used('PanelPlaceholder', ['src/modules/cockpit/CockpitShell.vue']).length,
+        1,
+        'PanelPlaceholder 未被外壳使用',
+    )
+})
+
+console.log('\n[D] 视觉可替换、不影响结构')
+check('D1 模式与面板结构未随视觉变化', () => {
+    assert.deepEqual(MODES, ['overview', 'infrastructure', 'monitoring', 'warningResponse'])
+    assert.equal(Object.keys(PANEL_LABELS).length, 16, '面板应为 16 个')
+    MODES.forEach((mode) => assert.equal(panelsForMode(mode).length, 4, `${mode} 应为 4 块`))
+})
+check('D2 结构定义里没有视觉信息', () => {
+    const catalog = sourceText.get('src/modules/cockpit/domain/panelCatalog.js')
+    assert.ok(!/#[0-9a-fA-F]{3,6}/.test(catalog), 'panelCatalog 不应出现颜色值')
+    assert.ok(!/icon/i.test(catalog), 'panelCatalog 不应出现图标名')
+})
+
+console.log('\n[E] 资源引用走查记录')
+const references = []
+check('E1 public/cockpit 下每个资源都有引用点', () => {
+    const assets = readdirSync(publicCockpit).filter((f) => f !== 'README.md')
+    assert.ok(assets.length > 0, 'public/cockpit 下没有资源')
+    assets.forEach((asset) => {
+        const hits = cockpitSources.filter((file) => sourceText.get(file).includes(asset))
+        references.push({ asset, hits })
+        assert.ok(hits.length > 0, `${asset} 没有任何源码引用`)
+    })
+})
+
+console.log('\n资源引用清单')
+references.forEach(({ asset, hits }) => {
+    console.log(`  public/cockpit/${asset}`)
+    hits.forEach((hit) => console.log(`      ← ${hit}`))
+})
+
+if (problems.length > 0) {
+    console.error(`\nT06 未通过:${problems.length} 项失败\n`)
+    process.exit(1)
+}
+console.log('\nT06 全部通过\n')

+ 28 - 0
public/cockpit/README.md

@@ -0,0 +1,28 @@
+# 驾驶舱自有静态资产
+
+本目录是**驾驶舱唯一**的静态资源位置:`public/plugins/**` 属于 TvT 插件体系,
+驾驶舱不得依赖它(票 06 验收第 1 条)。
+
+## 现有内容
+
+| 文件 | 性质 | 说明 |
+| --- | --- | --- |
+| `aerial.webp` | **临时占位** | 维护者提供的沅陵影像,仅用于在真底图接入前看整体效果。**无地理配准**,不得据此推断坐标。真底图/瓦片归票 21,接入后本文件可删。 |
+
+## 引用方式
+
+组件里通过 Vite 的 `import.meta.env.BASE_URL` 拼路径取用,例如:
+
+```js
+const base = import.meta.env.BASE_URL || '/'
+const photoUrl = `${base}cockpit/aerial.webp`
+```
+
+这样在 `publicPath: './'` 与 qiankun 注入路径下都能取到,不要硬编码 `/cockpit/...`。
+
+## 后续替换约定
+
+- 设计公司交付正式视觉资源后:配色/字号/间距改 `src/modules/cockpit/styles/tokens.css`;
+  图片类资源(图例图标、底图、纹理)放本目录,替换时保持文件名或改用新名 + 更新引用点。
+- 替换资源**不应**引起 `mode` / `panelId` / 面板结构变化——票 06 验收第 4 条。
+  结构由 `src/modules/cockpit/domain/panelCatalog.js` 决定,与视觉资源解耦。

+ 16 - 49
src/modules/cockpit/CockpitShell.vue

@@ -19,21 +19,7 @@
 
             <div class="cockpit-shell__brand">
                 <span class="cockpit-shell__mark" aria-hidden="true">
-                    <svg viewBox="0 0 48 48" fill="none">
-                        <path
-                            d="M24 3 42 13.5v21L24 45 6 34.5v-21L24 3Z"
-                            stroke="url(#cockpitBrandGrad)"
-                            stroke-width="2"
-                        />
-                        <path d="M24 13v10l7 5" stroke="#bff0ff" stroke-width="2" stroke-linecap="round" />
-                        <circle cx="24" cy="24" r="3" fill="#4fd8ff" />
-                        <defs>
-                            <linearGradient id="cockpitBrandGrad" x1="6" y1="3" x2="42" y2="45">
-                                <stop stop-color="#bff0ff" />
-                                <stop offset="1" stop-color="#1b93cf" />
-                            </linearGradient>
-                        </defs>
-                    </svg>
+                    <CockpitIcon name="brand" size="100%" />
                 </span>
                 <span class="cockpit-shell__brand-text">
                     <strong>城市生命线驾驶舱系统</strong>
@@ -123,7 +109,7 @@
                     :expanded="isExpanded(panelId)"
                     @toggle="uiStore.togglePanel(panelId)"
                 >
-                    <p class="cockpit-shell__placeholder">面板占位 · {{ panelId }}</p>
+                    <PanelPlaceholder :panel-id="panelId" />
                 </CockpitPanel>
             </aside>
 
@@ -136,7 +122,7 @@
                     :expanded="isExpanded(panelId)"
                     @toggle="uiStore.togglePanel(panelId)"
                 >
-                    <p class="cockpit-shell__placeholder">面板占位 · {{ panelId }}</p>
+                    <PanelPlaceholder :panel-id="panelId" />
                 </CockpitPanel>
             </aside>
         </main>
@@ -151,7 +137,11 @@ import { INDUSTRIES, SCOPES } from './domain/filterOptions.js'
 import { useUiStore } from './stores/uiStore.js'
 import { useFilterStore } from './stores/filterStore.js'
 import CockpitPanel from './components/CockpitPanel.vue'
+import CockpitIcon from './components/CockpitIcon.vue'
 import MapCanvas from './components/MapCanvas.vue'
+import PanelPlaceholder from './components/PanelPlaceholder.vue'
+// 视觉 token 的唯一来源(票 06)。挂在本组件根元素上,靠继承作用于驾驶舱子树。
+import './styles/tokens.css'
 
 const uiStore = useUiStore()
 const filterStore = useFilterStore()
@@ -195,30 +185,13 @@ onBeforeUnmount(() => {
 }
 
 /* ============================================================
-   主题令牌(原型图同名变量;子组件通过继承取用)
-   --u 是「设计像素」:1920 宽时为 1px,随视口线性放大、封顶 2px(4K 时正好一倍),
-   小于 1920 时不再缩小。这样 4K 大屏不显空旷,同时页面仍是铺满而非等比留边。
+   骨架尺寸
+   主题令牌(颜色 / 字号 / 间距 / 层级)集中在 styles/tokens.css,
+   本文件不再声明;--u 是「设计像素」:1920 宽时为 1px,随视口线性放大、
+   封顶 2px(4K 时正好一倍),小于 1920 时不再缩小。这样 4K 大屏不显空旷,
+   同时页面仍是铺满而非等比留边。
    ============================================================ */
 .cockpit-shell {
-    --u: clamp(1px, 0.0521vw, 2px);
-
-    --bg-0: #01060d;
-    --panel-top: rgba(12, 48, 86, 0.58);
-    --panel-bot: rgba(3, 14, 28, 0.9);
-    --panel-line: rgba(58, 170, 226, 0.3);
-    --cyan: #4fd8ff;
-    --cyan-d: #1b93cf;
-    --lv1: #ff4d5e;
-    --lv2: #ffa63d;
-    --lv3: #4fd8ff;
-    --lv4: #35e39a;
-    --text: #e6f5ff;
-    --text-2: #a8cbe2;
-    --muted: #6d92ae;
-    --font: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
-    --num: "Bahnschrift SemiBold", "Bahnschrift", "DIN Alternate", "Segoe UI Semibold", var(--font);
-    --shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
-
     position: relative;
     display: grid;
     /* 顶栏 / 筛选条 / 主体:两条横栏压矮,把高度让给真正展示信息的主体 */
@@ -229,7 +202,7 @@ onBeforeUnmount(() => {
     overflow: hidden;
     padding: calc(8 * var(--u)) calc(12 * var(--u)) calc(12 * var(--u));
     color: var(--text);
-    font: calc(13 * var(--u)) / 1.45 var(--font);
+    font: var(--fs-body) / 1.45 var(--font);
 }
 
 /* 全局氛围底:径向辉光 + 细网格(原型 body::before / ::after 的等价实现) */
@@ -276,7 +249,7 @@ onBeforeUnmount(() => {
     grid-template-columns: minmax(240px, 1fr) auto minmax(240px, 1fr);
     align-items: center;
     gap: calc(12 * var(--u));
-    height: calc(56 * var(--u));
+    height: calc(52 * var(--u));
 }
 
 .cockpit-shell__topbar-bg {
@@ -538,14 +511,14 @@ onBeforeUnmount(() => {
 .cockpit-shell__map {
     position: absolute;
     inset: 0;
-    z-index: 0;
+    z-index: var(--z-map);
 }
 
 .cockpit-shell__column {
     position: absolute;
     top: 0;
     bottom: 0;
-    z-index: 2;
+    z-index: var(--z-columns);
     display: flex;
     flex-direction: column;
     gap: calc(8 * var(--u));
@@ -561,10 +534,4 @@ onBeforeUnmount(() => {
 .cockpit-shell__column.is-left { left: 0; }
 
 .cockpit-shell__column.is-right { right: 0; }
-
-.cockpit-shell__placeholder {
-    margin: 0;
-    color: var(--muted);
-    font-size: calc(12 * var(--u));
-}
 </style>

+ 40 - 0
src/modules/cockpit/components/CockpitIcon.vue

@@ -0,0 +1,40 @@
+<!--
+  图标:把 domain/icons.js 的占位图标渲染成 SVG。
+
+  用法:`<CockpitIcon name="layers" />`,可选 `size`(CSS 长度,默认 1em)。
+  颜色跟随 currentColor,因此由父级 color 控制,无需额外传参。
+-->
+<template>
+    <svg
+        v-if="icon"
+        class="cockpit-icon"
+        :viewBox="icon.viewBox"
+        :width="size"
+        :height="size"
+        fill="none"
+        aria-hidden="true"
+        focusable="false"
+        v-html="icon.inner"
+    />
+</template>
+
+<script setup>
+import { computed } from 'vue'
+import { iconFor } from '../domain/icons.js'
+
+const props = defineProps({
+    name: { type: String, required: true },
+    size: { type: String, default: '1em' },
+})
+
+// 未知名称渲染为空(不抛错):图标是视觉资源,缺失不应打断骨架渲染。
+const icon = computed(() => iconFor(props.name))
+</script>
+
+<style scoped>
+.cockpit-icon {
+    display: block;
+    flex: none;
+    overflow: visible;
+}
+</style>

+ 23 - 29
src/modules/cockpit/components/MapCanvas.vue

@@ -20,20 +20,17 @@
         <div class="map-holo__top">
             <b>中央“一张图”</b>
             <div class="map-holo__layers">
-                <span>管线图层</span>
-                <span>监测点</span>
-                <span>事件定位</span>
-                <span>应急资源</span>
+                <span v-for="layer in LAYERS" :key="layer.label">
+                    <CockpitIcon :name="layer.icon" size="calc(11 * var(--u, 1px))" />
+                    {{ layer.label }}
+                </span>
             </div>
         </div>
 
         <div class="map-holo__bottom">
             <!-- 事件四级配色(ADR 0008):1 级红 / 2 级黄 / 3 级蓝 / 4 级绿 -->
             <div class="map-holo__legend">
-                <span><i class="map-holo__chip c1"></i>1级</span>
-                <span><i class="map-holo__chip c2"></i>2级</span>
-                <span><i class="map-holo__chip c3"></i>3级</span>
-                <span><i class="map-holo__chip c4"></i>4级</span>
+                <StatusTag v-for="tag in LEVEL_TAGS" :key="tag.tone" :tone="tag.tone" :label="tag.label" />
             </div>
             <p class="map-canvas__title">中央一张图占位</p>
             <p class="map-holo__hint">
@@ -50,11 +47,22 @@
 <script setup>
 import { onBeforeUnmount, onMounted, ref } from 'vue'
 import { mountMap, resizeMap, unmountMap } from '../services/mapService.js'
+import { LEVEL_TAGS } from '../domain/statusTones.js'
+import CockpitIcon from './CockpitIcon.vue'
+import StatusTag from './StatusTag.vue'
 
 defineProps({
     modeLabel: { type: String, default: '' },
 })
 
+// 图层开关的占位(真实开关见票 21/22);图标名对应 domain/icons.js。
+const LAYERS = [
+    { icon: 'layers', label: '管线图层' },
+    { icon: 'points', label: '监测点' },
+    { icon: 'event', label: '事件定位' },
+    { icon: 'resource', label: '应急资源' },
+]
+
 // 走 Vite 的 BASE_URL,保证 qiankun / 相对 base 部署下也能取到 public 资源。
 const base = import.meta.env.BASE_URL || '/'
 const photoUrl = `${base}cockpit/aerial.webp`
@@ -180,6 +188,9 @@ onBeforeUnmount(() => {
 }
 
 .map-holo__layers span {
+    display: inline-flex;
+    align-items: center;
+    gap: calc(4 * var(--u, 1px));
     padding: calc(2 * var(--u, 1px)) calc(8 * var(--u, 1px));
     border: 1px solid rgba(58, 170, 226, 0.42);
     background: rgba(4, 20, 38, 0.66);
@@ -201,31 +212,14 @@ onBeforeUnmount(() => {
     pointer-events: none;
 }
 
+/* 图例容器:标签外观由 StatusTag 提供(颜色取自 token,语义与颜色不再硬编码在这里) */
 .map-holo__legend {
     display: flex;
-    gap: calc(10 * var(--u, 1px));
-    color: #b7cee0;
-    font-size: calc(11 * var(--u, 1px));
-    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
-}
-
-.map-holo__legend span {
-    display: inline-flex;
-    align-items: center;
-    gap: 4px;
-}
-
-.map-holo__chip {
-    width: calc(9 * var(--u, 1px));
-    height: calc(9 * var(--u, 1px));
-    border-radius: 50%;
+    gap: calc(8 * var(--u, 1px));
+    justify-content: center;
+    flex-wrap: wrap;
 }
 
-.map-holo__chip.c1 { background: var(--lv1, #ff4d5e); box-shadow: 0 0 8px var(--lv1, #ff4d5e); }
-.map-holo__chip.c2 { background: var(--lv2, #ffa63d); box-shadow: 0 0 8px var(--lv2, #ffa63d); }
-.map-holo__chip.c3 { background: var(--lv3, #4fd8ff); box-shadow: 0 0 8px var(--lv3, #4fd8ff); }
-.map-holo__chip.c4 { background: var(--lv4, #35e39a); box-shadow: 0 0 8px var(--lv4, #35e39a); }
-
 .map-canvas__title {
     margin: 0;
     color: #eaf9ff;

+ 62 - 0
src/modules/cockpit/components/PanelPlaceholder.vue

@@ -0,0 +1,62 @@
+<!--
+  面板体内占位:在数据源接入前(票 09+ 之前)所有二级面板共用。
+
+  用途:让「哪些面板还没接数据」在界面上可辨认,而不是留一片空白。
+  正式实现落地后,本组件被具体面板内容替换——替换只动外壳里的插槽内容,
+  面板标题/结构(panelCatalog)不变(票 06 验收第 4 条)。
+-->
+<template>
+    <div class="cockpit-placeholder" :data-panel-id="panelId">
+        <CockpitIcon name="blank" size="calc(30 * var(--u, 1px))" class="cockpit-placeholder__icon" />
+        <p class="cockpit-placeholder__text">面板占位 · {{ panelId }}</p>
+        <p class="cockpit-placeholder__hint">{{ hint }}</p>
+    </div>
+</template>
+
+<script setup>
+import CockpitIcon from './CockpitIcon.vue'
+
+defineProps({
+    panelId: { type: String, required: true },
+    hint: { type: String, default: '数据源与图表见后续票' },
+})
+</script>
+
+<style scoped>
+.cockpit-placeholder,
+.cockpit-placeholder * {
+    box-sizing: border-box;
+}
+
+.cockpit-placeholder {
+    display: grid;
+    place-content: center;
+    justify-items: center;
+    gap: var(--space-2, 8px);
+    height: 100%;
+    min-height: calc(56 * var(--u, 1px));
+    padding: var(--space-2, 8px);
+    text-align: center;
+    border: 1px dashed rgba(58, 170, 226, 0.35);
+    background: var(--inset, rgba(2, 10, 20, 0.55));
+    color: var(--muted, #6d92ae);
+}
+
+.cockpit-placeholder__icon {
+    opacity: 0.7;
+}
+
+.cockpit-placeholder__text {
+    margin: 0;
+    color: var(--text-2, #a8cbe2);
+    font-size: var(--fs-body, 13px);
+    letter-spacing: 0.04em;
+}
+
+.cockpit-placeholder__hint {
+    margin: 0;
+    color: var(--muted, #6d92ae);
+    font-size: var(--fs-caption, 10.5px);
+    letter-spacing: 0.04em;
+}
+</style>

+ 63 - 0
src/modules/cockpit/components/StatusTag.vue

@@ -0,0 +1,63 @@
+<!--
+  状态标签:色块 + 文字,颜色取自 token(--lv1..--lv4 / --neutral)。
+
+  为什么必须带文字(而不是纯色点):ADR 0006 要求状态不能只靠颜色区分,
+  色盲与打印场景下仍要能读出「报警 / 预警 / 离线」。
+
+  用法:`<StatusTag tone="lv1" label="1级" />`。tone 取值见 domain/statusTones.js;
+  未知 tone 退回中性灰,避免一个拼写错误让标签整块消失。
+-->
+<template>
+    <span class="status-tag" :class="`is-${toneKey}`" :data-tone="toneKey">
+        <i class="status-tag__dot" aria-hidden="true"></i>
+        <span class="status-tag__label">{{ label }}</span>
+    </span>
+</template>
+
+<script setup>
+import { computed } from 'vue'
+import { DEFAULT_TONE, isKnownTone } from '../domain/statusTones.js'
+
+const props = defineProps({
+    tone: { type: String, default: DEFAULT_TONE },
+    label: { type: String, required: true },
+})
+
+const toneKey = computed(() => (isKnownTone(props.tone) ? props.tone : DEFAULT_TONE))
+</script>
+
+<style scoped>
+.status-tag {
+    display: inline-flex;
+    align-items: center;
+    gap: var(--space-1, 4px);
+    padding: 1px var(--space-2, 8px);
+    border: 1px solid currentcolor;
+    border-radius: 999px;
+    background: rgba(4, 18, 34, 0.6);
+    font-size: var(--fs-caption, 10.5px);
+    line-height: 1.5;
+    letter-spacing: 0.04em;
+    white-space: nowrap;
+    color: var(--tag-color, var(--neutral, #6d92ae));
+}
+
+.status-tag__dot {
+    width: 6px;
+    height: 6px;
+    border-radius: 50%;
+    background: currentcolor;
+    box-shadow: 0 0 8px currentcolor;
+}
+
+/* 文字用亮色保证对比度,边框与圆点用语义色 */
+.status-tag__label {
+    color: var(--text-2, #a8cbe2);
+}
+
+.status-tag.is-lv1 { --tag-color: var(--lv1, #ff4d5e); }
+.status-tag.is-lv2 { --tag-color: var(--lv2, #ffa63d); }
+.status-tag.is-lv3 { --tag-color: var(--lv3, #4fd8ff); }
+.status-tag.is-lv4 { --tag-color: var(--lv4, #35e39a); }
+.status-tag.is-neutral { --tag-color: var(--neutral, #6d92ae); }
+</style>

+ 67 - 0
src/modules/cockpit/domain/icons.js

@@ -0,0 +1,67 @@
+/**
+ * 驾驶舱图标集(轻量占位)。
+ *
+ * 为什么先用内联 SVG 字符串而不是图片文件:
+ * 图标是「可替换的视觉资源」,正式稿由设计公司交付。内联时它是纯代码、零请求、
+ * 用 currentColor 就能跟随文字色;将来换成图片或图标字体只需改本文件的取值,
+ * 引用点(`<CockpitIcon name="..." />`)不变。
+ *
+ * 每个条目:`viewBox` + 内部 SVG 标记字符串。标记均来自本文件,不含外部输入。
+ */
+
+export const ICONS = {
+    /* 城市生命线:同心环 + 十字轴线,用于顶栏品牌位 */
+    brand: {
+        viewBox: '0 0 32 32',
+        inner:
+            '<circle cx="16" cy="16" r="13" fill="none" stroke="currentColor" stroke-width="1.2" opacity=".45"/>' +
+            '<circle cx="16" cy="16" r="8" fill="none" stroke="currentColor" stroke-width="1.4" opacity=".7"/>' +
+            '<circle cx="16" cy="16" r="2.6" fill="currentColor"/>' +
+            '<path d="M16 1.5v6M16 24.5v6M1.5 16h6M24.5 16h6" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>',
+    },
+    /* 图层:叠片 */
+    layers: {
+        viewBox: '0 0 16 16',
+        inner:
+            '<path d="M8 1.6 1.8 5 8 8.4 14.2 5 8 1.6Z" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round"/>' +
+            '<path d="M2.2 8.6 8 11.8l5.8-3.2M2.2 11.6 8 14.8l5.8-3.2" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round" opacity=".6"/>',
+    },
+    /* 设备点位 */
+    points: {
+        viewBox: '0 0 16 16',
+        inner:
+            '<circle cx="8" cy="8" r="5.4" fill="none" stroke="currentColor" stroke-width="1.3"/>' +
+            '<circle cx="8" cy="8" r="1.9" fill="currentColor"/>',
+    },
+    /* 事件告警 */
+    event: {
+        viewBox: '0 0 16 16',
+        inner:
+            '<path d="M8 1.8 15 14H1L8 1.8Z" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linejoin="round"/>' +
+            '<path d="M8 6.2v3.6M8 11.6v.1" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>',
+    },
+    /* 处置力量 / 资源 */
+    resource: {
+        viewBox: '0 0 16 16',
+        inner:
+            '<path d="M2 6.4h12M3.6 6.4V13h8.8V6.4M1.4 6.4 3.2 3h9.6l1.8 3.4" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round"/>' +
+            '<path d="M6.6 13V9.4h2.8V13" fill="none" stroke="currentColor" stroke-width="1.2"/>',
+    },
+    /* 面板占位图示:空框 + 折线,用于未接数据的面板体 */
+    blank: {
+        viewBox: '0 0 48 32',
+        inner:
+            '<rect x="1" y="1" width="46" height="30" rx="3" fill="none" stroke="currentColor" stroke-width="1.4" opacity=".45"/>' +
+            '<path d="M6 24l8-7 6 4 9-11 7 8 6-4" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" opacity=".75"/>',
+    },
+}
+
+export const ICON_NAMES = Object.keys(ICONS)
+
+export function isKnownIcon(name) {
+    return Object.prototype.hasOwnProperty.call(ICONS, name)
+}
+
+export function iconFor(name) {
+    return isKnownIcon(name) ? ICONS[name] : null
+}

+ 31 - 0
src/modules/cockpit/domain/statusTones.js

@@ -0,0 +1,31 @@
+/**
+ * 状态/等级标签的语义色键(ADR 0006 点位状态、ADR 0008 事件四级共用一套调色板)。
+ *
+ * 这里只定义「视觉可用的色键」,不定义业务映射:
+ * 「报警 → lv1」「离线 → neutral」这类判定属于数据层,由后续票(点位状态/图例)接。
+ * 这样视觉资源可替换,业务规则也不会藏进样式里。
+ */
+
+export const TONES = ['lv1', 'lv2', 'lv3', 'lv4', 'neutral']
+
+export const DEFAULT_TONE = 'neutral'
+
+/** 事件四级标签:地图图例与事件列表共用。 */
+export const LEVEL_TAGS = [
+    { tone: 'lv1', label: '1级' },
+    { tone: 'lv2', label: '2级' },
+    { tone: 'lv3', label: '3级' },
+    { tone: 'lv4', label: '4级' },
+]
+
+export const TONE_DESCRIPTIONS = {
+    lv1: '红 · 一级/报警',
+    lv2: '黄 · 二级/预警',
+    lv3: '蓝 · 三级/处置中',
+    lv4: '绿 · 四级/正常',
+    neutral: '灰 · 离线/未关联',
+}
+
+export function isKnownTone(tone) {
+    return TONES.includes(tone)
+}

+ 66 - 0
src/modules/cockpit/styles/tokens.css

@@ -0,0 +1,66 @@
+/**
+ * 驾驶舱视觉 token —— 唯一来源。
+ *
+ * 主色、语义色、文字色、字体、字号、间距、层级都只在这里声明一份:设计公司交付正式视觉资源后
+ * 改本文件即可全驾驶舱生效(票 06 的「视觉资源可替换」就落在这里)。
+ * 例外:组件里各自的装饰性渐变/辉光(散落的 rgba,如面板切角高光、扫描线)不属主题色,
+ * 换肤时需个别替换——它们不影响信息架构,也不构成第二份主题定义。
+ *
+ * 为什么挂 `.cockpit-shell` 而不是 `:root`:
+ * 下面这些名字(--cyan / --text / --font / --muted 等)都很通用,挂到 :root 会顺着
+ * 全局样式漏进宿主应用与 src/plugins 里的插件样式;挂在外壳根元素上,靠 CSS 自定义
+ * 属性的继承只作用于驾驶舱子树,既集中又好收敛。
+ */
+
+.cockpit-shell {
+    /* 设计像素:1920 宽时为 1px,随视口线性放大封顶 2px(4K 正好一倍),更窄不再缩小。 */
+    --u: clamp(1px, 0.0521vw, 2px);
+
+    /* ---- 底色与面板 ---- */
+    --bg-0: #01060d;
+    --panel-top: rgba(12, 48, 86, 0.58);
+    --panel-bot: rgba(3, 14, 28, 0.9);
+    --panel-line: rgba(58, 170, 226, 0.3);
+    --panel-line-hi: rgba(96, 220, 255, 0.85);
+    --inset: rgba(2, 10, 20, 0.55);
+
+    /* ---- 主色 ---- */
+    --cyan: #4fd8ff;
+    --cyan-d: #1b93cf;
+
+    /* ---- 语义色:事件四级与点位状态共用一套调色板(ADR 0006 / 0008)----
+       lv1 红=1 级/报警;lv2 黄=2 级/预警;lv3 蓝=3 级/处置中;lv4 绿=4 级/正常;neutral 灰=离线或无关联 */
+    --lv1: #ff4d5e;
+    --lv2: #ffa63d;
+    --lv3: #4fd8ff;
+    --lv4: #35e39a;
+    --neutral: #6d92ae;
+
+    /* ---- 文字 ---- */
+    --text: #e6f5ff;
+    --text-2: #a8cbe2;
+    --muted: #6d92ae;
+
+    /* ---- 字体 ---- */
+    --font: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
+    --num: "Bahnschrift SemiBold", "Bahnschrift", "DIN Alternate", "Segoe UI Semibold", var(--font);
+
+    /* ---- 字号 ---- */
+    --fs-caption: calc(10.5 * var(--u));
+    --fs-body: calc(13 * var(--u));
+    --fs-title: calc(14.5 * var(--u));
+    --fs-heading: calc(17 * var(--u));
+
+    /* ---- 间距 ---- */
+    --space-1: calc(4 * var(--u));
+    --space-2: calc(8 * var(--u));
+    --space-3: calc(12 * var(--u));
+
+    /* ---- 层级 ---- */
+    --z-map: 0;
+    --z-columns: 2;
+    --z-overlay: 2;
+
+    /* ---- 阴影 ---- */
+    --shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
+}