Skip to content

Commit 54d7147

Browse files
committed
refactor(realtime): 优化实时告警页面组列表的渲染逻辑
- 在 Group 组件的 onRow 回调中,增加了对 level.color 属性的空值检查 - 通过使用可选链操作符,提高了代码的健壮性和可读性
1 parent cd8d549 commit 54d7147

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pages/realtime/alarm/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ const Group: React.FC = () => {
282282
onRow={(record) => {
283283
const { metricLevel: level } = record as RealtimeAlarmItem
284284
return {
285-
style: { background: showLevelColor ? level.level.extend?.color : '' }
285+
style: { background: showLevelColor ? level?.level?.extend?.color : '' }
286286
}
287287
}}
288288
/>

0 commit comments

Comments
 (0)