Commit 1598f9274edc3e94459f85d989a92da06ee9fd70
1 parent
55550f58
perf: alarm notify set off layre duration
Showing
4 changed files
with
10 additions
and
1 deletions
... | ... | @@ -9,12 +9,14 @@ interface UseAlarmNotifyParams { |
9 | 9 | alarmNotifyStatus?: AlarmStatus; |
10 | 10 | interval?: number; |
11 | 11 | color?: string; |
12 | + duration?: number; | |
12 | 13 | } |
13 | 14 | |
14 | 15 | export function useAlarmNotify(params: UseAlarmNotifyParams = {}) { |
15 | 16 | const { |
16 | 17 | alarmNotifyStatus = AlarmStatus.ACTIVE_UN_ACK, |
17 | 18 | interval = import.meta.env.VITE_ALARM_NOTIFY_POLLING_INTERVAL_TIME, |
19 | + duration = import.meta.env.VITE_ALARM_NOTIFY_DURATION, | |
18 | 20 | color = 'orange', |
19 | 21 | } = params; |
20 | 22 | const alarmNotifyStatusMean = AlarmStatusMean[alarmNotifyStatus]; |
... | ... | @@ -43,7 +45,7 @@ export function useAlarmNotify(params: UseAlarmNotifyParams = {}) { |
43 | 45 | console.log('enter'); |
44 | 46 | notification.open({ |
45 | 47 | message: '设备告警', |
46 | - duration: null, | |
48 | + duration, | |
47 | 49 | key, |
48 | 50 | description: h('div', {}, [ |
49 | 51 | h('div', { style: { marginRight: '5px' } }, [ | ... | ... |
... | ... | @@ -73,6 +73,7 @@ declare global { |
73 | 73 | VITE_GENERATE_UI: string; |
74 | 74 | VITE_CONTENT_SECURITY_POLICY: boolean; |
75 | 75 | VITE_ALARM_NOTIFY_POLLING_INTERVAL_TIME: number; |
76 | + VITE_ALARM_NOTIFY_DURATION: number; | |
76 | 77 | } |
77 | 78 | |
78 | 79 | declare function parseInt(s: string | number, radix?: number): number; | ... | ... |