diff --git a/src/api/rpTools.js b/src/api/rpTools.js index 49e080d99..142d92f61 100644 --- a/src/api/rpTools.js +++ b/src/api/rpTools.js @@ -23,9 +23,9 @@ export function listStations(lineId) { /** * 更新线路车站 */ -export function updateStation(lineId, data) { +export function updateStation(stationId, data) { return request({ - url: `/api/rpTools/station/${lineId}`, + url: `/api/rpTools/station/${stationId}`, method: 'put', data }) @@ -179,3 +179,19 @@ export function justTripTurnBack(planId, tripNo, data) { data }); } + +/** 开始编辑*/ +export function startRpEdit(planId) { + return request({ + url: `/api/rpTools/${planId}/edit`, + method: 'put' + }) +} + +/** 开始编辑*/ +export function endRpEdit(planId) { + return request({ + url: `/api/rpTools/${planId}/endEdit`, + method: 'put' + }) +} diff --git a/src/api/simulation.js b/src/api/simulation.js index df8606af0..c6efd75d2 100644 --- a/src/api/simulation.js +++ b/src/api/simulation.js @@ -380,3 +380,19 @@ export function getIbpInitialState (group, stationCode) { method: 'get' }); } +// 获取报警列表 +export function getAlarmList(group, params) { + return request({ + url: `/simulation/${group}/alarm`, + method: 'get', + params:params + }); +} +// 报警确认 +export function confirmAlarm(group, data) { + return request({ + url: `/simulation/${group}/alarm/confirm`, + method: 'put', + data + }); +} diff --git a/src/assets/icon/favicon_bjd.png b/src/assets/icon/favicon_bjd.png new file mode 100644 index 000000000..b2d5e932d Binary files /dev/null and b/src/assets/icon/favicon_bjd.png differ diff --git a/src/directive/quickMenuDrag/quickMenuDrag.js b/src/directive/quickMenuDrag/quickMenuDrag.js index 32287ee15..c9f4d3aaa 100644 --- a/src/directive/quickMenuDrag/quickMenuDrag.js +++ b/src/directive/quickMenuDrag/quickMenuDrag.js @@ -17,10 +17,10 @@ export default { /** 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px*/ if (sty.left.includes('%')) { styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100); - styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100); + styT = +document.body.clientHeight * (+sty.bottom.replace(/\%/g, '') / 100); } else { styL = +sty.left.replace(/\px/g, ''); - styT = +sty.top.replace(/\px/g, ''); + styT = +sty.bottom.replace(/\px/g, ''); } document.onmousemove = function (e) { @@ -28,20 +28,23 @@ export default { const l = e.clientX - disX; const t = e.clientY - disY; + console.log(l, l + styL, dragDom.style.left); + /** 移动当前元素*/ if (l + styL < 0) { dragDom.style.left = `0px`; - } else if (l + styL > document.body.clientWidth - dragDom.clientWidth - 30) { - dragDom.style.left = `${document.body.clientWidth - dragDom.clientWidth - 30}px`; + } else if (l + styL > document.body.clientWidth - dragDom.clientWidth - 100) { + dragDom.style.left = `${document.body.clientWidth - dragDom.clientWidth - 100}px`; } else { dragDom.style.left = `${l + styL}px`; } - if (t + styT < 0) { - dragDom.style.top = `0px`; - } else if (t + styT > document.body.clientHeight - dragDom.clientHeight - 10) { - dragDom.style.top = `${document.body.clientHeight - dragDom.clientHeight - 10}px`; + + if (document.body.clientHeight - (styT - t) - dragDom.clientHeight < 0) { + dragDom.style.bottom = `${document.body.clientHeight - dragDom.clientHeight}px`; + } else if (document.body.clientHeight - (styT - t) - dragDom.clientHeight > document.body.clientHeight - dragDom.clientHeight) { + dragDom.style.bottom = `0px`; } else { - dragDom.style.top = `${t + styT}px`; + dragDom.style.bottom = `${styT - t}px`; } /** 将此时的位置传出去*/ diff --git a/src/jlmap3d/edit/connect/initDataSave.js b/src/jlmap3d/edit/connect/initDataSave.js index 755c4fc4b..ab1b3749d 100644 --- a/src/jlmap3d/edit/connect/initDataSave.js +++ b/src/jlmap3d/edit/connect/initDataSave.js @@ -32,23 +32,32 @@ export function initDataSave(data) { let sections = []; // console.log(data.mapdata.sectionlist.sections.datalist); for(let i in data.mapdata.sectionlist.sections.datalist){ - console.log(data.mapdata.sectionlist.sections.datalist[i].mesh.railpoint); + let section = { // uuid:data.mapdata.sectionlist.sections.modellist[i].uuid, code:data.mapdata.sectionlist.sections.datalist[i].code, name:data.mapdata.sectionlist.sections.datalist[i].name, - lengthFact:data.mapdata.sectionlist.sections.datalist[i].mesh.lengthFact, + lengthFact:null, standTrack:data.mapdata.sectionlist.sections.datalist[i].standTrack, rp:data.mapdata.sectionlist.sections.datalist[i].rp, lp:data.mapdata.sectionlist.sections.datalist[i].lp, - railpoint:data.mapdata.sectionlist.sections.datalist[i].mesh.railpoint, + railpoint:null, rail:data.mapdata.sectionlist.sections.datalist[i].rail, - position:data.mapdata.sectionlist.sections.datalist[i].mesh.position, - rotation:data.mapdata.sectionlist.sections.datalist[i].mesh.rotation, - scale:data.mapdata.sectionlist.sections.datalist[i].mesh.scale, + position:null, + rotation:null, + scale:null, } - let nowmesh = data.mapdata.sectionlist.sectiongroup.getObjectByProperty("code",section.code); - section.railpoint = nowmesh.railpoint; + if(data.mapdata.sectionlist.sections.datalist[i].mesh){ + console.log(data.mapdata.sectionlist.sections.datalist[i].mesh.railpoint); + let nowmesh = data.mapdata.sectionlist.sectiongroup.getObjectByProperty("code",section.code); + section.railpoint = nowmesh.railpoint; + section.lengthFact = data.mapdata.sectionlist.sections.datalist[i].mesh.lengthFact; + section.position = data.mapdata.sectionlist.sections.datalist[i].mesh.position; + section.rotation = data.mapdata.sectionlist.sections.datalist[i].mesh.rotation; + section.scale = data.mapdata.sectionlist.sections.datalist[i].mesh.scale; + sections.push(section); + } + // console.log(nowmesh.railpoint); // if(data.mapdata.sectionlist.sections.datalist[i].rsection){ // section.rsection = data.mapdata.sectionlist.sections.datalist[i].rsection; @@ -62,7 +71,7 @@ export function initDataSave(data) { // testmesh1.position.z = link.position.z; - sections.push(section); + } let arrray = { section:sections, diff --git a/src/jlmap3d/edit/jlmap3dedit.js b/src/jlmap3d/edit/jlmap3dedit.js index e99031062..8a2487794 100644 --- a/src/jlmap3d/edit/jlmap3dedit.js +++ b/src/jlmap3d/edit/jlmap3dedit.js @@ -423,63 +423,12 @@ export function JLmap3dEdit(dom, data, mapid) { for(let i=0;i2){ - newAlignmentSection.lengthFact = newAlignmentSection.lengthFact/5; - } - - let len = newAlignmentSection.lengthFact; - // closedSpline.arcLengthDivisions; - let count = newAlignmentSection.geometry.attributes.position.count/3; - - for(let i=0;i2){ newAlignmentSection.lengthFact = newAlignmentSection.lengthFact/5; } - let len = newAlignmentSection.lengthFact; // closedSpline.arcLengthDivisions; let count = newAlignmentSection.geometry.attributes.position.count/3; + for(let i=0;i section.lengthFact/2){ - posx = section.mesh.position.x + data[i].sectionOffset - section.lengthFact/2; - }else{ - posx = section.mesh.position.x - (section.lengthFact/2 - data[i].sectionOffset); + if(section.lsection == undefined){ + section = sectiondata[section.rsection]; + data[i].sectionOffset = section.lengthFact; + data[i].sectionCode = section.rsection; } - //根据线路方向修改信号灯位置 - if(data[i].right == false){ - if(section.standTrack == true){ - posx = posx - 7; - } - - newmesh.position.set(posx,0,section.mesh.position.z-3); - newmesh.rotation.z = ( Math.PI / 2 ); - }else if(data[i].right == true){ - if(section.standTrack == true){ - posx = posx + 7; - } - newmesh.position.set(posx,0,section.mesh.position.z+3); - newmesh.rotation.z = ( - Math.PI / 2 ); + if(section.rsection == undefined){ + section = sectiondata[section.lsection]; + data[i].sectionOffset = 0; + data[i].sectionCode = section.rsection; } - newmesh.scale.x = 0.05; - newmesh.scale.y = 0.05; - newmesh.scale.z = 0.05; - newmesh.sectionOffset = data[i].sectionOffset; - newmesh.sectionCode = data[i].sectionCode; - newmesh.right = data[i].right; - newsignal.mesh = newmesh; - newsignal.sectionOffset = data[i].sectionOffset; - newsignal.mesh.status = "01"; - newsignal.name = data[i].name; - newsignal.modelid = assetloader.modellist[num].id; - newsignal.code = data[i].code; - newsignal.sectionCode = data[i].sectionCode; - newsignal.right = data[i].right; - scope.group.add(newmesh); - scope.list.push(newsignal); + if(data[i].sectionOffset > section.lengthFact/2){ + posx = section.mesh.position.x + data[i].sectionOffset - section.lengthFact/2; + }else{ + posx = section.mesh.position.x - (section.lengthFact/2 - data[i].sectionOffset); + } + //根据线路方向修改信号灯位置 + if(data[i].right == false){ + if(section.standTrack == true){ + posx = posx - 7; + } + + newmesh.position.set(posx,0,section.mesh.position.z-3); + newmesh.rotation.z = ( Math.PI / 2 ); + }else if(data[i].right == true){ + if(section.standTrack == true){ + posx = posx + 7; + } + newmesh.position.set(posx,0,section.mesh.position.z+3); + newmesh.rotation.z = ( - Math.PI / 2 ); + } + newmesh.scale.x = 0.05; + newmesh.scale.y = 0.05; + newmesh.scale.z = 0.05; + newmesh.sectionOffset = data[i].sectionOffset; + newmesh.sectionCode = data[i].sectionCode; + newmesh.right = data[i].right; + newsignal.mesh = newmesh; + + newsignal.sectionOffset = data[i].sectionOffset; + newsignal.mesh.status = "01"; + newsignal.name = data[i].name; + newsignal.modelid = assetloader.modellist[num].id; + newsignal.code = data[i].code; + newsignal.sectionCode = data[i].sectionCode; + newsignal.right = data[i].right; + scope.group.add(newmesh); + scope.list.push(newsignal); + }else{ for(let j=0;j= scope.playlist[scope.playorder].length-1){ if(scope.playorder >= scope.playlist.length-1 ){ scope.playlist = null; @@ -340,7 +329,6 @@ export function Moveanimate(main){ } } - }else{ // console.log(scope.animatelist[k].connectmodel); if(scope.nowmodelname != scope.playlist[scope.playorder][i].connectmodel.name){ @@ -383,5 +371,4 @@ export function Moveanimate(main){ } } - } diff --git a/src/jlmap3d/jl3ddevice/component/signallight.js b/src/jlmap3d/jl3ddevice/component/signallight.js index 6bb3178f4..9648653c5 100644 --- a/src/jlmap3d/jl3ddevice/component/signallight.js +++ b/src/jlmap3d/jl3ddevice/component/signallight.js @@ -1,8 +1,8 @@ import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js'; +//信号机贴图 export function Signallightload(lights) { - settexture(lights, "red", JL3D_LOCAL_STATIC+'/MODEL/device/signal/1.jpg'); settexture(lights, "yellow", JL3D_LOCAL_STATIC+'/MODEL/device/signal/2.jpg'); @@ -12,6 +12,7 @@ export function Signallightload(lights) { settexture(lights, "black", JL3D_LOCAL_STATIC+'/MODEL/device/signal/4.jpg'); } +//加载贴图 function settexture(lights, name, textureurl) { var loader = new THREE.TextureLoader(); diff --git a/src/jlmap3d/jl3ddevice/component/textconfig.js b/src/jlmap3d/jl3ddevice/component/textconfig.js index 1c6545f04..1c9a86ca5 100644 --- a/src/jlmap3d/jl3ddevice/component/textconfig.js +++ b/src/jlmap3d/jl3ddevice/component/textconfig.js @@ -4,13 +4,6 @@ export function Textconfig(){ this.devicelist = []; - this.jdqinit = function(){ - - } - - this.jdqraycast = function(){ - - } //配置继电器文字信息 this.initdevicetext = function(selectmodel){ diff --git a/src/jlmap3d/jl3ddevice/jl3ddevice.js b/src/jlmap3d/jl3ddevice/jl3ddevice.js deleted file mode 100644 index cdb2723cb..000000000 --- a/src/jlmap3d/jl3ddevice/jl3ddevice.js +++ /dev/null @@ -1,729 +0,0 @@ -import { Staticmodel } from '@/jlmap3d/jl3ddevice/config.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/jl3ddevice/loader.js'; -import { Signallightload } from '@/jlmap3d/jl3ddevice/component/signallight.js'; -import { Moveanimate } from '@/jlmap3d/jl3ddevice/component/moveanimate.js'; -import { Textconfig } from '@/jlmap3d/jl3ddevice/component/textconfig.js'; -import StompClient from '@/utils/sock'; - -var clock = new THREE.Clock(); -export function Jl3ddevice(dom,group,token) { - var scope = this; - - this.dom = dom; - this.nowcode = null; - this.animateswitch = false; - this.signallights = []; - Signallightload(this.signallights); - this.mixers = []; - this.showmodel = null; - - //新数据交互 - let helpbox,textplane; - let daochamodel; - //点击事件状态 - this.raycasterstatus = false; - //动画状态 - this.animastats = false; - //当前选中模型 - this.nowobject = null; - //当前动画播放模型 - this.animationmodel = null; - this.devicetext = new Textconfig(); - this.windowstatus = '0'; - - //初始化webgl渲染 - this.renderer = new THREE.WebGLRenderer({ antialias: true }); - - this.renderer.setClearColor(new THREE.Color(0x000000)); - this.renderer.setSize(dom.offsetWidth, dom.offsetHeight); - this.renderer.shadowMap.enabled = true; - this.renderer.shadowMap.type = THREE.PCFSoftShadowMap; - this.dom.appendChild(this.renderer.domElement); - - //定义相机 - - this.camera = new THREE.PerspectiveCamera(70, dom.offsetWidth / dom.offsetHeight, 0.01, 120); - this.camera.position.set(0, 20, 30); - this.camera.aspect = dom.offsetWidth / dom.offsetHeight; - this.camera.updateProjectionMatrix(); - //定义场景(渲染容器) - this.scene = new THREE.Scene(); - this.scene.background = new THREE.Color(0xa0a0a0); - - var mesh = new THREE.Mesh(new THREE.PlaneBufferGeometry(200, 200), new THREE.MeshPhongMaterial({ color: 0x999999, depthWrite: false })); - mesh.rotation.x = - Math.PI / 2; - mesh.receiveShadow = true; - this.scene.add(mesh); - - var grid = new THREE.GridHelper(200, 20, 0x000000, 0x000000); - grid.material.opacity = 0.2; - grid.material.transparent = true; - this.scene.add(grid); - - - //定义全局光 - let ambientLight = new THREE.AmbientLight(0xffffff, 1.3); - this.scene.add(ambientLight); - - - var spotLight = new THREE.SpotLight(0xffffff); - spotLight.position.set(-50, 60, 15); - spotLight.castShadow = true; - spotLight.shadow.mapSize.width = 1024; - spotLight.shadow.mapSize.height = 1024; - this.scene.add(spotLight); - - - - this.controls = new THREE.OrbitControls(this.camera, dom); - this.controls.maxPolarAngle = Math.PI / 2; - this.controls.minPolarangle = Math.PI / 5; - this.controls.maxDistance = 80; - this.controls.update(); - this.selectmodel = null; - - let moveanima = new Moveanimate(scope); - document.addEventListener( "mousedown", onselect, false ); - - - let teststomp = new StompClient(); - let topic = '/user/topic/simulation/assistant/'+group; - // let topic = '/user/queue/simulation/jl3d/'+group; - let header = {'X-Token': token}; - try { - // console.log("teststomp"); - teststomp.subscribe(topic, callback, header); - } catch (error) { - console.error('websocket订阅失败'); - } - - function callback(Response) { - let data = JSON.parse(Response.body); - if(scope.nowcode != data.body.code){ - scope.nowcode = data.body.code; - scope.selectmodel(data); - }else{ - scope.updateaction(data); - } - - } - window.onresize = function () { - scope.camera.aspect = scope.dom.offsetWidth / scope.dom.offsetHeight; - scope.camera.updateProjectionMatrix(); - scope.renderer.setSize(scope.dom.offsetWidth, scope.dom.offsetHeight); - } - this.domresize = function(){ - scope.camera.aspect = scope.dom.offsetWidth / scope.dom.offsetHeight; - scope.camera.updateProjectionMatrix(); - scope.renderer.setSize(scope.dom.offsetWidth, scope.dom.offsetHeight); - } - this.anime = null; - - this.modelmanager = new ModelManager(); - this.modelmanager.loadpromise(Staticmodel, scope.mixers).then(function (data) { - moveanima.initlistnew(scope.modelmanager.switchmodel.mesh); - daochamodel = scope.modelmanager.switchmodel.mesh.getObjectByName("DAOCHA"); - - animate(); - }) - - //循环渲染函数 - function animate() { - - scope.anime = requestAnimationFrame(animate); - scope.renderer.render(scope.scene, scope.camera); - scope.controls.update(); - //scope.camera.lookAt(plane); - // - moveanima.animateupdate(); - let delta = clock.getDelta(); - if (scope.mixers) { - for (let i = 0; i < scope.mixers.length; i++) { - if (scope.mixers[i]) { - scope.mixers[i].update(delta); - } - } - } - - - } - - this.selectmodel = function (data) { - if (scope.showmodel) { - scope.nowcode = data.body.code; - if (scope.showmodel.code != data.body.code) { - scope.scene.remove(scope.showmodel); - scope.showmodel = null - - if (data.body._type == "Switch") { - scope.modelmanager.switchmodel.locateType = data.body.locateType; - scope.modelmanager.switchmodel.code = data.body.code; - - scope.showmodel = scope.modelmanager.switchmodel.mesh; - scope.scene.add(scope.showmodel); - - scope.devicetext.initdevicetext(scope.modelmanager.switchmodel.mesh); - scope.nowobject = scope.modelmanager.switchmodel.mesh; - updatemenulist(scope.devicetext.devicelist); - scope.raycasterstatus = true; - - }else{ - scope.raycasterstatus = false; - scope.nowobject = ""; - updatemenulist(); - } - - if (data.body._type == "Signal") { - scope.modelmanager.signalmodel.code = data.body.code; - - scope.showmodel = scope.modelmanager.signalmodel.mesh; - scope.scene.add(scope.showmodel); - - } - - if (data.body._type == "StationStand") { - - scope.modelmanager.standmodel.code = data.body.code; - - scope.showmodel = scope.modelmanager.standmodel.mesh; - scope.scene.add(scope.showmodel); - } - - if(scope.showmodel){ - scope.resetmodel(); - scope.showmodel.code = data.code; - initstatus(data); - } - - } - } else { - if (data.body._type == "Switch") { - scope.modelmanager.switchmodel.locateType = data.body.locateType; - scope.modelmanager.switchmodel.code = data.body.code; - scope.showmodel = scope.modelmanager.switchmodel.mesh; - scope.scene.add(scope.showmodel); - - scope.devicetext.initdevicetext(scope.modelmanager.switchmodel.mesh); - scope.nowobject = scope.modelmanager.switchmodel.mesh; - updatemenulist(scope.devicetext.devicelist); - scope.raycasterstatus = true; - if (data.body.locateType == "01") { - scope.modelmanager.switchmodel.locateType = "01"; - scope.modelmanager.switchmodel.action.reset(); - scope.modelmanager.switchmodel.action.time = 0; - scope.modelmanager.switchmodel.action.timeScale = -1; - scope.modelmanager.switchmodel.action.play(); - - } else if (data.body.locateType == "02") { - scope.modelmanager.switchmodel.locateType = "02"; - scope.modelmanager.switchmodel.action.reset(); - scope.modelmanager.switchmodel.action.time = scope.modelmanager.switchmodel.action._clip.duration; - scope.modelmanager.switchmodel.action.timeScale = 1; - scope.modelmanager.switchmodel.action.play(); - - } - - }else{ - scope.raycasterstatus = false; - scope.nowobject = ""; - updatemenulist(); - } - if (data.body._type == "Signal") { - scope.modelmanager.signalmodel.code = data.body.code; - scope.showmodel = scope.modelmanager.signalmodel.mesh; - scope.scene.add(scope.showmodel); - } - - if (data.body._type == "StationStand") { - scope.modelmanager.standmodel.code = data.body.code; - scope.showmodel = scope.modelmanager.standmodel.mesh; - scope.scene.add(scope.showmodel); - } - initstatus(data); - } - - - } - - this.updateaction = function (data) { - - if (data.body._type == "Switch") { - if (data.body.code == scope.modelmanager.switchmodel.code) { - if (scope.modelmanager.switchmodel.locateType != data.body.locateType) { - if (data.body.locateType == "03" && scope.modelmanager.switchmodel.locateType == "01") { - - scope.modelmanager.switchmodel.locateType = "02"; - scope.modelmanager.switchmodel.action.reset(); - scope.modelmanager.switchmodel.action.time = 0; - scope.modelmanager.switchmodel.action.timeScale = 1; - scope.modelmanager.switchmodel.action.play(); - - } else if (data.body.locateType == "03" && scope.modelmanager.switchmodel.locateType == "02") { - - scope.modelmanager.switchmodel.locateType = "01"; - scope.modelmanager.switchmodel.action.reset(); - scope.modelmanager.switchmodel.action.time = scope.modelmanager.switchmodel.action._clip.duration; - scope.modelmanager.switchmodel.action.timeScale = -1; - scope.modelmanager.switchmodel.action.play(); - - } - } - } - - } - if (data.body._type == "Signal") {//从上往下红绿黄 - if (data.body.code == scope.modelmanager.signalmodel.code) { - scope.modelmanager.signalmodel.status = data.body.status; - - if (data.body.lightType == "01") { - - if (data.body.status == "01") { - scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["red"]; - scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; - } - //开放 - if (data.body.status == "02") { - scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["green"]; - scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; - } - //开放侧向 - if (data.body.status == "03") { - scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["yellow"]; - scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; - } - //引导 - if (data.body.status == "04") { - scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["red"]; - scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["yellow"]; - scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; - } - //封锁 - if (data.body.status == "05") { - scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; - } - //故障 - if (data.body.status == "06") { - scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; - } - - } else if (data.body.lightType == "02") { - scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; - } - } - - } - - - if (data.body._type == "StationStand") { - if (data.body.code == scope.modelmanager.standmodel.code) { - if (data.body.screenDoorOpenStatus == "02" && scope.modelmanager.standmodel.screenDoorOpenStatus == "01") { - scope.modelmanager.standmodel.screenDoorOpenStatus = "00"; - } - if (data.body.screenDoorOpenStatus == "02" && scope.modelmanager.standmodel.screenDoorOpenStatus == "00") { - scope.modelmanager.standmodel.screenDoorOpenStatus = "02"; - - scope.modelmanager.standmodel.action.reset(); - scope.modelmanager.standmodel.action.time = 0; - scope.modelmanager.standmodel.action.timeScale = 1; - scope.modelmanager.standmodel.action.play(); - } - - if (data.body.screenDoorOpenStatus == "01" && scope.modelmanager.standmodel.screenDoorOpenStatus == "02") { - scope.modelmanager.standmodel.screenDoorOpenStatus = "00"; - } - if (data.body.screenDoorOpenStatus == "01" && scope.modelmanager.standmodel.screenDoorOpenStatus == "00") { - scope.modelmanager.standmodel.screenDoorOpenStatus = "01"; - - scope.modelmanager.standmodel.action.reset(); - scope.modelmanager.standmodel.action.time = scope.modelmanager.standmodel.action._clip.duration; - scope.modelmanager.standmodel.action.timeScale = -1; - scope.modelmanager.standmodel.action.play(); - } - } - - } - // scope.showmodel. - } - - function initstatus(data) { - - if (data.body._type == "Switch") { - - if (data.body.locateType == "01") { - scope.modelmanager.switchmodel.locateType = "01"; - scope.modelmanager.switchmodel.action.reset(); - scope.modelmanager.switchmodel.action.time = 0; - scope.modelmanager.switchmodel.action.timeScale = -1; - scope.modelmanager.switchmodel.action.play(); - - } else if (data.body.locateType == "02") { - scope.modelmanager.switchmodel.locateType = "02"; - scope.modelmanager.switchmodel.action.reset(); - scope.modelmanager.switchmodel.action.time = scope.modelmanager.switchmodel.action._clip.duration; - scope.modelmanager.switchmodel.action.timeScale = 1; - scope.modelmanager.switchmodel.action.play(); - - } - - - } - - if (data.body._type == "Signal") { - if (data.body.lightType == "01") { - - if (data.body.status == "01") { - scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["red"]; - scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; - } - //开放 - if (data.body.status == "02") { - scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["green"]; - scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; - } - if (data.body.switchLocateType == "03") { - scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["yellow"]; - scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; - } - //引导 - if (data.body.status == "03") { - scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["red"]; - scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["yellow"]; - scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; - } - //封锁 - if (data.body.status == "04") { - scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; - } - //故障 - if (data.body.status == "05") { - scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; - } - - } else if (data.body.lightType == "02") { - scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; - scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["black"]; - scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; - } - } - - if (data.body._type == "StationStand") { - if (data.body.code == scope.modelmanager.standmodel.code) { - - if (data.body.screenDoorOpenStatus == "02") { - scope.modelmanager.standmodel.screenDoorOpenStatus = "02"; - - scope.modelmanager.standmodel.action.reset(); - scope.modelmanager.standmodel.action.time = scope.modelmanager.standmodel.action._clip.duration; - scope.modelmanager.standmodel.action.timeScale = 1; - scope.modelmanager.standmodel.action.play(); - } - - if (data.body.screenDoorOpenStatus == "01") { - scope.modelmanager.standmodel.screenDoorOpenStatus = "01"; - - scope.modelmanager.standmodel.action.reset(); - scope.modelmanager.standmodel.action.time = 0; - scope.modelmanager.standmodel.action.timeScale = -1; - scope.modelmanager.standmodel.action.play(); - } - } - - } - - } - - //设备分解、归位动画按钮 - this.disperdevice1 = function(){ - if(scope.nowobject.animacode){ - if(moveanima.status == true){ - if(scope.animastats == false){ - scope.animastats = true; - moveanima.setplaylist(moveanima.animatelist[scope.nowobject.animacode+"on"],true) - } else if(scope.animastats == true){ - scope.animastats = false; - moveanima.setplaylist(moveanima.animatelist[scope.nowobject.animacode+"off"],true); - } - } - } - - - }; - - this.disperdevice2 = function(){ - if(scope.nowobject.animacode){ - if(moveanima.status == true){ - if(scope.animastats == false){ - scope.animastats = true; - moveanima.setplaylist(moveanima.animatelist[scope.nowobject.animacode+"chaijie"],true); - } else if(scope.animastats == true){ - scope.animastats = false; - moveanima.setplaylist(moveanima.animatelist[scope.nowobject.animacode+"fuwei"],true); - } - } - } - - }; - - this.resetmodel = function(){ - if(scope.nowobject.animacode){ - scope.animastats = false; - moveanima.setplaylist(moveanima.animatelist[scope.nowobject.animacode+"fuwei"],true); - } - - }; - - this.animationmsgshowon = function(nowobject){ - scope.animationmodel = nowobject; - if(helpbox){ - scope.animationmodel.helpbox = null; - scope.scene.remove( helpbox ); - helpbox = undefined; - } - - settext(scope.animationmodel,scope.animationmodel.position); - // console.log(scope.animationmodel); - helpbox = new THREE.BoxHelper( scope.animationmodel, 0xff0000 ); - moveanima.updatehelpbox(helpbox,textplane); - // settext(intersects[0].object,intersects[0].point); - // getdevicemsg(intersects[0].object.name); - scope.scene.add( helpbox ); - getdevicemsg(nowobject.name); - } - - this.animationmsgshowoff = function(nowobject){ - if(helpbox){ - scope.animationmodel.helpbox = null; - scope.scene.remove( helpbox ); - helpbox = undefined; - } - if(textplane){ - scope.scene.remove(textplane); - textplane.geometry.dispose(); - textplane.material.dispose(); - } - scope.animationmodel = null; - } - - this.updateselect = function(updata){ - // console.log(updata); - if(helpbox){ - scope.scene.remove( helpbox ); - helpbox = null; - } - helpbox = new THREE.BoxHelper( updata.mesh, 0xff0000 ); - // console.log(updata.mesh); - let point = { - x:updata.mesh.matrixWorld.elements[12], - y:updata.mesh.matrixWorld.elements[13], - z:updata.mesh.matrixWorld.elements[14] - }; - settext(updata.mesh,point) - getdevicemsg(updata.mesh.name); - scope.scene.add( helpbox ); - } - - function getdevicemsg(selectname){ - // console.log(selectname); - for(let i=0,leni=scope.devicetext.devicelist.length;i { let netDataAssets = JSON.parse(netdata.data.assets); @@ -283,6 +275,7 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) { }); + //初始化屏蔽门贴图 function setpsdstationmap(stationlist){ for(let i=0,leni=stationlist.length;i=0;j--){ diff --git a/src/jlmap3d/jl3dsimulation/jlmap3d.js b/src/jlmap3d/jl3dsimulation/jlmap3d.js index 5ffb6ccb0..596e6f7d4 100644 --- a/src/jlmap3d/jl3dsimulation/jlmap3d.js +++ b/src/jlmap3d/jl3dsimulation/jlmap3d.js @@ -37,7 +37,6 @@ var clock = new THREE.Clock(); export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) { - let scope = this; this.dom = dom; @@ -46,8 +45,10 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) { renderer.domElement.style.position = "absolute"; renderer.domElement.style.top = "0"; document.getElementById('testjlmap3d').appendChild(renderer.domElement); + //定义相机 let camera = SetCamera(dom); + //定义场景(渲染容器) let scene = SetScene(project); let scenesimulation = new THREE.Group(); @@ -79,6 +80,7 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) { //模型操作命令组 this.actions = {}; + //设备数据 let sectionlist = null; let linklist = null; let signallist = null; @@ -87,16 +89,17 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) { let realsectionlist = null; let rails = null; + //轨道相机 let camerarail = { curve:null, progress:0, moveswitch:false }; + //地图模型数据 let mapdata = new Jl3ddata(); + //订阅仿真socket - - this.webwork = new Worker(JL3D_LOCAL_STATIC+"/workertest/trainworker.js"); //初始化加载数据和模型getPublishMapDetail getPublishMapDetail(skinCode).then(data => { @@ -110,46 +113,7 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) { SimulationLoadNew(mapnetdata,scope,netdata.data,mapdata,camera,controls,scenesimulation,storemod); }); }); - // - // let stats = new Stats(); - // dom.appendChild( stats.dom ); - // var timer = setInterval(function() { - // if(trainlisttest){ - // if(trainlisttest.group){ - // if(trainlisttest.group.children[0]){ - // for(let k in rails.switchrail){ - // const ddd = storemod.getters['map/getDeviceByCode'](k); - // let switchdata = rails.switchrail[k]; - // rails.switchrail[k].locateType = ddd.locateType; - // - // if(ddd.locateType == "01"){ - // //1--向左 2--向右 - // //__\__ __/__ - // if(rails.switchrail[k].directtype == "1"){ - // rails.linkrail[switchdata.alink].lconnect = switchdata.blink; - // rails.linkrail[switchdata.blink].rconnect = switchdata.alink; - // }else if(rails.switchrail[k].directtype == "2"){ - // rails.linkrail[switchdata.alink].rconnect = switchdata.blink; - // rails.linkrail[switchdata.blink].lconnect = switchdata.alink; - // } - // - // }else if(ddd.locateType == "02"){ - // if(rails.switchrail[k].directtype == "1"){ - // rails.linkrail[switchdata.alink].lconnect = switchdata.clink; - // rails.linkrail[switchdata.clink].rconnect = switchdata.alink; - // }else if(rails.switchrail[k].directtype == "2"){ - // rails.linkrail[switchdata.alink].rconnect = switchdata.clink; - // rails.linkrail[switchdata.clink].lconnect = switchdata.alink; - // } - // } - // } - // clearInterval(timer); - // } - // } - // } - // - // }, 2000); //开启渲染 animate(); startWorker(scope.webwork); @@ -158,18 +122,13 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) { //循环渲染函数 function animate() { //循环渲染 - //requestAnimationFrame(animate); - //renderer.setAnimationLoop(animate); requestAnimationFrame(animate); - //判断渲染是否开启 - //根据相机渲染场景 + //根据相机渲染场景 renderer.render(scene,camera); - //检测动画构造器播放动画 - - // } // stats.update(); } + //利用webworker当做定时器驱动设备动画,更新列车状态,车站漫游动画 function startWorker(webwork){ if(typeof(Worker)!=="undefined"){ @@ -181,6 +140,15 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) { UpdateTrain(camera,trainlisttest); } + delta = clock.getDelta(); + for(let i=scope.mixers.length-1;i>=0;i--){ + if(scope.mixers[i]._actions[0].isRunning()){ + // console.log(scope.mixers[i]._actions[0].isRunning()); + scope.mixers[i].update( delta ); + } + } + + //开启车站漫游 if(camerarail.moveswitch == true){ // console.log(camerarail.progress); if(camerarail.progress>=0.99){ @@ -201,18 +169,12 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) { } - delta = clock.getDelta(); - for(let i=scope.mixers.length-1;i>=0;i--){ - if(scope.mixers[i]._actions[0].isRunning()){ - // console.log(scope.mixers[i]._actions[0].isRunning()); - scope.mixers[i].update( delta ); - } - } }; } } + //释放场景缓存关闭渲染循环 this.dispose = function(){ renderer.setAnimationLoop(null); renderer.dispose(); @@ -242,6 +204,7 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) { } }; + //切换显示车站信息 this.showstationmsg = function(showtype){ if(showtype == "show"){ for(let st=0;st item.show() ); } else { diff --git a/src/jmapNew/shape/Train/TrainBody.js b/src/jmapNew/shape/Train/TrainBody.js index f69fda857..1b5a6e889 100644 --- a/src/jmapNew/shape/Train/TrainBody.js +++ b/src/jmapNew/shape/Train/TrainBody.js @@ -40,12 +40,22 @@ export default class TrainBody extends Group { create() { const model = this.model; const style = this.model.style; - const serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.serviceNumber || model.model.specialServiceNumber || style.Train.trainServer.defaultServiceNumber);// 服务号(表号) + this.nameFormat = model.nameFormat; const tripNumber = style.Train.trainTarget.tripNumberPrefix + (style.Train.trainTarget.defaultDirectionCode ? (model.directionCode || style.Train.trainTarget.defaultDirectionCode) + (model.tripNumber || style.Train.trainTarget.defaultTripNumber) - : model.tripNumber || style.Train.trainTarget.defaultTripNumber); // 车次号 - let targetCode = style.Train.trainNumber.targetCodePrefix + (model.destinationCode || style.Train.trainNumber.defaultTargetCode); // 目的地码 + : model.tripNumber || style.Train.trainTarget.defaultTripNumber); // 车次号 const groupNumber = style.Train.trainTargetNumber.groupNumberPrefix + (style.Train.trainTargetNumber.lineNumber || '') + (model.groupNumber || style.Train.trainTargetNumber.defaultGroupNumber); // 车组号 + let serviceNumber = ''; // 服务号(表号) + if (this.model.type == 'PLAN') { // 计划车 + serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.serviceNumber || model.model.specialServiceNumber || style.Train.trainServer.defaultServiceNumber); + } else if (this.model.type == 'HEAD') { // 头码车 + serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.destinationCode || style.Train.trainNumber.defaultTargetCode); + this.nameFormat = 'serviceNumber:groupNumber'; + } else if (this.model.type == 'MANUAL') { // 人工车 + serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.serviceNumber || model.model.specialServiceNumber || style.Train.trainServer.defaultServiceHeadNum); + this.nameFormat = 'serviceNumber:groupNumber'; + } + let targetCode = style.Train.trainNumber.targetCodePrefix + (model.destinationCode || style.Train.trainNumber.defaultTargetCode); // 目的地码 if (Vue.prototype.$jlmap.lineCode == '09') { // 暂时先写死 后面有了删掉就好 targetCode = '01'; } diff --git a/src/jmapNew/theme/aus_00/planConvert.js b/src/jmapNew/theme/aus_00/planConvert.js index ae521da21..64c674c71 100644 --- a/src/jmapNew/theme/aus_00/planConvert.js +++ b/src/jmapNew/theme/aus_00/planConvert.js @@ -2,6 +2,12 @@ import { createSeriesModel, createMarkLineModels, createRectArea, createMartPoin import { toTimeStamp } from '@/utils/date'; export default { + /** 最小时间*/ + MinTime: 0, + + /** 最大时间*/ + MaxTime: 3600*24-1, + /** 边缘高度*/ EdgeHeight: 600, @@ -13,11 +19,10 @@ export default { /** 转换model为Rect数据*/ calcAreaArgsByModel(chart, model) { - const startTime = model.startTime; - const endTime = model.endTime; const fartherKmRange = model.fartherKmRange; const closerKmRange = model.closerKmRange; - + const startTime = model.startTime; + const endTime = model.endTime; const point1 = [ startTime, this.getCoordinateYByKmRange(fartherKmRange)]; const point2 = [ endTime, this.getCoordinateYByKmRange(closerKmRange)] const position1 = chart.convertToPixel('grid', point1); @@ -43,8 +48,8 @@ export default { planData.areaList && planData.areaList.length) { planData.areaList.forEach(model => { - model.startTime = toTimeStamp(model.startTime); - model.endTime = toTimeStamp(model.endTime); + if (typeof model.startTime == 'string') model.startTime = toTimeStamp(model.startTime); + if (typeof model.endTime == 'string') model.endTime = toTimeStamp(model.endTime); graphs.push(createRectArea(this.calcAreaArgsByModel(chart, model))); }) } @@ -235,13 +240,32 @@ export default { return null; }, + /**限制区域范围 */ + limitAreaTime(model) { + if (model) { + model.startTime = model.startTime < this.MinTime + ? this.MinTime + : model.startTime > this.MaxTime + ? this.MaxTime + : model.startTime; + + model.endTime = model.endTime < this.MinTime + ? this.MinTime + : model.endTime > this.MaxTime + ? this.MaxTime + : model.endTime; + } + return model; + }, + /** 检查公里表是否超出范围*/ limitAreaKmRange(stations, model) { const closerKmRange = model.closerKmRange; const fartherKmRange = model.fartherKmRange; const length = stations.length; + const first = stations[0]||{}; const last = stations[length-1]||{}; - const minRange = -this.EdgeHeight/2; + const minRange = first.kmRange-this.EdgeHeight; const maxRange = last.kmRange; const tolerant = 0; diff --git a/src/jmapNew/theme/aus_00/utils.js b/src/jmapNew/theme/aus_00/utils.js index 0e1c833de..e6bc7efc2 100644 --- a/src/jmapNew/theme/aus_00/utils.js +++ b/src/jmapNew/theme/aus_00/utils.js @@ -52,6 +52,8 @@ export function createRectArea(opt, style={}) { point1: opt.point1, point2: opt.point2, model: opt.model, + culling: true, + progressive: true, shape: { x: 0, y: 0, @@ -96,10 +98,13 @@ export function createMarkLineModels(stations, computedYaxis) { show: true, position: 'start', formatter: elem.name, - color: 'black' + color: elem.transferable ? '#000': '#000', + backgroundColor: elem.transferable ? '#008800': '', + padding: [5,3,3,3], }, lineStyle: { - type: 'solid', + type: 'solid', + color: elem.transferable? '#008800': '#000', width: 0.5, opacity: 0.5 }, diff --git a/src/jmapNew/theme/chengdu_03/menus/menuBar.vue b/src/jmapNew/theme/chengdu_03/menus/menuBar.vue index c9cf5c801..ccebb5430 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuBar.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuBar.vue @@ -126,7 +126,8 @@ export default { Local: [ { title: '系统', - operate: OperationEvent.Command.mBar.system, + // operate: OperationEvent.Command.mBar.system, + operate: '', children: [ { title: '登录', @@ -174,7 +175,8 @@ export default { }, { title: '查看', - operate: OperationEvent.Command.mBar.check, + // operate: OperationEvent.Command.mBar.check, + operate: '', children: [ { title: '运行图', @@ -287,7 +289,8 @@ export default { }, { title: '显示', - operate: OperationEvent.Command.mBar.view, + // operate: OperationEvent.Command.mBar.view, + operate: '', hide: true, children: [ { diff --git a/src/jmapNew/theme/components/menus/dialog/setFault.vue b/src/jmapNew/theme/components/menus/dialog/setFault.vue index 0bdb2fb57..9a80448ff 100644 --- a/src/jmapNew/theme/components/menus/dialog/setFault.vue +++ b/src/jmapNew/theme/components/menus/dialog/setFault.vue @@ -119,7 +119,11 @@ export default { if (selected._type == 'Train') { name = selected.serviceNumber; } - this.deviceName = deviceType[selected._type] + '-' + name; + if (name) { + this.deviceName = deviceType[selected._type] + '-' + name; + } else { + this.deviceName = deviceType[selected._type]; + } this.faultList = deviceFaultType[selected._type]; if (this.faultList && this.faultList.length) { this.form.faultType = this.faultList[0].value; diff --git a/src/jmapNew/theme/components/utils/menuOperate.js b/src/jmapNew/theme/components/utils/menuOperate.js index 63c8a2ac4..e8fba250f 100644 --- a/src/jmapNew/theme/components/utils/menuOperate.js +++ b/src/jmapNew/theme/components/utils/menuOperate.js @@ -302,6 +302,11 @@ export const menuOperate = { // 批量取消扣车 operation: OperationEvent.StationStand.cancelBulkBuckleTrain.menu.operation, cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN_ALL + }, + openPsdByHand:{ + // 手动开启屏蔽门 + operation: OperationEvent.StationStand.openPsdByHand.menu.operation, + cmdType:CMD.Stand.CMD_STAND_OPEN_PSD } }, StationControl:{ diff --git a/src/jmapNew/theme/fuzhou_01/planConvert.js b/src/jmapNew/theme/fuzhou_01/planConvert.js index 001dc5030..0163d7a31 100644 --- a/src/jmapNew/theme/fuzhou_01/planConvert.js +++ b/src/jmapNew/theme/fuzhou_01/planConvert.js @@ -15,120 +15,232 @@ export default { beginRow: 1, beginCol: 0, // fieldNum: 10, - columns: { - '默认上行折返轨': { key: 'upTrack', formatter: (val) => { return val; } }, - '默认下行折返轨': { key: 'downTrack', formatter: (val) => { return val; } } - } + trainId: '车次号', + columns: ['备注', '车次号'] + // beginRow: 1, + // beginCol: 0, + // // fieldNum: 10, + // columns: { + // '默认上行折返轨': { key: 'upTrack', formatter: (val) => { return val; } }, + // '默认下行折返轨': { key: 'downTrack', formatter: (val) => { return val; } } + // } }, + // /** 解析exal数据转换为Json后台数据*/ + // importData(Sheet, JsonData) { + // const dataList = convertSheetToList(Sheet, true); + // const needList = Object.keys(this.ExcelConfig.columns); + // const tripObj = { upTrack: '', downTrack: '' }; + // if (dataList && dataList.length && dataList[1] && dataList[0]) { + // const tIndex = dataList.findIndex(it => { return it[0]; }); + // if (dataList[0][0] == needList[0] && dataList[1][0] == needList[1]) { + // for (var colIndex = this.ExcelConfig.beginCol; colIndex < dataList.length; colIndex += 1) { + // var isContinue = true; + + // for (var rowIndex = this.ExcelConfig.beginRow; isContinue; rowIndex += 1) { + // isContinue = false; + + // var title = dataList[colIndex][0]; + // var value = dataList[colIndex][rowIndex]; + + // if (title && value) { + // // 数据列解析 + // isContinue = true; + // var titleStr = `${title}`.replace(/\s*/g, ''); + // var valueStr = `${value}`.replace(/\s*/g, ''); + + // // 取需要的字段 + // if (needList.findIndex(elem => { return elem == titleStr; }) >= 0) { + // tripObj[this.ExcelConfig.columns[titleStr].key] = this.ExcelConfig.columns[titleStr].formatter(valueStr); + // } + // } + + // } + // } + // } else { + // /** 解析二维数组为json对象*/ + // const reg0 = /^[↑|↓|¡|ü|ý|]+(.*)/; // ↑|↓ + // const reg1 = /^([▼|▲|¡ø|¨‹]+)\s*(\d+:\d+:\d+)/; // ▲ 06:10:00 + // const reg2 = /^(\d+:\d+:\d+)\s*([▼|▲|¡ø|¨‹]+)/; // 06:10:00 ▲ + // const reg3 = /^(\d+:\d+:\d+)\s*(\d+:\d+:\d+|)/; // 06:10:00 06:12:00 + // const reg4 = /[▼|▲|¡|ø|¨|‹]+/; // ▲ + + // dataList.forEach((elem, i) => { + // var begin = -1; + // /** 跳过名称所在的行*/ + // if (i != tIndex && elem && elem.length > 0) { + // elem.forEach((item, j) => { + // /** 过滤空值*/ + // if (item) { + // var value = `${item}`.trim(); + // var title = `${dataList[tIndex][j]}`.replace(/\s*/g, ''); + // /** 匹配到开始位置或者结束位置*/ + // if (reg0.test(value)) { + // if (begin == -1) { + // begin = value; // 设置初始索引 + // JsonData.push({ + // code: reg0.exec(value)[1], + // arrivalList: [] + // }); + // } else if (begin === value) { + // begin = -1; // 清空初始索引 + // } + // } else if (begin !== -1) { + // /** 匹配到中间位置*/ + // var begTime, endTime; + // var runFlag = JsonData[JsonData.length - 1].code[2]; + // var stationName = title.replace(/\s/, ''); + // var need = false; + // var flag = false; + // if (reg1.test(value)) { + // /** 含有特殊字符的时间格式*/ + // [, begTime, endTime] = reg1.exec(value); + + // begTime = reg4.test(begTime) ? '' : begTime; + // endTime = reg4.test(endTime) ? '' : endTime; + + // /** 下行方向时间互换*/ + // if (runFlag === '2') { + // [begTime, endTime] = [endTime, begTime]; + // } + + // /** 设置标志*/ + // [need, flag] = [true, true]; + // } else if (reg2.test(value)) { + // /** 含有特殊字符的时间格式*/ + // [, begTime, endTime] = reg2.exec(value); + + // begTime = reg4.test(begTime) ? '' : begTime; + // endTime = reg4.test(endTime) ? '' : endTime; + + // /** 下行方向时间互换*/ + // if (runFlag === '2') { + // [begTime, endTime] = [endTime, begTime]; + // } + + // /** 设置标志*/ + // [need, flag] = [true, true]; + // } else if (reg3.test(value)) { + // /** 正常时间格式*/ + // [, begTime, endTime] = reg3.exec(value); + + // /** 如果只存在一个数据时,则开始和结束设置一样*/ + // endTime = endTime || begTime; + + // /** 下行方向时间互换*/ + // if (runFlag === '2') { + // [begTime, endTime] = [endTime, begTime]; + // } + + // /** 设置标志*/ + // [need, flag] = [true, false]; + // } + + // /** 添加json数据*/ + // if (need) { // 储存非空 数据 + // var stationObj = { + // stationName: stationName + // }; + + // if (begTime) { stationObj['arriveTime'] = prefixTime(begTime); } + // if (endTime) { stationObj['departureTime'] = prefixTime(endTime); } + // if (flag) { stationObj['flag'] = flag; } // 是否转换轨 + // JsonData[JsonData.length - 1].arrivalList.push(stationObj); + // } + // } + // } + // }); + // } + // }); + // } + // } + // JsonData.forEach(item => { + // item['upTrack'] = tripObj.upTrack; + // item['downTrack'] = tripObj.downTrack; + // }); + + // return JsonData; + // }, /** 解析exal数据转换为Json后台数据*/ importData(Sheet, JsonData) { const dataList = convertSheetToList(Sheet, true); - const needList = Object.keys(this.ExcelConfig.columns); - const tripObj = { upTrack: '', downTrack: '' }; if (dataList && dataList.length && dataList[1] && dataList[0]) { - const tIndex = dataList.findIndex(it => { return it[0]; }); - if (dataList[0][0] == needList[0] && dataList[1][0] == needList[1]) { - for (var colIndex = this.ExcelConfig.beginCol; colIndex < dataList.length; colIndex += 1) { - var isContinue = true; - - for (var rowIndex = this.ExcelConfig.beginRow; isContinue; rowIndex += 1) { - isContinue = false; - - var title = dataList[colIndex][0]; - var value = dataList[colIndex][rowIndex]; - - if (title && value) { - // 数据列解析 - isContinue = true; - var titleStr = `${title}`.replace(/\s*/g, ''); - var valueStr = `${value}`.replace(/\s*/g, ''); - - // 取需要的字段 - if (needList.findIndex(elem => { return elem == titleStr; }) >= 0) { - tripObj[this.ExcelConfig.columns[titleStr].key] = this.ExcelConfig.columns[titleStr].formatter(valueStr); + const tIndex = 8; // 设置不用过滤行数 + /** 解析二维数组为json对象*/ + const reg3 = /^(\d+:\d+:\d+|)/; // 06:12:00 + const reg4 = /[▼|▲|¡|ø|¨|‹]+/; // ▲ + dataList.forEach((elem, i) => { + var begin = -1; + /** 跳过名称所在的行*/ + if (i != tIndex && elem && elem.length > 0) { + let flag = false; + let param = { begTime: '', endTime: '' }; + if (i > tIndex) { elem.reverse(); } + let interval = 1; + for (let j = 0; j < elem.length;) { + const item = elem[j]; + let title = ''; + var value = `${item}`.trim(); + if (i > tIndex) { // 上行线 + title = `${dataList[tIndex][dataList[tIndex].length - j - 1]}`.replace(/\s*/g, ''); + if (title == 'undefined') { + title = `${dataList[tIndex][dataList[tIndex].length - j - 2]}`.replace(/\s*/g, ''); + } + } else { // 下行线 + title = `${dataList[tIndex][j]}`.replace(/\s*/g, ''); + if (title == 'undefined') { + title = `${dataList[tIndex][j - 1]}`.replace(/\s*/g, ''); } } - } - } - } else { - /** 解析二维数组为json对象*/ - const reg0 = /^[↑|↓|¡|ü|ý|]+(.*)/; // ↑|↓ - const reg1 = /^([▼|▲|¡ø|¨‹]+)\s*(\d+:\d+:\d+)/; // ▲ 06:10:00 - const reg2 = /^(\d+:\d+:\d+)\s*([▼|▲|¡ø|¨‹]+)/; // 06:10:00 ▲ - const reg3 = /^(\d+:\d+:\d+)\s*(\d+:\d+:\d+|)/; // 06:10:00 06:12:00 - const reg4 = /[▼|▲|¡|ø|¨|‹]+/; // ▲ - - dataList.forEach((elem, i) => { - var begin = -1; - /** 跳过名称所在的行*/ - if (i != tIndex && elem && elem.length > 0) { - elem.forEach((item, j) => { - /** 过滤空值*/ - if (item) { - var value = `${item}`.trim(); - var title = `${dataList[tIndex][j]}`.replace(/\s*/g, ''); - /** 匹配到开始位置或者结束位置*/ - if (reg0.test(value)) { - if (begin == -1) { - begin = value; // 设置初始索引 - JsonData.push({ - code: reg0.exec(value)[1], - arrivalList: [] - }); - } else if (begin === value) { - begin = -1; // 清空初始索引 + /** 匹配到开始位置或者结束位置*/ + if (title == this.ExcelConfig.trainId && value != 'undefined') { + if (begin == -1) { + interval = 2; + flag = true; + begin = value; // 设置初始索引 + JsonData.push({ + code: value, + destinationCode: '', + arrivalList: [] + }); + } else if (flag) { + interval = 1; + begin = -1; // 清空初始索引 + JsonData[JsonData.length - 1].destinationCode = value; + flag = false; + } + } else if (title == this.ExcelConfig.columns[0]) { + interval = 1; + } else if (begin !== -1) { + const item1 = `${elem[j]}`.trim(); + const item2 = `${elem[j + 1]}`.trim(); + if (item1 != 'undefined' || item2 != 'undefined') { + /** 匹配到中间位置*/ + var stationName = title.replace(/\s/, ''); + const flag = reg3.test(item1) || reg3.test(item2); + if (this.ExcelConfig.columns.indexOf(stationName) == -1 && flag) { + let need = false; + if (value.split(':')[0] == '24') { // 24:XX:XX 类似这种数据 变24为00 + const arr = value.split(':'); + arr[0] = '00'; + value = arr.join(':'); + } + const item1 = elem[j] ? `${elem[j]}`.trim() : ''; + const item2 = elem[j + 1] ? `${elem[j + 1]}`.trim() : ''; + if (item1 && item2) { + param.begTime = item1; + param.endTime = item2; + } else if (item1 && !item2) { + param.begTime = item1; + param.endTime = item1; + } else if (!item1 && item2) { + param.begTime = item2; + param.endTime = item2; } - } else if (begin !== -1) { - /** 匹配到中间位置*/ - var begTime, endTime; - var runFlag = JsonData[JsonData.length - 1].code[2]; - var stationName = title.replace(/\s/, ''); - var need = false; - var flag = false; - if (reg1.test(value)) { - /** 含有特殊字符的时间格式*/ - [, begTime, endTime] = reg1.exec(value); - begTime = reg4.test(begTime) ? '' : begTime; - endTime = reg4.test(endTime) ? '' : endTime; - - /** 下行方向时间互换*/ - if (runFlag === '2') { - [begTime, endTime] = [endTime, begTime]; - } - - /** 设置标志*/ - [need, flag] = [true, true]; - } else if (reg2.test(value)) { - /** 含有特殊字符的时间格式*/ - [, begTime, endTime] = reg2.exec(value); - - begTime = reg4.test(begTime) ? '' : begTime; - endTime = reg4.test(endTime) ? '' : endTime; - - /** 下行方向时间互换*/ - if (runFlag === '2') { - [begTime, endTime] = [endTime, begTime]; - } - - /** 设置标志*/ - [need, flag] = [true, true]; - } else if (reg3.test(value)) { - /** 正常时间格式*/ - [, begTime, endTime] = reg3.exec(value); - - /** 如果只存在一个数据时,则开始和结束设置一样*/ - endTime = endTime || begTime; - - /** 下行方向时间互换*/ - if (runFlag === '2') { - [begTime, endTime] = [endTime, begTime]; - } - - /** 设置标志*/ - [need, flag] = [true, false]; + if (param.begTime && param.endTime) { + need = true; } /** 添加json数据*/ @@ -136,25 +248,32 @@ export default { var stationObj = { stationName: stationName }; - - if (begTime) { stationObj['arriveTime'] = prefixTime(begTime); } - if (endTime) { stationObj['departureTime'] = prefixTime(endTime); } - if (flag) { stationObj['flag'] = flag; } // 是否转换轨 + if (reg4.test(param.begTime)) { + param.begTime = ''; + } + if (reg4.test(param.endTime)) { + param.endTime = ''; + } + stationObj['arriveTime'] = prefixTime(param.begTime); + stationObj['departureTime'] = prefixTime(param.endTime); JsonData[JsonData.length - 1].arrivalList.push(stationObj); + param = { begTime: '', endTime: '' }; } } } - }); + } + j = j + interval; } - }); - } + } + }); } - JsonData.forEach(item => { - item['upTrack'] = tripObj.upTrack; - item['downTrack'] = tripObj.downTrack; + const arr = []; + JsonData.forEach((item, i) => { + if (item.code) { + arr.push(item); + } }); - - return JsonData; + return arr; }, /** 将后台数据解析成图表*/ diff --git a/src/jmapNew/theme/haerbin_01/menus/menuBar.vue b/src/jmapNew/theme/haerbin_01/menus/menuBar.vue index 0a83494c2..487e1d15a 100644 --- a/src/jmapNew/theme/haerbin_01/menus/menuBar.vue +++ b/src/jmapNew/theme/haerbin_01/menus/menuBar.vue @@ -36,9 +36,9 @@ +
+
单位:
+
+
+ {{ handleCompany(userInfo.companyId) }} +
+
+
绑定微信:
@@ -278,6 +286,7 @@ import QrcodeVue from 'qrcode.vue'; import { setInterval, clearInterval } from 'timers'; import { checkLoginStatus } from '@/api/login'; import { getSessionStorage } from '@/utils/auth'; +import { getCompanyList } from '@/api/company'; export default { components: { QrcodeVue }, @@ -296,14 +305,16 @@ export default { nickname: '', mobile: '', email: '', - passWord: '' + passWord: '', + companyId: '' }, editInfo: { name: '', nickname: '', mobile: '', email: '', - passWord: '' + passWord: '', + companyId: '' }, nationCode: '86', nameShow: true, @@ -311,6 +322,7 @@ export default { mobileShow: true, emailShow: true, passwordShow: true, + companyShow: true, mobileCode: null, emailCode: null, passWordCode: null, @@ -340,7 +352,8 @@ export default { nationCodeInit: '86', // 默认国际地区 loginClient: 'LianKeTang', project:'', - wmOpenId: '' + wmOpenId: '', + companyList: [] }; }, computed: { @@ -372,7 +385,8 @@ export default { nickname: user.nickname, mobile: user.mobile, email: user.email, - passWord: '' + passWord: '', + companyId: user.companyId }; this.wmOpenId = user.wmOpenId || ''; this.oldPassWord = user.password; @@ -384,6 +398,11 @@ export default { .catch(error => { console.log(error, '请求个人信息失败'); }); + getCompanyList().then(resp => { + this.companyList = resp.data; + }).catch((error) => { + console.log(error, '获取公司列表信息失败'); + }); }, doClose() { this.visible = false; @@ -394,6 +413,10 @@ export default { this.editInfo.name = this.userInfo.name; this.nameShow = !this.nameShow; }, + switcherCompany() { + this.editInfo.companyId = this.userInfo.companyId; + this.companyShow = !this.companyShow; + }, async saveName() { if (this.editInfo.name) { try { @@ -406,7 +429,16 @@ export default { } } }, - + async saveCompany() { + try { + await getUserinfoName(this.info.id, this.editInfo.name); + this.userInfo.name = this.editInfo.name; + this.nameShow = !this.nameShow; + this.$store.commit('SET_NAME', this.editInfo.name); + } catch (error) { + console.log(error, '错误'); + } + }, switcherNickname() { this.editInfo.nickname = this.userInfo.nickname; this.nickNameShow = !this.nickNameShow; @@ -426,7 +458,15 @@ export default { } } }, - + handleCompany(companyId) { + let name = ''; + this.companyList.forEach(item => { + if (item.id == companyId) { + name = item.name; + } + }); + return name; + }, switcherMobile() { // this.editInfo.mobile = this.userInfo.mobile; this.mobileShow = !this.mobileShow; diff --git a/src/scripts/ConstConfig.js b/src/scripts/ConstConfig.js index 781b5d0ed..97e7798bc 100644 --- a/src/scripts/ConstConfig.js +++ b/src/scripts/ConstConfig.js @@ -95,9 +95,9 @@ export default { {label: '司机', value: 'DRIVER', enLabel: 'Driver '}, {label: '通号', value: 'MAINTAINER', enLabel: 'Repairman '}, {label: '车辆段调度', value: 'DEPOT_DISPATCHER', enLabel: 'Depot dispatcher '}, - {label: '工电调度', value: 'ELECTRIC_DISPATCHER', enLabel: 'Electric dispatcher'}, + {label: '电力调度', value: 'ELECTRIC_DISPATCHER', enLabel: 'Electric dispatcher'}, {label: '行调', value: 'DISPATCHER', enLabel: 'Dispatcher '}, - {label: '上级部门', value: 'PARENT_DEPARTMENT', enLabel: 'Parent_department'} + {label: '上级部门', value: 'PARENT_DEPARTMENT', enLabel: 'Parent department'} ], SimulationType: [ diff --git a/src/scripts/ConstDic.js b/src/scripts/ConstDic.js index 24b072c46..f234c7cf1 100644 --- a/src/scripts/ConstDic.js +++ b/src/scripts/ConstDic.js @@ -118,6 +118,7 @@ export const DeviceMenu = { AxleReset: '12', Enabled: '13', StationTurnBack: '14', + Power:'15', Map: '100', PrdCategory: '101', @@ -128,7 +129,7 @@ export const DeviceMenu = { SetDriver: '106', Script: '107', IscsSystem: '108', - IscsInterface: '109' + IscsInterface: '109' }; /** diff --git a/src/scripts/ProjectConfig.js b/src/scripts/ProjectConfig.js index 3ffaf9b17..b2ee27436 100644 --- a/src/scripts/ProjectConfig.js +++ b/src/scripts/ProjectConfig.js @@ -12,6 +12,7 @@ import FaviconTky from '@/assets/icon/favicon_tky.png'; import FaviconBxkc from '@/assets/icon/favicon_bxkc.png'; import FaviconCrsc from '@/assets/icon/favicon_crsc.png'; import FaviconNty from '@/assets/icon/favicon_nty.png'; +import FaviconBjd from '@/assets/icon/favicon_bjd.png'; import Link_Bxkc from '@/assets/icon/link_bxkc.png'; import Link_Crsc from '@/assets/icon/link_crsc.png'; import Link_Hls from '@/assets/icon/link_hls.png'; @@ -29,6 +30,19 @@ export const loginInfo = { navigationMarginLeft: '60px', systemType: '013' }, + bjd: { + title: '城市轨道交通列车运行智慧辅助系统', + loginPath: '/login?project=bjd', + logoWidth: '400px', + bottomIcon: FaviconBjd, + bottomColumn: '', + loginTitle: '空串', + linkIcon: FaviconBjd, + loginParam: 'BJD', + navigationLogoWidth: '160px', + navigationMarginLeft: '175px', + systemType: '011' + }, nty: { title: '南京铁道职业技术学院城市轨道交通实训平台', loginPath:'/login?project=nty', @@ -72,6 +86,18 @@ export const loginInfo = { navigationMarginLeft: '60px', systemType: '020' }, + designbjd: { + title: '城市轨道交通列车运行智慧辅助系统', + loginPath: '/design/login?project=bjd', + logoWidth: '400px', + bottomIcon: FaviconBjd, + bottomColumn: '', + linkIcon: '', + loginParam: 'BJD', + navigationLogoWidth: '160px', + navigationMarginLeft: '175px', + systemType: '011' + }, designxty: { title: '西安铁路职业技术学院城市轨道交通设计平台', loginPath:'/design/login?project=xty', @@ -352,7 +378,9 @@ export const ProjectIcon = { drts: Favicon, designdrts: Favicon, nty: FaviconNty, - designnty: FaviconNty + designnty: FaviconNty, + bjd: FaviconBjd, + designbjd: FaviconBjd }; export const ProjectCode = { @@ -375,7 +403,7 @@ export const CaseHideProjectList = ['heb', 'designheb']; // 案例展示隐藏 export const VersionBaseNoShow = ['heb', 'designheb', 'hls', 'designhls', 'drts', 'hyd', 'designhyd']; // 登录页右下角版本开发基于不展示 export const MainBodyNoShow = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'hyd', 'designhyd']; // 登录页右下角主体不展示 export const GenerateRouteProjectList = ['jsxt', 'refereeJsxt'];// 需要在公共路由中生成登录页面的项目 -export const ProjectLoginStyleList = ['jsxt', 'refereeJsxt', 'gzb', 'designgzb', 'xty', 'designxty', 'xadt', 'designxadt', 'tky', 'designtky', 'jyd', 'designjyd', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'drts', 'hyd', 'designhyd', 'nty', 'designnty']; // 登录页样式 +export const ProjectLoginStyleList = ['jsxt', 'refereeJsxt', 'gzb', 'designgzb', 'xty', 'designxty', 'xadt', 'designxadt', 'tky', 'designtky', 'jyd', 'designjyd', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'drts', 'hyd', 'designhyd', 'nty', 'designnty', 'bjd', 'designbjd']; // 登录页样式 export const NoQrcodeList = ['heb', 'designheb']; export const goOtherPlatformMenu = { // 导航栏快速切换平台 login: '/design/login', diff --git a/src/scripts/cmdPlugin/CommandEnum.js b/src/scripts/cmdPlugin/CommandEnum.js index 1a5ce4016..332779ef3 100644 --- a/src/scripts/cmdPlugin/CommandEnum.js +++ b/src/scripts/cmdPlugin/CommandEnum.js @@ -183,7 +183,9 @@ export default { /** 查看站台状态 */ CMD_STAND_VIEW_STATUS:{value:'Stand_View_Status', label: '查看站台状态'}, /** 站台总取消 */ - CMD_STAND_TOTAL_CANCLE:{value:'Stand_Total_Cancle', label: '站台总取消'} + CMD_STAND_TOTAL_CANCLE:{value:'Stand_Total_Cancle', label: '站台总取消'}, + /** 手动开启屏蔽门 */ + CMD_STAND_OPEN_PSD:{value:'Stand_Open_Psd', label: '手动开启屏蔽门'} }, Station: { diff --git a/src/scripts/cmdPlugin/Config.js b/src/scripts/cmdPlugin/Config.js index 1dca7fcd9..f12e408d1 100644 --- a/src/scripts/cmdPlugin/Config.js +++ b/src/scripts/cmdPlugin/Config.js @@ -41,13 +41,17 @@ export const deviceFaultType = { {label: '反位失表', value: 'REVERSE_SPLIT'} ], StationStand: [ - {label: '屏蔽门故障打开', value: 'FAULT_PSD_OPEN'} + {label: '屏蔽门无法关闭', value: 'PSD_CANNOT_BE_CLOSED'}, + {label: '屏蔽门无法开启', value: 'PSD_CANNOT_BE_OPENED'} ], ZcControl:[ {label: 'zc故障', value: 'FAULT'} ], Train: [ {label: '通信异常', value: 'COMMUNICATION_ABNORMAL'} + ], + Power:[ + {label: '供电故障', value: 'FAULT'} ] }; /** 设备类型 */ @@ -58,5 +62,6 @@ export const deviceType = { Station: '车站', StationStand: '站台', Train: '列车', - ZcControl:'ZC' + ZcControl:'ZC', + Power:'供电线' }; diff --git a/src/scripts/cmdPlugin/Handler.js b/src/scripts/cmdPlugin/Handler.js index 837a16734..8ccb9b347 100644 --- a/src/scripts/cmdPlugin/Handler.js +++ b/src/scripts/cmdPlugin/Handler.js @@ -141,7 +141,7 @@ class Handler { } getTrainingStart() { - return store.state.training.started; + return store.state.training.trainingStart; } getOperateBreakStatus () { diff --git a/src/scripts/cmdPlugin/MenuContextHandler.js b/src/scripts/cmdPlugin/MenuContextHandler.js index 0c617021f..832e83584 100644 --- a/src/scripts/cmdPlugin/MenuContextHandler.js +++ b/src/scripts/cmdPlugin/MenuContextHandler.js @@ -42,15 +42,15 @@ class MenuContextHandler { data.conditionList.forEach(val=>{ switch (val.expression) { case 'eq': { - result = result || (selected[val.name].toString() == val.value); + result = result || ((selected[val.name] || 0).toString() == val.value); break; } case 'neq': { - result = result || (selected[val.name].toString() != val.value); + result = result || ((selected[val.name] || 0).toString() != val.value); break; } default: { - result = result || (selected[val.name].toString() == val.value); + result = result || ((selected[val.name] || 0).toString() == val.value); break; } } diff --git a/src/scripts/cmdPlugin/OperationHandler.js b/src/scripts/cmdPlugin/OperationHandler.js index 1702248f2..a063c08e8 100644 --- a/src/scripts/cmdPlugin/OperationHandler.js +++ b/src/scripts/cmdPlugin/OperationHandler.js @@ -1766,6 +1766,13 @@ export const OperationEvent = { operation: '518', domId: '_Tips-Stand-cancelDetainTrainAuto-Menu' } + }, + // 手动开启屏蔽门 + openPsdByHand:{ + menu: { + operation: '519', + domId: '_Tips-Stand-openPsdByHand-Menu' + } } }, diff --git a/src/scripts/cmdPlugin/ValidateHandler.js b/src/scripts/cmdPlugin/ValidateHandler.js index 3f8b771a9..02be8563d 100644 --- a/src/scripts/cmdPlugin/ValidateHandler.js +++ b/src/scripts/cmdPlugin/ValidateHandler.js @@ -31,7 +31,6 @@ class ValidateHandler { const steps = Handler.getSteps(); const order = Handler.getOrder(); let valid = false; - if (operate.over && steps.length == 1) { // 右键菜单直接发送校验 if (operate && steps[0] && operate.code == steps[0].code && diff --git a/src/store/modules/socket.js b/src/store/modules/socket.js index 8634bb6d2..b659b9c13 100644 --- a/src/store/modules/socket.js +++ b/src/store/modules/socket.js @@ -65,7 +65,6 @@ function handle(state, data) { break; case 'Simulation_Reset': // 仿真-仿真重置消息 退出计划行车 state.simulationReset += 1; - state.simulationAlarmInfoList = []; break; case 'Simulation_Conversation': // 仿真-用户交互消息(聊天/命令) handleSimulationInfo(state, msg); @@ -277,8 +276,7 @@ const socket = { simulationTimeSync: '', // 仿真时间 simulationIbpStatus: null, competitionPracticeFinish:0, // 竞赛场景结束标识 - simulationAlarmInfo: {}, // 仿真报警信息 - simulationAlarmInfoList: [] + simulationAlarmInfo: []// 仿真报警信息 }, getters: { }, diff --git a/src/store/modules/training.js b/src/store/modules/training.js index acda3e1bd..6695eb570 100644 --- a/src/store/modules/training.js +++ b/src/store/modules/training.js @@ -43,7 +43,8 @@ const training = { scriptQuitCount: 0, // 主动退出剧本 scriptOperationType: '', // 剧本操作类型 triggerFaultCount: 0, // 触发故障计数器 - triggerFaultDevice: '' // 触发故障目标设备 + triggerFaultDevice: '', // 触发故障目标设备 + trainingStart: false // 实训开始状态 }, getters: { @@ -279,6 +280,9 @@ const training = { setTriggerFaultCount: (state, device) => { state.triggerFaultCount++; state.triggerFaultDevice = device; + }, + setTrainingStart: (state, flag) => { + state.trainingStart = flag; } }, @@ -314,7 +318,6 @@ const training = { */ reset: ({ commit }) => { commit('over'); - commit('resetOrder'); // commit('stopCountTime'); // 清空计时器以及得分 @@ -338,13 +341,20 @@ const training = { commit('resetScore'); commit('start'); }, - + // setTrainingStart:({ commit }) ={ + // commit('setTrainingStart'); + // }, + setTrainingStart: ({ commit }, flag) => { + commit('setTrainingStart', flag); + if (!flag) { + commit('resetOrder'); + } + }, /** * 结束 */ over: ({ commit }) => { commit('over'); - commit('resetOrder'); // commit('stopCountTime'); }, @@ -368,7 +378,7 @@ const training = { * 主动判断是否结束 */ judgeFinish: ({ dispatch, commit, state }, rtn) => { - if (state.started) { + if (state.trainingStart) { if (state.order >= state.steps.length) { if (rtn && rtn.valid) { commit('next'); @@ -470,7 +480,7 @@ const training = { try { // 处理operation Handler.handle(operate).then(rtn => { - if (state.started) { + if (state.trainingStart) { // 教学和联系模式需要给出过程步骤提示 if (TrainingMode.TEACH === state.mode || TrainingMode.PRACTICE === state.mode) { if (rtn && rtn.valid) { diff --git a/src/utils/date.js b/src/utils/date.js index ad7cbd3d6..f81c3632b 100644 --- a/src/utils/date.js +++ b/src/utils/date.js @@ -16,8 +16,8 @@ export function now() { return year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second; } -export function timeFormat(usedTime) { - let hour = 0; let minute = 0; let second = 0; let sumTime = usedTime; +export function timeFormat(usedTime=0) { + let hour = 0; let minute = 0; let second = 0; let sumTime = usedTime; if (sumTime) { if (sumTime >= 3600) { hour = Math.floor(sumTime / 3600) % 24; @@ -37,8 +37,8 @@ export function timeFormat(usedTime) { // 时分秒转为时间戳 -export function toTimeStamp(time) { - let s = 0; +export function toTimeStamp(time='') { + let s = 0; const hour = time.split(':')[0]; const min = time.split(':')[1]; const sec = time.split(':')[2]; diff --git a/src/views/competitionManage/bankList/question-form.vue b/src/views/competitionManage/bankList/question-form.vue index bee7f896f..8b3cd803a 100644 --- a/src/views/competitionManage/bankList/question-form.vue +++ b/src/views/competitionManage/bankList/question-form.vue @@ -159,8 +159,9 @@ export default { if (this.option.optionList[index]) { this.option.optionList[index].content = item; this.option.optionList[index].correct = true; + this.option.optionList[index].order = index + 1; } else { - this.option.optionList[index] = { content: item, correct: true }; + this.option.optionList[index] = { content: item, correct: true, order: index + 1 }; } }); } else if (this.option.type === 'answer') { diff --git a/src/views/drts/scene/modify.vue b/src/views/drts/scene/modify.vue index 1e4a43cde..b51fe9e90 100644 --- a/src/views/drts/scene/modify.vue +++ b/src/views/drts/scene/modify.vue @@ -271,7 +271,9 @@ export default { this.formModel.operationScore = row.operationScore; this.formModel.scriptId = row.scriptId; getScriptByIdNew(row.scriptId).then(res=>{ - this.actionList = res.data.actionList; + this.actionList = res.data.actionList.filter(action=>{ + return action.type != 'Exit_Conversation' && action.type != 'Accept_Conversation_Invitation'; + }); getCompetitionPracticalSceneById(row.id).then(response=>{ const commandEvaluationRuleVOs = {}; if (response.data.commandEvaluationRuleVOs) { diff --git a/src/views/jlmap3d/device/jl3ddevice.vue b/src/views/jlmap3d/device/jl3ddevice.vue index 5eedfb997..e5d1a49fb 100644 --- a/src/views/jlmap3d/device/jl3ddevice.vue +++ b/src/views/jlmap3d/device/jl3ddevice.vue @@ -26,7 +26,6 @@ + + + diff --git a/src/views/jlmap3d/drive/sceneview/tmsview.vue b/src/views/jlmap3d/drive/sceneview/tmsview.vue index 9d2b603f4..cc3b0e810 100644 --- a/src/views/jlmap3d/drive/sceneview/tmsview.vue +++ b/src/views/jlmap3d/drive/sceneview/tmsview.vue @@ -1,6 +1,7 @@