Commit 4b636feea427bd80c17d06d4da591ac884ebd762
1 parent
f012f4b2
fix: data board socket can not echo first record
Showing
1 changed file
with
2 additions
and
2 deletions
... | ... | @@ -3,6 +3,7 @@ import { Ref, unref } from 'vue'; |
3 | 3 | import { DataBoardLayoutInfo } from '../types/type'; |
4 | 4 | import { JWT_TOKEN_KEY } from '/@/enums/cacheEnum'; |
5 | 5 | import { getAuthCache } from '/@/utils/auth'; |
6 | +import { isNullAndUnDef } from '/@/utils/is'; | |
6 | 7 | |
7 | 8 | interface SocketMessage { |
8 | 9 | tsSubCmds: SocketMessageItem[]; |
... | ... | @@ -74,10 +75,9 @@ export function useSocketConnect(dataSourceRef: Ref<DataBoardLayoutInfo[]>) { |
74 | 75 | }, |
75 | 76 | onMessage(_ws, message) { |
76 | 77 | try { |
77 | - // console.log({ dataSource: unref(dataSourceRef), cmdIdMapping }); | |
78 | 78 | const res: ResponseMessage = JSON.parse(message.data); |
79 | 79 | const { subscriptionId, data = {} } = res; |
80 | - if (!subscriptionId) return; | |
80 | + if (isNullAndUnDef(subscriptionId)) return; | |
81 | 81 | const mappingRecord = cmdIdMapping.get(subscriptionId); |
82 | 82 | if (!mappingRecord) return; |
83 | 83 | const { attribute, recordIndex, dataSourceIndex } = mappingRecord; | ... | ... |