|
@@ -9,12 +9,14 @@ interface UseAlarmNotifyParams { |
|
@@ -9,12 +9,14 @@ interface UseAlarmNotifyParams { |
|
9
|
alarmNotifyStatus?: AlarmStatus;
|
9
|
alarmNotifyStatus?: AlarmStatus;
|
|
10
|
interval?: number;
|
10
|
interval?: number;
|
|
11
|
color?: string;
|
11
|
color?: string;
|
|
|
|
12
|
+ duration?: number;
|
|
12
|
}
|
13
|
}
|
|
13
|
|
14
|
|
|
14
|
export function useAlarmNotify(params: UseAlarmNotifyParams = {}) {
|
15
|
export function useAlarmNotify(params: UseAlarmNotifyParams = {}) {
|
|
15
|
const {
|
16
|
const {
|
|
16
|
alarmNotifyStatus = AlarmStatus.ACTIVE_UN_ACK,
|
17
|
alarmNotifyStatus = AlarmStatus.ACTIVE_UN_ACK,
|
|
17
|
interval = import.meta.env.VITE_ALARM_NOTIFY_POLLING_INTERVAL_TIME,
|
18
|
interval = import.meta.env.VITE_ALARM_NOTIFY_POLLING_INTERVAL_TIME,
|
|
|
|
19
|
+ duration = import.meta.env.VITE_ALARM_NOTIFY_DURATION,
|
|
18
|
color = 'orange',
|
20
|
color = 'orange',
|
|
19
|
} = params;
|
21
|
} = params;
|
|
20
|
const alarmNotifyStatusMean = AlarmStatusMean[alarmNotifyStatus];
|
22
|
const alarmNotifyStatusMean = AlarmStatusMean[alarmNotifyStatus];
|
|
@@ -43,7 +45,7 @@ export function useAlarmNotify(params: UseAlarmNotifyParams = {}) { |
|
@@ -43,7 +45,7 @@ export function useAlarmNotify(params: UseAlarmNotifyParams = {}) { |
|
43
|
console.log('enter');
|
45
|
console.log('enter');
|
|
44
|
notification.open({
|
46
|
notification.open({
|
|
45
|
message: '设备告警',
|
47
|
message: '设备告警',
|
|
46
|
- duration: null,
|
48
|
+ duration,
|
|
47
|
key,
|
49
|
key,
|
|
48
|
description: h('div', {}, [
|
50
|
description: h('div', {}, [
|
|
49
|
h('div', { style: { marginRight: '5px' } }, [
|
51
|
h('div', { style: { marginRight: '5px' } }, [
|