Skip to content

Commit

Permalink
refactor(realtime): 优化实时告警页面组列表的渲染逻辑
Browse files Browse the repository at this point in the history
- 在 Group 组件的 onRow 回调中,增加了对 level.color 属性的空值检查
- 通过使用可选链操作符,提高了代码的健壮性和可读性
  • Loading branch information
aide-cloud committed Jan 17, 2025
1 parent cd8d549 commit 54d7147
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/realtime/alarm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ const Group: React.FC = () => {
onRow={(record) => {
const { metricLevel: level } = record as RealtimeAlarmItem
return {
style: { background: showLevelColor ? level.level.extend?.color : '' }
style: { background: showLevelColor ? level?.level?.extend?.color : '' }
}
}}
/>
Expand Down

0 comments on commit 54d7147

Please sign in to comment.