diff --git a/src/api/rtSimulation.js b/src/api/rtSimulation.js index 6c9e74571..de35255a2 100644 --- a/src/api/rtSimulation.js +++ b/src/api/rtSimulation.js @@ -29,9 +29,13 @@ export function sendSimulationCommand(group, memberId, type, data) { }); } /** 获取仿真成员列表 */ -export function getMemberListCommon(group) { +export function getMemberListCommon(group,role) { + + if(!role){ + role = ""; + } return request({ - url: `/common/simulation/${group}/members`, + url: `/common/simulation/${group}/members?role=${role}`, method: 'get' }); } diff --git a/src/jlmap3d/jl3ddrive/jl3ddrive.js b/src/jlmap3d/jl3ddrive/jl3ddrive.js index 6af29cd1e..aff136ee0 100644 --- a/src/jlmap3d/jl3ddrive/jl3ddrive.js +++ b/src/jlmap3d/jl3ddrive/jl3ddrive.js @@ -25,7 +25,7 @@ import { DriverLoadNew } from '@/jlmap3d/main/loaders/DriverLoadNew'; // connect import {Jl3dDrivingNew} from '@/jlmap3d/jl3ddrive/moveupdate/DrivingConnectNew'; -import { getPublishMapVersion, getPublishMapDetail, getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata'; +import {getPublishMapDetail, getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata'; // utils import { UpdateTrain } from '@/jlmap3d/jl3ddrive/moveupdate/UpdateTrain'; diff --git a/src/jlmap3d/jl3dmaintainer/jlmap3dmaintainer.js b/src/jlmap3d/jl3dmaintainer/jlmap3dmaintainer.js index 91c00ae88..55a583912 100644 --- a/src/jlmap3d/jl3dmaintainer/jlmap3dmaintainer.js +++ b/src/jlmap3d/jl3dmaintainer/jlmap3dmaintainer.js @@ -25,7 +25,7 @@ import { MaintainerLoad } from '@/jlmap3d/jl3dmaintainer/maintainerload'; //connect import {Maintainerconnect } from '@/jlmap3d/jl3dmaintainer/maintainerconnect'; -import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata'; +import {getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata'; //utils // import { UpdateTrain } from '@/jlmap3d/main/utils/UpdateTrain'; diff --git a/src/jlmap3d/jl3dpassflow/jl3dpassflownew.js b/src/jlmap3d/jl3dpassflow/jl3dpassflownew.js index 4b9276350..b177e610a 100644 --- a/src/jlmap3d/jl3dpassflow/jl3dpassflownew.js +++ b/src/jlmap3d/jl3dpassflow/jl3dpassflownew.js @@ -9,7 +9,7 @@ import { ModelManager } from '@/jlmap3d/jl3dpassflow/loader.js'; //骨骼动画模型辅助工具 import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.js'; //获取信息接口 -import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata'; +import {getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata'; //cctv站台对象 import { PasserStation } from '@/jlmap3d/jl3dpassflow/model/passerstation.js'; //cctv检票机对象 diff --git a/src/jlmap3d/jl3drailwaydevice/component/moveanimate.js b/src/jlmap3d/jl3drailwaydevice/component/moveanimate.js new file mode 100644 index 000000000..0b2f8a14f --- /dev/null +++ b/src/jlmap3d/jl3drailwaydevice/component/moveanimate.js @@ -0,0 +1,374 @@ +//转辙机动画 +export function Moveanimate(main){ + let scope = this; + //内容信息显示plane + this.helpbox = null; + this.textplane = null; + //动画列表 + this.animatelist = []; + this.playlist = null; + this.playorder = 0; + //动画播放器开关 + this.enable = true; + //动画开关状态 + this.status = true; + //当前动画模型 + this.nowmodelname = undefined; + //定义转辙机零件动画 + this.initlistnew = function(switchmodel){ + scope.animatelist[switchmodel.animacode+"chaijie"] = []; + scope.animatelist[switchmodel.animacode+"fuwei"] = []; + for(let i=0,leni=switchmodel.children.length;i=1){ + let point = scope.playlist[scope.playorder][i].curve.getPointAt(1); + //更新模型坐标 + scope.playlist[scope.playorder][i].connectmodel.position.x = point.x; + scope.playlist[scope.playorder][i].connectmodel.position.y = point.y; + scope.playlist[scope.playorder][i].connectmodel.position.z = point.z; + scope.playlist[scope.playorder][i].enable = false; + scope.playlist[scope.playorder][i].status = "end"; + scope.playlist[scope.playorder][i].progress = 0; + + if(i >= scope.playlist[scope.playorder].length-1){ + if(scope.playorder >= scope.playlist.length-1 ){ + scope.playlist = null; + scope.status = true; + scope.enable = false; + main.animationmsgshowoff(); + scope.nowmodelname = undefined; + scope.playorder = null; + break; + }else{ + scope.playorder += 1; + } + } + + }else{ + // console.log(scope.animatelist[k].connectmodel); + if(scope.nowmodelname != scope.playlist[scope.playorder][i].connectmodel.name){ + scope.nowmodelname = scope.playlist[scope.playorder][i].connectmodel.name; + main.animationmsgshowon(scope.playlist[scope.playorder][i].connectmodel); + } + //根据动画进度获取动画轨迹上点 + scope.status = false; + let point = scope.playlist[scope.playorder][i].curve.getPointAt(scope.playlist[scope.playorder][i].progress); + + //更新模型坐标 + scope.playlist[scope.playorder][i].connectmodel.position.x = point.x; + scope.playlist[scope.playorder][i].connectmodel.position.y = point.y; + scope.playlist[scope.playorder][i].connectmodel.position.z = point.z; + + if(scope.helpbox){ + scope.helpbox.update(); + } + if(scope.textplane){ + + scope.textplane.position.x = scope.playlist[scope.playorder][i].connectmodel.matrixWorld.elements[12]; + scope.textplane.position.y = scope.playlist[scope.playorder][i].connectmodel.matrixWorld.elements[13]+100; + scope.textplane.position.z = scope.playlist[scope.playorder][i].connectmodel.matrixWorld.elements[14]; + } + //判断模型转向 + if(scope.playlist[scope.playorder][i].directchange){ + let tangent = scope.playlist[scope.playorder][i].curve.getPointAt(scope.playlist[scope.playorder][i].progress+0.001); + // scope.animatelist[k] + tangent = null; + } + //增加动画进度,释放点变量 + scope.playlist[scope.playorder][i].progress += scope.playlist[scope.playorder][i].speed; + point = null; + + } + + } + + } + } + } + +} diff --git a/src/jlmap3d/jl3drailwaydevice/component/signallight.js b/src/jlmap3d/jl3drailwaydevice/component/signallight.js new file mode 100644 index 000000000..0f7c4f720 --- /dev/null +++ b/src/jlmap3d/jl3drailwaydevice/component/signallight.js @@ -0,0 +1,38 @@ +import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js'; + +//信号机贴图 +export function Signallightload(lights) { + + settexture(lights, "red", JL3D_LOCAL_STATIC+'/device/signal/1.jpg'); + + settexture(lights, "yellow", JL3D_LOCAL_STATIC+'/device/signal/2.jpg'); + + settexture(lights, "green", JL3D_LOCAL_STATIC+'/device/signal/3.jpg'); + + settexture(lights, "black", JL3D_LOCAL_STATIC+'/device/signal/4.jpg'); +} + +//加载贴图 +function settexture(lights, name, textureurl) { + var loader = new THREE.TextureLoader(); + + // 加载一个资源 + loader.load( + // 资源URL + textureurl, + + // onLoad回调 + function (texture) { + texture.name = name; + lights[name] = texture; + }, + + // 目前暂不支持onProgress的回调 + undefined, + + // onError回调 + function (err) { + console.error('An error happened.'); + } + ); +} diff --git a/src/jlmap3d/jl3drailwaydevice/component/textconfig.js b/src/jlmap3d/jl3drailwaydevice/component/textconfig.js new file mode 100644 index 000000000..1c9a86ca5 --- /dev/null +++ b/src/jlmap3d/jl3drailwaydevice/component/textconfig.js @@ -0,0 +1,113 @@ + +export function Textconfig(){ + let scope = this; + + this.devicelist = []; + + + //配置继电器文字信息 + this.initdevicetext = function(selectmodel){ + if(scope.devicelist.length>0){ + scope.devicelist = []; + } + + for(let i=0,leni=selectmodel.children.length;i { + let mapnetdata = data.data; + for(let i=0,leni=mapnetdata.switchList.length;i { + location.reload(); + }); + } + + } + } + let changeelement = document.getElementById('jl3d'); + window.addEventListener('resize', () => + onresize() + , false) + let onresize = function () { + + scope.camera.aspect = changeelement.offsetWidth / changeelement.offsetHeight; + scope.camera.updateProjectionMatrix(); + scope.renderer.setSize(changeelement.offsetWidth, changeelement.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(); + + getPublish3dMapDetail(skinCode).then(netdata => { + + let netDataAssets = JSON.parse(netdata.data.assets); + if(netDataAssets.stationTextureList[0].urls.length > 1){ + setpsdstationmap(JSON.parse(netdata.data.stands)); + Standtextureload(scope,netDataAssets.stationTextureList[0]); + } + scope.modelmanager.loadpromise(netDataAssets.deviceAssetList, scope.mixers).then(function (data) { + //综合演练情况下当模型加载后显示 + psdModelShow(); + moveanima.initlistnew(scope.modelmanager.switchmodel.mesh); + daochamodel = scope.modelmanager.switchmodel.mesh.getObjectByName("DAOCHA"); + if(scope.stationtexture["devicelist"]){ + scope.modelmanager.standmodel.mesh.getObjectByName("zhantailiebiao").material.map =scope.stationtexture["devicelist"]; + scope.modelmanager.standmodel.mesh.getObjectByName("zhantailiebiao").material.map.needsUpdate = true; + } + if(scope.stationtexture["pingbimen"]){ + scope.modelmanager.standmodel.mesh.getObjectByName("pingbimen1").material.map =scope.stationtexture["pingbimen"]; + scope.modelmanager.standmodel.mesh.getObjectByName("pingbimen1").material.map.needsUpdate = true; + } + + }) + let checkobject = setInterval(function(){ + if(scope.modelmanager.switchmodel.mesh){ + clearInterval(checkobject); + animate(); + } + + + },1000); + + }); + + //初始化屏蔽门贴图 + function setpsdstationmap(stationlist){ + for(let i=0,leni=stationlist.length;i { + resolve("success"); //['成功了', 'success'] + }).catch((error) => { + //console.log(error); + }); + + }); + } + +} + +function fbxpromise(asset,mixers,model){ + return new Promise(function(resolve, reject){ + var loader = new THREE.FBXLoader(); + let modelurl; + if(asset.type == "staticSwitch"){ + modelurl = JL3D_LOCAL_STATIC+asset.url; + }else{ + modelurl = BASE_ASSET_API+asset.url; + } + loader.load( modelurl, function ( object ) { + let mixer = new THREE.AnimationMixer( object ); + object.traverse( function ( child ) { + if ( child.isMesh ) { + child.castShadow = true; + child.receiveShadow = true; + } + } ); + object.animacode = model.code; + model.mesh = object; + if(object.animations.length>0){ + if(asset.type == "staticSwitch"){ + + // for(let i=0;i import('@/views/jlmap3d/simulation/jl3dsimulation') const Jlmap3dPassFlow = () => import('@/views/jlmap3d/passflow/jl3dpassflow'); const Jlmap3dTrafficPlan = () => import('@/views/jlmap3d/trafficplan/jl3dtrafficplan'); const Jlmap3dTrafficTrain = () => import('@/views/jlmap3d/trafficplan/jl3dtraffictrain'); +const Jl3dRailwayDrive = () => import('@/views/jlmap3d/railwaydrive/jl3drailwaydrive'); // 三维沙盘测试 const Jlmap3dSandBoxTest = () => import('@/views/jlmap3d/trafficplan/jl3dtestview'); // 三维车站管理测试 @@ -328,6 +329,11 @@ export const constantRoutes = [ hidden: true }, + { + path: '/jlmap3d/lesson3dplayer', + component: Jl3dRailwayDrive, + hidden: true + }, { path: '/jlmap3d/devicemodel', component: Jlmap3dModel, diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index aa7bf7e1b..11702c286 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,9 +2,9 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - // BASE_API = 'https://test.joylink.club/jlcloud'; + BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.8.107:9000'; // 袁琪 - BASE_API = 'http://192.168.3.83:9000'; // 旭强 有线 + // BASE_API = 'http://192.168.3.83:9000'; // 旭强 有线 // BASE_API = 'http://192.168.8.114:9000'; // 旭强 无线 // BASE_API = 'http://192.168.3.120:9000'; // 张赛 // BASE_API = 'http://192.168.8.140:9000'; // 杜康 diff --git a/src/views/jlmap3d/railwaydevice/component/devicelist.vue b/src/views/jlmap3d/railwaydevice/component/devicelist.vue new file mode 100644 index 000000000..2da64de12 --- /dev/null +++ b/src/views/jlmap3d/railwaydevice/component/devicelist.vue @@ -0,0 +1,153 @@ + + + + + + diff --git a/src/views/jlmap3d/railwaydevice/component/devicemsg.vue b/src/views/jlmap3d/railwaydevice/component/devicemsg.vue new file mode 100644 index 000000000..0784114ab --- /dev/null +++ b/src/views/jlmap3d/railwaydevice/component/devicemsg.vue @@ -0,0 +1,99 @@ + + + + + + diff --git a/src/views/jlmap3d/railwaydevice/jl3drailwaydevice.vue b/src/views/jlmap3d/railwaydevice/jl3drailwaydevice.vue new file mode 100644 index 000000000..a11863acb --- /dev/null +++ b/src/views/jlmap3d/railwaydevice/jl3drailwaydevice.vue @@ -0,0 +1,348 @@ + + + diff --git a/src/views/jlmap3d/railwaydrive/drivecontrol/centerpane.vue b/src/views/jlmap3d/railwaydrive/drivecontrol/centerpane.vue index a906b413c..c7bfc0864 100644 --- a/src/views/jlmap3d/railwaydrive/drivecontrol/centerpane.vue +++ b/src/views/jlmap3d/railwaydrive/drivecontrol/centerpane.vue @@ -1,23 +1,23 @@