diff --git a/src/api/jmap/map.js b/src/api/jmap/map.js index 9acfc87ba..7a625330d 100644 --- a/src/api/jmap/map.js +++ b/src/api/jmap/map.js @@ -236,3 +236,10 @@ export function getNewMapDataByMapId(mapId) { method: 'get' }); } +/** 发布地图根据id生成子系统及权限 */ +export function generateAncillaryData(mapId) { + return request({ + url: `/api/map/${mapId}/function/generate`, + method: 'post' + }); +} diff --git a/src/i18n/langs/en/display.js b/src/i18n/langs/en/display.js index 5cef3d6e5..8f157a6d9 100644 --- a/src/i18n/langs/en/display.js +++ b/src/i18n/langs/en/display.js @@ -55,6 +55,7 @@ export default { threeDimensionalView: 'Three-Dimensional View', threeDimensionalStation: 'Three-Dimensional Station', passengerflow: 'CCTV View', + trafficplantext:'Passer Planing', maintainer: 'Maintainer View', deviceView: 'DeviceView', taskOperateSuccess: 'Task Operate success', diff --git a/src/i18n/langs/zh/display.js b/src/i18n/langs/zh/display.js index a1f631698..8afa2346c 100644 --- a/src/i18n/langs/zh/display.js +++ b/src/i18n/langs/zh/display.js @@ -55,6 +55,7 @@ export default { threeDimensionalView: '数字沙盘', threeDimensionalStation: '三维车站', passengerflow: 'cctv视图', + trafficplantext:'客流规划', maintainer: '设备故障视图', deviceView: '设备视图', taskOperateSuccess: '任务操作成功', diff --git a/src/i18n/langs/zh/login.js b/src/i18n/langs/zh/login.js index bfb2fec32..fc3fdbcd7 100644 --- a/src/i18n/langs/zh/login.js +++ b/src/i18n/langs/zh/login.js @@ -9,7 +9,7 @@ export default { mobilePhoneNumberOrEmail: '手机号/邮箱', password: '密码', autoLogin: '自动登录', - perfectInformation: '请在琏课堂小程序助手,完善个人信息,设置登录密码,手机号或邮箱。', + perfectInformation: '请在玖琏科技小程序,完善个人信息,设置登录密码,手机号或邮箱。', unableToLogin: '无法登录?', login: '登录', enterTheCorrectUserName: '请输入正确的用户名', diff --git a/src/jlmap3d/edit/config/editassetconfig.js b/src/jlmap3d/edit/config/editassetconfig.js index 9f8e95bb3..fe2eff174 100644 --- a/src/jlmap3d/edit/config/editassetconfig.js +++ b/src/jlmap3d/edit/config/editassetconfig.js @@ -40,7 +40,7 @@ export let driverListConfig = [ url:'' }, { - assetname:"三站台", + assetname:"特殊站台", id:'', packageName:'', deviceType:'', @@ -98,7 +98,7 @@ export let sceneListConfig = [ url:'' }, { - assetname:"三站台", + assetname:"特殊站台", id:'', packageName:'', deviceType:'', diff --git a/src/jlmap3d/edit/connect/newgetmodels.js b/src/jlmap3d/edit/connect/newgetmodels.js index bba4b7afd..394cdd47e 100644 --- a/src/jlmap3d/edit/connect/newgetmodels.js +++ b/src/jlmap3d/edit/connect/newgetmodels.js @@ -93,9 +93,9 @@ export function getmodels(data) { assets.push(assetwaicestation); let assetstation3 = { - assetname:"三站台", + assetname:"特殊站台", id:"6", - packageName:"沙盘驾驶三站台", + packageName:"沙盘驾驶特殊站台", deviceType:"SimulationStation", type:"stationThree", url:JL3D_LOCAL_STATIC+"/MODEL/station/station3.FBX" diff --git a/src/jlmap3d/jl3dtrafficplan/connect/stationconnect.js b/src/jlmap3d/jl3dtrafficplan/connect/stationconnect.js new file mode 100644 index 000000000..0dbbfcfe9 --- /dev/null +++ b/src/jlmap3d/jl3dtrafficplan/connect/stationconnect.js @@ -0,0 +1,249 @@ +import StompClient from '@/utils/sock'; +import { getBaseUrl } from '@/utils/baseUrl' +import { getToken } from '@/utils/auth'; +import store from '@/store/index_APP_TARGET'; + +// 定于仿真socket接口 +export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passerStation,passerAi,jl3d) { + const scope = this; + this.teststomp = new StompClient(); + let start = true; + let topic = '/user/queue/simulation/jl3d/'+routegroup; + let header = {'X-Token': getToken() }; + let topswitch = false; + let downswitch = false; + socketon(topic); + + function socketon(topic) { + try { + scope.teststomp.subscribe(topic, callback, header); + } catch (error) { + console.error('websocket订阅失败'); + } + + }; + + this.socketoff = function(topic) { + scope.teststomp.unsubscribe(topic); + }; + + // 仿真socket接口回调函数 + function callback(Response) { + const data = JSON.parse(Response.body); + + // console.log(data); + /** 站台客流当前人数信息 */ + if(data.type == "STAND_PFI"){ + + let newStandData = data.body; + let count = 0; + for(let j=0;j { + location.reload(); + }); + } + } + let actions; + + function opentraindoor(train,doorcode,direct){ + // console.log(train); + if(direct == "top"){ + // if(doorcode == "1"){ + // actions = train.action.down; + // } + // + // if(doorcode == "2"){ + actions = train.action.top; + // } + }else{ + // if(doorcode == "1"){ + actions = train.action.top; + // } + // + // if(doorcode == "2"){ + // actions = train.action.down; + // } + } + + for(let an=actions.length-1;an>=0;an--){ + actions[an].reset(); + actions[an].time = 0; + actions[an].timeScale = 1; + actions[an].play(); + } + } + function closetraindoor(train,doorcode,direct){ + + if(direct == "top"){ + // if(doorcode == "1"){ + // actions = train.action.down; + // } + // if(doorcode == "2"){ + actions = train.action.top; + // } + toptrain.nowcode = null; + }else{ + // if(doorcode == "1"){ + actions = train.action.top; + // } + // if(doorcode == "2"){ + // actions = train.action.down; + // } + downtrain.nowcode = null; + } + + for(let an=actions.length-1;an>=0;an--){ + actions[an].reset(); + actions[an].time = actions[an]._clip.duration; + actions[an].timeScale = -1; + actions[an].play(); + } + + } +} diff --git a/src/jlmap3d/jl3dtrafficplan/connect/trainconnect.js b/src/jlmap3d/jl3dtrafficplan/connect/trainconnect.js new file mode 100644 index 000000000..f7558989f --- /dev/null +++ b/src/jlmap3d/jl3dtrafficplan/connect/trainconnect.js @@ -0,0 +1,157 @@ +import StompClient from '@/utils/sock'; +import { getBaseUrl } from '@/utils/baseUrl' +import { getToken } from '@/utils/auth'; +import store from '@/store/index_APP_TARGET'; + +// 定于仿真socket接口 +export function TrainConnect(trafficTrain,deviceaction,toptrain,routegroup,passerAi) { + const scope = this; + this.teststomp = new StompClient(); + + let topic = '/user/queue/simulation/jl3d/'+routegroup; + let header = {'X-Token': getToken() }; + + socketon(topic); + + function socketon(topic) { + try { + scope.teststomp.subscribe(topic, callback, header); + } catch (error) { + console.error('websocket订阅失败'); + } + + }; + + this.socketoff = function(topic) { + scope.teststomp.unsubscribe(topic); + }; + + // 仿真socket接口回调函数 + function callback(Response) { + const data = JSON.parse(Response.body); + + + if(data.type == "BeAbout2Arrive_3D"){ + if(toptrain.nowcode == data.body.groupNumber){ + console.log(data); + } + + } + if(data.type == "TRAIN_PFI_BL"){ + + trafficTrain.updateTrainData(data.body); + + + // if(toptrain.nowcode == data.body.code){ + // console.log(data); + // //根据上下车人数创建人 + // jl3d.updateNowLeaveData("top",data.body.out); + // } + // if(downtrain.nowcode == data.body.code){ + // console.log(data); + // //根据上下车人数创建人 + // jl3d.updateNowLeaveData("down",data.body.out); + // } + } + if(data.type == "TRAIN_PFI_NUM"){ + + trafficTrain.trainList = []; + // trafficTrain.trainList = data.body; + + for(let i=0;i { + location.reload(); + }); + } + } + let actions; + + function opentraindoor(train,doorcode,direct){ + + if(direct == "top"){ + if(doorcode == "1"){ + actions = train.action.down; + } + + if(doorcode == "2"){ + actions = train.action.top; + } + }else{ + if(doorcode == "1"){ + actions = train.action.top; + } + + if(doorcode == "2"){ + actions = train.action.down; + } + } + for(let an=actions.length-1;an>=0;an--){ + actions[an].reset(); + actions[an].time = 0; + actions[an].timeScale = 1; + actions[an].play(); + } + } + function closetraindoor(train,doorcode,direct){ + + if(direct == "top"){ + if(doorcode == "1"){ + actions = train.action.down; + } + if(doorcode == "2"){ + actions = train.action.top; + } + }else{ + if(doorcode == "1"){ + actions = train.action.top; + } + if(doorcode == "2"){ + actions = train.action.down; + } + } + + for(let an=actions.length-1;an>=0;an--){ + actions[an].reset(); + actions[an].time = actions[an]._clip.duration; + actions[an].timeScale = -1; + actions[an].play(); + } + + } +} diff --git a/src/jlmap3d/jl3dtrafficplan/jl3dtrafficplan.js b/src/jlmap3d/jl3dtrafficplan/jl3dtrafficplan.js new file mode 100644 index 000000000..8e2a8ea83 --- /dev/null +++ b/src/jlmap3d/jl3dtrafficplan/jl3dtrafficplan.js @@ -0,0 +1,439 @@ +import { Staticmodel } from '@/jlmap3d/jl3dtrafficplan/loader/stationconfig.js'; +//静态资源文件路劲 +import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js'; +//loader +import { FBXLoader } from '@/jlmap3d/main/loaders/FBXLoader'; +//轨道视角控制 +import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls'; +//模型管理器 +import { ModelManager } from '@/jlmap3d/jl3dtrafficplan/loader/loader.js'; +//骨骼动画模型辅助工具 +import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.js'; +//获取信息接口 +import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata'; +//cctv站台对象 +import { PasserStation } from '@/jlmap3d/jl3dtrafficplan/model/passerstation.js'; +//cctv检票机对象 +import { PasserCheckDoor } from '@/jlmap3d/jl3dtrafficplan/model/passercheckdoor.js'; +//cctv列车对象 +import { PasserTrain } from '@/jlmap3d/jl3dtrafficplan/model/passertrain.js'; +//cctv行人对象 +import { PasserHuman } from '@/jlmap3d/jl3dtrafficplan/model/passerhuman.js'; +//cctv渲染器 +import { PasserRender } from '@/jlmap3d/jl3dpassflow/passerrender/passerrender.js'; +//cctv行人ai +import { PasserAi } from '@/jlmap3d/jl3dtrafficplan/passerai/passerai.js'; +//行人寻路相关工具 +import { ZoneManager } from '@/jlmap3d/jl3dtrafficplan/model/zonemanager.js'; +import { PathFinder } from '@/jlmap3d/jl3dtrafficplan/passerai/pathfinder.js'; +//cctv通信工具 +import { PassflowConnect } from '@/jlmap3d/jl3dtrafficplan/connect/stationconnect.js'; + +import StompClient from '@/utils/sock'; +import store from '@/store/index_APP_TARGET'; +// import { Loading } from 'element-ui'; +import {Stats} from '@/jlmap3d/main/lib/stats.min.js'; + +//动画播放相关 +let clock = new THREE.Clock(); +let delta; + +let scene,camerass,renderer; + +let aiswitch = 0; +//动画组 +let mixers = []; +//车站摄像机模型 +let monitor; + +//寻路相关对象 +let passerZone = new ZoneManager(); +let pathFinder = new PathFinder(); +let path; + +//设备动画action组 +let deviceaction = []; +//控制帧率的webworker线程 +let passerWebWork = new Worker(JL3D_LOCAL_STATIC+"/workertest/trafficplan/trafficstation.js"); + +//老版本临时ai控制 +let olddataai = false; + +export function Jl3dTrafficPlan(dom,skinCode,routegroup,viewMap) { + + // let stats = new Stats(); + // dom.appendChild( stats.dom ); + + let scope = this; + + this.dom = dom; + this.nowcode = null; + this.animateswitch = false; + this.signallights = []; + this.mixers = []; + this.showmodel = null; + + this.allStationData = []; + this.humanWaitTop = 0; + this.humanWaitDown = 0; + this.humanInSpeed = 0; + this.humanOutSpeed = 0; + let waitForCreatIn = []; + let waitForCreatOutTop = []; + let waitForCreatOutDown = []; + //定义相机 + camerass = new THREE.PerspectiveCamera(70, dom.offsetWidth / dom.offsetHeight, 0.01, 1000); + camerass.position.set(0, 80, 40); + camerass.aspect = dom.offsetWidth / dom.offsetHeight; + camerass.updateProjectionMatrix(); + + //定义场景(渲染容器) + scene = new THREE.Scene(); + scene.background = new THREE.Color(0xa0a0a0); + + let passerRender = new PasserRender(viewMap); + passerRender.initView(dom,scene,camerass); + + //定义全局光 + let ambientLight = new THREE.AmbientLight(0xffffff, 1.3); + scene.add(ambientLight); + + let controls = new THREE.OrbitControls(camerass, dom); + controls.maxPolarAngle = Math.PI / 2; + controls.minPolarangle = Math.PI / 5; + controls.maxDistance = 800; + controls.screenSpacePanning = true; + controls.update(); + this.selectmodel = null; + + // let mouse = new THREE.Vector2(); + let raycaster = new THREE.Raycaster(); + + //进站运动中乘客 + let humanlist = new THREE.Group(); + //上行等待上车乘客 + let topWaitPassers = new THREE.Group(); + //下行等待上车乘客 + let downWaitPassers = new THREE.Group(); + //出站乘客 + let outStationPassers = new THREE.Group(); + + let passerHuman = new PasserHuman(); + + let passerAi = new PasserAi(passerZone,pathFinder); + + this.anime = null; + + this.modelmanager = new ModelManager(); + // let loadingInstance = Loading.service({ fullscreen: true }); + + let stationlist = []; + let socktest = null; + let passerStation = new PasserStation(); + let passerCheckDoor = new PasserCheckDoor(); + let passerTrain = new PasserTrain(); + + // document.addEventListener( "mousedown", onselect, false ); + + getPublish3dMapDetail(skinCode).then(netdata3d => { + passerStation.loadMaterial(netdata3d); + this.modelmanager.loadpromise(Staticmodel, scope.mixers,"2").then(function (data) { + // console.log(scope.modelmanager.station.mesh.getObjectByName("top")); + // let testtop = scope.modelmanager.station.mesh.getObjectByName("down"); + // for(let i=0;i { + + scope.switchviews('freeview'); + passerHuman.initHumans(scope.modelmanager.man1.mesh,scope.modelmanager.man2.mesh); + scene.add(humanlist); + scene.add(topWaitPassers); + scene.add(downWaitPassers); + scene.add(outStationPassers); + + passerStation.initStationList(netdata.data.stationList,netdata.data.stationStandList,netdata.data.psdList); + socktest = new PassflowConnect(deviceaction,passerTrain.toptrain,passerTrain.downtrain,routegroup,passerStation,passerAi,scope); + + store.dispatch('app/animationsClose'); + + let checkobject = setInterval(function(){ + + clearInterval(checkobject); + + //进站控制 + startWorker(); + passerWebWork.postMessage(["on"]); + },1000); + }); + + animate(); + }) + }); + + this.initTrafficStart = function(){ + + scope.humanWaitTop = passerStation.nowStation.toppassers; + scope.humanWaitDown = passerStation.nowStation.downpassers; + scope.humanInSpeed = 0; + scope.humanOutSpeed = 0; + passerHuman.speed = scope.humanInSpeed; + passerAi.initPasser(humanlist,topWaitPassers,downWaitPassers,passerHuman,scope); + + updatePasserData(humanlist.children.length,topWaitPassers.children.length,downWaitPassers.children.length,outStationPassers.children.length,passerHuman.speed); + } + + this.changestation = function(stationname){ + passerStation.changestation(stationname); + scope.humanWaitTop = passerStation.nowStation.toppassers; + scope.humanWaitDown = passerStation.nowStation.downpassers; + passerHuman.speed = passerStation.nowStation.topspeed + passerStation.nowStation.downspeed; + updatePasserData(humanlist.children.length,topWaitPassers.children.length,downWaitPassers.children.length,outStationPassers.children.length,passerHuman.speed); + + scope.resetscene(); + } + + this.updateNowStationData = function(){ + for(let i=0;i=0;an--){ + passerTrain.toptrain.action.top[an].reset(); + passerTrain.toptrain.action.top[an].time = passerTrain.toptrain.action.top[an]._clip.duration; + passerTrain.toptrain.action.top[an].timeScale = -1; + passerTrain.toptrain.action.top[an].play(); + } + for(let an=passerTrain.toptrain.action.down.length-1;an>=0;an--){ + passerTrain.toptrain.action.down[an].reset(); + passerTrain.toptrain.action.down[an].time = passerTrain.toptrain.action.down[an]._clip.duration; + passerTrain.toptrain.action.down[an].timeScale = -1; + passerTrain.toptrain.action.down[an].play(); + } + // for(let an=actions.length-1;an>=0;an--){ + // actions[an].reset(); + // actions[an].time = actions[an]._clip.duration; + // actions[an].timeScale = -1; + // actions[an].play(); + // } + setTimeout(function(){ + passerAi.initPasser(humanlist,topWaitPassers,downWaitPassers,passerHuman,scope); + aiswitch = 0; + }, 2000); + + } + + function startWorker(){ + + let updateaianimate = setInterval( + function(){ + // console.log("?"); + if(aiswitch == 0){ + updatePasserData(humanlist.children.length,topWaitPassers.children.length,downWaitPassers.children.length,outStationPassers.children.length,passerHuman.speed); + + passerHuman.moveAnimateUpdate(humanlist,topWaitPassers,downWaitPassers,outStationPassers,passerHuman); + passerAi.aiUpdate(humanlist,topWaitPassers,downWaitPassers,outStationPassers,passerHuman,passerCheckDoor,deviceaction); + // passerZone.zoneActionCheck(humanlist,passerHuman,passerCheckDoor,deviceaction); + delta = clock.getDelta(); + + for(let i=mixers.length-1;i>=0;i--){ + if(mixers[i]._actions[0].isRunning()){ + mixers[i].update( delta ); + } + } + for(let i=topWaitPassers.children.length-1;i>=0;i--){ + if(topWaitPassers.children[i].mixer._actions[0].isRunning()){ + topWaitPassers.children[i].mixer.update( delta ); + } + } + for(let i=downWaitPassers.children.length-1;i>=0;i--){ + if(downWaitPassers.children[i].mixer._actions[0].isRunning()){ + downWaitPassers.children[i].mixer.update( delta ); + } + } + for(let i=outStationPassers.children.length-1;i>=0;i--){ + if(outStationPassers.children[i].mixer._actions[0].isRunning()){ + outStationPassers.children[i].mixer.update( delta ); + } + } + for(let i=humanlist.children.length-1;i>=0;i--){ + if(humanlist.children[i].mixer._actions[0].isRunning()){ + humanlist.children[i].mixer.update( delta ); + } + } + } + } + , 100); + + passerWebWork.onmessage = function (event) { + if(aiswitch == 0){ + // console.log(humanlist.children.length); + + this.allStationData = []; + if(waitForCreatIn.length>0){ + let direct = Math.floor(Math.random()*(3-1+1))+1; + //1--top + //2-- down + if(direct == 1){ + passerHuman.newHumanCreate(humanlist,passerZone.getzoneposition("enter1"),0,waitForCreatIn[0].overGoal); + }else{ + passerHuman.newHumanCreate(humanlist,passerZone.getzoneposition("enter2"),0,waitForCreatIn[0].overGoal); + } + waitForCreatIn.shift(); + } + } + }; + } + // + // function onselect(event){ + // if(event.button == '0'){ + // + // //定义光线 + // let raycaster = new THREE.Raycaster(); + // //定义平面鼠标点击坐标 + // let mouse = new THREE.Vector2(); + // mouse.x = (event.clientX / scope.dom.offsetWidth) * 2 - 1; + // mouse.y = -(event.clientY / scope.dom.offsetHeight) * 2 + 1; + // + // raycaster.setFromCamera( mouse, camerass ); + // + // let intersects = raycaster.intersectObject(scope.modelmanager.station.mesh,true); + // console.log(intersects[0].point); + // } + // } + + + //循环渲染函数 + function animate() { + passerRender.update(); + + // if(passerRender.state == "freeview"){ + controls.update(); + // } + // delta = clock.getDelta(); + requestAnimationFrame(animate); + + } + + window.onresize = function () { + passerRender.reSize(scope.dom.offsetWidth,scope.dom.offsetHeight); + } + + this.switchviews = function(viewmode){ + passerRender.changeRenderMode(viewmode); + } + + function getnum(num,pnum){ + let re = []; + let base = Math.floor(num/pnum); + let reset = num%pnum; + for(let i=0;i { + scope.switchviews('freeview'); + passerHuman.initHumans(scope.modelmanager.man1.mesh,scope.modelmanager.man2.mesh); + scene.add(humanlist); + + socktest = new TrainConnect(scope,deviceaction,passerTrain.toptrain,routegroup,passerAi); + + store.dispatch('app/animationsClose'); + + let checkobject = setInterval(function(){ + + clearInterval(checkobject); + //进站控制 + startWorker(); + passerWebWork.postMessage("on"); + animate(); + },1000); + }); + + + }) + + + + this.resetscene = function(){ + + // humanlist = new THREE.Group(); + for(let j=0; j=0;an--){ + passerTrain.toptrain.action.top[an].reset(); + passerTrain.toptrain.action.top[an].time = passerTrain.toptrain.action.top[an]._clip.duration; + passerTrain.toptrain.action.top[an].timeScale = -1; + passerTrain.toptrain.action.top[an].play(); + } + + setTimeout(function(){ + passerHuman.setNowTrunkPasser(humanlist); + aiswitch = 0; + }, 2000); + + } + + function startWorker(){ + passerHuman.setNowTrunkPasser(humanlist,0,0); + let updateaianimate = setInterval( + function(){ + // console.log("?"); + if(aiswitch == 0){ + passerHuman.moveAnimateUpdate(humanlist,passerHuman); + // passerAi.aiUpdate(humanlist,passerHuman,passerCheckDoor,deviceaction); + + delta = clock.getDelta(); + // console.log(mixers); + for(let i=mixers.length-1;i>=0;i--){ + if(mixers[i]._actions[0].isRunning()){ + // console.log(mixers[i]); + mixers[i].update( delta ); + } + } + for(let i=humanlist.children.length-1;i>=0;i--){ + if(humanlist.children[i].mixer._actions[0].isRunning()){ + humanlist.children[i].mixer.update( delta ); + } + } + + } + } + , 100); + + } + + + //循环渲染函数 + function animate() { + passerRender.update(); + + if(passerRender.state == "freeview"){ + controls.update(); + } + // delta = clock.getDelta(); + requestAnimationFrame(animate); + + } + + window.onresize = function () { + passerRender.reSize(scope.dom.offsetWidth,scope.dom.offsetHeight); + } + + this.switchcamera = function(trunkNum){ + + passerHuman.nowTrunk = trunkNum; + passerHuman.resetPasser(humanlist); + + + + passerHuman.setNowTrunkPasser(humanlist,scope.nowTrunk.numList[trunkNum].num,trunkNum); + switch (trunkNum) { + case '0': + camerass.position.x = 4.78; + camerass.position.y = 5.076; + camerass.position.z = -0.016; + controls.target = new THREE.Vector3(camerass.position.x+0.5,camerass.position.y-0.1,camerass.position.z); + controls.update(); + break; + case '1': + camerass.position.x = 26.00; + camerass.position.y = 5.076; + camerass.position.z = -0.016; + controls.target = new THREE.Vector3(camerass.position.x+0.5,camerass.position.y-0.1,camerass.position.z); + controls.update(); + break; + case '2': + camerass.position.x = 48.71; + camerass.position.y = 5.076; + camerass.position.z = -0.016; + controls.target = new THREE.Vector3(camerass.position.x+0.5,camerass.position.y-0.1,camerass.position.z); + controls.update(); + break; + case '3': + camerass.position.x = 70.01; + camerass.position.y = 5.076; + camerass.position.z = -0.016; + controls.target = new THREE.Vector3(camerass.position.x+0.5,camerass.position.y-0.1,camerass.position.z); + controls.update(); + break; + case '4': + camerass.position.x = 92.06; + camerass.position.y = 5.076; + camerass.position.z = -0.016; + controls.target = new THREE.Vector3(camerass.position.x+0.5,camerass.position.y-0.1,camerass.position.z); + controls.update(); + break; + case '5': + camerass.position.x = 107.30; + camerass.position.y = 5.076; + camerass.position.z = -0.016; + controls.target = new THREE.Vector3(camerass.position.x+0.5,camerass.position.y-0.1,camerass.position.z); + controls.update(); + break; + default: + } + } + + this.getTrainList = function(){ + return scope.trainList; + } + + let nowLeaveDoor = null; + this.updatePasserMove = function(doorData){ + nowLeaveDoor = doorData.doorCode; + // console.log(doorData); + } + + + this.updateTrainData = function(newData){ + if(scope.trainList.length > 0){ + for(let i=0;i=0;an--){ + passerTrain.toptrain.action.top[an].reset(); + passerTrain.toptrain.action.top[an].time = passerTrain.toptrain.action.top[an]._clip.duration; + passerTrain.toptrain.action.top[an].timeScale = -1; + passerTrain.toptrain.action.top[an].play(); + } + + for(let an=passerTrain.toptrain.action.top.length-1;an>=0;an--){ + passerTrain.toptrain.action.down[an].reset(); + passerTrain.toptrain.action.down[an].time = passerTrain.toptrain.action.top[an]._clip.duration; + passerTrain.toptrain.action.down[an].timeScale = -1; + passerTrain.toptrain.action.down[an].play(); + } + + if(scope.trainList[i].open != "0"){ + if(scope.trainList[i].doorCode == "1"){ + for(let an=passerTrain.toptrain.action.top.length-1;an>=0;an--){ + passerTrain.toptrain.action.top[an].reset(); + passerTrain.toptrain.action.top[an].time = 0; + passerTrain.toptrain.action.top[an].timeScale = 1; + passerTrain.toptrain.action.top[an].play(); + } + }else{ + for(let an=passerTrain.toptrain.action.top.length-1;an>=0;an--){ + passerTrain.toptrain.action.down[an].reset(); + passerTrain.toptrain.action.down[an].time = 0; + passerTrain.toptrain.action.down[an].timeScale = 1; + passerTrain.toptrain.action.down[an].play(); + } + } + } + + updateTrainNum(trainDataList); + i = scope.trainList.length; + } + } + + + } + + this.switchviews = function(viewmode){ + passerRender.changeRenderMode(viewmode); + } + + function getnum(num,pnum){ + let re = []; + let base = Math.floor(num/pnum); + let reset = num%pnum; + for(let i=0;i { + console.log("success"); + resolve("success"); //['成功了', 'success'] + }).catch((error) => { + //console.log(error); + }); + + }); + } + +} +//fbx模型加载 +function fbxpromise(asset,mixers,model){ + return new Promise(function(resolve, reject){ + var loader = new THREE.FBXLoader(); + + if( mode == "2"){ + + loader.load( asset.url, function ( object ) { + + model.mesh = object; + + resolve(asset.deviceType); + } ); + + }else{ + loader.load( BASE_ASSET_API+asset.url, function ( object ) { + + //列车模型子物体重新排序 + if(asset.type == "cctvTrain"){ + // let mixer = new THREE.AnimationMixer( object ); + let realtrain = new THREE.Group(); + for(let j=6;j>0;j--){ + let name = "c"+j; + for(let i=0;i=1){ + outStationPassers.children[i].progress = 1; + outStationPassers.children[i].action.stop(); + outStationPassers.children[i].status = 0; + + if(outStationPassers.children[i].stage == 8){ + passerHuman.uncache(outStationPassers.children[i]); + outStationPassers.remove(outStationPassers.children[i]); + i--; + }else if(outStationPassers.children[i].stage == 7){ + outStationPassers.children[i].stage = 8; + } + else if(outStationPassers.children[i].stage == 5){ + + outStationPassers.children[i].stage = 7; + + } + }else{ + //根据动画进度获取动画轨迹上点 + // console.log(i); + // console.log(humanlist.children[i].runrail); + // console.log(humanlist.children[i].progress); + let point = outStationPassers.children[i].runrail.getPointAt(outStationPassers.children[i].progress); + + //更新模型坐标 + outStationPassers.children[i].position.x = point.x; + outStationPassers.children[i].position.y = point.y; + outStationPassers.children[i].position.z = point.z; + if((outStationPassers.children[i].progress+0.001)<1){ + let tangent = outStationPassers.children[i].runrail.getPointAt(outStationPassers.children[i].progress+0.001); + outStationPassers.children[i].lookAt(new THREE.Vector3(tangent.x,outStationPassers.children[i].position.y,tangent.z)); + } + + outStationPassers.children[i].progress += outStationPassers.children[i].speed; + point = null; + + } + } + } + + for(let i=0;i=1){ + topWaitPassers.children[i].progress = 1; + topWaitPassers.children[i].action.stop(); + topWaitPassers.children[i].status = 0; + + if(topWaitPassers.children[i].stage == 4){ + passerHuman.uncache(topWaitPassers.children[i]); + topWaitPassers.remove(topWaitPassers.children[i]); + i--; + } + }else{ + //根据动画进度获取动画轨迹上点 + // console.log(i); + // console.log(humanlist.children[i].runrail); + // console.log(humanlist.children[i].progress); + let point = topWaitPassers.children[i].runrail.getPointAt(topWaitPassers.children[i].progress); + + //更新模型坐标 + topWaitPassers.children[i].position.x = point.x; + topWaitPassers.children[i].position.y = point.y; + topWaitPassers.children[i].position.z = point.z; + if((topWaitPassers.children[i].progress+0.001)<1){ + let tangent = topWaitPassers.children[i].runrail.getPointAt(topWaitPassers.children[i].progress+0.001); + topWaitPassers.children[i].lookAt(new THREE.Vector3(tangent.x,topWaitPassers.children[i].position.y,tangent.z)); + } + + topWaitPassers.children[i].progress += topWaitPassers.children[i].speed; + point = null; + + } + } + } + + for(let i=0;i=1){ + downWaitPassers.children[i].progress = 1; + downWaitPassers.children[i].action.stop(); + downWaitPassers.children[i].status = 0; + if(downWaitPassers.children[i].stage == 4){ + passerHuman.uncache(downWaitPassers.children[i]); + downWaitPassers.remove(downWaitPassers.children[i]); + i--; + } + }else{ + //根据动画进度获取动画轨迹上点 + // console.log(i); + // console.log(humanlist.children[i].runrail); + // console.log(humanlist.children[i].progress); + let point = downWaitPassers.children[i].runrail.getPointAt(downWaitPassers.children[i].progress); + + //更新模型坐标 + downWaitPassers.children[i].position.x = point.x; + downWaitPassers.children[i].position.y = point.y; + downWaitPassers.children[i].position.z = point.z; + if((downWaitPassers.children[i].progress+0.001)<1){ + let tangent = downWaitPassers.children[i].runrail.getPointAt(downWaitPassers.children[i].progress+0.001); + downWaitPassers.children[i].lookAt(new THREE.Vector3(tangent.x,downWaitPassers.children[i].position.y,tangent.z)); + } + + downWaitPassers.children[i].progress += downWaitPassers.children[i].speed; + point = null; + + } + } + } + + for(let i=0;i=1){ + //更新模型坐标 + if(humanlist.children[i].status == 1){ + + + humanlist.children[i].progress = 1; + humanlist.children[i].action.stop(); + humanlist.children[i].status = 0; + if(humanlist.children[i].stage == 3){ + + humanlist.children[i].stage = 4; + if(humanlist.children[i].direct == "top"){ + topWaitPassers.add(humanlist.children[i]); + i--; + }else if(humanlist.children[i].direct == "down"){ + downWaitPassers.add(humanlist.children[i]); + i--; + } + + }else if(humanlist.children[i].stage == 2){ + humanlist.children[i].stage = 3; + + }else if(humanlist.children[i].stage == 1){ + + + humanlist.children[i].stage = 2; + + }else if(humanlist.children[i].stage == 0){ + // // console.log(humans[i].doors); + // zhajiin[humanlist.children[i].doors].waiting = 0; + humanlist.children[i].stage = 1; + } + + } + + }else{ + //根据动画进度获取动画轨迹上点 + // console.log(i); + // console.log(humanlist.children[i].runrail); + // console.log(humanlist.children[i].progress); + let point = humanlist.children[i].runrail.getPointAt(humanlist.children[i].progress); + + //更新模型坐标 + humanlist.children[i].position.x = point.x; + humanlist.children[i].position.y = point.y; + humanlist.children[i].position.z = point.z; + if((humanlist.children[i].progress+0.001)<1){ + let tangent = humanlist.children[i].runrail.getPointAt(humanlist.children[i].progress+0.001); + humanlist.children[i].lookAt(new THREE.Vector3(tangent.x,humanlist.children[i].position.y,tangent.z)); + } + + humanlist.children[i].progress += humanlist.children[i].speed; + point = null; + + } + } + } + } + //离开车站释放缓存 + this.uncache = function(uncachemodel){ + if(uncachemodel){ + uncachemodel.mixer.uncacheAction(); + uncachemodel.traverse( function ( child ) { + if ( child.isMesh ) { + child.geometry.dispose(); + child.material.dispose(); + } + } ); + } + } +} diff --git a/src/jlmap3d/jl3dtrafficplan/model/passerstation.js b/src/jlmap3d/jl3dtrafficplan/model/passerstation.js new file mode 100644 index 000000000..c02d4134f --- /dev/null +++ b/src/jlmap3d/jl3dtrafficplan/model/passerstation.js @@ -0,0 +1,186 @@ +import {Materialload} from '@/jlmap3d/main/loaders/Materialload.js'; + +export function PasserStation() { + var scope = this; + this.stationMesh = null; + this.stationleft = []; + this.stationright = []; + //替换材质组(站台的) + this.stationtexture = []; + + this.stationlist = []; + + this.nowStation = ""; + + for(let i=0;i<22;i++){ + let sl = { + id:"left"+i, + status:0, + waiting:0 + } + scope.stationleft.push(sl); + } + + for(let i=0;i<22;i++){ + let sr = { + id:"right"+i, + status:0, + waiting:0 + } + scope.stationright.push(sr); + } + //初始化车站模型动画 + this.initStationAnimation = function( object,mixers ,deviceaction ,scene){ + let mixer = new THREE.AnimationMixer( object ,mixers ,deviceaction ,scene); + + let newclip = object.animations[ 0 ]; + for(let j=0;j0){ + let stationobject = { + code : list[k][0].stationCode, + name : k, + topspeed:0, + downspeed:0, + toppassers:0, + downpassers:0, + toppsd:null, + downpsd:null, + topsection:null, + downsection:null, + topstand:null, + downstand:null + }; + if(list[k][0].position.y=1){ + //更新模型坐标 + humanlist.children[i].progress = 1; + humanlist.children[i].action.stop(); + if(humanlist.children[i].status == 1){ + + + + waitGroup.add(humanlist.children[i]); + } + + }else{ + //根据动画进度获取动画轨迹上点 + // console.log(i); + // console.log(humanlist.children[i].runrail); + // console.log(humanlist.children[i].progress); + let point = humanlist.children[i].runrail.getPointAt(humanlist.children[i].progress); + + //更新模型坐标 + humanlist.children[i].position.x = point.x; + humanlist.children[i].position.y = point.y; + humanlist.children[i].position.z = point.z; + if((humanlist.children[i].progress+0.001)<1){ + let tangent = humanlist.children[i].runrail.getPointAt(humanlist.children[i].progress+0.001); + humanlist.children[i].lookAt(new THREE.Vector3(tangent.x,humanlist.children[i].position.y,tangent.z)); + } + + humanlist.children[i].progress += humanlist.children[i].speed; + point = null; + + } + } + } + + this.resetPasser = function(humanlist){ + let passerlength = humanlist.children.length; + for(let i=0;i y ? (x > c ? x : c) : (y > c ? y : c); + // var min = x < y ? (x < c ? x : c) : (y < c ? y : c); + + function getnum(num,pnum){ + let re = []; + let base = Math.floor(num/pnum); + let reset = num%pnum; + for(let i=0;i Math.round(Math.random()*(max-min))+min; + + this.getDoorRandomPos = function(trunkNum,direct){ + let newPos = null; + let doorNum = rand(0,2); + + if(direct == "1"){ + newPos = scope.trunk[trunkNum].leftdoor[doorNum]; + }else if(direct == "2"){ + newPos = scope.trunk[trunkNum].rightdoor[doorNum]; + } + return newPos; + } + + this.getTrunkRandomPos = function(index){ + let newPos = new THREE.Vector3( + scope.trunk[index].position.x+RandomNum(-11,11), + 1.22, + scope.trunk[index].position.z+RandomNum(-1.28,1.28)); + + return newPos; + } + + function RandomNum(Min, Max) { + var Range = Max - Min; + var Rand = Math.random(); + var num = Min + Rand * Range; //四舍五入 + return num; + } +} diff --git a/src/jlmap3d/jl3dtrafficplan/model/zonemanager.js b/src/jlmap3d/jl3dtrafficplan/model/zonemanager.js new file mode 100644 index 000000000..912057e35 --- /dev/null +++ b/src/jlmap3d/jl3dtrafficplan/model/zonemanager.js @@ -0,0 +1,331 @@ +import { ZoneModel } from '@/jlmap3d/jl3dpassflow/model/zonemodel.js'; +//进站区域1 +let enter1 = { + code : '001', + name : "enter1", + type : "normal", + stage : "0", + randompoint : new THREE.Vector3(26.6,9.8,-2.7), + railpoints : [ + new THREE.Vector3(34,9.8,-6), + new THREE.Vector3(32,9.8,-6) + ] +}; +//进站区域2 +let enter2 = { + code : '002', + name : "enter2", + type : "normal", + stage : "0", + randompoint : new THREE.Vector3(27,9.8,16), + railpoints : [ + new THREE.Vector3(34,9.8,31.5), + new THREE.Vector3(32,9.8,31.5) + ] +}; +//安检区域 +let security = { + code : '003', + name : "security", + type : "device", + stage : "1", + randompoint : new THREE.Vector3(8.8,9.8,18), + railpoints : [ + new THREE.Vector3(20.5,9.8,18), + new THREE.Vector3(21,9.8,21) + ] +}; +//进方向闸机区域 +let entergate = { + code : '004', + name : "entergate", + type : "device", + stage : "2", + randompoint : new THREE.Vector3(2.3,9.8,13), + railpoints : [ + new THREE.Vector3(6.3,9.8,18.1), + new THREE.Vector3(4.8,9.8,18.1), + new THREE.Vector3(3.4,9.8,18.1), + new THREE.Vector3(2.1,9.8,18.1), + new THREE.Vector3(0.7,9.8,18.1) + ] +}; +//站台上车区域 +let standtop = { + code : '005', + name : "standtop", + type : "stand", + stage : "3", + randompoint : new THREE.Vector3(-64,1.77,0.38), + doorpoints:[ + new THREE.Vector3(-62.1,1.77,-4.38), + new THREE.Vector3(-57.54,1.77,-4.38), + new THREE.Vector3(-53.1,1.77,-4.38), + new THREE.Vector3(-42.5,1.77,-4.38), + new THREE.Vector3(-37.6,1.77,-4.38), + new THREE.Vector3(-33.6,1.77,-4.38), + new THREE.Vector3(-20.8,1.77,-4.38), + new THREE.Vector3(-16.6,1.77,-4.38), + new THREE.Vector3(-12,1.77,-4.38), + new THREE.Vector3(0.5,1.77,-4.38), + new THREE.Vector3(4.8,1.77,-4.38), + new THREE.Vector3(9.27,1.77,-4.38), + new THREE.Vector3(21.6,1.77,-4.38), + new THREE.Vector3(26.2,1.77,-4.38), + new THREE.Vector3(30.48,1.77,-4.38), + new THREE.Vector3(43.2,1.77,-4.38), + new THREE.Vector3(47.5,1.77,-4.38), + new THREE.Vector3(51.9,1.77,-4.38) + ], + // new THREE.Vector3(-62.84,1.77,-4.38), + // new THREE.Vector3(-58.11,1.77,-4.38), + // new THREE.Vector3(-53.47,1.77,-4.38), + // new THREE.Vector3(-45.45,1.77,-4.38), + // new THREE.Vector3(-41.1,1.77,-4.38), + // new THREE.Vector3(-36.33,1.77,-4.38), + // new THREE.Vector3(-31.5,1.77,-4.38), + // new THREE.Vector3(-23.65,1.77,-4.38), + // new THREE.Vector3(-18.98,1.77,-4.38), + // new THREE.Vector3(-14.46,1.77,-4.38), + // new THREE.Vector3(-10,1.77,-4.38), + // new THREE.Vector3(-2.2,1.77,-4.38), + // new THREE.Vector3(2.49,1.77,-4.38), + // new THREE.Vector3(7.17,1.77,-4.38), + // new THREE.Vector3(11.8,1.77,-4.38), + // new THREE.Vector3(19.41,1.77,-4.38), + // new THREE.Vector3(24.09,1.77,-4.38), + // new THREE.Vector3(28.72,1.77,-4.38), + // new THREE.Vector3(33.46,1.77,-4.38), + // new THREE.Vector3(41.24,1.77,-4.38), + // new THREE.Vector3(45.82,1.77,-4.38), + // new THREE.Vector3(50.69,1.77,-4.38) + railpoints : [ + new THREE.Vector3(53.1,1.77,-1.8), + new THREE.Vector3(-63.5,1.77,-1.8) + ] +}; +//站台下车区域 +let standdown = { + code : '006', + name : "standdown", + type : "stand", + stage : "3", + randompoint : new THREE.Vector3(-64,1.77,21), + doorpoints:[ + new THREE.Vector3(-62.1,1.77,27), + new THREE.Vector3(-57.54,1.77,27), + new THREE.Vector3(-53.1,1.77,27), + new THREE.Vector3(-42.5,1.77,27), + new THREE.Vector3(-37.6,1.77,27), + new THREE.Vector3(-33.6,1.77,27), + new THREE.Vector3(-20.8,1.77,27), + new THREE.Vector3(-16.6,1.77,27), + new THREE.Vector3(-12,1.77,27), + new THREE.Vector3(0.5,1.77,27), + new THREE.Vector3(4.8,1.77,27), + new THREE.Vector3(9.27,1.77,27), + new THREE.Vector3(21.6,1.77,27), + new THREE.Vector3(26.2,1.77,27), + new THREE.Vector3(30.48,1.77,27), + new THREE.Vector3(43.2,1.77,27), + new THREE.Vector3(47.5,1.77,27), + new THREE.Vector3(51.9,1.77,27) + ], + // new THREE.Vector3(-62.84,1.77,27), + // new THREE.Vector3(-58.11,1.77,27), + // new THREE.Vector3(-53.47,1.77,27), + // new THREE.Vector3(-45.45,1.77,27), + // new THREE.Vector3(-41.1,1.77,27), + // new THREE.Vector3(-36.33,1.77,27), + // new THREE.Vector3(-31.5,1.77,27), + // new THREE.Vector3(-23.65,1.77,27), + // new THREE.Vector3(-18.98,1.77,27), + // new THREE.Vector3(-14.46,1.77,27), + // new THREE.Vector3(-10,1.77,27), + // new THREE.Vector3(-2.2,1.77,27), + // new THREE.Vector3(2.49,1.77,27), + // new THREE.Vector3(7.17,1.77,27), + // new THREE.Vector3(11.8,1.77,27), + // new THREE.Vector3(19.41,1.77,27), + // new THREE.Vector3(24.09,1.77,27), + // new THREE.Vector3(28.72,1.77,27), + // new THREE.Vector3(33.46,1.77,27), + // new THREE.Vector3(41.24,1.77,27), + // new THREE.Vector3(45.82,1.77,27), + // new THREE.Vector3(50.69,1.77,27) + railpoints : [ + new THREE.Vector3(53.1,1.77,24), + new THREE.Vector3(-64,1.77,24) + ] +}; +//4是刚下车状态 +//出方向闸机区域 +let exitgate = { + code : '007', + name : "exitgate", + type : "device", + stage : "5", + randompoint : new THREE.Vector3(-16,9.8,-0.4), + railpoints : [ + new THREE.Vector3(18,9.8,-0.27), + new THREE.Vector3(18,9.8,1.18), + new THREE.Vector3(18,9.8,2.64), + new THREE.Vector3(18,9.8,4.1), + new THREE.Vector3(18,9.8,5.4) + ] +}; +//出站台区域1 +let exit1 = { + code : '008', + name : "exit1", + type : "normal", + stage : "6", + randompoint : new THREE.Vector3(), + railpoints : [ + new THREE.Vector3(28.2,9.8,-7), + new THREE.Vector3(30.5,9.8,-7.4) + ] +}; +//出站台区域2 +let exit2 = { + code : '009', + name : "exit2", + type : "normal", + stage : "6", + randompoint : new THREE.Vector3(), + railpoints : [ + new THREE.Vector3(28.3,9.8,28), + new THREE.Vector3(30.2,9.8,28) + ] +}; +let enternum = 0; +let exitnum = 0; +//区域管理器 +export function ZoneManager() { + + var scope = this; + + this.name = "test"; + + this.list = []; + + initzone(); + //初始化区域对象 + function initzone(){ + scope.list[enter1.name] = new ZoneModel(enter1); + scope.list[enter2.name] = new ZoneModel(enter2); + scope.list[security.name] = new ZoneModel(security); + scope.list[entergate.name] = new ZoneModel(entergate); + scope.list[standtop.name] = new ZoneModel(standtop); + scope.list[standdown.name] = new ZoneModel(standdown); + scope.list[exitgate.name] = new ZoneModel(exitgate); + scope.list[exit1.name] = new ZoneModel(exit1); + scope.list[exit2.name] = new ZoneModel(exit2); + } + //获取区域范围内点 + this.getinitposition = function(name){ + // console.log(scope.list[name]); + let randompoint = new THREE.Vector3(0,scope.list[name].randompoint.y,0); + + // console.log(randompoint); + if(name == "enter1"){ + randompoint.x = scope.list[name].randompoint.x + Math.random()*8; + randompoint.z = scope.list[name].randompoint.z + Math.random()*8; + } + if(name == "enter2"){ + randompoint.x = scope.list[name].randompoint.x + Math.random()*8; + randompoint.z = scope.list[name].randompoint.z + Math.random()*8; + } + if(name == "security"){ + randompoint.x = scope.list[name].randompoint.x + Math.random()*10; + randompoint.z = scope.list[name].randompoint.z + Math.random()*2; + } + if(name == "entergate"){ + randompoint.x = scope.list[name].randompoint.x + Math.random()*5; + randompoint.z = scope.list[name].randompoint.z - Math.random()*2; + } + if(name == "standtop"){ + randompoint.x = scope.list[name].randompoint.x + Math.random()*100; + randompoint.z = scope.list[name].randompoint.z + Math.random(); + } + if(name == "standdown"){ + randompoint.x = scope.list[name].randompoint.x + Math.random()*100; + randompoint.z = scope.list[name].randompoint.z ; + } + if(name == "exitgate"){ + randompoint.x = scope.list[name].randompoint.x + Math.random()*30; + randompoint.z = scope.list[name].randompoint.z + Math.random()*5; + } + // let random = Math.random(); + return randompoint; + } + + this.getstandposition = function(name){ + let n = Math.round(Math.random()*17); + if(n>=1){ + n=n; + }else{ + n=0; + } + let randompoint = new THREE.Vector3(0,scope.list[name].doorpoints[n].y,0); + + if(name == "standtop"){ + randompoint.x = scope.list[name].doorpoints[n].x + Math.random()*3; + randompoint.z = scope.list[name].doorpoints[n].z +4+Math.random()*5; + } + if(name == "standdown"){ + randompoint.x = scope.list[name].doorpoints[n].x + Math.random()*3; + randompoint.z = scope.list[name].doorpoints[n].z -4-Math.random()*5; + } + let standdata = { + door:n, + point:randompoint + }; + return standdata; + } + + this.getgateposition = function(name){ + let randompoint = new THREE.Vector3(0,0,0); + + let standdata = { + door:null, + point:null + }; + if(name == "entergate"){ + randompoint.x = scope.list[name].railpoints[enternum].x ; + randompoint.y = scope.list[name].railpoints[enternum].y ; + randompoint.z = scope.list[name].railpoints[enternum].z ; + standdata.door = 4-enternum; + enternum += 1; + if(enternum>4){ + enternum = 0; + } + } + + if(name == "exitgate"){ + + randompoint.x = scope.list[name].railpoints[exitnum].x ; + randompoint.y = scope.list[name].railpoints[exitnum].y ; + randompoint.z = scope.list[name].railpoints[exitnum].z ; + standdata.door = 4-exitnum; + exitnum += 1; + if(exitnum>4){ + exitnum = 0; + } + } + standdata.point = randompoint; + + return standdata; + } + + this.getzoneposition = function(name){ + // let random = Math.random(); + let position = scope.list[name].railline.getPointAt(Math.random()); + return position; + } + + this.zoneActionCheck = function(){ + + } + +} diff --git a/src/jlmap3d/jl3dtrafficplan/model/zonemodel.js b/src/jlmap3d/jl3dtrafficplan/model/zonemodel.js new file mode 100644 index 000000000..d31f8883f --- /dev/null +++ b/src/jlmap3d/jl3dtrafficplan/model/zonemodel.js @@ -0,0 +1,20 @@ +export function ZoneModel(data) { + var scope = this; + //code + this.code = data.code; + //命名 + this.name = data.name; + this.type = data.type; + this.stage = data.stage; + this.status = 0; + this.randompoint = data.randompoint; + //轨迹点 + this.railpoints = data.railpoints; + + this.railline = new THREE.CatmullRomCurve3(data.railpoints); + if(data.doorpoints){ + this.doorpoints = data.doorpoints; + }else{ + this.doorpoints = null; + } +} diff --git a/src/jlmap3d/jl3dtrafficplan/passerai/passerai.js b/src/jlmap3d/jl3dtrafficplan/passerai/passerai.js new file mode 100644 index 000000000..8b5709dd7 --- /dev/null +++ b/src/jlmap3d/jl3dtrafficplan/passerai/passerai.js @@ -0,0 +1,267 @@ + + +export function PasserAi(zone,finder) { + let scope = this; + + //下车控制开关 + this.toppasseron = false; + this.downpasseron = false; + //上车控制开关 + this.toppasserin = false; + this.downpasserin = false; + let passerZone = zone; + let pathFinder = finder; + + let path; + let playerPosition = new THREE.Vector3( -3.5, 0.5, 5.5 ); + let targetPosition = new THREE.Vector3(); + //生成下车出站人物 + this.passerout = function(direct,mode){ + // console.log(direct); + if(direct == "top"){ + // console.log("toppasser"); + if(mode == "start"){ + scope.toppasseron = true; + scope.toppasserin = true; + } + if(mode == "end"){ + scope.toppasseron = false + scope.toppasserin = false; + } + // scope.toppasseron = true; + // setTimeout(function(){ + // scope.toppasseron = false + // scope.toppasserin = true; + // + // setTimeout(function(){ + // scope.toppasserin = false; + // }, 20000); + // }, 5000); + } + if(direct == "down"){ + if(mode == "start"){ + scope.downpasseron = true; + scope.downpasserin = true; + } + if(mode == "end"){ + scope.downpasseron = false; + scope.downpasserin = false; + } + // console.log("downpasser"); + // scope.downpasseron = true; + // setTimeout(function(){ + // scope.downpasseron = false; + // scope.downpasserin = true; + // setTimeout(function(){ + // scope.downpasserin = false; + // }, 20000); + // }, 5000); + } + } + + //初始化加载人物 + this.initPasser = function(humanlist,topWaitPassers,downWaitPassers,passerHuman,jl3d){ + + + for(let i=0;i val2) { + return 1; + } else { + return 0; + } +} //canvas文字贴图方法 //PS:待提炼 增强功能 var stationcanvas = new Image(); diff --git a/src/jmapNew/config/skinCode/bejing_01.js b/src/jmapNew/config/skinCode/bejing_01.js index f40879aaa..5c0308133 100644 --- a/src/jmapNew/config/skinCode/bejing_01.js +++ b/src/jmapNew/config/skinCode/bejing_01.js @@ -383,9 +383,16 @@ class SkinCode extends defaultStyle { }; this[deviceType.Station] = { - // text: { - // show: true // 公里标名称显示 - // }, + // 北京线车站元素 车站名称 + elemnetType:['stationText'], + stationText:{ + z:0, + fontWeight:'normal', // 字体粗细 + textPadding:[0, 0], // 字体边距 + borderColor:'', // 字体边框颜色 + textBorderWidth:0 // 字体边框宽度 + }, + kmPostShow: true, // 公里标显示 kilometerPosition: 'down', // 公里标位置 fontWeight: 'bold', // 文字错细 @@ -688,7 +695,6 @@ class SkinCode extends defaultStyle { haveArrowText: true, // 是否需创建arrowText对象 textOffset: 4, // 字体偏移(用以控制字体据车头的距离) trainWidthMoreText: 8, // 计算列车长度时--列车长比text多出尺寸 - displayPosition: 'margin', // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗 trainTip:true // 鼠标悬停列车状态信息框是否显示 }, trainStatusStyle: { diff --git a/src/jmapNew/config/skinCode/chengdu_01.js b/src/jmapNew/config/skinCode/chengdu_01.js index 8a69318ad..5a083dcd0 100644 --- a/src/jmapNew/config/skinCode/chengdu_01.js +++ b/src/jmapNew/config/skinCode/chengdu_01.js @@ -335,9 +335,16 @@ class SkinCode extends defaultStyle { } }; this[deviceType.Station] = { - // text: { - // show: true // 公里标名称显示 - // }, + // 成都一号线车站元素 车站名称 + elemnetType:['stationText'], + stationText:{ + z:0, + fontWeight:'normal', // 字体粗细 + textPadding:[0, 0], // 字体边距 + borderColor:'', // 字体边框颜色 + textBorderWidth:0 // 字体边框宽度 + }, + kmPostShow: false, // 公里标显示 kilometerPosition: 'up', // 公里标朝向 text: { @@ -612,7 +619,6 @@ class SkinCode extends defaultStyle { haveArrowText: true, // 是否需创建arrowText对象 textOffset: 4, // 字体偏移(用以控制字体据车头的距离) trainWidthMoreText: 8, // 计算列车长度时--列车长比text多出尺寸 - displayPosition: 'margin', // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗 trainTip:true // 鼠标悬停列车状态信息框是否显示 }, trainStatusStyle: { diff --git a/src/jmapNew/config/skinCode/chengdu_03.js b/src/jmapNew/config/skinCode/chengdu_03.js index 171d3313f..6e34272f1 100644 --- a/src/jmapNew/config/skinCode/chengdu_03.js +++ b/src/jmapNew/config/skinCode/chengdu_03.js @@ -332,9 +332,16 @@ class SkinCode extends defaultStyle { }; this[deviceType.Station] = { - // text: { - // show: true // 公里标名称显示 - // }, + // 成都三号线车站元素 车站名称 + elemnetType:['stationText'], + stationText:{ + z:0, + fontWeight:'normal', // 字体粗细 + textPadding:[0, 0], // 字体边距 + borderColor:'', // 字体边框颜色 + textBorderWidth:0 // 字体边框宽度 + }, + kmPostShow: false, // 公里标显示 kilometerPosition: 'up', // 公里标朝向 text: { @@ -798,7 +805,6 @@ class SkinCode extends defaultStyle { haveArrowText: true, // 是否需创建arrowText对象 textOffset: 4, // 字体偏移(用以控制字体据车头的距离) trainWidthMoreText: 8, // 计算列车长度时--列车长比text多出尺寸 - displayPosition: 'margin', // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗 trainTip:true // 鼠标悬停列车状态信息框是否显示 }, trainStatusStyle: { diff --git a/src/jmapNew/config/skinCode/foshan_01.js b/src/jmapNew/config/skinCode/foshan_01.js index 08ba7fc49..72e90c9ab 100644 --- a/src/jmapNew/config/skinCode/foshan_01.js +++ b/src/jmapNew/config/skinCode/foshan_01.js @@ -342,9 +342,16 @@ class SkinCode extends defaultStyle { } }; this[deviceType.Station] = { - // text: { - // show: true // 公里标名称显示 - // }, + // 佛山有轨电车 车站元素 车站名称 + elemnetType:['stationText'], + stationText:{ + z:0, + fontWeight:'normal', // 字体粗细 + textPadding:[0, 0], // 字体边距 + borderColor:'', // 字体边框颜色 + textBorderWidth:0 // 字体边框宽度 + }, + kmPostShow: true, // 公里标显示 kilometerPosition: 'up', // 公里标朝向 text: { @@ -649,7 +656,6 @@ class SkinCode extends defaultStyle { haveArrowText: true, // 是否需创建arrowText对象 textOffset: 1, // 字体偏移(用以控制字体据车头的距离) trainWidthMoreText: 2, // 计算列车长度时--列车长比text多出尺寸 - displayPosition: 'margin', // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗 trainTip:true // 鼠标悬停列车状态信息框是否显示 }, trainStatusStyle: { diff --git a/src/jmapNew/config/skinCode/fuzhou_01.js b/src/jmapNew/config/skinCode/fuzhou_01.js index 669521a8a..db8739e34 100644 --- a/src/jmapNew/config/skinCode/fuzhou_01.js +++ b/src/jmapNew/config/skinCode/fuzhou_01.js @@ -338,9 +338,16 @@ class SkinCode extends defaultStyle { } }; this[deviceType.Station] = { - // text: { - // show: true // 公里标名称显示 - // }, + // 福州一号线 车站元素 车站名称 + elemnetType:['stationText'], + stationText:{ + z:0, + fontWeight:'normal', // 字体粗细 + textPadding:[0, 0], // 字体边距 + borderColor:'', // 字体边框颜色 + textBorderWidth:0 // 字体边框宽度 + }, + kmPostShow: true, // 公里标显示 kilometerPosition: 'up', // 公里标朝向 text: { @@ -648,7 +655,6 @@ class SkinCode extends defaultStyle { haveArrowText: true, // 是否需创建arrowText对象 textOffset: 1, // 字体偏移(用以控制字体据车头的距离) trainWidthMoreText: 2, // 计算列车长度时--列车长比text多出尺寸 - displayPosition: 'margin', // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗 trainTip:true // 鼠标悬停列车状态信息框是否显示 }, trainStatusStyle: { diff --git a/src/jmapNew/config/skinCode/haerbin_01.js b/src/jmapNew/config/skinCode/haerbin_01.js index 58921660f..b624b709f 100644 --- a/src/jmapNew/config/skinCode/haerbin_01.js +++ b/src/jmapNew/config/skinCode/haerbin_01.js @@ -374,9 +374,16 @@ class SkinCode extends defaultStyle { } }; this[deviceType.Station] = { - // text: { - // show: true // 公里标名称显示 - // }, + // 哈尔滨一号线 车站元素 车站名称 + elemnetType:['stationText'], + stationText:{ + z:0, + fontWeight:'normal', // 字体粗细 + textPadding:[2, 6], // 字体边距 + borderColor:'', // 字体边框颜色 + textBorderWidth:1 // 字体边框宽度 + }, + kmPostShow: true, // 公里标显示 kilometerPosition: 'up', // 公里标朝向 text: { @@ -722,7 +729,6 @@ class SkinCode extends defaultStyle { haveArrowText: true, // 是否需创建arrowText对象 textOffset: 1, // 字体偏移(用以控制字体据车头的距离) trainWidthMoreText: 2, // 计算列车长度时--列车长比text多出尺寸 - displayPosition: 'margin', // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗, trainTip:true // 鼠标悬停列车状态信息框是否显示 }, trainStatusStyle: { diff --git a/src/jmapNew/config/skinCode/ningbo_01.js b/src/jmapNew/config/skinCode/ningbo_01.js index 4f4dfccaf..a8b58e64c 100644 --- a/src/jmapNew/config/skinCode/ningbo_01.js +++ b/src/jmapNew/config/skinCode/ningbo_01.js @@ -192,9 +192,16 @@ class SkinCode extends defaultStyle { }; this[deviceType.Station] = { - // text: { - // show: true // 公里标名称显示 - // }, + // 宁波一号线 车站元素 车站名称 + elemnetType:['stationText'], + stationText:{ + z:0, + fontWeight:'normal', // 字体粗细 + textPadding:[0, 0], // 字体边距 + borderColor:'', // 字体边框颜色 + textBorderWidth:0 // 字体边框宽度 + }, + kmPostShow: false, // 公里标显示 kilometerPosition: 'up', // 公里标朝向 text: { @@ -681,7 +688,6 @@ class SkinCode extends defaultStyle { textOffset: 4, // 字体偏移(用以控制字体据车头的距离) trainWidthMoreText: 8, // 计算列车长度时--列车长比text多出尺寸 trainHeadColorChangeMode: 1, // 1:driveMode + runlevel - displayPosition: 'margin', // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗 trainTip:false // 鼠标悬停列车状态信息框是否显示 }, mouseOverStyle:{ diff --git a/src/jmapNew/config/skinCode/ningbo_03.js b/src/jmapNew/config/skinCode/ningbo_03.js index ac71be77f..02fc2e07c 100644 --- a/src/jmapNew/config/skinCode/ningbo_03.js +++ b/src/jmapNew/config/skinCode/ningbo_03.js @@ -231,9 +231,16 @@ class SkinCode extends defaultStyle { }; this[deviceType.Station] = { - // text: { - // show: true // 公里标名称显示 - // }, + // 宁波三号线 车站元素 车站名称 + elemnetType:['stationText'], + stationText:{ + z:0, + fontWeight:'normal', // 字体粗细 + textPadding:[0, 0], // 字体边距 + borderColor:'', // 字体边框颜色 + textBorderWidth:0 // 字体边框宽度 + }, + kmPostShow: false, // 公里标显示 kilometerPosition: 'up', // 公里标朝向 text: { @@ -741,7 +748,6 @@ class SkinCode extends defaultStyle { textOffset: 4, // 字体偏移(用以控制字体据车头的距离) trainWidthMoreText: 8, // 计算列车长度时--列车长比text多出尺寸 trainHeadColorChangeMode: 1, // 1:driveMode + runlevel - displayPosition: 'margin', // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗 trainTip:false // 鼠标悬停列车状态信息框是否显示 }, mouseOverStyle:{ diff --git a/src/jmapNew/config/skinCode/race_01.js b/src/jmapNew/config/skinCode/race_01.js index 8d8c4f0cd..ec4c206a0 100644 --- a/src/jmapNew/config/skinCode/race_01.js +++ b/src/jmapNew/config/skinCode/race_01.js @@ -413,9 +413,16 @@ class SkinCode extends defaultStyle { }; this[deviceType.Station] = { - // text: { - // show: true // 公里标名称显示 - // }, + // 竞赛线路 车站元素 车站名称 + elemnetType:['stationText'], + stationText:{ + z:0, + fontWeight:'normal', // 字体粗细 + textPadding:[0, 0], // 字体边距 + borderColor:'', // 字体边框颜色 + textBorderWidth:0 // 字体边框宽度 + }, + kmPostShow: true, // 公里标显示 kilometerPosition: 'down', // 公里标位置 fontWeight: 'bold', // 文字错细 @@ -722,7 +729,6 @@ class SkinCode extends defaultStyle { haveArrowText: true, // 是否需创建arrowText对象 textOffset: 4, // 字体偏移(用以控制字体据车头的距离) trainWidthMoreText: 8, // 计算列车长度时--列车长比text多出尺寸 - displayPosition: 'margin', // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗 trainTip:true // 鼠标悬停列车状态信息框是否显示 }, trainStatusStyle: { diff --git a/src/jmapNew/config/skinCode/xian_01.js b/src/jmapNew/config/skinCode/xian_01.js index dedc4203f..e3fda6713 100644 --- a/src/jmapNew/config/skinCode/xian_01.js +++ b/src/jmapNew/config/skinCode/xian_01.js @@ -355,9 +355,16 @@ class SkinCode extends defaultStyle { } }; this[deviceType.Station] = { - // text: { - // show: true // 公里标名称显示 - // }, + // 西安一号线 车站元素 车站名称 + elemnetType:['stationText'], + stationText:{ + z:0, + fontWeight:'normal', // 字体粗细 + textPadding:[0, 0], // 字体边距 + borderColor:'', // 字体边框颜色 + textBorderWidth:0 // 字体边框宽度 + }, + kmPostShow: true, // 公里标显示 kilometerPosition: 'up', // 公里标朝向 text: { @@ -713,7 +720,6 @@ class SkinCode extends defaultStyle { haveArrowText: true, // 是否需创建arrowText对象 textOffset: 1, // 字体偏移(用以控制字体据车头的距离) trainWidthMoreText: 2, // 计算列车长度时--列车长比text多出尺寸 - displayPosition: 'margin', // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗 trainTip:true // 鼠标悬停列车状态信息框是否显示 }, trainStatusStyle: { diff --git a/src/jmapNew/config/skinCode/xian_02.js b/src/jmapNew/config/skinCode/xian_02.js index 97b63f7cc..c5d687bb4 100644 --- a/src/jmapNew/config/skinCode/xian_02.js +++ b/src/jmapNew/config/skinCode/xian_02.js @@ -382,9 +382,16 @@ class SkinCode extends defaultStyle { } }; this[deviceType.Station] = { - // text: { - // show: true // 公里标名称显示 - // }, + // 西安二号线 车站元素 车站名称 + elemnetType:['stationText'], + stationText:{ + z:0, + fontWeight:'normal', // 字体粗细 + textPadding:[0, 0], // 字体边距 + borderColor:'', // 字体边框颜色 + textBorderWidth:0 // 字体边框宽度 + }, + kmPostShow: false, // 公里标显示 kilometerPosition: 'up', // 公里标朝向 text: { @@ -793,7 +800,6 @@ class SkinCode extends defaultStyle { haveArrowText: true, // 是否需创建arrowText对象 textOffset: 4, // 字体偏移(用以控制字体据车头的距离) trainWidthMoreText: 8, // 计算列车长度时--列车长比text多出尺寸 - displayPosition: 'margin', // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗 trainTip:true // 鼠标悬停列车状态信息框是否显示 }, trainStatusStyle: { diff --git a/src/jmapNew/painter.js b/src/jmapNew/painter.js index 637772076..e4d93be0b 100644 --- a/src/jmapNew/painter.js +++ b/src/jmapNew/painter.js @@ -87,41 +87,40 @@ class Painter { } } - checkIntersect(device) { - var intersect = false; - var befor = device.instance; - var train = shapefactory(device, this.$jmap); - + checkTrainOverlap(device) { // 检查重叠列车 + const trainWindowCode = device.trainWindowCode; + const overlapTrainList = [device.code]; this.mapInstanceLevel[deviceType.Train].eachChild(elem => { - if (elem !== befor && elem.getBoundingRect().intersect(train.getBoundingRect())) { - intersect = true; - return; + if (elem.model.code !== device.code && elem.model.trainWindowCode === trainWindowCode) { + overlapTrainList.push(elem.model.code); + } + }); + if (overlapTrainList.length > 1) { + this.sortOverLapTrain(overlapTrainList); + } + return overlapTrainList; + } + sortOverLapTrain(overlapTrainList) { // 对重叠列车按照区段上的位置进行排序 + overlapTrainList.sort((a, b) => { + const trainA = this.$jmap.getDeviceByCode(a); + const trainB = this.$jmap.getDeviceByCode(b); + if (trainA.right) { + return trainA.offsetp - trainB.offsetp; + } else { + return trainB.offsetp - trainA.offsetp; } }); - - return intersect; } - /** * 更新列车 * @param {*} device */ updateTrain(device) { - var oldTrainWindowModel = null; - var instance = device.instance; - var curModel = device; - let displayPosition = 'margin'; - if (instance) { - oldTrainWindowModel = device.trainWindowModel; - displayPosition = instance.style.Train.common.displayPosition; - } + const curModel = device; if (curModel.sectionCode) { curModel.sectionModel = this.$jmap.getDeviceByCode(curModel.sectionCode); if (curModel.sectionModel.trainWindowCode) { curModel.trainWindowCode = curModel.sectionModel.trainWindowCode; - } else if (displayPosition === 'center' && curModel.sectionModel.logicSectionCodeList && curModel.sectionModel.logicSectionCodeList.length) { - const sec = this.$jmap.getDeviceByCode(curModel.sectionModel.logicSectionCodeList[Math.floor(curModel.sectionModel.logicSectionCodeList.length / 2)]); - curModel.trainWindowCode = sec.trainWindowCode; } else if (curModel.right && curModel.sectionModel.logicSectionCodeList && curModel.sectionModel.logicSectionCodeList.length) { const sec = this.$jmap.getDeviceByCode(curModel.sectionModel.logicSectionCodeList[curModel.sectionModel.logicSectionCodeList.length - 1]); curModel.trainWindowCode = sec.trainWindowCode; @@ -134,13 +133,13 @@ class Painter { if (curModel.trainWindowCode) { curModel.trainWindowModel = this.$jmap.getDeviceByCode(curModel.trainWindowCode); } - - if (instance && oldTrainWindowModel && this.checkIntersect(device)) { - device.trainWindowModel = oldTrainWindowModel; - } - - instance && this.mapInstanceLevel[deviceType.Train].remove(instance); - this.add(device); + const overlapTrainList = this.checkTrainOverlap(device); + overlapTrainList.forEach((item, index) => { + const trainDevice = this.$jmap.getDeviceByCode(item); + trainDevice.overLapIndex = index; + trainDevice.instance && this.mapInstanceLevel[deviceType.Train].remove(trainDevice.instance); + this.add(trainDevice); + }); if (this.screenFlag) { this.$transformHandleScreen.transformView(device.instance); @@ -233,7 +232,6 @@ class Painter { y: transPoint[1] }; } - } } diff --git a/src/jmapNew/shape/Station/EStationText.js b/src/jmapNew/shape/Station/EStationText.js new file mode 100644 index 000000000..f6b8418a9 --- /dev/null +++ b/src/jmapNew/shape/Station/EStationText.js @@ -0,0 +1,67 @@ +import Group from 'zrender/src/container/Group'; +import Text from 'zrender/src/graphic/Text'; + +class EStationText extends Group { + constructor(model) { + super(); + this.model = model; + this.create(); + } + + create() { + const model = this.model.modelData; + const style = this.model.style; + + // 车站名称 + this.stationName = new Text({ + zlevel: this.model.zlevel, + z: this.model.z, + silent: !model.visible || false, + style: { + x: model.position.x, + y: model.position.y, + fontWeight: style.Station.stationText.fontWeight, + fontSize: isNaN(Number(model.nameFont)) ? 20 : Number(model.nameFont), + fontFamily: style.fontFamily, + text: model.number ? model.number + model.name : model.name, + textAlign: 'middle', + textFill: model.nameFontColor, + textVerticalAlign: 'top', + textPadding:style.Station.stationText.textPadding, + textBorderColor:style.Station.stationText.borderColor || model.nameFontColor, + textBorderWidth:style.Station.stationText.textBorderWidth + } + }); + this.add(this.stationName); + if (model.subheadDisplay) { // 副标题 + this.subheadText = new Text({ + zlevel: this.model.zlevel, + z: this.model.z, + silent: !model.visible || false, + style: { + x: model.subheadPosition.x, + y: model.subheadPosition.y, + fontWeight: model.fontWeight, + fontSize: model.subheadFont || 18, + fontFamily: style.fontFamily, + text: model.subhead, + textAlign: 'middle', + textVerticalAlign: 'top', + textFill: model.subheadFontColor, + textPadding:style.Station.stationText.textPadding, + textBorderColor:style.Station.stationText.borderColor || model.nameFontColor, + textBorderWidth:style.Station.stationText.textBorderWidth + } + }); + this.add(this.subheadText); + } + } + + recover() { + } + + setState() { + } +} + +export default EStationText; diff --git a/src/jmapNew/shape/Station/index.js b/src/jmapNew/shape/Station/index.js index f24fbe4e6..f2c31b1fe 100644 --- a/src/jmapNew/shape/Station/index.js +++ b/src/jmapNew/shape/Station/index.js @@ -11,6 +11,10 @@ import { arrow } from '../utils/ShapePoints'; import Rect from 'zrender/src/graphic/shape/Rect'; import Text from 'zrender/src/graphic/Text'; import store from '@/store/index_APP_TARGET'; + +import EStationText from './EStationText'; +import {traverseLineElements, traverseStatusElements} from '../utils/ShapeStatusCovert'; + import Vue from 'vue'; export default class Station extends Group { @@ -28,37 +32,21 @@ export default class Station extends Group { this.createControlMode(); this.setState(model); this.checkIsDrawMap(); + this.setVisible(model.visible); } create() { const model = this.model; const style = this.style; - // 公里标名称是否显示 - this.stationText = new ETextName({ - zlevel: this.zlevel, - z: this.z, - x: model.position.x, - y: model.position.y, - fontWeight: style.Station.text.fontWeight, - fontSize: isNaN(Number(model.nameFont)) ? 20 : Number(model.nameFont), - fontFamily: style.fontFamily, - silent: !model.visible, - text: model.number ? model.number + model.name : model.name, - textAlign: 'middle', - textVerticalAlign: 'top', - textFill: model.nameFontColor - }); - this.add(this.stationText); - if (style.Station.text.borderShow) { // 哈尔滨线路单独显示 - this.stationText.attr({ - style: { - textPadding: style.Station.text.textPadding || [2, 6], - textBorderColor: style.Station.text.borderColor || model.nameFontColor, - textBorderWidth: style.Station.text.textBorderWidth || 1 - } - }); - } + // // 站台所有的绘图元素 + const elementTypeList = { + 'stationText':EStationText // 车站名称 (普通站台样式) + }; + + // 遍历当前线路下的绘图元素 组合模式 + traverseLineElements(style.Station, elementTypeList, model, style, this); + const path = window.location.href; if (style.Station.kmPostShow || path.includes('/map/draw')) { // 公里标是否显示 let direction = 1; @@ -88,37 +76,13 @@ export default class Station extends Group { this.add(this.mileageText); model.kmPostShow ? this.mileageText.show() : this.mileageText.hide(); } - if (model.subheadDisplay) { // 副标题 - this.subheadText = new ETextName({ - zlevel: this.zlevel, - z: this.z, - x: model.subheadPosition.x, - y: model.subheadPosition.y, - fontWeight: model.fontWeight, - fontSize: model.subheadFont || 18, - fontFamily: style.fontFamily, - text: model.subhead, - silent: !model.visible, - textAlign: 'middle', - textVerticalAlign: 'top', - textFill: model.subheadFontColor - }); - this.add(this.subheadText); - if (style.Station.text.borderShow) { - this.subheadText.attr({ - style: { - textPadding: [2, 6], - textBorderColor: model.nameFontColor, - textBorderWidth: 1 - } - }); - } - } - if (!model.visible) { // 隐藏车站 - this.subheadText && this.subheadText.setStyle('textFill', 'rgba(0,0,0,0)'); - this.mileageText && this.mileageText.setStyle('textFill', 'rgba(0,0,0,0)'); - this.stationText && this.stationText.setStyle('textFill', 'rgba(0,0,0,0)'); - } + + // if (!model.visible) { // 隐藏车站 + // // this.subheadText && this.subheadText.setStyle('textFill', 'rgba(0,0,0,0)'); + // // this.mileageText && this.mileageText.setStyle('textFill', 'rgba(0,0,0,0)'); + // // this.stationText && this.stationText.setStyle('textFill', 'rgba(0,0,0,0)'); + // this.eachChild(elem => { elem.hide(); }); + // } } createTurnBack() { // 创建按图折返 const model = this.model; @@ -406,6 +370,13 @@ export default class Station extends Group { } } + // /** 恢复初始状态*/ + // recover() { + // const currentTypeList = this.style.Station.elemnetType; + // currentTypeList.forEach(element => { + // this[element].recover(); + // }); + // } recover() { this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor); this.emergencyControl && this.emergencyControl.setTextColor(this.style.Station.StationControl.text.fontColor); @@ -433,6 +404,18 @@ export default class Station extends Group { } } + // setState(model) { + // if (!this.isShowShape) return; + // // // 新版地图使用新版状态变更方式 + // this.recover(); + + // // 更新状态 + // const currentTypeList = this.style.Station.elemnetType; + // currentTypeList.forEach(element => { + // this[element].setState(model); + // }); + // } + getShapeTipPoint(opts) { let rect; if (opts.subDeviceType === 'button') { @@ -448,13 +431,14 @@ export default class Station extends Group { getBoundingRect() { const rect = this.stationText.getBoundingRect().clone(); - if (this.model.subheadDisplay) { - const subheadText = this.subheadText.getBoundingRect().clone(); - rect.union(subheadText); - return rect; - } else { - return rect; - } + // if (this.model.subheadDisplay) { + // const subheadText = this.subheadText.getBoundingRect().clone(); + // rect.union(subheadText); + // return rect; + // } else { + // return rect; + // } + return rect; } drawSelected(selected) { @@ -489,4 +473,12 @@ export default class Station extends Group { this.isShowShape = false; } } + + setVisible(visible) { + if (visible) { + this.eachChild(elem => { elem.show(); }); + } else { + this.eachChild(elem => { elem.hide(); }); + } + } } diff --git a/src/jmapNew/shape/StationStand/index.js b/src/jmapNew/shape/StationStand/index.js index 540cdfc97..d3b640253 100644 --- a/src/jmapNew/shape/StationStand/index.js +++ b/src/jmapNew/shape/StationStand/index.js @@ -63,6 +63,7 @@ class StationStand extends Group { // 加载皮肤控制的元素 const model = this.model; const style = this.style; + // // 站台所有的绘图元素 const elementTypeList = { 'solidStand':ESolidStand, // 矩形实心站台 (普通站台样式) diff --git a/src/jmapNew/shape/Train/index.js b/src/jmapNew/shape/Train/index.js index 55913cfa3..faa2404aa 100644 --- a/src/jmapNew/shape/Train/index.js +++ b/src/jmapNew/shape/Train/index.js @@ -46,10 +46,10 @@ export default class Train extends Group { }; if (model.right) { this.point.x = this.point.x - style.Train.trainHead.trainConntWidth * this.newScale - style.Train.common.trainWidth / 2; - this.point.y = this.point.y - style.Train.common.trainHeight / 2; + this.point.y = this.point.y - style.Train.common.trainHeight / 2 + model.overLapIndex * (style.Train.common.trainHeight + 5); } else { this.point.x = this.point.x + style.Train.trainHead.trainConntWidth * this.newScale - style.Train.common.trainWidth / 2; - this.point.y = this.point.y + model.trainWindowModel.height - style.Train.common.trainHeight / 2; + this.point.y = this.point.y + model.trainWindowModel.height - style.Train.common.trainHeight / 2 - model.overLapIndex * (style.Train.common.trainHeight + 5); } } else { this.point = model.position; diff --git a/src/jmapNew/theme/beijing_01/menus/dialog/alxeEffective.vue b/src/jmapNew/theme/beijing_01/menus/dialog/alxeEffective.vue index 76f80c3c8..50c7654c3 100644 --- a/src/jmapNew/theme/beijing_01/menus/dialog/alxeEffective.vue +++ b/src/jmapNew/theme/beijing_01/menus/dialog/alxeEffective.vue @@ -111,7 +111,7 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/beijing_01/menus/dialog/childDialog/confirmTrain.vue b/src/jmapNew/theme/beijing_01/menus/dialog/childDialog/confirmTrain.vue index 0b657cdd8..b3e620c49 100644 --- a/src/jmapNew/theme/beijing_01/menus/dialog/childDialog/confirmTrain.vue +++ b/src/jmapNew/theme/beijing_01/menus/dialog/childDialog/confirmTrain.vue @@ -29,7 +29,7 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/beijing_01/menus/dialog/standBackStrategy.vue b/src/jmapNew/theme/beijing_01/menus/dialog/standBackStrategy.vue index f0cae6718..f490d7217 100644 --- a/src/jmapNew/theme/beijing_01/menus/dialog/standBackStrategy.vue +++ b/src/jmapNew/theme/beijing_01/menus/dialog/standBackStrategy.vue @@ -158,7 +158,7 @@ export default { }; this.strategy = row.value; this.isConfirm = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } diff --git a/src/jmapNew/theme/beijing_01/menus/dialog/standDetail.vue b/src/jmapNew/theme/beijing_01/menus/dialog/standDetail.vue index 3d4c4f2c6..bd08e779f 100644 --- a/src/jmapNew/theme/beijing_01/menus/dialog/standDetail.vue +++ b/src/jmapNew/theme/beijing_01/menus/dialog/standDetail.vue @@ -18,7 +18,7 @@ style="background: #f0f0f0;" >
-
{{ data.name }}
+
{{ node.name }}
import { mapGetters } from 'vuex'; -import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; +import { MapDeviceType } from '@/scripts/cmdPlugin/Config'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { mouseCancelState } from '@/jmapNew/theme/components/utils/menuItemStatus'; import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; @@ -262,7 +263,7 @@ export default { operation: OperationEvent.Command.cancel.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.doClose(); } diff --git a/src/jmapNew/theme/beijing_01/menus/dialog/stationCmdControl.vue b/src/jmapNew/theme/beijing_01/menus/dialog/stationCmdControl.vue index de74f773b..85befb629 100644 --- a/src/jmapNew/theme/beijing_01/menus/dialog/stationCmdControl.vue +++ b/src/jmapNew/theme/beijing_01/menus/dialog/stationCmdControl.vue @@ -77,7 +77,8 @@
\ No newline at end of file + diff --git a/src/jmapNew/theme/beijing_01/menus/menuDialog/childDialog/userDelete.vue b/src/jmapNew/theme/beijing_01/menus/menuDialog/childDialog/userDelete.vue index ec304506c..d2ba3392b 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuDialog/childDialog/userDelete.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuDialog/childDialog/userDelete.vue @@ -1,126 +1,134 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/beijing_01/menus/menuDialog/childDialog/userEdit.vue b/src/jmapNew/theme/beijing_01/menus/menuDialog/childDialog/userEdit.vue index ec87e0f81..0dc72a5a4 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuDialog/childDialog/userEdit.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuDialog/childDialog/userEdit.vue @@ -1,170 +1,181 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/beijing_01/menus/menuDialog/detainTrainContorl.vue b/src/jmapNew/theme/beijing_01/menus/menuDialog/detainTrainContorl.vue index a60fbeeae..2fc0b1930 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuDialog/detainTrainContorl.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuDialog/detainTrainContorl.vue @@ -27,7 +27,8 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/beijing_01/menus/menuDialog/manageUser.vue b/src/jmapNew/theme/beijing_01/menus/menuDialog/manageUser.vue index 2ec6fadfa..62803376d 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuDialog/manageUser.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuDialog/manageUser.vue @@ -1,282 +1,300 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/beijing_01/menus/menuDialog/stationControl.vue b/src/jmapNew/theme/beijing_01/menus/menuDialog/stationControl.vue index fb1ba7387..dab41a4c8 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuDialog/stationControl.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuDialog/stationControl.vue @@ -131,7 +131,7 @@ export default { operation: OperationEvent.Command.cancel.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.doClose(); } diff --git a/src/jmapNew/theme/beijing_01/menus/menuDialog/trainAdd.vue b/src/jmapNew/theme/beijing_01/menus/menuDialog/trainAdd.vue index 6bf8c82a0..9c2ab1ec8 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuDialog/trainAdd.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuDialog/trainAdd.vue @@ -1,154 +1,167 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/beijing_01/menus/menuDialog/trainDelete.vue b/src/jmapNew/theme/beijing_01/menus/menuDialog/trainDelete.vue index bbdd4bb4f..dd2710c1a 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuDialog/trainDelete.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuDialog/trainDelete.vue @@ -1,141 +1,149 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/beijing_01/menus/menuDialog/trainTranstalet.vue b/src/jmapNew/theme/beijing_01/menus/menuDialog/trainTranstalet.vue index 8b62effb9..fe78e420f 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuDialog/trainTranstalet.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuDialog/trainTranstalet.vue @@ -1,152 +1,165 @@ \ No newline at end of file +}; + diff --git a/src/jmapNew/theme/beijing_01/menus/menuStation.vue b/src/jmapNew/theme/beijing_01/menus/menuStation.vue index 595630474..8cfcd8e98 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuStation.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuStation.vue @@ -193,7 +193,7 @@ export default { code: this.selected.code, operation: OperationEvent.Station.setAutoTrigger.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } @@ -209,7 +209,7 @@ export default { code: this.selected.code, operation: OperationEvent.Station.cancelAutoTrigger.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } @@ -224,7 +224,7 @@ export default { code: this.selected.code, operation: OperationEvent.Station.powerUnLock.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.stationCmdControl.doShow(operate, this.selected); @@ -238,7 +238,7 @@ export default { code: this.selected.code, operation: OperationEvent.Station.execKeyOperationTest.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.stationCmdControl.doShow(operate, this.selected); @@ -252,7 +252,7 @@ export default { code: this.selected.code, operation: OperationEvent.Station.humanControlALL.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.stationHumanControlAll.doShow(operate, this.selected); @@ -266,7 +266,7 @@ export default { code: this.selected.code, operation: OperationEvent.Station.atsAutoControlALL.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.stationSetRouteControlAll.doShow(operate, this.selected); diff --git a/src/jmapNew/theme/beijing_01/menus/menuStationStand.vue b/src/jmapNew/theme/beijing_01/menus/menuStationStand.vue index 2e24b5e2e..dc075462a 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuStationStand.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuStationStand.vue @@ -249,22 +249,6 @@ export default { } }); }, - // 强制取消扣车 - // cancelDetainTrainForce() { - // const operate = { - // start: true, - // code: this.selected.code, - // type: MapDeviceType.StationStand.type, - // label: MapDeviceType.StationStand.label, - // operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation - // }; - // this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - // if (valid) { - // this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - // this.$refs.standControl.doShow(operate, this.selected); - // } - // }); - // }, // 设置跳停 setJumpStop() { commitOperate(menuOperate.StationStand.setJumpStop, {standCode:this.selected.code}, 0).then(({ valid, operate })=>{ diff --git a/src/jmapNew/theme/beijing_01/menus/menuTrain.vue b/src/jmapNew/theme/beijing_01/menus/menuTrain.vue index 9cac90607..71d502bdf 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuTrain.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuTrain.vue @@ -393,7 +393,7 @@ export default { code: this.selected.code, operation: OperationEvent.Train.limitSpeed.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } else { @@ -418,7 +418,7 @@ export default { code: this.selected.code, operation: OperationEvent.Train.addTrainId.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.trainDefine.doShow(operate, this.selected); @@ -432,7 +432,7 @@ export default { code: this.selected.code, operation: OperationEvent.Train.delTrainId.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.trainDelete.doShow(operate, this.selected); @@ -446,7 +446,7 @@ export default { code: this.selected.code, operation: OperationEvent.Train.moveTrainId.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.trainMove.doShow(operate, this.selected); @@ -460,7 +460,7 @@ export default { code: this.selected.code, operation: OperationEvent.Train.editTrainId.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.trainEdit.doShow(operate, this.selected); @@ -474,7 +474,7 @@ export default { code: this.selected.code, operation: OperationEvent.Train.editTrainId.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.trainSetPlan.doShow(operate, this.selected); @@ -488,7 +488,7 @@ export default { code: this.selected.code, operation: OperationEvent.Train.moveEventlyTrainId.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.trainMoveEvently.doShow(operate, this.selected); @@ -502,7 +502,7 @@ export default { code: this.selected.code, operation: OperationEvent.Train.deletePlanTrainId.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.trainDeletePlan.doShow(operate, this.selected); @@ -516,7 +516,7 @@ export default { code: this.selected.code, operation: OperationEvent.Train.editTrainId.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.trainSetHead.doShow(operate, this.selected); @@ -530,7 +530,7 @@ export default { code: this.selected.code, operation: OperationEvent.Train.editTrainId.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.trainSetWork.doShow(operate, this.selected); @@ -544,7 +544,7 @@ export default { code: this.selected.code, operation: OperationEvent.Train.editTrainId.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.trainFlag.doShow(operate, this.selected); @@ -558,7 +558,7 @@ export default { code: this.selected.code, operation: OperationEvent.Train.editTrainId.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.trainFlag.doShow(operate, this.selected); diff --git a/src/jmapNew/theme/beijing_01/menus/passiveDialog/alarm.vue b/src/jmapNew/theme/beijing_01/menus/passiveDialog/alarm.vue index 56483d8d6..78e19c88a 100644 --- a/src/jmapNew/theme/beijing_01/menus/passiveDialog/alarm.vue +++ b/src/jmapNew/theme/beijing_01/menus/passiveDialog/alarm.vue @@ -83,7 +83,7 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/ningbo_01/menus/menuDialog/childDialog/userDelete.vue b/src/jmapNew/theme/ningbo_01/menus/menuDialog/childDialog/userDelete.vue index 243fe7ec2..e62e5d148 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuDialog/childDialog/userDelete.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuDialog/childDialog/userDelete.vue @@ -1,126 +1,136 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/ningbo_01/menus/menuDialog/childDialog/userEdit.vue b/src/jmapNew/theme/ningbo_01/menus/menuDialog/childDialog/userEdit.vue index 33d38059f..2bb23568a 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuDialog/childDialog/userEdit.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuDialog/childDialog/userEdit.vue @@ -1,170 +1,181 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/ningbo_01/menus/menuDialog/detainTrainContorl.vue b/src/jmapNew/theme/ningbo_01/menus/menuDialog/detainTrainContorl.vue index d3b7c130e..7bbd277fb 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuDialog/detainTrainContorl.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuDialog/detainTrainContorl.vue @@ -27,7 +27,8 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/ningbo_01/menus/menuDialog/manageUser.vue b/src/jmapNew/theme/ningbo_01/menus/menuDialog/manageUser.vue index 6c22ac606..688ea98e2 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuDialog/manageUser.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuDialog/manageUser.vue @@ -1,282 +1,300 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/ningbo_01/menus/menuDialog/trainAdd.vue b/src/jmapNew/theme/ningbo_01/menus/menuDialog/trainAdd.vue index ae759a395..a3778e533 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuDialog/trainAdd.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuDialog/trainAdd.vue @@ -47,7 +47,8 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/childDialog/userDelete.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/childDialog/userDelete.vue index 243fe7ec2..e62e5d148 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/childDialog/userDelete.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/childDialog/userDelete.vue @@ -1,126 +1,136 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/childDialog/userEdit.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/childDialog/userEdit.vue index 33d38059f..2bb23568a 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/childDialog/userEdit.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/childDialog/userEdit.vue @@ -1,170 +1,181 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/trainTranstalet.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/trainTranstalet.vue index 133de1d96..813c752ac 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/trainTranstalet.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/trainTranstalet.vue @@ -47,7 +47,8 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/race_01/menus/menuDialog/childDialog/userDelete.vue b/src/jmapNew/theme/race_01/menus/menuDialog/childDialog/userDelete.vue index 243fe7ec2..e62e5d148 100644 --- a/src/jmapNew/theme/race_01/menus/menuDialog/childDialog/userDelete.vue +++ b/src/jmapNew/theme/race_01/menus/menuDialog/childDialog/userDelete.vue @@ -1,126 +1,136 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/race_01/menus/menuDialog/childDialog/userEdit.vue b/src/jmapNew/theme/race_01/menus/menuDialog/childDialog/userEdit.vue index 33d38059f..4b421f185 100644 --- a/src/jmapNew/theme/race_01/menus/menuDialog/childDialog/userEdit.vue +++ b/src/jmapNew/theme/race_01/menus/menuDialog/childDialog/userEdit.vue @@ -1,170 +1,181 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/race_01/menus/menuDialog/detainTrainContorl.vue b/src/jmapNew/theme/race_01/menus/menuDialog/detainTrainContorl.vue index d3b7c130e..7bbd277fb 100644 --- a/src/jmapNew/theme/race_01/menus/menuDialog/detainTrainContorl.vue +++ b/src/jmapNew/theme/race_01/menus/menuDialog/detainTrainContorl.vue @@ -27,7 +27,8 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/race_01/menus/menuDialog/manageUser.vue b/src/jmapNew/theme/race_01/menus/menuDialog/manageUser.vue index 6c22ac606..688ea98e2 100644 --- a/src/jmapNew/theme/race_01/menus/menuDialog/manageUser.vue +++ b/src/jmapNew/theme/race_01/menus/menuDialog/manageUser.vue @@ -1,282 +1,300 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/race_01/menus/menuDialog/trainAdd.vue b/src/jmapNew/theme/race_01/menus/menuDialog/trainAdd.vue index ae759a395..a3778e533 100644 --- a/src/jmapNew/theme/race_01/menus/menuDialog/trainAdd.vue +++ b/src/jmapNew/theme/race_01/menus/menuDialog/trainAdd.vue @@ -47,7 +47,8 @@ + diff --git a/src/views/exam/detail/examDetail.vue b/src/views/exam/detail/examDetail.vue index 46706c5ea..c435cab2d 100644 --- a/src/views/exam/detail/examDetail.vue +++ b/src/views/exam/detail/examDetail.vue @@ -55,7 +55,6 @@ import { getExamLessonDetail } from '@/api/management/exam'; import { generateExamList } from '@/api/management/userexam'; import { getPublishLessonDetail } from '@/api/jmap/lesson'; import { PermissionType } from '@/scripts/ConstDic'; -// import { getDetailList } from '@/api/management/dictionary'; import { mapGetters } from 'vuex'; import { launchFullscreen } from '@/utils/screen'; import { UrlConfig } from '@/scripts/ConstDic'; diff --git a/src/views/jlmap3d/edit/component/index.vue b/src/views/jlmap3d/edit/component/index.vue index a75f96293..10376f451 100644 --- a/src/views/jlmap3d/edit/component/index.vue +++ b/src/views/jlmap3d/edit/component/index.vue @@ -1,6 +1,6 @@ diff --git a/src/views/jlmap3d/trafficplan/jl3dtrafficplan.vue b/src/views/jlmap3d/trafficplan/jl3dtrafficplan.vue new file mode 100644 index 000000000..68e742aae --- /dev/null +++ b/src/views/jlmap3d/trafficplan/jl3dtrafficplan.vue @@ -0,0 +1,235 @@ + + + diff --git a/src/views/jlmap3d/trafficplan/jl3dtraffictrain.vue b/src/views/jlmap3d/trafficplan/jl3dtraffictrain.vue new file mode 100644 index 000000000..2b87b1a21 --- /dev/null +++ b/src/views/jlmap3d/trafficplan/jl3dtraffictrain.vue @@ -0,0 +1,341 @@ + + + diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 043905dde..ebc7b37c3 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -158,7 +158,6 @@ import { loginInfo, ProjectIcon, ProjectLoginStyleList, VersionBaseNoShow, MainB import { removeToken, getToken } from '@/utils/auth'; import LangStorage from '@/utils/lang'; import FloatPart from './floatPart'; -import { getIsSignUp } from '@/api/competition'; import { getSimulationInfoNew } from '@/api/simulation'; import { getSessionStorage } from '@/utils/auth'; import { launchFullscreen } from '@/utils/screen'; @@ -473,23 +472,7 @@ export default { this.loading = this.project === 'drts' || false; this.tipsMsg = ''; removeSessionStorage('againEnter'); - if (this.$route.query.raceId) { - if (this.$route.path.includes('jsxt/login')) { - getIsSignUp(this.$route.query.raceId, { isLogin: true }).then(res => { - if (res.data) { - setSessionStorage('raceId', this.$route.query.raceId); - this.$router.push({ path: this.path, query:{ raceId:this.$route.query.raceId } }); - } else { - this.$messageBox('您未报名该竞赛,所以无法进入竞赛系统'); - } - }).catch(() => { - this.$messageBox('登陆竞赛系统失败,请稍后重试'); - }); - } else { - setSessionStorage('raceId', this.$route.query.raceId); - this.$router.push({ path: this.path, query:{ raceId:this.$route.query.raceId } }); - } - } else if (this.$route.query.projectDevice) { + if (this.$route.query.projectDevice) { getLoginInfo(getToken()).then(res => { getSimulationInfoNew(res.data.group).then(resp => { const query = { @@ -554,14 +537,14 @@ export default { } }); }); - } else if (this.project === 'drts') { + } else if (this.project === 'drts' || this.project === 'bjd') { getLoginInfo(getToken()).then(res => { getSimulationInfoNew(res.data.group).then(resp => { this.$store.dispatch('app/transitionAnimations'); this.$router.push({ path: `/displayNew/demon`, query: { lineCode: resp.data.map.lineCode, group: res.data.group, - prdType: '02', + prdType: resp.data.prodType, mapId: resp.data.map.id, goodsId:'', try:'0', @@ -571,20 +554,6 @@ export default { launchFullscreen(); }); }); - } else if (this.project === 'bjd') { - getLoginInfo(getToken()).then(res => { - getSimulationInfoNew(res.data.group).then(resp => { - this.$store.dispatch('app/transitionAnimations'); - this.$router.push({ path: `/jointTrainingNew`, query: { - lineCode: resp.data.map.lineCode, - group: res.data.group, - mapId: resp.data.map.id, - project:this.project - }}); - this.loading = false; - launchFullscreen(); - }); - }); } else if (!this.$route.path.includes('jsxt/login') && !this.$route.path.includes('refereeJsxt/login')) { this.$router.push({ path: this.path }); } else { diff --git a/src/views/newMap/displayNew/demon/faultChoose.vue b/src/views/newMap/displayNew/demon/faultChoose.vue index 05ec951ed..4485d6738 100644 --- a/src/views/newMap/displayNew/demon/faultChoose.vue +++ b/src/views/newMap/displayNew/demon/faultChoose.vue @@ -58,7 +58,7 @@ - + @@ -123,7 +123,7 @@ import { getSimulationFaultRules, setFailureModeNew, deleteFailureRule, cancelFa import ConstConfig from '@/scripts/ConstConfig'; import { FaultStatusEnum } from '@/scripts/FaultDicNew'; import ModelType from '@/jmapNew/constant/deviceType'; -import { deviceFaultType} from '@/scripts/cmdPlugin/Config'; +import { deviceFaultType } from '@/scripts/cmdPlugin/Config'; // 故障列表 export default { @@ -168,7 +168,8 @@ export default { ], field:'', triggerStatusList:[], - faultTypeList:[] + faultTypeList:[], + targetDeviceName: '' }; }, computed: { @@ -191,6 +192,9 @@ export default { if (device && device.code) { this.deviceSelect(device); } + }, + targetDevice: function(device) { + this.targetDeviceName = this.targetDevice.name || this.targetDevice.code; } }, mounted() { @@ -231,13 +235,13 @@ export default { return name; }, - formatTriggerStatus(condition) { - if (!condition.triggerDeviceType) { - return ''; - } - const faultStatus = FaultStatusEnum[condition.triggerDeviceType]; - return faultStatus[condition.triggerDeviceStatus]; - }, + // formatTriggerStatus(condition) { + // if (!condition.triggerDeviceType) { + // return ''; + // } + // const faultStatus = FaultStatusEnum[condition.triggerDeviceType]; + // return faultStatus[condition.triggerDeviceStatus]; + // }, hover(field) { if (this.field == '') { this.field = field; diff --git a/src/views/newMap/displayNew/demon/runPlanView.vue b/src/views/newMap/displayNew/demon/runPlanView.vue index d0c46c89f..fca562703 100644 --- a/src/views/newMap/displayNew/demon/runPlanView.vue +++ b/src/views/newMap/displayNew/demon/runPlanView.vue @@ -201,7 +201,7 @@ export default { }, async analyticalServiceNumber(data) { this.serviceNumberConfig.data = Object.keys(data || {}) - .sort((a, b) => { return data[a].oldIndex - data[b].oldIndex; }) + .sort((a, b) => { return parseInt(data[a].serviceNumber) - parseInt(data[b].serviceNumber); }) .map(serviceNumber => { return { serviceNumber }; }); }, async analyticalTripNumber(data) { diff --git a/src/views/newMap/displayNew/demonMenu.vue b/src/views/newMap/displayNew/demonMenu.vue index f4bf216c4..20cac8daa 100644 --- a/src/views/newMap/displayNew/demonMenu.vue +++ b/src/views/newMap/displayNew/demonMenu.vue @@ -5,11 +5,13 @@ - {{ jl3dmodel }} + {{ jl3dmodel }} - {{ jl3dname }} + {{ jl3dname }} - {{ jl3dpassflow }} + {{ jl3dpassflow }} + + {{ jl3dtrafficplan }} 故障设备 @@ -22,6 +24,11 @@ 理论考试 切换地图 +
+ +
- diff --git a/src/views/newMap/displayNew/menuSchema.vue b/src/views/newMap/displayNew/menuSchema.vue index f4765aad9..0a73e57fe 100644 --- a/src/views/newMap/displayNew/menuSchema.vue +++ b/src/views/newMap/displayNew/menuSchema.vue @@ -2,7 +2,7 @@
-