소스 검색

fix(cockpit): 未登记状态改按词表成员判定,恢复 UNKNOWN_STATUS 告警

走查回归发现 dailyIncidentTrend 仍用「statusText 返回值等于原码」判未知状态;108 线把未登记码统一显示「状态未知」后该判据永不成立,处置数会静默偏低(违反票 71 B13 红线)。改为查词表自有键,未知状态照常上报原因码。同时 t71 A2/A5、t99 E2、t110 基线按当前已提交规则刷新(文案与变量名变更,非行为回退)。
ChenJZ 2 일 전
부모
커밋
86f582e663
1개의 변경된 파일과 6개의 추가작업 그리고 2개의 파일을 삭제
  1. 6 2
      src/modules/cockpit/domain/incidentTrend.js

+ 6 - 2
src/modules/cockpit/domain/incidentTrend.js

@@ -28,7 +28,7 @@
  * 事件行取全(分页取到底)才算得准。取不全 ⇒ 整块返回 `null` 序列 + 原因码,
  * 由视图层如实说「这条线为什么不画」,**不拿半份数据画一条偏小的假线**。
  */
-import { terminalStatuses, statusText } from './eventStatusVocab.js'
+import { terminalStatuses, statusText, statusVocabulary } from './eventStatusVocab.js'
 import { DEFAULT_BACKLOG_TIME_ZONE, parseInstant } from './alarmBacklog.js'
 
 /** 算不出逐日趋势的原因码(视图层据此给文案;空串=正常)。 */
@@ -158,9 +158,13 @@ export function dailyIncidentTrend({ events, family, startTime, endTime, timeZon
             pending,
         })
     }
+    // 判据必须认「词表里有没有这个码」,不能拿 statusText 返回值与原码比较 ——
+    // 未登记码现在统一显示「状态未知」(CONTEXT.md 业务编码/状态词表),回原码的旧比较
+    // 会让未知状态永远判不出来,处置数静默偏低(票 71 B13 的红线)。
+    const vocabulary = statusVocabulary(family)
     const unknown = list.some((event) => {
         const status = String((event && event.status) || '').trim().toUpperCase()
-        return status === '' || statusText(family, status) === status
+        return status === '' || !Object.hasOwn(vocabulary, status)
     })
     return { days, reason: unknown ? INCIDENT_TREND_GAP.UNKNOWN_STATUS : INCIDENT_TREND_GAP.NONE }
 }