EquipmentDetailSections.vue 71 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540
  1. <!--
  2. 设备详情的分区(票 11):档案 / 指标 / 预警 / 报警 / 工单状态 / 设备图片。
  3. 票 46 返工(维护者 2026-10-15 第 1 条):**弃用六块竖排的长滚动**,改为标签页切换
  4. 设备档案(默认,图片归此页下方)|最新指标|预警信息|报警信息|工单状态;
  5. 预警/报警列表每页最多 10 条。页签计划与分页边界都是
  6. domain 纯函数(`EQUIPMENT_TABS`/`panelsForTab`/`pagedRows`),组件只画结论。
  7. 票 59(统一分页批次一):**三清单(预警/报警/工单)都接共享 `PagerNav.vue`**
  8. (页码直达 + 输入框跳页 + 计数行),翻页窗口计算归 `domain/pagination.js` 单源,
  9. 本组件不再自画 pager、不再有第二份翻页算术;前后页/页码/跳页共用唯一出口
  10. `gotoPage(panel, target)`,越界夹回由 `pagedRows` 做。
  11. **渲染计划仍是六块独立分区**(t11 D1/D9):标签页只改呈现归属,
  12. 每块仍独立成败;指标页改读独立采集记录分区,按当前需求不画状态点/过期说明。
  13. 档案读失败但指标可用仍各自呈现,不能共用一个成败。
  14. 三种「没内容」在界面上的区别(票 16 的词汇,措辞由 domain/equipmentDetailView.js 给):
  15. 空数据 EMPTY → 「该分区当前没有数据」
  16. 失败 FAILED → 「该分区加载失败(其它分区不受影响)」
  17. 不可用 UNAVAILABLE → 「该分区数据不可用(其它分区不受影响)」
  18. 过期 STALE 是**有值**:内容照画,只是标签说「数据已过期,显示最后一次成功数据」。
  19. 事件高亮采用既有四级颜色词表;数值预警黄/报警红与等级提示点分别呈现。
  20. 票 12 在**工单状态这块里**接上了状态时间线(不新增第七块面板):
  21. 每张工单下面挂它自己的那条轨迹(`timelineSource()` 按工单编码配好)。
  22. 轨迹分区**独立于工单列表成败** —— 后端可在工单列表成功时单独把 `timelines` 标 FAILED
  23. (`SOURCE_SECTION_FAILED`),那时界面必须说「轨迹没取到」而不是"没有动作记录"。
  24. -->
  25. <template>
  26. <div ref="sectionsRoot" class="equipment-sections" data-equipment-sections :data-device-code="deviceCode">
  27. <!--
  28. 票 46 返工:标签页条。计数挂在页签上(预警/报警/工单才有;
  29. 维护者要「避免长滚动列表查找困难」——点之前就知道每页后面有多少条)。
  30. -->
  31. <div class="equipment-tabs" role="tablist" aria-label="设备详情分区切换" data-equipment-tabs>
  32. <button
  33. v-for="tab in tabs"
  34. :key="tab.name"
  35. type="button"
  36. role="tab"
  37. class="equipment-tabs__tab"
  38. :class="{ 'is-active': tab.name === activeTab }"
  39. :aria-selected="tab.name === activeTab"
  40. :data-equipment-tab="tab.name"
  41. :data-tab-count="tab.count || ''"
  42. @click="activeTab = tab.name"
  43. >
  44. {{ tab.label }}<b v-if="tab.count" class="equipment-tabs__count">{{ tab.count }}</b>
  45. </button>
  46. </div>
  47. <!--
  48. 当前页签的面板(档案页含两块:档案 + 设备图片,所以 tabpanel 挂在**包装层**
  49. 而不是每块 section 上 —— 一个页签对应一个 tabpanel 才是正确的可访问语义)。
  50. -->
  51. <p v-if="aggregate?.retained" class="equipment-section__hint" data-detail-refresh-retained>本次详情更新未完成,保留上次已加载内容。</p>
  52. <div class="equipment-tab__body" role="tabpanel" data-equipment-tab-body>
  53. <section
  54. v-for="panel in activePanels"
  55. :key="panel.name"
  56. class="equipment-section"
  57. :class="{ 'equipment-section--video': panel.kind === 'metrics' && isCamera }"
  58. :data-equipment-section="panel.name"
  59. :data-panel-state="panel.section.state || 'empty'"
  60. :data-panel-retained="panel.section.retained ? 'true' : 'false'"
  61. >
  62. <header class="equipment-section__head">
  63. <span class="equipment-section__title">{{ panel.label }}</span>
  64. <SectionStateTag v-if="panel.kind !== 'metrics'" :name="panel.name" :section="panel.section" />
  65. </header>
  66. <!-- 过期分区在内容之上再点一次题(颜色之外的第二种提示,灰度下也读得出) -->
  67. <p v-if="panel.kind !== 'metrics' && panel.section.retained" class="equipment-section__stale" data-section-stale-note>
  68. {{ staleNote }}
  69. </p>
  70. <!-- ---------- 有内容:按 kind 分派 ---------- -->
  71. <template v-if="panel.kind === 'metrics' || panel.hasContent">
  72. <!--
  73. 票 46:分类查询条 —— 预警/报警/工单**共用这一块**(同一组绑定只写一处)。
  74. 分类归组在 domain(等级复用票 13 词表、工单复用 0–7 字典),组件只画 chips;
  75. 点分类只筛视图,不发请求、不动选择(筛选变化不丢详情上下文)。
  76. -->
  77. <template v-if="isFilterable(panel) && chipsOf(panel).length > 1">
  78. <div class="equipment-section__chips" role="group" :aria-label="`${panel.label}分类查询`" data-category-bar>
  79. <button
  80. v-for="chip in chipsOf(panel)"
  81. :key="chip.key || 'all'"
  82. type="button"
  83. class="equipment-section__chip"
  84. :class="{ 'is-active': chip.key === activeCategory(panel.name) }"
  85. :aria-pressed="chip.key === activeCategory(panel.name)"
  86. :data-category-chip="`${panel.name}:${chip.key || 'all'}`"
  87. @click="toggleCategory(panel.name, chip.key)"
  88. >
  89. {{ chip.label }} <b class="equipment-section__chip-count" data-category-count>{{ chip.count }}</b>
  90. </button>
  91. </div>
  92. <p v-if="categoryNoteText(panel)" class="equipment-section__note" data-category-note>{{ categoryNoteText(panel) }}</p>
  93. </template>
  94. <!-- 档案:键值行 -->
  95. <dl v-if="panel.kind === 'archive'" class="equipment-section__rows" data-archive-rows>
  96. <div v-for="row in rowsOf(panel)" :key="row.key" class="equipment-section__row" :data-archive-row="row.key">
  97. <dt>{{ row.label }}</dt>
  98. <dd :class="{ 'is-muted': isPlaceholder(row.value), 'equipment-section__mono': row.mono }">{{ row.value }}</dd>
  99. </div>
  100. </dl>
  101. <!-- 采集记录:最近50行;分页后只合并当前页相同采集时间。 -->
  102. <div v-else-if="panel.kind === 'metrics'" class="equipment-section__list" data-collection-records>
  103. <!-- 监控入口属于最新指标卡片本身,不再与指标框并列(维护者 2026-11-18)。 -->
  104. <p v-if="isCamera" class="equipment-section__hint" data-video-metrics-note>
  105. 视频监控通过下方入口查看实时画面与已有录像
  106. </p>
  107. <VideoMonitorEntry :device-code="deviceCode" :monitor-source="monitorSource" @device-resolved="videoDevice = $event" />
  108. <!-- 仅已确认的摄像机不呈现数值采集记录;其它设备保留独立分区的真实状态。 -->
  109. <template v-if="!isCamera">
  110. <p v-if="panel.section.state === 'failed'" class="equipment-section__hint" data-metrics-failed>
  111. 该分区加载失败(其它分区不受影响)
  112. </p>
  113. <p v-else-if="panel.section.state === 'unavailable'" class="equipment-section__hint" data-metrics-unavailable>
  114. 该分区数据不可用(其它分区不受影响)
  115. </p>
  116. <p v-else-if="!recordTableOf(panel).total" class="equipment-section__hint" data-metrics-empty>
  117. 暂无采集记录
  118. </p>
  119. <template v-else>
  120. <p class="equipment-section__note">采集记录(最近50条)</p>
  121. <div class="collection-table-wrap">
  122. <table v-if="recordTableOf(panel).total" class="collection-table" data-collection-table aria-label="设备最近采集记录">
  123. <thead>
  124. <tr>
  125. <th v-for="column in recordTableOf(panel).columns" :key="column.key" :class="{ 'collection-table__time': column.isTime, 'collection-table__audio-col': column.isAudio }">
  126. <span class="collection-table__heading" :title="column.label">{{ column.label }}</span>
  127. <span v-if="column.unit" class="collection-table__unit">({{ column.unit }})</span>
  128. </th>
  129. </tr>
  130. </thead>
  131. <tbody v-for="group in recordTableOf(panel).groups" :key="group.key"
  132. :class="{ 'collection-table__group--latest': group.isLatest }"
  133. :style="{ '--collection-accent': group.color }"
  134. :data-collection-group="group.key" :data-collection-group-state="group.state">
  135. <tr v-for="(row, rowIndex) in group.rows" :key="rowIndex" data-collection-row :class="{ 'collection-table__row--latest': group.isLatest }" :data-collection-latest="group.isLatest ? 'true' : undefined">
  136. <template v-for="(cell, cellIndex) in row.cells" :key="cell.key">
  137. <td
  138. v-if="!recordTableOf(panel).columns[cellIndex].isTime || row.timeRowspan > 0"
  139. data-collection-cell
  140. :data-reading-state="cell.assessment?.state"
  141. :style="cell.assessment ? { '--reading-color': cell.assessment.color } : undefined"
  142. :title="cell.assessment?.label"
  143. :rowspan="recordTableOf(panel).columns[cellIndex].isTime ? row.timeRowspan : undefined"
  144. :class="{ 'collection-table__time': recordTableOf(panel).columns[cellIndex].isTime, 'collection-table__audio-col': recordTableOf(panel).columns[cellIndex].isAudio }"
  145. >
  146. <template v-if="recordTableOf(panel).columns[cellIndex].isTime">
  147. <span v-if="group.isLatest" class="collection-table__latest-badge" data-collection-latest-badge>最新</span>
  148. <span class="collection-table__time-date">{{ row.createDate }}</span>
  149. <span v-if="row.createClock" class="collection-table__time-clock">{{ row.createClock }}</span>
  150. </template>
  151. <button v-else-if="cell.audioPath" type="button" class="collection-table__audio-button" data-collection-audio-open :aria-label="'播放' + (cell.audioLabel || '音频记录')" :title="cell.audioLabel || '播放音频'" @click="openRecordAudio(cell, $event)">
  152. <span aria-hidden="true">▶</span><span>播放</span>
  153. </button>
  154. <!--
  155. long 布局的格内是「指标名:读数」整条:名称走正文样式,
  156. 读数段与其它设备的指标值同一套等宽数字字体。
  157. -->
  158. <span
  159. v-else-if="cell.reading && cell.reading.label"
  160. class="collection-table__reading"
  161. >
  162. <span class="collection-table__reading-label">{{ cell.reading.label }}</span>
  163. <span class="collection-table__reading-result">
  164. <span class="collection-table__reading-value" :class="{ 'is-muted': isPlaceholder(cell.reading.value) }">{{ cell.reading.value }}</span>
  165. <MetricStateHint v-if="cell.assessment?.hint" :color="cell.assessment.hint.color"
  166. :label="cell.assessment.hint.label" :refresh-key="aggregate" />
  167. </span>
  168. </span>
  169. <span v-else class="collection-table__reading-result">
  170. <span :class="{ 'is-muted': isPlaceholder(cell.text), 'collection-table__value': cell.isReading }">{{ cell.text }}</span>
  171. <MetricStateHint v-if="cell.assessment?.hint" :color="cell.assessment.hint.color"
  172. :label="cell.assessment.hint.label" :refresh-key="aggregate" />
  173. </span>
  174. </td>
  175. </template>
  176. </tr>
  177. </tbody>
  178. </table>
  179. </div>
  180. <p v-if="recordTableOf(panel).assessmentNote" class="equipment-section__hint" data-collection-assessment-note>{{ recordTableOf(panel).assessmentNote }}</p>
  181. <PagerNav
  182. :page="recordTableOf(panel).page"
  183. :page-count="recordTableOf(panel).pageCount"
  184. :total="recordTableOf(panel).total"
  185. list-name="采集记录"
  186. @page="(target) => gotoPage(panel, target)"
  187. />
  188. </template>
  189. </template>
  190. </div>
  191. <!--
  192. 预警 / 报警:条目默认可折叠(票 46)—— 折叠行给时间·名称·等级·状态·量值,
  193. 展开看详情(事件时间 / 状态 / 来源 / 关联设备,缺值给占位符)。
  194. 票 46 返工第 1 条:每页最多 10 条(上一页/下一页 + 页码;先筛后翻)。
  195. 分类 chips 在上面共用那一块。
  196. -->
  197. <div v-else-if="panel.kind === 'events'" class="equipment-section__list" :data-event-list="panel.name">
  198. <details
  199. v-for="(event, index) in pagedOf(panel).rows"
  200. :key="event.code || index"
  201. class="equipment-section__item equipment-section__item--collapsible"
  202. :class="{ 'equipment-section__item--active': event.active }"
  203. :style="{ '--detail-accent': event.activeColor }"
  204. :open="isDetailOpen(panel, event, index)"
  205. @toggle="rememberDetailToggle(panel, event, index, $event)"
  206. :data-event="event.code || index"
  207. :data-event-level-color="event.levelColor"
  208. :data-item-active="event.active ? 'true' : 'false'"
  209. data-history-item
  210. >
  211. <summary class="equipment-section__item-head">
  212. <!-- 标题=单号;内容=描述、时间、等级、状态;右下角提示可展开看详情。 -->
  213. <span class="equipment-section__item-name equipment-section__mono" data-event-title>{{ event.title }}</span>
  214. <span v-if="event.description" class="equipment-section__item-desc" data-event-desc>{{ event.description }}</span>
  215. <span class="equipment-section__meta" data-event-meta>
  216. <span data-event-level :data-tone="event.levelTone">{{ event.levelText }}</span>
  217. <!-- 维护者 2026-11-13:不再用笼统的「未解除」徽标,直接高亮真实状态。 -->
  218. <span v-if="event.status" class="equipment-section__status-badge"
  219. :data-event-status="event.status" :data-status-tone="event.statusTone"
  220. :data-tone="event.statusTone">{{ event.status }}</span>
  221. <span v-if="event.timeText" data-event-time>{{ event.timeText }}</span>
  222. </span>
  223. <span class="equipment-section__item-more" aria-hidden="true" data-event-more>点击查看详情 ›</span>
  224. </summary>
  225. <dl class="equipment-section__detail" data-history-detail>
  226. <div v-for="row in eventDetailRows(event)" :key="row.label" class="equipment-section__detail-row" :data-detail-row="row.label">
  227. <dt>{{ row.label }}</dt>
  228. <dd :data-tone="row.tone || undefined" :class="{ 'equipment-section__detail-value--tone': row.tone }">{{ row.value }}</dd>
  229. </div>
  230. </dl>
  231. </details>
  232. <p v-if="!pagedOf(panel).total" class="equipment-section__hint" data-section-empty-list>
  233. {{ rowsOf(panel).length ? '当前分类下没有记录(换一个分类或点「全部」)' : emptyList(panel.label) }}
  234. </p>
  235. <!-- 分页控件(票 59 共享 PagerNav,前后页/页码/跳页同一个 @page 出口) -->
  236. <PagerNav
  237. :page="pagedOf(panel).page"
  238. :page-count="pagedOf(panel).pageCount"
  239. :total="pagedOf(panel).total"
  240. :list-name="panel.label"
  241. @page="(target) => gotoPage(panel, target)"
  242. />
  243. </div>
  244. <!--
  245. 工单状态:状态名(缺则按状态字典补)+ 关键时间 + 每张工单自己的状态时间线(票 12)。
  246. 票 46:条目默认可折叠,展开保留事件时间/状态/来源/关联对象 + 计划与实际结案时间。
  247. 「没有动作记录」那句仍由 `timeline.hasContent` 门控(票 12 的 F9 守卫逐字钉住)。
  248. 票 59:接入统一分页(每页 ≤10,先分类后翻页)。
  249. -->
  250. <div v-else-if="panel.kind === 'orders'" class="equipment-section__list" data-work-order-list>
  251. <details
  252. v-for="(order, index) in pagedOf(panel).rows"
  253. :key="order.code || index"
  254. class="equipment-section__item equipment-section__item--collapsible"
  255. :class="{ 'equipment-section__item--active': order.active }"
  256. :style="{ '--detail-accent': order.activeColor }"
  257. :open="isDetailOpen(panel, order, index)"
  258. @toggle="rememberDetailToggle(panel, order, index, $event)"
  259. :data-work-order="order.code || index"
  260. :data-work-order-state="order.stateCode"
  261. :data-item-active="order.active ? 'true' : 'false'"
  262. data-history-item
  263. >
  264. <summary class="equipment-section__item-head equipment-section__wo-head">
  265. <!-- 维护者 2026-11-13:按管理端工单卡片排版(工单号+状态、描述、关联设备、位置、故障时间、查看详情)。 -->
  266. <span class="equipment-section__wo-title">
  267. <span class="equipment-section__wo-label">工单号</span>
  268. <span class="equipment-section__mono" data-work-order-code>{{ order.title }}</span>
  269. <span class="equipment-section__status-badge" :data-work-order-state-name="order.stateName"
  270. :data-tone="order.active ? 'lv3' : 'lv4'">{{ order.stateName }}</span>
  271. </span>
  272. <span class="equipment-section__wo-row">
  273. <span class="equipment-section__wo-label">工单描述</span>
  274. <span data-work-order-desc>{{ order.description || '—' }}</span>
  275. </span>
  276. <span class="equipment-section__wo-row">
  277. <span class="equipment-section__wo-label">关联设备</span>
  278. <span class="equipment-section__wo-value" data-work-order-device>{{ order.deviceLabel }}</span>
  279. <button v-if="order.deviceCode" type="button" class="equipment-section__locate"
  280. :data-locate-device="order.deviceCode" @click.stop="locateDevice(order.deviceCode)">定位设备</button>
  281. </span>
  282. <span class="equipment-section__wo-row">
  283. <span class="equipment-section__wo-label">设备位置</span>
  284. <span data-work-order-location>{{ order.deviceLocation }}</span>
  285. </span>
  286. <span class="equipment-section__wo-row">
  287. <span class="equipment-section__wo-label">故障时间</span>
  288. <span data-work-order-fault-time>{{ order.faultTimeText || order.timeText || '—' }}</span>
  289. </span>
  290. <span class="equipment-section__item-more" aria-hidden="true" data-work-order-more>查看详情 ›</span>
  291. </summary>
  292. <!-- 维护者 2026-11-23:详情分「工单信息 / 处置流程」两个子页签,各自独立查看。 -->
  293. <div class="equipment-section__wo-tabs" role="tablist" data-work-order-tabs>
  294. <button
  295. v-for="tab in WORK_ORDER_DETAIL_TABS"
  296. :key="tab.key"
  297. type="button"
  298. role="tab"
  299. class="equipment-section__wo-tab"
  300. :data-work-order-tab="tab.key"
  301. :data-active="woTabOf(order) === tab.key ? 'true' : 'false'"
  302. :aria-selected="woTabOf(order) === tab.key ? 'true' : 'false'"
  303. @click="setWoTab(order, tab.key)"
  304. >{{ tab.label }}</button>
  305. </div>
  306. <template v-if="woTabOf(order) === 'info'">
  307. <dl class="equipment-section__detail equipment-section__wo-detail" data-history-detail>
  308. <div v-for="row in workOrderDetailRows(order)" :key="row.label" class="equipment-section__detail-row" :data-detail-row="row.label">
  309. <dt>{{ row.label }}</dt>
  310. <dd>{{ row.value }}</dd>
  311. </div>
  312. </dl>
  313. <!-- 维修前/后附件:缩略图直接点开查看(维护者 2026-11-23)。 -->
  314. <div
  315. v-for="group in workOrderAttachmentGroups(order)"
  316. :key="group.key"
  317. class="equipment-section__wo-attachments"
  318. :data-work-order-images="group.key"
  319. >
  320. <span class="equipment-section__wo-label">{{ group.label }}附件</span>
  321. <span class="equipment-section__thumbs">
  322. <button
  323. v-for="(path, index) in group.images"
  324. :key="`${group.key}-${index}`"
  325. type="button"
  326. class="equipment-section__thumb"
  327. :aria-label="`查看${group.label}附件${index + 1}`"
  328. @click="openProof(order, group, path)"
  329. >
  330. <img :src="resolveDeviceImageUrl(path)" :alt="`${group.label}附件${index + 1}`" loading="lazy" @error="markProofFailed($event)" />
  331. </button>
  332. </span>
  333. </div>
  334. </template>
  335. <!--
  336. 票 12:这张工单自己的状态路径 + 动作轨迹。
  337. · 轨迹分区拿到了数据 → 完整轨迹(状态路径 + 动作流水);
  338. · 轨迹分区失败/为空 → **仍铺状态路径**(当前状态码在工单列表里,
  339. 本来就拿得到),只是没有动作流水。因为"轨迹没取到"而连
  340. "这张工单现在在哪一态"也一起不画,等于丢掉已有的信息。
  341. 分区自己的成败由下面那条整块占位说明如实交代。
  342. -->
  343. <template v-else>
  344. <WorkOrderTimeline
  345. v-if="trackOfOrder(order)"
  346. :track="trackOfOrder(order)"
  347. :path-only="!timeline.hasContent"
  348. @preview="openStepProof"
  349. />
  350. <p v-else-if="timeline.hasContent" class="equipment-section__hint" data-wo-timeline-missing>
  351. 这张工单没有动作记录
  352. </p>
  353. </template>
  354. </details>
  355. <!-- 轨迹分区自己失败/为空:整块说一句(不按每张工单重复同一句话,那是噪音) -->
  356. <p v-if="timeline.placeholder" class="equipment-section__hint" data-wo-timeline-placeholder>
  357. {{ timeline.placeholder }}
  358. </p>
  359. <p v-if="!pagedOf(panel).total" class="equipment-section__hint" data-section-empty-list>
  360. {{ rowsOf(panel).length ? '当前分类下没有记录(换一个分类或点「全部」)' : emptyList('工单') }}
  361. </p>
  362. <!-- 分页控件(票 59 共享 PagerNav,与预警/报警同一控件、同一出口) -->
  363. <PagerNav
  364. :page="pagedOf(panel).page"
  365. :page-count="pagedOf(panel).pageCount"
  366. :total="pagedOf(panel).total"
  367. :list-name="panel.label"
  368. @page="(target) => gotoPage(panel, target)"
  369. />
  370. </div>
  371. <!-- 设备图片:只画后端指定的那一张(前端不索引、不挑选) -->
  372. <figure v-else-if="panel.kind === 'image'" class="equipment-section__figure" data-latest-image>
  373. <template v-if="image(panel).hasImage">
  374. <button v-if="!imageFailed" type="button" class="equipment-section__image-button" aria-label="放大查看设备图片" @click="imagePreviewOpen = true">
  375. <img class="equipment-section__img" :src="image(panel).url" :alt="`${deviceCode} 设备图片`" @load="imageLoading = false" @error="imageFailed = true; imageLoading = false" />
  376. <span>{{ imageLoading ? '图片加载中…' : '点击放大' }}</span>
  377. </button>
  378. <p v-else class="equipment-section__hint" role="status">图片加载失败,请检查图片服务地址或文件是否可访问。<button type="button" @click="imageFailed = false; imageLoading = true">重试</button></p>
  379. <figcaption class="equipment-section__meta">拍摄于 {{ image(panel).capturedAt }}</figcaption>
  380. </template>
  381. <p v-else class="equipment-section__hint" data-latest-image-empty>后端未提供该设备的图片</p>
  382. </figure>
  383. </template>
  384. <!-- ---------- 没内容:如实说,不画空框冒充数据 ---------- -->
  385. <p v-else class="equipment-section__hint" data-section-placeholder>{{ panel.placeholder }}</p>
  386. <!-- 字段缺失:只说条数,具体路径进 tooltip(不漏接口字段名给值班人员) -->
  387. <p
  388. v-if="panel.missing.count"
  389. class="equipment-section__missing"
  390. data-section-missing
  391. :data-missing-count="panel.missing.count"
  392. :title="panel.missing.tooltip"
  393. >
  394. {{ panel.missing.text }}
  395. </p>
  396. </section>
  397. </div>
  398. <!-- 设备图片 / 维修附件共用通用图片查看器(背景虚化压暗、右上角 × 关闭、不画背景板)。 -->
  399. <ImagePreview :open="imagePreviewOpen" :src="currentImageUrl" :alt="`${deviceCode} 设备图片`" @close="imagePreviewOpen = false" />
  400. <ImagePreview :open="proofPreviewOpen" :src="proofUrl" :alt="proofImage.caption" :caption="proofImage.caption" @close="proofPreviewOpen = false" />
  401. <!--
  402. 音频播放条:贴在播放键上方渐入的小浮层(Teleport 到 body,避免被滚动容器裁剪)。
  403. 不再用居中大弹窗/背景虚化;点击外部、滚动或 Esc 都会收起。
  404. -->
  405. <Teleport to="body">
  406. <div
  407. v-if="activeAudioPath"
  408. ref="audioPlayer"
  409. class="collection-audio-player"
  410. :class="{ 'is-below': audioPlacement.below }"
  411. :style="audioPlayerStyle"
  412. data-collection-audio-player
  413. >
  414. <div class="collection-audio-player__head">
  415. <span class="collection-audio-player__label">{{ activeAudioLabel }}</span>
  416. <button type="button" class="collection-audio-player__close" aria-label="关闭播放条" @click="closeAudioPlayer">×</button>
  417. </div>
  418. <audio v-if="activeAudioUrl" class="collection-audio-player__audio" controls preload="metadata" :src="activeAudioUrl" />
  419. </div>
  420. </Teleport>
  421. </div>
  422. </template>
  423. <script setup>
  424. import { computed, nextTick, onBeforeUnmount, ref, watch } from 'vue'
  425. import { resolveDeviceImageUrl } from '../services/deviceImage.js'
  426. import { DETAIL_PLACEHOLDER } from '../domain/detailFlow.js'
  427. import {
  428. DEFAULT_EQUIPMENT_TAB,
  429. EVENT_CATEGORY_ORDER,
  430. EQUIPMENT_TABS,
  431. WORK_ORDER_CATEGORY_ORDER,
  432. archiveRows,
  433. categoryChips,
  434. categoryNote,
  435. emptyListText,
  436. equipmentPanels,
  437. eventDetailRows,
  438. eventRows,
  439. filterByCategory,
  440. imageView,
  441. collectionRecordTable,
  442. pagedRows,
  443. panelsForTab,
  444. prioritizeActiveRows,
  445. tabCount,
  446. timelineSource,
  447. workOrderDetailRows,
  448. workOrderAttachmentGroups,
  449. workOrderRows,
  450. } from '../domain/equipmentDetailView.js'
  451. import { pathOnlyTrack } from '../domain/workOrderTimeline.js'
  452. import VideoMonitorEntry from './VideoMonitorEntry.vue'
  453. import SectionStateTag from './SectionStateTag.vue'
  454. import WorkOrderTimeline from './WorkOrderTimeline.vue'
  455. import PagerNav from './PagerNav.vue'
  456. import MetricStateHint from './MetricStateHint.vue'
  457. import ImagePreview from './ImagePreview.vue'
  458. const props = defineProps({
  459. /** `stores/detailStore.js` 的 `sections.equipmentAggregate`。 */
  460. aggregate: { type: Object, default: null },
  461. /** 当前选中的设备编码(分区头与图片 alt 用)。 */
  462. deviceCode: { type: String, default: '' },
  463. monitorSource: { type: String, default: 'detail' },
  464. })
  465. const emit = defineEmits(['locate-device'])
  466. /** 工单卡「关联设备」定位:#131 统一由外壳的 pointLocateStore 处理。 */
  467. function locateDevice(code) {
  468. if (code) emit('locate-device', code)
  469. }
  470. const sectionsRoot = ref(null)
  471. const panels = computed(() => equipmentPanels(props.aggregate))
  472. const videoDevice = ref(null)
  473. // 档案 type 是 deviceType 的领域字段;只认当前设备的摄像机正证据,不以能力查询失败推断传感器。
  474. const isCamera = computed(() => {
  475. const archive = panels.value.find((panel) => panel.kind === 'archive')?.section.data
  476. return String(archive?.type ?? '').trim() === '20'
  477. || (videoDevice.value?.deviceCode === props.deviceCode && videoDevice.value?.typeCode === '20')
  478. })
  479. /**
  480. * 工单详情的两个子页签(维护者 2026-11-23:信息与流水分开看,便于查看)。
  481. * 停在哪个页签**按工单号记忆**,互不影响;默认停在「工单信息」。
  482. */
  483. const WORK_ORDER_DETAIL_TABS = [
  484. { key: 'info', label: '工单信息' },
  485. { key: 'flow', label: '处置流程' },
  486. ]
  487. const woTabs = ref({})
  488. function woTabOf(order) {
  489. return woTabs.value[order?.code] || 'info'
  490. }
  491. function setWoTab(order, key) {
  492. if (!order?.code || woTabOf(order) === key) return
  493. woTabs.value = { ...woTabs.value, [order.code]: key }
  494. }
  495. /**
  496. * 附件/流水图片的查看弹窗:缩略图与流水截图共用同一个 <dialog>。
  497. * 路径走 `resolveDeviceImageUrl`(维修附件与设备图片同一对象基址);解析不出就不弹空窗。
  498. */
  499. const proofPreviewOpen = ref(false)
  500. const proofImage = ref({ url: '', caption: '' })
  501. const proofUrl = computed(() => proofImage.value.url)
  502. function showProof(path, caption) {
  503. const url = resolveDeviceImageUrl(path)
  504. if (!url) return
  505. proofImage.value = { url, caption }
  506. proofPreviewOpen.value = true
  507. }
  508. function openProof(order, group, path) {
  509. showProof(path, `${order?.title || '工单'} · ${group.label}附件`)
  510. }
  511. function openStepProof(detail) {
  512. showProof(detail?.path, detail?.caption || '维修过程附件')
  513. }
  514. /** 缩略图取不到就压暗并明确标出来,不画破图。 */
  515. function markProofFailed(event) {
  516. const img = event?.target
  517. if (img && typeof img.setAttribute === 'function') img.setAttribute('data-broken', 'true')
  518. }
  519. // ---- 票 46 返工第 1 条:标签页切换(弃用六块竖排的长滚动)----
  520. /** 页签清单(domain 给顺序与背后的分区归属;计数给预警/报警/工单三页)。 */
  521. const tabs = computed(() =>
  522. EQUIPMENT_TABS.map((tab) => ({ ...tab, count: tabCount(panels.value, tab.name) })),
  523. )
  524. /** 当前页签(默认「设备档案」;换设备复位,不把 A 的页签停在 B 上)。 */
  525. const activeTab = ref(DEFAULT_EQUIPMENT_TAB)
  526. // 同设备刷新只更新内容;DOM 重排后保留内部及外层详情的滚动位置与可见条目。
  527. let scrollRevision = 0
  528. watch([() => props.aggregate, () => props.deviceCode], (_current, previous) => {
  529. const revision = ++scrollRevision
  530. const device = props.deviceCode
  531. const sameDevice = previous[1] === device
  532. const tab = activeTab.value
  533. const positions = []
  534. const items = Array.from(sectionsRoot.value?.querySelectorAll?.('[data-collection-record-key], [data-history-item]') || [])
  535. for (let element = sectionsRoot.value; element; element = element.parentElement) {
  536. if (typeof document !== 'undefined' && (element === document.body || element === document.documentElement)) break
  537. if (typeof element.scrollTop === 'number' && (element.scrollTop || element.scrollHeight > element.clientHeight)) {
  538. const rect = element.getBoundingClientRect?.()
  539. const anchor = rect && items.find((item) => {
  540. const bounds = item.getBoundingClientRect()
  541. return bounds.bottom > rect.top && bounds.top < rect.bottom
  542. })
  543. const key = anchor && (anchor.getAttribute('data-collection-record-key') || anchor.getAttribute('data-event') || anchor.getAttribute('data-work-order'))
  544. positions.push({ element, top: element.scrollTop, left: element.scrollLeft,
  545. key: key && key !== DETAIL_PLACEHOLDER ? key : '',
  546. offset: anchor ? anchor.getBoundingClientRect().top - rect.top : 0,
  547. })
  548. }
  549. }
  550. nextTick(() => {
  551. if (revision !== scrollRevision || device !== props.deviceCode || (sameDevice && tab !== activeTab.value)) return
  552. if (!sameDevice) {
  553. for (const { element } of positions) { element.scrollTop = 0; element.scrollLeft = 0 }
  554. return
  555. }
  556. const currentItems = Array.from(sectionsRoot.value?.querySelectorAll?.('[data-collection-record-key], [data-history-item]') || [])
  557. for (const { element, top, left, key, offset } of positions) {
  558. if (element.isConnected === false) continue
  559. const anchor = key && currentItems.find((item) =>
  560. [item.getAttribute('data-collection-record-key'), item.getAttribute('data-event'), item.getAttribute('data-work-order')].includes(key))
  561. // 新记录插到前面时仍跟住原来正在看的条目;条目已移除才退回像素位置。
  562. element.scrollTop = anchor ? element.scrollTop + anchor.getBoundingClientRect().top - element.getBoundingClientRect().top - offset : top
  563. element.scrollLeft = left
  564. }
  565. })
  566. }, { flush: 'pre' })
  567. onBeforeUnmount(() => { scrollRevision += 1 })
  568. /** 当前页签要渲染的面板(保留渲染计划自己的次序;图片随档案页出现)。 */
  569. const activePanels = computed(() => panelsForTab(panels.value, activeTab.value))
  570. /**
  571. * 时间线来源(票 12):按工单编码配好的轨迹 + 轨迹分区自己的状态。
  572. * 只算一次 —— 每张工单渲染时都去重算会把 O(n²) 的判断塞进模板。
  573. */
  574. const timeline = computed(() => timelineSource(props.aggregate))
  575. const staleNote = '数据已过期 · 显示最后一次成功数据,不是实时值'
  576. // ---- 票 46:分类查询与历史折叠(**视图本地状态**)----
  577. //
  578. // 为什么不进 store:分类/页码/折叠是「这一屏怎么看」,不是业务事实,也不是全局筛选条件。
  579. // 放进 `filterStore` 会让它跨设备、跨模式生效并触发重新取数 —— 那是把视图偏好
  580. // 冒充成数据条件(票 46 非目标明写「不改变后端事实与只读边界」)。
  581. // 组件卸载即消失;换设备时下面 `watch` 把它清掉,不残留成"A 的分类挂在 B 上"。
  582. /** 各分区当前生效的分类键(`{ [分区名]: 分类键 }`;空串/缺失=全部)。 */
  583. const categories = ref({})
  584. /** 各分区当前页码(1 起;预警/报警/工单三块都接入分页)。 */
  585. const pages = ref({})
  586. const recordTables = computed(() => Object.fromEntries(
  587. panels.value.filter((panel) => panel.kind === 'metrics').map((panel) => [panel.name, collectionRecordTable(panel.section.data, pages.value[panel.name] || 1)]),
  588. ))
  589. function recordTableOf(panel) {
  590. return recordTables.value[panel.name]
  591. }
  592. function recordKey(row) {
  593. if (!row.timeKey) return undefined
  594. return JSON.stringify([row.timeKey, row.cells.filter((cell) => cell.isReading).map((cell) => [cell.key, cell.reading?.label])])
  595. }
  596. const audioPlayer = ref(null)
  597. const activeAudioPath = ref('')
  598. const activeAudioLabel = ref('音频记录')
  599. const activeAudioUrl = computed(() => activeAudioPath.value ? resolveDeviceImageUrl(activeAudioPath.value) : '')
  600. const audioPlacement = ref({ left: 0, top: 0, below: false })
  601. const audioPlayerStyle = computed(() => ({
  602. left: `${audioPlacement.value.left}px`,
  603. top: `${audioPlacement.value.top}px`,
  604. }))
  605. let audioTriggerEl = null
  606. /** 打开播放条:以触发按钮为锚,默认在按钮上方渐入;顶部空间不足时翻到按钮下方。 */
  607. function openRecordAudio(cell, event) {
  608. if (!cell?.audioPath) return
  609. const rect = event?.currentTarget?.getBoundingClientRect?.()
  610. if (rect) {
  611. const margin = 132
  612. const left = Math.min(Math.max(rect.left + rect.width / 2, margin), Math.max(margin, window.innerWidth - margin))
  613. const below = rect.top < 96
  614. audioPlacement.value = { left: Math.round(left), top: Math.round(below ? rect.bottom : rect.top), below }
  615. }
  616. audioTriggerEl = event?.currentTarget || null
  617. activeAudioPath.value = cell.audioPath
  618. activeAudioLabel.value = cell.audioLabel || '音频记录'
  619. }
  620. function closeAudioPlayer() {
  621. if (!activeAudioPath.value) return
  622. activeAudioPath.value = ''
  623. audioTriggerEl = null
  624. }
  625. function audioOutsideHandler(event) {
  626. if (audioPlayer.value?.contains(event.target) || audioTriggerEl?.contains?.(event.target)) return
  627. closeAudioPlayer()
  628. }
  629. function audioEscapeHandler(event) {
  630. if (event.key === 'Escape') closeAudioPlayer()
  631. }
  632. function attachAudioGuards() {
  633. document.addEventListener('pointerdown', audioOutsideHandler, true)
  634. // 滚动时按钮会离开锚点,直接收起(capture 才能收到各滚动容器不冒泡的 scroll)。
  635. window.addEventListener('scroll', closeAudioPlayer, true)
  636. window.addEventListener('keydown', audioEscapeHandler, true)
  637. }
  638. function detachAudioGuards() {
  639. if (typeof document === 'undefined' || typeof window === 'undefined') return
  640. document.removeEventListener('pointerdown', audioOutsideHandler, true)
  641. window.removeEventListener('scroll', closeAudioPlayer, true)
  642. window.removeEventListener('keydown', audioEscapeHandler, true)
  643. }
  644. watch(activeAudioPath, (open) => { if (open) attachAudioGuards(); else detachAudioGuards() })
  645. onBeforeUnmount(detachAudioGuards)
  646. /** 某分区的行视图(未过滤)。 */
  647. function rowsOf(panel) {
  648. const data = panel.section.data
  649. if (panel.kind === 'archive') return archiveRows(data)
  650. if (panel.kind === 'orders') return workOrderRows(data)
  651. return eventRows(data)
  652. }
  653. /** 这一块有没有分类查询(预警/报警/工单有;档案/指标/图片没有列表语义)。 */
  654. function isFilterable(panel) {
  655. return panel.kind === 'events' || panel.kind === 'orders'
  656. }
  657. /** 某分区的分类 chips(只有 events/orders 两类有;其它块回空数组,模板据此不画 chip 条)。 */
  658. function chipsOf(panel) {
  659. if (panel.kind !== 'events' && panel.kind !== 'orders') return []
  660. const order = panel.kind === 'orders' ? WORK_ORDER_CATEGORY_ORDER : EVENT_CATEGORY_ORDER
  661. return categoryChips(rowsOf(panel), order)
  662. }
  663. function activeCategory(panelName) {
  664. return categories.value[panelName] || ''
  665. }
  666. /** 点同一项取消(与票 37 的类型筛选同款交互:不需要额外的"清除"按钮就能撤)。 */
  667. function toggleCategory(panelName, key) {
  668. categories.value = { ...categories.value, [panelName]: activeCategory(panelName) === key ? '' : key }
  669. // 换分类 = 换结果集,页码回第 1 页(停在第 3 页看新分类会直接显示"没有记录")。
  670. pages.value = { ...pages.value, [panelName]: 1 }
  671. }
  672. /** 过滤后的行(chip 只筛视图,不动数据、不发请求)。 */
  673. function visibleRows(panel) {
  674. const rows = filterByCategory(rowsOf(panel), activeCategory(panel.name))
  675. if (panel.kind !== 'events' && panel.kind !== 'orders') return rows
  676. return prioritizeActiveRows(rows)
  677. }
  678. /** 过滤 + 分页后的窗口(domain 单源 `pagedRows` 收边界;票 59 三清单同一条路径,组件不再备第二份兜底形状)。 */
  679. function pagedOf(panel) {
  680. return pagedRows(visibleRows(panel), pages.value[panel.name] || 1)
  681. }
  682. /**
  683. * 翻页唯一出口(票 59):PagerNav 的前后页/页码直达/跳页都带**目标页码(1 起)**回来。
  684. * 这里只存状态,不另做夹取——越界统一由 domain `pagedRows` 在下一帧渲染时夹回(条文 6)。
  685. */
  686. function gotoPage(panel, target) {
  687. pages.value = { ...pages.value, [panel.name]: Number(target) || 1 }
  688. }
  689. function categoryNoteText(panel) {
  690. return categoryNote(chipsOf(panel), activeCategory(panel.name))
  691. }
  692. /**
  693. * 票 115 优化:未解除/未结案条目的展开状态。
  694. *
  695. * 切换页签时清空手动状态 ⇒ 进入对应页签时,active 条目默认展开;
  696. * 用户手动收起/展开后以手动状态为准(manualOpen[key]),不会每帧被默认值顶回去。
  697. */
  698. const manualOpen = ref({})
  699. function detailKey(panel, item, index) {
  700. return panel.name + '|' + (item.code || index)
  701. }
  702. function isDetailOpen(panel, item, index) {
  703. const key = detailKey(panel, item, index)
  704. return Object.hasOwn(manualOpen.value, key) ? manualOpen.value[key] : item.active === true
  705. }
  706. function rememberDetailToggle(panel, item, index, event) {
  707. const key = detailKey(panel, item, index)
  708. manualOpen.value = { ...manualOpen.value, [key]: event.target.open }
  709. }
  710. watch(activeTab, () => {
  711. manualOpen.value = {}
  712. })
  713. // 换设备:页签、分类条件与页码全部复位(不同设备的分布互不相干,留着就是拿 A 的状态看 B)。
  714. watch(
  715. () => props.deviceCode,
  716. () => {
  717. categories.value = {}
  718. pages.value = {}
  719. manualOpen.value = {}
  720. activeTab.value = DEFAULT_EQUIPMENT_TAB
  721. },
  722. )
  723. /**
  724. * 取某张工单的轨迹。
  725. *
  726. * 轨迹分区有数据 → 用它那条**完整**轨迹(按工单编码配,票 12 验收第 2 条);
  727. * 分区没数据(失败/空)→ 退回**只有状态路径**的那份(`pathOnlyTrack`),
  728. * 因为"这张工单现在在哪一态"来自工单列表,与轨迹成败无关,不该一起丢掉。
  729. */
  730. function trackOfOrder(order) {
  731. if (!order.code) return null
  732. const full = timeline.value.hasContent ? timeline.value.tracks[order.code] : null
  733. return full || pathOnlyTrack(order)
  734. }
  735. function image(panel) {
  736. const view = imageView(panel.section.data)
  737. return { ...view, url: resolveDeviceImageUrl(view.url) }
  738. }
  739. const imagePreviewOpen = ref(false)
  740. const imageFailed = ref(false)
  741. const imageLoading = ref(true)
  742. const currentImageUrl = computed(() => {
  743. const panel = panels.value.find((item) => item.kind === 'image')
  744. return panel ? image(panel).url : ''
  745. })
  746. watch([() => props.deviceCode, currentImageUrl], () => {
  747. imagePreviewOpen.value = false
  748. proofPreviewOpen.value = false
  749. proofImage.value = { url: '', caption: '' }
  750. imageFailed.value = false
  751. imageLoading.value = true
  752. })
  753. watch([() => props.deviceCode, activeTab], () => {
  754. closeAudioPlayer()
  755. })
  756. /** 图片查看交互已收口到通用 ImagePreview(背景点击 / Esc 关闭)。 */
  757. function emptyList(label) {
  758. return emptyListText(label)
  759. }
  760. function isPlaceholder(text) {
  761. return text === DETAIL_PLACEHOLDER
  762. }
  763. </script>
  764. <style scoped>
  765. .collection-table-wrap { min-width: 0; overflow-x: hidden; }
  766. .collection-table {
  767. width: 100%;
  768. table-layout: fixed;
  769. border-collapse: collapse;
  770. color: var(--text-primary, #e5f4ff);
  771. font-size: calc(11 * var(--u, 1px));
  772. }
  773. .collection-table th,
  774. .collection-table td {
  775. min-width: 0;
  776. padding: calc(4 * var(--u, 1px)) calc(3 * var(--u, 1px));
  777. border: 1px solid rgba(69, 161, 226, .16);
  778. text-align: left;
  779. vertical-align: middle;
  780. }
  781. .collection-table th {
  782. color: #a6d8ff;
  783. background: rgba(29, 83, 124, .25);
  784. font-size: calc(10 * var(--u, 1px));
  785. letter-spacing: .02em;
  786. line-height: 1.2;
  787. }
  788. .collection-table__heading {
  789. display: inline-block;
  790. max-width: 100%;
  791. overflow: hidden;
  792. color: inherit;
  793. font-weight: 600;
  794. text-overflow: ellipsis;
  795. vertical-align: bottom;
  796. white-space: nowrap;
  797. word-break: keep-all;
  798. }
  799. .collection-table__unit {
  800. white-space: normal;
  801. word-break: break-word;
  802. overflow-wrap: anywhere;
  803. font-size: .92em;
  804. }
  805. .collection-table td { background: rgba(7, 27, 48, .35); font-variant-numeric: tabular-nums; line-height: 1.35; overflow-wrap: anywhere; }
  806. .collection-table tbody:not(.collection-table__group--latest):nth-of-type(even) td { background: rgba(7, 27, 48, .22); }
  807. .collection-table tbody:not(.collection-table__group--latest) tr:hover td { background: rgba(1, 171, 234, .12); }
  808. /* 渐变只画在整次采集的行组上,td 透明;长表 rowspan 的时间格也共用同一张背景。 */
  809. .collection-table__group--latest {
  810. --reading-color: var(--lv4, #27d17a);
  811. background: linear-gradient(90deg, color-mix(in srgb, var(--collection-accent) 24%, transparent), rgba(7, 27, 48, .28) 100%);
  812. }
  813. .collection-table .collection-table__group--latest td {
  814. background: transparent;
  815. border-color: color-mix(in srgb, var(--collection-accent) 30%, transparent);
  816. }
  817. .collection-table__group--latest tr:first-child td:first-child { box-shadow: inset 3px 0 0 var(--collection-accent); }
  818. .collection-table__group--latest:hover {
  819. background: linear-gradient(90deg, color-mix(in srgb, var(--collection-accent) 30%, transparent), rgba(7, 27, 48, .34) 100%);
  820. }
  821. .collection-table__latest-badge {
  822. display: inline-flex;
  823. align-items: center;
  824. margin-bottom: calc(2 * var(--u, 1px));
  825. padding: 0 calc(5 * var(--u, 1px));
  826. border: 1px solid color-mix(in srgb, var(--collection-accent) 65%, transparent);
  827. border-radius: 999px;
  828. background: color-mix(in srgb, var(--collection-accent) 16%, transparent);
  829. color: var(--collection-accent);
  830. font-size: var(--fs-caption, 10.5px);
  831. line-height: calc(16 * var(--u, 1px));
  832. letter-spacing: .04em;
  833. white-space: nowrap;
  834. }
  835. /* 采集时间已拆两行(日期 10 字符是最宽一行),定宽按内容收紧,
  836. 余量让给右侧指标列(维护者 2026-11-06 反馈:125u 约剩一半空白)。 */
  837. .collection-table__time { width: calc(82 * var(--u, 1px)); }
  838. .collection-table__time-date,
  839. .collection-table__time-clock { display: block; white-space: nowrap; }
  840. .collection-table__audio-col { width: calc(72 * var(--u, 1px)); }
  841. .collection-table__audio-button {
  842. display: inline-flex;
  843. align-items: center;
  844. justify-content: center;
  845. gap: calc(3 * var(--u, 1px));
  846. width: 100%;
  847. min-width: 0;
  848. padding: calc(3 * var(--u, 1px)) calc(4 * var(--u, 1px));
  849. border: 1px solid rgba(1, 171, 234, .5);
  850. border-radius: 999px;
  851. background: rgba(1, 91, 150, .26);
  852. color: #b8e8ff;
  853. font: inherit;
  854. white-space: nowrap;
  855. cursor: pointer;
  856. }
  857. .collection-table__audio-button:hover,
  858. .collection-table__audio-button:focus-visible { border-color: #ffb020; color: #ffd08a; outline: none; }
  859. /* 指标读数排版(wide / long 两种布局共用这一套,不因列名不同而脱节):
  860. 字体与左右侧面板 KPI 数值(.panel-kpi__value)同档 --num(Rajdhani / Share Tech Mono…,
  861. 单源 tokens.css);字号按表格密度自 22u KPI 档收到 13.5u;满不透明度的 --text-strong
  862. 高亮白并加粗,读数在大屏上一眼可读;读数相对单元格左边界略微缩进。
  863. long 布局的「指标名:读数」整条,名称段用正文样式、读数段复用本套字体(见下)。
  864. 报警行以更高优先级抢回红色,占位灰由后置 is-muted 覆盖。 */
  865. .collection-table__value,
  866. .collection-table__reading-value {
  867. color: var(--reading-color, var(--text-strong, #fff));
  868. opacity: 1;
  869. font-family: var(--num, monospace);
  870. font-size: calc(13.5 * var(--u, 1px));
  871. font-weight: 700;
  872. letter-spacing: .02em;
  873. text-shadow: 0 0 8px color-mix(in srgb, currentColor 24%, transparent);
  874. }
  875. .collection-table__value {
  876. padding-left: calc(4 * var(--u, 1px));
  877. }
  878. .collection-table__reading-label {
  879. color: var(--muted, #5680b0);
  880. font-size: calc(11 * var(--u, 1px));
  881. font-weight: 400;
  882. }
  883. .collection-table__reading {
  884. display: grid;
  885. grid-template-columns: minmax(0, 48%) minmax(0, 1fr);
  886. column-gap: calc(14 * var(--u, 1px));
  887. align-items: baseline;
  888. padding-left: calc(4 * var(--u, 1px));
  889. text-align: left;
  890. }
  891. .collection-table__reading-result {
  892. display: inline-flex;
  893. min-width: 0;
  894. align-items: baseline;
  895. justify-content: flex-start;
  896. gap: calc(6 * var(--u, 1px));
  897. }
  898. .collection-table__reading-result > span:first-child { min-width: 0; }
  899. .collection-table__value.is-muted,
  900. .collection-table__reading-value.is-muted { color: var(--muted, #5680b0); font-weight: 400; text-shadow: none; }
  901. .collection-table__label {
  902. color: var(--muted, #5680b0);
  903. font-size: calc(10.5 * var(--u, 1px));
  904. }
  905. .equipment-sections,
  906. .equipment-sections *,
  907. .equipment-sections *::before,
  908. .equipment-sections *::after {
  909. box-sizing: border-box;
  910. }
  911. .equipment-sections {
  912. display: grid;
  913. gap: calc(6 * var(--u, 1px));
  914. }
  915. /*
  916. 票 46 返工第 1 条:标签页条(与票 13 的分段切换、票 46 的分类 chips 同一套视觉语言,
  917. 但它是**分区切换**不是筛选)。计数挂在页签右上角;默认页 = 设备档案。
  918. */
  919. .equipment-tabs {
  920. display: flex;
  921. flex-wrap: wrap;
  922. gap: calc(3 * var(--u, 1px));
  923. }
  924. .equipment-tabs__tab {
  925. display: inline-flex;
  926. align-items: center;
  927. gap: calc(3 * var(--u, 1px));
  928. padding: calc(2 * var(--u, 1px)) calc(9 * var(--u, 1px));
  929. border: 1px solid rgba(1, 171, 234, 0.32);
  930. border-radius: calc(8 * var(--u, 1px));
  931. background: rgba(0, 20, 72, 0.6);
  932. color: var(--text-2);
  933. font: inherit;
  934. font-size: var(--fs-caption, 10.5px);
  935. letter-spacing: 0.04em;
  936. cursor: pointer;
  937. }
  938. .equipment-tabs__tab:hover,
  939. .equipment-tabs__tab:focus-visible {
  940. border-color: rgba(1, 171, 234, 0.6);
  941. color: var(--text-strong);
  942. outline: none;
  943. }
  944. .equipment-tabs__tab.is-active {
  945. border-color: rgba(0, 184, 255, 0.85);
  946. background: linear-gradient(180deg, rgba(1, 171, 234, 0.85), rgba(0, 82, 168, 0.85));
  947. color: var(--text-strong);
  948. }
  949. .equipment-tabs__count {
  950. font-family: var(--num, monospace);
  951. color: var(--lv2, #ffb020);
  952. }
  953. .equipment-tabs__tab.is-active .equipment-tabs__count {
  954. color: var(--text-strong);
  955. }
  956. .equipment-tab__body {
  957. display: grid;
  958. gap: calc(6 * var(--u, 1px));
  959. }
  960. /* 票 59:分页控件与样式移交共享 PagerNav.vue,组件不再自画 pager。 */
  961. /* 每块分区:自己的边框与抬头 —— 失败的那一块缩成一行提示,成功的照常展开。 */
  962. .equipment-section {
  963. display: grid;
  964. gap: calc(3 * var(--u, 1px));
  965. padding: calc(5 * var(--u, 1px)) var(--space-2, 8px);
  966. border: 1px solid rgba(1, 171, 234, 0.24);
  967. border-radius: calc(8 * var(--u, 1px));
  968. background: var(--inset, rgba(2, 10, 20, 0.55));
  969. }
  970. .equipment-section[data-panel-state='failed'],
  971. .equipment-section[data-panel-state='unavailable'] {
  972. border-color: rgba(255, 59, 82, 0.4);
  973. }
  974. .equipment-section--video[data-panel-state='failed'],
  975. .equipment-section--video[data-panel-state='unavailable'] {
  976. border-color: rgba(1, 171, 234, 0.24);
  977. }
  978. .equipment-section[data-panel-state='stale'] {
  979. border-color: rgba(255, 176, 32, 0.45);
  980. }
  981. .equipment-section__head {
  982. display: flex;
  983. align-items: center;
  984. justify-content: space-between;
  985. gap: var(--space-2, 8px);
  986. }
  987. .equipment-section__title {
  988. min-width: 0;
  989. overflow: hidden;
  990. color: var(--text);
  991. font-size: var(--fs-body, 13px);
  992. font-weight: 700;
  993. letter-spacing: 0.06em;
  994. white-space: nowrap;
  995. text-overflow: ellipsis;
  996. }
  997. .equipment-section__stale {
  998. margin: 0;
  999. color: var(--lv2, #ffb020);
  1000. font-size: var(--fs-caption, 10.5px);
  1001. letter-spacing: 0.04em;
  1002. }
  1003. .equipment-section__rows {
  1004. display: grid;
  1005. gap: calc(2 * var(--u, 1px));
  1006. margin: 0;
  1007. }
  1008. .equipment-section__row {
  1009. display: grid;
  1010. grid-template-columns: calc(58 * var(--u, 1px)) minmax(0, 1fr);
  1011. align-items: baseline;
  1012. gap: var(--space-2, 8px);
  1013. border-bottom: 1px dashed rgba(1, 171, 234, 0.14);
  1014. }
  1015. .equipment-section__row dt {
  1016. color: var(--muted, #5680b0);
  1017. font-size: var(--fs-caption, 10.5px);
  1018. letter-spacing: 0.04em;
  1019. }
  1020. .equipment-section__row dd {
  1021. margin: 0;
  1022. color: var(--text, #d7ecff);
  1023. min-width: 0;
  1024. overflow-wrap: anywhere;
  1025. word-break: normal;
  1026. }
  1027. .equipment-section__list {
  1028. display: grid;
  1029. gap: calc(4 * var(--u, 1px));
  1030. }
  1031. .equipment-section__item {
  1032. display: grid;
  1033. gap: 1px;
  1034. padding-bottom: calc(3 * var(--u, 1px));
  1035. border-bottom: 1px dashed rgba(1, 171, 234, 0.14);
  1036. }
  1037. /*
  1038. 票 46:分类 chips 条(预警/报警按等级、工单按状态)。
  1039. 与票 13 的分段切换同一套视觉语言(胶囊 + 选中高亮),但它是**视图过滤**不是模式切换。
  1040. 计数直接挂在 chip 上 —— 分类前有多少条要看得见,筛完剩几条由列表自己说话。
  1041. */
  1042. .equipment-section__chips {
  1043. display: flex;
  1044. flex-wrap: wrap;
  1045. gap: calc(3 * var(--u, 1px));
  1046. }
  1047. .equipment-section__chip {
  1048. display: inline-flex;
  1049. align-items: center;
  1050. gap: calc(3 * var(--u, 1px));
  1051. padding: 1px calc(7 * var(--u, 1px));
  1052. border: 1px solid rgba(1, 171, 234, 0.32);
  1053. border-radius: calc(8 * var(--u, 1px));
  1054. background: rgba(0, 20, 72, 0.6);
  1055. color: var(--text-2);
  1056. font: inherit;
  1057. font-size: var(--fs-caption, 10.5px);
  1058. letter-spacing: 0.04em;
  1059. cursor: pointer;
  1060. }
  1061. .equipment-section__chip:hover,
  1062. .equipment-section__chip:focus-visible {
  1063. border-color: rgba(1, 171, 234, 0.6);
  1064. color: var(--text-strong);
  1065. outline: none;
  1066. }
  1067. .equipment-section__chip.is-active {
  1068. border-color: rgba(0, 184, 255, 0.85);
  1069. background: linear-gradient(180deg, rgba(1, 171, 234, 0.85), rgba(0, 82, 168, 0.85));
  1070. color: var(--text-strong);
  1071. }
  1072. .equipment-section__chip-count {
  1073. font-family: var(--num, monospace);
  1074. }
  1075. /*
  1076. 票 46:历史条目默认折叠(`<details>` 原生语义:键盘可达、展开态自带 aria-expanded)。
  1077. summary 一行读完关键信息;展开后的详情走 dl 键值行。去掉原生三角,换成边框反馈。
  1078. */
  1079. .equipment-section__item--collapsible {
  1080. gap: calc(2 * var(--u, 1px));
  1081. /* 每条数据一个线框:普通项也由整块持有边框,与高亮项同一层,不再出现错位/重叠。 */
  1082. padding: calc(4 * var(--u, 1px)) calc(6 * var(--u, 1px));
  1083. border: 1px solid rgba(1, 171, 234, 0.22);
  1084. border-radius: calc(6 * var(--u, 1px));
  1085. }
  1086. .equipment-section__item--collapsible[open] {
  1087. border-color: rgba(1, 171, 234, 0.5);
  1088. }
  1089. .equipment-section__item--collapsible[open] {
  1090. border-bottom-color: rgba(1, 171, 234, 0.35);
  1091. padding-bottom: calc(5 * var(--u, 1px));
  1092. }
  1093. /*
  1094. 事件按等级色强调;未分级预警黄、报警红;非终态工单天蓝。
  1095. 2026-11-12 维护者反馈「高亮框和普通框对不上、边框重叠」:原来整块用 inset box-shadow
  1096. 画了一圈,头部又各带一条 border + 背景,两层框叠在一起。现在**每条只保留一个线框**:
  1097. 普通项用整块 border,高亮项把同一个 border 换成等级色,头部不再画框。
  1098. */
  1099. .equipment-section__item--active {
  1100. padding-left: calc(6 * var(--u, 1px));
  1101. border: 1px solid color-mix(in srgb, var(--detail-accent) 55%, transparent);
  1102. border-radius: calc(6 * var(--u, 1px));
  1103. background: linear-gradient(90deg, color-mix(in srgb, var(--detail-accent) 20%, transparent), rgba(7, 27, 48, .12) 78%);
  1104. box-shadow: inset 3px 0 0 var(--detail-accent), 0 0 12px color-mix(in srgb, var(--detail-accent) 12%, transparent);
  1105. }
  1106. .equipment-section__item--active[open] {
  1107. border-color: color-mix(in srgb, var(--detail-accent) 78%, transparent);
  1108. background: linear-gradient(90deg, color-mix(in srgb, var(--detail-accent) 26%, transparent), rgba(7, 27, 48, .16) 82%);
  1109. }
  1110. /* 高亮项的头部不另画框,避免与整块边框形成双层。 */
  1111. .equipment-section__item--active .equipment-section__item-head,
  1112. .equipment-section__item--collapsible.equipment-section__item--active[open] .equipment-section__item-head {
  1113. border-color: transparent;
  1114. background: transparent;
  1115. }
  1116. /* 状态徽标:按预警状态色高亮(待接收/已接收黄、处置中蓝、已处置紫、已解除绿)。 */
  1117. .equipment-section__status-badge {
  1118. display: inline-flex;
  1119. align-items: center;
  1120. padding: 0 calc(6 * var(--u, 1px));
  1121. border: 1px solid currentcolor;
  1122. border-radius: 999px;
  1123. background: color-mix(in srgb, currentcolor 18%, transparent);
  1124. font-size: var(--fs-caption, 10.5px);
  1125. line-height: calc(16 * var(--u, 1px));
  1126. letter-spacing: .04em;
  1127. white-space: nowrap;
  1128. }
  1129. /* 等级与状态共用的色键映射(色值只在 tokens.css 声明一份)。 */
  1130. [data-tone="lv1"] { color: var(--lv1); }
  1131. [data-tone="lv2"] { color: var(--lv2); }
  1132. [data-tone="lv3"] { color: var(--lv3); }
  1133. [data-tone="lv4"] { color: var(--lv4); }
  1134. [data-tone="handled"] { color: var(--status-handled); }
  1135. [data-tone="neutral"] { color: var(--neutral); }
  1136. .equipment-section__detail-value--tone { font-weight: 600; }
  1137. /* 预警描述允许多行(简单描述一行、实际值/阈值一行)。 */
  1138. .equipment-section__detail-row dd { white-space: pre-line; }
  1139. .equipment-section__active-badge {
  1140. display: inline-flex;
  1141. align-items: center;
  1142. padding: 0 calc(6 * var(--u, 1px));
  1143. border: 1px solid var(--detail-accent);
  1144. border-radius: 999px;
  1145. background: color-mix(in srgb, var(--detail-accent) 24%, transparent);
  1146. color: color-mix(in srgb, var(--detail-accent) 55%, white);
  1147. font-size: var(--fs-caption, 10.5px);
  1148. line-height: calc(16 * var(--u, 1px));
  1149. letter-spacing: .04em;
  1150. white-space: nowrap;
  1151. }
  1152. /* 工单卡片:管理端同款竖向排布,字号提到正文级(维护者 2026-11-13 要求加大)。 */
  1153. .equipment-section__wo-head { gap: calc(4 * var(--u, 1px)); }
  1154. /* 工单卡片字号与预警/报警卡片保持一致(不单独放大),只保留卡片式排布。 */
  1155. .equipment-section__wo-title {
  1156. display: flex;
  1157. align-items: center;
  1158. gap: calc(8 * var(--u, 1px));
  1159. min-width: 0;
  1160. padding-bottom: calc(3 * var(--u, 1px));
  1161. border-bottom: 1px dashed rgba(1, 171, 234, 0.28);
  1162. }
  1163. .equipment-section__wo-label {
  1164. flex: none;
  1165. min-width: calc(56 * var(--u, 1px));
  1166. color: var(--muted, #5680b0);
  1167. }
  1168. .equipment-section__wo-row {
  1169. display: flex;
  1170. align-items: flex-start;
  1171. gap: calc(8 * var(--u, 1px));
  1172. line-height: 1.5;
  1173. }
  1174. .equipment-section__wo-row > span:last-child { min-width: 0; overflow-wrap: anywhere; }
  1175. .equipment-section__wo-value { min-width: 0; flex: 1; overflow-wrap: anywhere; }
  1176. .equipment-section__locate {
  1177. flex: none;
  1178. padding: 0 calc(7 * var(--u, 1px));
  1179. border: 1px solid rgba(1, 171, 234, .45);
  1180. border-radius: calc(9 * var(--u, 1px));
  1181. background: rgba(0, 20, 72, .5);
  1182. color: var(--cyan-hi, #35d8ff);
  1183. font: inherit;
  1184. font-size: calc(10 * var(--u, 1px));
  1185. cursor: pointer;
  1186. }
  1187. .equipment-section__locate:hover,
  1188. .equipment-section__locate:focus-visible { border-color: var(--cyan-hi, #00b8ff); color: var(--text-strong); }
  1189. /* 工单详情子页签(维护者 2026-11-23):工单信息与处置流程分开看,各自独立。 */
  1190. .equipment-section__wo-tabs {
  1191. display: flex;
  1192. gap: calc(6 * var(--u, 1px));
  1193. margin: calc(2 * var(--u, 1px)) 0;
  1194. }
  1195. .equipment-section__wo-tab {
  1196. padding: calc(2 * var(--u, 1px)) calc(10 * var(--u, 1px));
  1197. border: 1px solid rgba(1, 171, 234, .3);
  1198. border-radius: 999px;
  1199. background: transparent;
  1200. color: var(--muted, #5680b0);
  1201. font-size: var(--fs-caption, 10.5px);
  1202. line-height: 1.6;
  1203. cursor: pointer;
  1204. }
  1205. .equipment-section__wo-tab[data-active='true'] {
  1206. border-color: var(--lv3, #1aabff);
  1207. color: var(--lv3, #1aabff);
  1208. background: color-mix(in srgb, var(--lv3, #1aabff) 14%, transparent);
  1209. }
  1210. /* 维修前/后附件:缩略图点开看大图(取不到就压暗并标注,不画破图)。 */
  1211. .equipment-section__wo-attachments {
  1212. display: flex;
  1213. align-items: flex-start;
  1214. gap: calc(8 * var(--u, 1px));
  1215. margin-top: calc(4 * var(--u, 1px));
  1216. }
  1217. .equipment-section__thumbs {
  1218. display: flex;
  1219. flex-wrap: wrap;
  1220. gap: calc(4 * var(--u, 1px));
  1221. min-width: 0;
  1222. }
  1223. .equipment-section__thumb {
  1224. width: calc(44 * var(--u, 1px));
  1225. height: calc(44 * var(--u, 1px));
  1226. padding: 0;
  1227. overflow: hidden;
  1228. border: 1px solid rgba(1, 171, 234, .3);
  1229. border-radius: calc(3 * var(--u, 1px));
  1230. background: rgba(1, 12, 32, .5);
  1231. cursor: zoom-in;
  1232. }
  1233. .equipment-section__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
  1234. .equipment-section__thumb img[data-broken='true'] { opacity: .3; }
  1235. /* 工单详情:面板较窄,两列键值改为竖向一行一项,字号与正文一致。 */
  1236. .equipment-section__wo-detail { gap: calc(6 * var(--u, 1px)); }
  1237. .equipment-section__item-desc {
  1238. color: var(--text-2, #88b7e8);
  1239. font-size: var(--fs-caption, 10.5px);
  1240. line-height: 1.5;
  1241. overflow-wrap: anywhere;
  1242. }
  1243. .equipment-section__item-more {
  1244. justify-self: end;
  1245. color: var(--muted, #5680b0);
  1246. font-size: var(--fs-caption, 10.5px);
  1247. letter-spacing: .02em;
  1248. }
  1249. .equipment-section__item-head:hover .equipment-section__item-more { color: var(--cyan-hi, #00b8ff); }
  1250. .equipment-section__item-head {
  1251. display: grid;
  1252. gap: 1px;
  1253. cursor: pointer;
  1254. list-style: none;
  1255. padding: calc(1 * var(--u, 1px)) calc(3 * var(--u, 1px));
  1256. margin: calc(-1 * var(--u, 1px)) calc(-3 * var(--u, 1px)) 0;
  1257. border: 1px solid transparent;
  1258. border-radius: calc(8 * var(--u, 1px));
  1259. }
  1260. .equipment-section__item-head::-webkit-details-marker {
  1261. display: none;
  1262. }
  1263. /* hover / 展开只改背景,不再给头部加第二条框——整块边框已经是这一行的唯一线框。 */
  1264. .equipment-section__item-head:hover {
  1265. background: rgba(0, 53, 156, 0.28);
  1266. }
  1267. .equipment-section__item--collapsible[open] .equipment-section__item-head {
  1268. background: rgba(0, 53, 156, 0.22);
  1269. }
  1270. .equipment-section__detail {
  1271. display: grid;
  1272. gap: calc(1 * var(--u, 1px));
  1273. margin: calc(2 * var(--u, 1px)) 0 0;
  1274. padding: calc(3 * var(--u, 1px)) var(--space-2, 8px);
  1275. border-left: 2px solid rgba(1, 171, 234, 0.4);
  1276. background: rgba(2, 10, 20, 0.4);
  1277. }
  1278. .equipment-section__detail-row {
  1279. display: grid;
  1280. grid-template-columns: calc(58 * var(--u, 1px)) minmax(0, 1fr);
  1281. align-items: baseline;
  1282. gap: var(--space-2, 8px);
  1283. }
  1284. /* 详情键值改竖向一项一行,字号与事件详情一致(不单独放大)。 */
  1285. .equipment-section__wo-detail .equipment-section__detail-row { grid-template-columns: calc(84 * var(--u, 1px)) minmax(0, 1fr); }
  1286. .equipment-section__detail-row dt {
  1287. color: var(--muted, #5680b0);
  1288. font-size: var(--fs-caption, 10.5px);
  1289. letter-spacing: 0.04em;
  1290. }
  1291. .equipment-section__detail-row dd {
  1292. margin: 0;
  1293. min-width: 0;
  1294. color: var(--text, #d7ecff);
  1295. font-size: var(--fs-caption, 10.5px);
  1296. overflow-wrap: anywhere;
  1297. }
  1298. .equipment-section__item-name {
  1299. color: var(--text, #d7ecff);
  1300. font-size: var(--fs-caption, 10.5px);
  1301. }
  1302. .equipment-section__item-name em {
  1303. color: var(--muted, #5680b0);
  1304. font-style: normal;
  1305. }
  1306. .equipment-section__value {
  1307. color: var(--text);
  1308. font-family: var(--num, monospace);
  1309. font-size: var(--fs-body, 13px);
  1310. }
  1311. .equipment-section__value em {
  1312. color: var(--muted, #5680b0);
  1313. font-style: normal;
  1314. font-size: var(--fs-caption, 10.5px);
  1315. }
  1316. .equipment-section__meta {
  1317. display: flex;
  1318. flex-wrap: wrap;
  1319. gap: var(--space-2, 8px);
  1320. color: var(--text-2, #88b7e8);
  1321. font-size: var(--fs-caption, 10.5px);
  1322. }
  1323. .equipment-section__note {
  1324. margin: 0;
  1325. color: var(--muted, #5680b0);
  1326. font-size: var(--fs-caption, 10.5px);
  1327. }
  1328. .equipment-section__figure {
  1329. display: grid;
  1330. gap: calc(3 * var(--u, 1px));
  1331. margin: 0;
  1332. }
  1333. .equipment-section__img {
  1334. display: block;
  1335. width: 100%;
  1336. max-height: calc(140 * var(--u, 1px));
  1337. object-fit: cover;
  1338. border: 1px solid rgba(1, 171, 234, 0.35);
  1339. border-radius: calc(8 * var(--u, 1px));
  1340. }
  1341. .equipment-section__hint,
  1342. .equipment-section__missing,
  1343. .is-muted {
  1344. margin: 0;
  1345. color: var(--muted, #5680b0);
  1346. font-size: var(--fs-caption, 10.5px);
  1347. letter-spacing: 0.04em;
  1348. }
  1349. .equipment-section__missing {
  1350. color: var(--lv2, #ffb020);
  1351. }
  1352. .equipment-section__mono {
  1353. font-family: var(--num, monospace);
  1354. letter-spacing: 0.04em;
  1355. }
  1356. .equipment-section__image-button {
  1357. display: grid;
  1358. gap: 6px;
  1359. width: 100%;
  1360. padding: 0;
  1361. border: 0;
  1362. background: transparent;
  1363. color: var(--cyan-hi);
  1364. font: inherit;
  1365. cursor: zoom-in;
  1366. }
  1367. .equipment-image-viewer {
  1368. width: min(90vw, 1200px);
  1369. max-height: 90vh;
  1370. padding: 16px;
  1371. border: 1px solid var(--cyan);
  1372. border-radius: calc(8 * var(--u, 1px));
  1373. background: var(--bg-0);
  1374. color: var(--text);
  1375. }
  1376. .equipment-image-viewer::backdrop { background: rgba(1, 5, 20, .8); backdrop-filter: blur(6px); }
  1377. .equipment-image-viewer img { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: contain; }
  1378. .equipment-image-viewer__close { display: block; margin-left: auto; margin-bottom: 8px; cursor: pointer; }
  1379. /* 音频播放条:贴播放键上方渐入的小浮层,不遮罩、不虚化整屏 UI。 */
  1380. .collection-audio-player {
  1381. position: fixed;
  1382. z-index: calc(var(--z-columns, 30) + 5);
  1383. width: min(264px, 88vw);
  1384. padding: calc(6 * var(--u, 1px)) calc(8 * var(--u, 1px)) calc(8 * var(--u, 1px));
  1385. border: 1px solid var(--cyan, #01abea);
  1386. border-radius: calc(8 * var(--u, 1px));
  1387. background: rgba(4, 20, 38, .97);
  1388. box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
  1389. color: var(--text, #e5f4ff);
  1390. transform: translate(-50%, calc(-100% - 8px));
  1391. animation: collection-audio-pop-above .18s ease-out;
  1392. }
  1393. .collection-audio-player.is-below {
  1394. transform: translate(-50%, 8px);
  1395. animation-name: collection-audio-pop-below;
  1396. }
  1397. @keyframes collection-audio-pop-above {
  1398. from { opacity: 0; transform: translate(-50%, calc(-100% - 2px)); }
  1399. }
  1400. @keyframes collection-audio-pop-below {
  1401. from { opacity: 0; transform: translate(-50%, 2px); }
  1402. }
  1403. .collection-audio-player__head {
  1404. display: flex;
  1405. align-items: center;
  1406. justify-content: space-between;
  1407. gap: calc(6 * var(--u, 1px));
  1408. margin-bottom: calc(4 * var(--u, 1px));
  1409. }
  1410. .collection-audio-player__label {
  1411. min-width: 0;
  1412. overflow: hidden;
  1413. color: #a6d8ff;
  1414. font-size: var(--fs-caption, 10.5px);
  1415. text-overflow: ellipsis;
  1416. white-space: nowrap;
  1417. }
  1418. .collection-audio-player__close {
  1419. flex: none;
  1420. width: calc(20 * var(--u, 1px));
  1421. height: calc(20 * var(--u, 1px));
  1422. padding: 0;
  1423. border: 1px solid rgba(1, 171, 234, .5);
  1424. border-radius: 999px;
  1425. background: rgba(1, 91, 150, .26);
  1426. color: inherit;
  1427. font-size: calc(12 * var(--u, 1px));
  1428. line-height: 1;
  1429. cursor: pointer;
  1430. }
  1431. .collection-audio-player__audio { display: block; width: 100%; max-width: 100%; height: calc(32 * var(--u, 1px)); }
  1432. </style>