|
...
|
...
|
@@ -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];
|
|
...
|
...
|
@@ -40,10 +42,9 @@ export function useAlarmNotify(params: UseAlarmNotifyParams = {}) { |
|
40
|
42
|
|
|
41
|
43
|
const severityMean = alarmLevel(severity);
|
|
42
|
44
|
|
|
43
|
|
- console.log('enter');
|
|
44
|
45
|
notification.open({
|
|
45
|
46
|
message: '设备告警',
|
|
46
|
|
- duration: null,
|
|
|
47
|
+ duration,
|
|
47
|
48
|
key,
|
|
48
|
49
|
description: h('div', {}, [
|
|
49
|
50
|
h('div', { style: { marginRight: '5px' } }, [
|
|
...
|
...
|
@@ -61,8 +62,6 @@ export function useAlarmNotify(params: UseAlarmNotifyParams = {}) { |
|
61
|
62
|
]),
|
|
62
|
63
|
icon: h(ExclamationCircleOutlined, { style: { color: '#faa22d' } }),
|
|
63
|
64
|
onClose: () => {
|
|
64
|
|
- console.log('enter close');
|
|
65
|
|
- // currentNotifyId = null;
|
|
66
|
65
|
key = null;
|
|
67
|
66
|
},
|
|
68
|
67
|
btn: h(
|
...
|
...
|
|