Pārlūkot izejas kodu

fix(cockpit): 采集记录列标签沿用档案profile而非硬覆盖

ChenJZ 1 stundu atpakaļ
vecāks
revīzija
401e73e541
1 mainītis faili ar 4 papildinājumiem un 2 dzēšanām
  1. 4 2
      src/modules/cockpit/domain/equipmentDetailView.js

+ 4 - 2
src/modules/cockpit/domain/equipmentDetailView.js

@@ -41,7 +41,8 @@ import { detailEventLevel, collectionCellAssessment, collectionGroupAccent } fro
 
 const RECORD_TEXT = {
     COD: '化学需氧量(COD)', PH: '酸碱度(pH)', pH: '酸碱度(pH)',
-    create_time: '采集时间', indicator: '监测因子', item: '监测因子', value: '监测值', filepath: '音频记录',
+    // create_time 是记录创建时间,按领域词表叫「数据时间」,不等同采样时刻;profile 给了 label 时优先沿用。
+    create_time: '数据时间', indicator: '监测因子', item: '监测因子', value: '监测值', filepath: '音频记录',
 }
 function recordText(value, fallback = '监测值') {
     const text = valueText(value)
@@ -93,7 +94,8 @@ export function collectionRecordTable(data, page = 1) {
     const view = data?.recordView || {}
     const rawColumns = (Array.isArray(view.columns) ? view.columns : []).map((column) => ({
         key: column.key,
-        label: column.key === 'create_time' ? '采集时间' : recordText(column.label, RECORD_TEXT[column.key] || '监测值'),
+        // 列完全沿用 profile 给的 label;只有缺 label 时才按 key 取词表兜底,不硬覆盖业务标签。
+        label: recordText(column.label, RECORD_TEXT[column.key] || '监测值'),
         unit: column.unit || '',
         isTime: column.key === 'create_time',
         isAudio: column.key === 'filepath',