Commit 1598f9274edc3e94459f85d989a92da06ee9fd70

Authored by ww
1 parent 55550f58

perf: alarm notify set off layre duration

... ... @@ -44,3 +44,6 @@ VITE_CONTENT_SECURITY_POLICY = false
44 44
45 45 # Alarm Notify Polling Interval Time
46 46 VITE_ALARM_NOTIFY_POLLING_INTERVAL_TIME = 5000
  47 +
  48 +# Alarm Notify Auto Close Time
  49 +VITE_ALARM_NOTIFY_DURATION = 5000
... ...
... ... @@ -45,3 +45,6 @@ VITE_CONTENT_SECURITY_POLICY = false
45 45
46 46 # Alarm Notify Polling Interval Time
47 47 VITE_ALARM_NOTIFY_POLLING_INTERVAL_TIME = 60000
  48 +
  49 +# Alarm Notify Auto Close Time
  50 +VITE_ALARM_NOTIFY_DURATION = 5000
... ...
... ... @@ -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;
... ...