| 
@@ -23,6 +23,7 @@ import { | 
 | 
@@ -23,6 +23,7 @@ import { | 
| 
23
 | 
   TsSubCmdsItemType,
 | 
23
 | 
   TsSubCmdsItemType,
 | 
| 
24
 | 
 } from './useSocket.type';
 | 
24
 | 
 } from './useSocket.type';
 | 
| 
25
 | 
 import { ComponentPropsConfigType } from '../../index.type';
 | 
25
 | 
 import { ComponentPropsConfigType } from '../../index.type';
 | 
| 
 | 
   | 
26
 | 
+import { isNullOrUnDef } from '/@/utils/is';
 | 
| 
26
 | 
 
 | 
27
 | 
 
 | 
| 
27
 | 
 interface DeviceGroupMapType {
 | 
28
 | 
 interface DeviceGroupMapType {
 | 
| 
28
 | 
   subscriptionId: number;
 | 
29
 | 
   subscriptionId: number;
 | 
 | 
@@ -70,11 +71,14 @@ class Subscriber { | 
 | 
@@ -70,11 +71,14 @@ class Subscriber { | 
| 
70
 | 
   clearSubscriber = () => {
 | 
71
 | 
   clearSubscriber = () => {
 | 
| 
71
 | 
     this.deviceGroupMap.clear();
 | 
72
 | 
     this.deviceGroupMap.clear();
 | 
| 
72
 | 
     this.subscriptionMap.clear();
 | 
73
 | 
     this.subscriptionMap.clear();
 | 
| 
73
 | 
-    this.componentUpdateFnMap.clear();
 | 
 | 
   | 
| 
74
 | 
-    this.componentGroupUpdateFnMap.clear();
 | 
 | 
   | 
| 
75
 | 
     this.customSubscribeMap.clear();
 | 
74
 | 
     this.customSubscribeMap.clear();
 | 
| 
76
 | 
   };
 | 
75
 | 
   };
 | 
| 
77
 | 
 
 | 
76
 | 
 
 | 
| 
 | 
   | 
77
 | 
+  clearUpdateFn() {
 | 
| 
 | 
   | 
78
 | 
+    this.componentUpdateFnMap.clear();
 | 
| 
 | 
   | 
79
 | 
+    this.componentGroupUpdateFnMap.clear();
 | 
| 
 | 
   | 
80
 | 
+  }
 | 
| 
 | 
   | 
81
 | 
+
 | 
| 
78
 | 
   addSubscriber = (info: Record<'deviceId' | 'slaveDeviceId' | 'attribute' | 'uuid', string>) => {
 | 
82
 | 
   addSubscriber = (info: Record<'deviceId' | 'slaveDeviceId' | 'attribute' | 'uuid', string>) => {
 | 
| 
79
 | 
     const { deviceId, attribute, uuid } = info;
 | 
83
 | 
     const { deviceId, attribute, uuid } = info;
 | 
| 
80
 | 
     if (!this.deviceGroupMap.has(deviceId)) {
 | 
84
 | 
     if (!this.deviceGroupMap.has(deviceId)) {
 | 
 | 
@@ -188,7 +192,7 @@ class Subscriber { | 
 | 
@@ -188,7 +192,7 @@ class Subscriber { | 
| 
188
 | 
       return;
 | 
192
 | 
       return;
 | 
| 
189
 | 
     }
 | 
193
 | 
     }
 | 
| 
190
 | 
 
 | 
194
 | 
 
 | 
| 
191
 | 
-    if (message.subscriptionId) {
 | 
195
 | 
+    if (!isNullOrUnDef(message.subscriptionId)) {
 | 
| 
192
 | 
       this.triggerTsSubCmdsMessage(message);
 | 
196
 | 
       this.triggerTsSubCmdsMessage(message);
 | 
| 
193
 | 
     }
 | 
197
 | 
     }
 | 
| 
194
 | 
   }
 | 
198
 | 
   }
 | 
 | 
@@ -204,29 +208,30 @@ class Subscriber { | 
 | 
@@ -204,29 +208,30 @@ class Subscriber { | 
| 
204
 | 
     const updateGroups = this.componentGroupUpdateFnMap.get(deviceId);
 | 
208
 | 
     const updateGroups = this.componentGroupUpdateFnMap.get(deviceId);
 | 
| 
205
 | 
 
 | 
209
 | 
 
 | 
| 
206
 | 
     if (updateGroups) {
 | 
210
 | 
     if (updateGroups) {
 | 
| 
207
 | 
-      (updateGroups || []).forEach((item) => {
 | 
211
 | 
+      for (const item of updateGroups || []) {
 | 
| 
208
 | 
         const { attributes, fn } = item;
 | 
212
 | 
         const { attributes, fn } = item;
 | 
| 
209
 | 
         try {
 | 
213
 | 
         try {
 | 
| 
210
 | 
-          if (!fn) return;
 | 
214
 | 
+          if (!fn) continue;
 | 
| 
211
 | 
           fn?.(this.getGroupScopeMessage(message, attributes, deviceId), deviceId, attributes);
 | 
215
 | 
           fn?.(this.getGroupScopeMessage(message, attributes, deviceId), deviceId, attributes);
 | 
| 
212
 | 
         } catch (error) {
 | 
216
 | 
         } catch (error) {
 | 
| 
213
 | 
           console.error(`deviceId: ${deviceId}`);
 | 
217
 | 
           console.error(`deviceId: ${deviceId}`);
 | 
| 
214
 | 
           throw error;
 | 
218
 | 
           throw error;
 | 
| 
215
 | 
         }
 | 
219
 | 
         }
 | 
| 
216
 | 
-      });
 | 
220
 | 
+      }
 | 
| 
 | 
   | 
221
 | 
+      return;
 | 
| 
217
 | 
     }
 | 
222
 | 
     }
 | 
| 
218
 | 
 
 | 
223
 | 
 
 | 
| 
219
 | 
-    subscriptionGroup.forEach((item) => {
 | 
224
 | 
+    for (const item of subscriptionGroup) {
 | 
| 
220
 | 
       const { attribute, uuid } = item;
 | 
225
 | 
       const { attribute, uuid } = item;
 | 
| 
221
 | 
       const updateFn = this.componentUpdateFnMap.get(uuid);
 | 
226
 | 
       const updateFn = this.componentUpdateFnMap.get(uuid);
 | 
| 
222
 | 
       try {
 | 
227
 | 
       try {
 | 
| 
223
 | 
-        if (!updateFn) return;
 | 
228
 | 
+        if (!updateFn) continue;
 | 
| 
224
 | 
         updateFn?.(this.getScopeMessage(message, [attribute]), attribute);
 | 
229
 | 
         updateFn?.(this.getScopeMessage(message, [attribute]), attribute);
 | 
| 
225
 | 
       } catch (error) {
 | 
230
 | 
       } catch (error) {
 | 
| 
226
 | 
         console.error(`uuid: ${uuid}`);
 | 
231
 | 
         console.error(`uuid: ${uuid}`);
 | 
| 
227
 | 
         throw error;
 | 
232
 | 
         throw error;
 | 
| 
228
 | 
       }
 | 
233
 | 
       }
 | 
| 
229
 | 
-    });
 | 
234
 | 
+    }
 | 
| 
230
 | 
   }
 | 
235
 | 
   }
 | 
| 
231
 | 
 
 | 
236
 | 
 
 | 
| 
232
 | 
   triggerAlarmDataMesssage(message: ReceiveAlarmDataCmdsMessageType) {
 | 
237
 | 
   triggerAlarmDataMesssage(message: ReceiveAlarmDataCmdsMessageType) {
 | 
 | 
@@ -299,6 +304,8 @@ export const useSocket = (dataSourceRef: Ref<WidgetDataType[]>) => { | 
 | 
@@ -299,6 +304,8 @@ export const useSocket = (dataSourceRef: Ref<WidgetDataType[]>) => { | 
| 
299
 | 
 
 | 
304
 | 
 
 | 
| 
300
 | 
   onUnmounted(() => {
 | 
305
 | 
   onUnmounted(() => {
 | 
| 
301
 | 
     close();
 | 
306
 | 
     close();
 | 
| 
 | 
   | 
307
 | 
+    subscriber.clearSubscriber();
 | 
| 
 | 
   | 
308
 | 
+    subscriber.clearUpdateFn();
 | 
| 
302
 | 
   });
 | 
309
 | 
   });
 | 
| 
303
 | 
 
 | 
310
 | 
 
 | 
| 
304
 | 
   return {
 | 
311
 | 
   return {
 |