|
|
@@ -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 }
|
|
|
}
|