Commit ae44df41d437a6fa0a34c5374fb0996a77998116

Authored by fengwotao
1 parent 69e68e92

fix: DEFECT-1681 告警弹窗,设备有别名则显示别名,没有则显示设备名称

@@ -187,6 +187,7 @@ export interface AlarmLogItem { @@ -187,6 +187,7 @@ export interface AlarmLogItem {
187 originatorType: number; 187 originatorType: number;
188 deviceId: string; 188 deviceId: string;
189 deviceName: string; 189 deviceName: string;
  190 + deviceAlias: string;
190 type: string; 191 type: string;
191 severity: string; 192 severity: string;
192 status: string; 193 status: string;
@@ -67,7 +67,7 @@ export function useAlarmNotify(params: UseAlarmNotifyParams = {}) { @@ -67,7 +67,7 @@ export function useAlarmNotify(params: UseAlarmNotifyParams = {}) {
67 67
68 if (items.length) { 68 if (items.length) {
69 const first = items.at(0)!; 69 const first = items.at(0)!;
70 - const { deviceName, id, severity, type } = first; 70 + const { deviceAlias, deviceName, id, severity, type } = first;
71 71
72 let key: Nullable<string> = `open-notify-${id}`; 72 let key: Nullable<string> = `open-notify-${id}`;
73 73
@@ -80,7 +80,7 @@ export function useAlarmNotify(params: UseAlarmNotifyParams = {}) { @@ -80,7 +80,7 @@ export function useAlarmNotify(params: UseAlarmNotifyParams = {}) {
80 description: h('div', {}, [ 80 description: h('div', {}, [
81 h('div', { style: { marginRight: '5px' } }, [ 81 h('div', { style: { marginRight: '5px' } }, [
82 h('span', { style: { marginRight: '5px' } }, '设备:'), 82 h('span', { style: { marginRight: '5px' } }, '设备:'),
83 - h('span', {}, `[${deviceName}]`), 83 + h('span', {}, `[${deviceAlias ?? deviceName}]`),
84 ]), 84 ]),
85 h('div', { style: { marginRight: '5px' } }, [ 85 h('div', { style: { marginRight: '5px' } }, [
86 h('span', { style: { marginRight: '5px' } }, '告警场景:'), 86 h('span', { style: { marginRight: '5px' } }, '告警场景:'),