测试发布

This commit is contained in:
fan 2023-07-31 10:41:50 +08:00
parent 6c9ae09ae8
commit 4a36daf843

View File

@ -107,43 +107,43 @@ export async function loadLineNetDatas(app: GraphicApp) {
pathLineList.forEach((pathLine) => { pathLineList.forEach((pathLine) => {
pathLine.visible = false; pathLine.visible = false;
}); });
app.enableWsMassaging({ // app.enableWsMassaging({
wsUrl: `${getWebsocketUrl()}`, // wsUrl: `${getWebsocketUrl()}`,
token: getJwtToken() as string, // token: getJwtToken() as string,
}); // });
app.subscribe({ // app.subscribe({
destination: '/queue/lineNet', // destination: '/queue/lineNet',
messageConverter: (message: Uint8Array) => { // messageConverter: (message: Uint8Array) => {
const storage = state.WsLineNetMessage.deserialize(message); // const storage = state.WsLineNetMessage.deserialize(message);
const states: GraphicState[] = []; // const states: GraphicState[] = [];
storage.offset.forEach((item) => { // storage.offset.forEach((item) => {
states.push(new TrainLineState(item)); // states.push(new TrainLineState(item));
}); // });
return states; // return states;
}, // },
}); // });
app.subscribe({ // app.subscribe({
destination: '/queue/xian/ncc/alert', // destination: '/queue/xian/ncc/alert',
messageHandle: (message: Uint8Array) => { // messageHandle: (message: Uint8Array) => {
const storage = alert.NccAlertInfoMessage.deserialize(message); // const storage = alert.NccAlertInfoMessage.deserialize(message);
lineNetStore.setAlarmInfo(storage.messages as []); // lineNetStore.setAlarmInfo(storage.messages as []);
}, // },
}); // });
let msgNotify: null | ((props?: QNotifyUpdateOptions | undefined) => void) = // let msgNotify: null | ((props?: QNotifyUpdateOptions | undefined) => void) =
null; // null;
app.on('websocket-connect-state-change', (connected) => { // app.on('websocket-connect-state-change', (connected) => {
if (!connected && !msgNotify) { // if (!connected && !msgNotify) {
msgNotify = Notify.create({ // msgNotify = Notify.create({
type: 'negative', // type: 'negative',
timeout: 0, // timeout: 0,
position: 'top-right', // position: 'top-right',
message: '通信链接已断开!', // message: '通信链接已断开!',
}); // });
} else if (msgNotify && connected) { // } else if (msgNotify && connected) {
msgNotify(); // msgNotify();
msgNotify = null; // msgNotify = null;
} // }
}); // });
} else { } else {
app.loadGraphic([]); app.loadGraphic([]);
} }