Skip to content

Commit e32ea39

Browse files
committed
使用更稳定的 alarm-${item.name}-${item.editTime}代替index作为唯一id
1 parent 8aa4120 commit e32ea39

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

client/src/stores/app.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ export interface ModuleRecord {
6262
eventData?: any
6363
}
6464

65+
// 告警变更记录类型定义
66+
export interface AlarmChangeItem {
67+
id: string
68+
service: string
69+
change: string
70+
timestamp: string
71+
details: string
72+
}
73+
6574
export const useAppStore = defineStore('app', () => {
6675
// 状态
6776
const currentView = ref<'home' | 'changelog'>('home')

client/src/views/ChangeLogView.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const transformDeploymentChangelogToChangeItems = (changelogData: any[]): Change
121121
]
122122
123123
return {
124-
id: `chg-${index + 1}`,
124+
id: `chg-${item.service}-${item.version}-${item.startTime}`,
125125
service: item.service,
126126
version: item.version,
127127
state,
@@ -147,7 +147,7 @@ const transformAlertRuleChangelogToAlarmChangeItems = (changelogData: AlertRuleC
147147
const timestamp = new Date(item.editTime).toLocaleString('zh-CN')
148148
149149
return {
150-
id: `alarm-${index + 1}`,
150+
id: `alarm-${item.name}-${item.editTime}`,
151151
service: serviceName,
152152
change: `${item.name}: ${changeDescription}`,
153153
timestamp,

0 commit comments

Comments
 (0)