From bf1377fc277991b8de4cd9976f7fc1c4630211b4 Mon Sep 17 00:00:00 2001 From: sunleking Date: Fri, 27 Nov 2020 21:39:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=89=E7=BB=B4=E5=AE=A2?= =?UTF-8?q?=E6=B5=81=E5=88=97=E8=BD=A6=E4=B9=98=E5=91=98=E6=9B=B4=E6=96=B0?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jl3dtrafficplan/connect/trainconnect.js | 8 ++++--- .../jl3dtrafficplan/jl3dtraffictrain.js | 24 ++++++++++++------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/jlmap3d/jl3dtrafficplan/connect/trainconnect.js b/src/jlmap3d/jl3dtrafficplan/connect/trainconnect.js index c06250299..cdfbf9ada 100644 --- a/src/jlmap3d/jl3dtrafficplan/connect/trainconnect.js +++ b/src/jlmap3d/jl3dtrafficplan/connect/trainconnect.js @@ -31,12 +31,13 @@ export function TrainConnect(trafficTrain,deviceaction,toptrain,routegroup,passe const data = JSON.parse(Response.body); if(data.type == "PFV"){ - console.log(data); - console.log(trafficTrain.trainList); + // console.log(data); + // console.log(trafficTrain.trainList); for(let k in trafficTrain.trainList){ if(trafficTrain.trainList[k].code == data.body){ updateValue(data.body); trafficTrain.updateNowTrainCode(data.body); + trafficTrain.updateNowTrunk(0+''); break; } } @@ -55,8 +56,9 @@ export function TrainConnect(trafficTrain,deviceaction,toptrain,routegroup,passe } } - if(data.type == "TRAIN_PFI_BL"){ + if(data.type == "TRAIN_PFI_BL"){ + // console.log(data); trafficTrain.updateTrainData(data.body); diff --git a/src/jlmap3d/jl3dtrafficplan/jl3dtraffictrain.js b/src/jlmap3d/jl3dtrafficplan/jl3dtraffictrain.js index 4ac6ca28a..7b1d10be7 100644 --- a/src/jlmap3d/jl3dtrafficplan/jl3dtraffictrain.js +++ b/src/jlmap3d/jl3dtrafficplan/jl3dtraffictrain.js @@ -244,7 +244,9 @@ export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap,initCode) { window.onresize = function () { passerRender.reSize(scope.dom.offsetWidth,scope.dom.offsetHeight); } - + this.updateNowTrunk = function(newTrunkNum){ + passerHuman.nowTrunk = newTrunkNum; + }; this.switchcamera = function(trunkNum){ passerHuman.nowTrunk = trunkNum; @@ -316,10 +318,14 @@ export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap,initCode) { this.updateTrainData = function(newData){ - if(scope.trainList.length > 0){ - for(let i=0;i 0){ + // for(let k in scope.trainList.length){ + let k = newData.code; + if(scope.trainList[k]){ + // console.log(newData); + // console.log(scope.trainList[k].num); + scope.trainList[k].num = scope.trainList[k].num + newData.in - newData.out; if(passerTrain.toptrain.nowcode == newData.code){ scope.humanWaitIn = getnum(newData.in,6); @@ -330,15 +336,15 @@ export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap,initCode) { // console.log("------------------"); passerHuman.initTrainRail(humanlist,scope.humanWaitIn,scope.humanWaitOut,nowLeaveDoor); - let trainDataList = getnum(scope.trainList[i].num,6); + let trainDataList = getnum(scope.trainList[k].num,6); // nowTrunk.code = newCode; scope.nowTrunk.numList = trainDataList; updateTrainNum(trainDataList); } - i = scope.trainList.length; + // i = scope.trainList.length; } - } - } + // } + // } } this.updateNowTrainCode = function(newCode){