diff --git a/src/pages/AlarmInfoList.vue b/src/pages/AlarmInfoList.vue index c6bf285..1b12774 100644 --- a/src/pages/AlarmInfoList.vue +++ b/src/pages/AlarmInfoList.vue @@ -395,7 +395,10 @@ onMounted(() => { tableRef.value.requestServerInteraction(); lineNetStore.alarmInfoListTable = tableRef.value; destinations.forEach((destination) => { - socket = webSocketConnect(destination, handler); + allSocketsAndDestinations.push({ + socket: webSocketConnect(destination, handler), + destination, + }); }); }); }); @@ -584,7 +587,10 @@ function openAlarmDialog(row: any) { }); } -let socket: StompMessagingClient | null = null; +let allSocketsAndDestinations: { + socket: StompMessagingClient; + destination: string; +}[] = []; let destinations: string[] = []; function handler(message: Uint8Array) { const storage = alert.NccAlertInfoMessage.deserialize(message); @@ -592,8 +598,8 @@ function handler(message: Uint8Array) { } onUnmounted(() => { - destinations.forEach((destination) => { - closeWebSocketConnect(socket, destination); + allSocketsAndDestinations.forEach((info) => { + closeWebSocketConnect(info.socket, info.destination); }); });