修改从CCTV界面点击菜单退出会直接退出登录问题
This commit is contained in:
parent
b97a155b24
commit
bd0e1f1a9a
@ -8,8 +8,8 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
|
||||
this.teststomp = new StompClient();
|
||||
|
||||
// let topic = '/user/queue/simulation/jl3d/'+routegroup;
|
||||
let topic = '/user/queue/simulation/'+ routegroup +'/jl3d';
|
||||
let header = {'X-Token': getToken() };
|
||||
const topic = '/user/queue/simulation/' + routegroup + '/jl3d';
|
||||
const header = {'X-Token': getToken() };
|
||||
|
||||
socketon(topic);
|
||||
|
||||
@ -20,7 +20,7 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
|
||||
console.error('websocket订阅失败');
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
this.socketoff = function(topic) {
|
||||
scope.teststomp.unsubscribe(topic);
|
||||
@ -30,8 +30,8 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
|
||||
function callback(Response) {
|
||||
const data = JSON.parse(Response.body);
|
||||
|
||||
if(data.type == "DeviceCtrl_3D"){
|
||||
if(data.body.type == "PSD"){
|
||||
if (data.type == 'DeviceCtrl_3D') {
|
||||
if (data.body.type == 'PSD') {
|
||||
if (data.body.code == passerStation.nowStation.toppsd) {
|
||||
if (data.body.command == 'G') {
|
||||
|
||||
@ -40,7 +40,7 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
|
||||
deviceaction.top.action.timeScale = -1;
|
||||
deviceaction.top.action.play();
|
||||
} else {
|
||||
passerAi.passerout("top")
|
||||
passerAi.passerout('top');
|
||||
deviceaction.top.action.reset();
|
||||
deviceaction.top.action.time = 0;
|
||||
deviceaction.top.action.timeScale = 1;
|
||||
@ -54,7 +54,7 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
|
||||
deviceaction.down.action.timeScale = -1;
|
||||
deviceaction.down.action.play();
|
||||
} else {
|
||||
passerAi.passerout("down");
|
||||
passerAi.passerout('down');
|
||||
deviceaction.down.action.reset();
|
||||
deviceaction.down.action.time = 0;
|
||||
deviceaction.down.action.timeScale = 1;
|
||||
@ -63,14 +63,14 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
|
||||
|
||||
}
|
||||
}
|
||||
if(data.body.type == "TRAIN_DOOR"){
|
||||
if (data.body.type == 'TRAIN_DOOR') {
|
||||
if (toptrain.nowcode == data.body.trainCode) {
|
||||
|
||||
if (data.body.command == 'G') {
|
||||
closetraindoor(toptrain,data.body.code,"top");
|
||||
closetraindoor(toptrain, data.body.code, 'top');
|
||||
|
||||
} else {
|
||||
opentraindoor(toptrain,data.body.code,"top");
|
||||
opentraindoor(toptrain, data.body.code, 'top');
|
||||
|
||||
}
|
||||
|
||||
@ -78,10 +78,10 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
|
||||
if (downtrain.nowcode == data.body.trainCode) {
|
||||
// console.log(data.body);
|
||||
if (data.body.command == 'G') {
|
||||
closetraindoor(downtrain,data.body.code,"down");
|
||||
closetraindoor(downtrain, data.body.code, 'down');
|
||||
|
||||
} else {
|
||||
opentraindoor(downtrain,data.body.code,"down");
|
||||
opentraindoor(downtrain, data.body.code, 'down');
|
||||
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
|
||||
}
|
||||
}
|
||||
|
||||
if(data.type == "TrainRun_3D"){
|
||||
if (data.type == 'TrainRun_3D') {
|
||||
|
||||
for (let i = 0, leni = data.body.length; i < leni; i++) {
|
||||
if (data.body[i].section == passerStation.nowStation.topsection) {
|
||||
@ -120,29 +120,29 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
|
||||
}
|
||||
}
|
||||
}
|
||||
if(data.type == 'Simulation_Over') {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
// if(data.type == 'Simulation_Over') {
|
||||
// store.dispatch('LogOut').then(() => {
|
||||
// location.reload();
|
||||
// });
|
||||
// }
|
||||
}
|
||||
let actions;
|
||||
|
||||
function opentraindoor(train, doorcode, direct) {
|
||||
if(direct == "top"){
|
||||
if(doorcode == "1"){
|
||||
if (direct == 'top') {
|
||||
if (doorcode == '1') {
|
||||
actions = train.action.down;
|
||||
}
|
||||
|
||||
if(doorcode == "2"){
|
||||
if (doorcode == '2') {
|
||||
actions = train.action.top;
|
||||
}
|
||||
} else {
|
||||
if(doorcode == "1"){
|
||||
if (doorcode == '1') {
|
||||
actions = train.action.top;
|
||||
}
|
||||
|
||||
if(doorcode == "2"){
|
||||
if (doorcode == '2') {
|
||||
actions = train.action.down;
|
||||
}
|
||||
}
|
||||
@ -156,19 +156,19 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
|
||||
}
|
||||
function closetraindoor(train, doorcode, direct) {
|
||||
|
||||
if(direct == "top"){
|
||||
if(doorcode == "1"){
|
||||
if (direct == 'top') {
|
||||
if (doorcode == '1') {
|
||||
actions = train.action.down;
|
||||
}
|
||||
if(doorcode == "2"){
|
||||
if (doorcode == '2') {
|
||||
actions = train.action.top;
|
||||
}
|
||||
toptrain.nowcode = null;
|
||||
} else {
|
||||
if(doorcode == "1"){
|
||||
if (doorcode == '1') {
|
||||
actions = train.action.top;
|
||||
}
|
||||
if(doorcode == "2"){
|
||||
if (doorcode == '2') {
|
||||
actions = train.action.down;
|
||||
}
|
||||
downtrain.nowcode = null;
|
||||
|
Loading…
Reference in New Issue
Block a user