Browse Source

Pull request #9644: REPORT-126948 合并WebSocket的namespace和event FBP部分

Merge in DEC/decision-webui-dcm from ~HANS/decision-webui-dcm:research/mss-2.0 to research/mss-2.0

* commit '564c5ac01c1650bf59f7fee5a6c9c372f42c3c9d':
  REPORT-126948 合并WebSocket的namespace和event FBP部分 数据结构调整
  REPORT-126948 合并WebSocket的namespace和event FBP部分
research/mss-2.0
Hans-杨瀚 4 months ago
parent
commit
50b9a9a181
  1. 7
      src/modules/crud/decision.api.ts
  2. 2
      types/globals.d.ts

7
src/modules/crud/decision.api.ts

@ -90,8 +90,7 @@ export class DecisionApi implements Api {
} }
return new Promise((resolve, rejected) => { return new Promise((resolve, rejected) => {
this.addEventListener(editStatusEvent.OPEN, res => { this.addEventListener(editStatusEvent.OPEN, data => {
const data = JSON.parse(res.data);
if (data.errorCode) { if (data.errorCode) {
let errorMessage = ''; let errorMessage = '';
@ -111,7 +110,7 @@ export class DecisionApi implements Api {
}); });
rejected(data); rejected(data);
} else { } else {
resolve(res); resolve(data);
} }
}); });
}); });
@ -191,6 +190,6 @@ export class DecisionApi implements Api {
Dec.socket.removeListener(name); Dec.socket.removeListener(name);
} }
Dec.socket.originOn(name, callback); Dec.socket.on(name, callback);
} }
} }

2
types/globals.d.ts vendored

@ -12,7 +12,7 @@ declare const Dec: {
socket: { socket: {
connected: boolean; connected: boolean;
emit: Function; emit: Function;
originOn: Function; on: Function;
hasListeners: Function; hasListeners: Function;
removeListener: Function; removeListener: Function;
}; };

Loading…
Cancel
Save