修改三维通号进入的界面,修改三维vr维修Gui

This commit is contained in:
sunzhenyu 2020-08-13 15:55:25 +08:00
parent ba6797bbda
commit 5b4db675a8
27 changed files with 1193 additions and 215 deletions

View File

@ -55,6 +55,7 @@ export default {
threeDimensionalView: 'Three-Dimensional View',
threeDimensionalStation: 'Three-Dimensional Station',
passengerflow: 'CCTV View',
maintainer: 'Maintainer View',
deviceView: 'DeviceView',
taskOperateSuccess: 'Task Operate success',
getTimeFail: 'Failed to get time',

View File

@ -55,6 +55,7 @@ export default {
threeDimensionalView: '三维视图',
threeDimensionalStation: '三维车站',
passengerflow: 'cctv视图',
maintainer: '设备故障视图',
deviceView: '设备视图',
taskOperateSuccess: '任务操作成功',
getTimeFail: '获取时间失败',

View File

@ -141,6 +141,7 @@ export function Jl3dfaultdevice(dom,group,token,skinCode) {
this.anime = null;
this.modelmanager = new ModelManager();
console.log(skinCode);
getPublish3dMapDetail(skinCode).then(netdata => {
let netDataAssets = JSON.parse(netdata.data.assets);
setpsdstationmap(JSON.parse(netdata.data.stands));
@ -159,7 +160,7 @@ export function Jl3dfaultdevice(dom,group,token,skinCode) {
scope.modelmanager.standmodel.mesh.getObjectByName("menkuangyanse").material.map.needsUpdate = true;
}
// scope.stationtexture
animate();
})
});
@ -169,7 +170,9 @@ export function Jl3dfaultdevice(dom,group,token,skinCode) {
psdtexturemap[stationlist[i].direction2.code] = stationlist[i].code;
}
}
this.startAnimate = function(){
animate();
}
//循环渲染函数
function animate() {

View File

@ -12,7 +12,8 @@ import { MoveanimateVr } from '@/jlmap3d/jl3dmaintainer/utils/moveanimatevr.js';
import { Textconfig } from '@/jlmap3d/jl3ddevice/component/textconfig.js';
import { getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
import {Materialload} from '@/jlmap3d/main/loaders/Materialload.js';
import { getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
import StompClient from '@/utils/sock';
import { getBaseUrl } from '@/utils/baseUrl'
@ -27,6 +28,15 @@ let vrPlane;
let vrPlaneStatus = false;
let tempMatrix = new THREE.Matrix4();
let nowdevice = null;
let lableCodeMap = {
switch:[],
psd:[],
signal:[],
section:[]
};
let faultList = [];
let stationList = [];
export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
var scope = this;
@ -39,7 +49,7 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
let pathPoints = [];
let playerPosition = new THREE.Vector3( -3.5, 0.5, 5.5 );
let targetPosition = new THREE.Vector3();
let pathfinder = new THREE.Pathfinding();
let pathFinder = new THREE.Pathfinding();
var textureNav = new THREE.TextureLoader().load( '../../static/vrtest/daohang.png' );
textureNav.wrapS = THREE.RepeatWrapping;
textureNav.wrapT=THREE.RepeatWrapping;
@ -60,7 +70,6 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
this.animateswitch = false;
this.mixers = [];
this.showmodel = null;
let helpbox,textplane;
let daochamodel;
@ -71,6 +80,9 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
this.animastats = true;
//当前选中模型
this.nowobject = null;
this.nowstation = null;
this.nowStationModel = null;
//当前动画播放模型
this.animationmodel = null;
@ -93,7 +105,7 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
document.body.appendChild( VRButton.createButton( this.renderer ) );
//定义相机
this.camera = new THREE.PerspectiveCamera(50, window.innerWidth / window.innerHeight, 0.01, 200);
this.camera = new THREE.PerspectiveCamera(50, window.innerWidth / window.innerHeight, 0.01, 300);
this.camera.position.set(0, 0, 0);
this.camera.aspect = window.innerWidth / window.innerHeight;
this.camera.updateProjectionMatrix();
@ -143,7 +155,7 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
const zone = THREE.Pathfinding.createZone(object.children[0].geometry);
// console.timeEnd('createZone()');
pathfinder.setZoneData( ZONE, zone );
pathFinder.setZoneData( ZONE, zone );
const navWireframe = new THREE.Mesh(object.children[0].geometry, new THREE.MeshBasicMaterial({
color: 0x808080,
@ -156,7 +168,7 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
// scene.add(navmesh);
// movegroup.add(navmesh);
// Set the player's navigation mesh group
groupID = pathfinder.getGroup( ZONE, playerPosition );
groupID = pathFinder.getGroup( ZONE, playerPosition );
},
// called when loading is in progresses
@ -191,13 +203,14 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
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.screenSpacePanning = true;
this.controls.update();
this.controls = new THREE.OrbitControls(scope.camera, dom);
// this.controls.maxPolarAngle = Math.PI / 2;
// this.controls.minPolarangle = Math.PI / 5;
this.controls.maxDistance = 600;
// this.controls.screenSpacePanning = true;
this.controls.target.set( 0, 1.6, 0 );
this.controls.update();
document.addEventListener( "mousedown", onselect, false );
@ -217,8 +230,7 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
console.log(event.data.type);
console.log(event.data);
if(event.data.type == "Device_Fault_Set_3D"){
if(event.data.body.type == "SWITCH"){
nowdevice = {
let newfault = {
code:event.data.body.code,
name:'',
type:event.data.body.type,
@ -226,15 +238,43 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
text:event.data.body.fault,
fault:event.data.body.fault,
}
nowdevice.name = "道岔"+nowdevice.code+"故障";
nowdevice.typetext = "道岔";
if(event.data.body.fault == "SPLIT"){
nowdevice.text = "道岔失表";
if(event.data.body.type == "SIGNAL"){
newfault.name = lableCodeMap.signal[newfault.code];
newfault.typetext = "信号机";
if(event.data.body.fault[1] == "MAIN_FILAMENT_BROKEN"){
newfault.text = "主灯丝断丝故障";
}
}
setTextVr(nowdevice,vrPlane);
if(event.data.body.type == "SWITCH"){
newfault.name = lableCodeMap.switch[newfault.code];
newfault.typetext = "道岔";
if(event.data.body.fault[1] == "SPLIT"){
newfault.text = "道岔挤岔";
}
}
if(event.data.body.type == "SECTION"){
newfault.name = lableCodeMap.section[newfault.code];
newfault.typetext = "区段";
if(event.data.body.fault[1] == "FAULT"){
newfault.text = "计轴故障";
}
}
if(event.data.body.type == "STAND"){
newfault.name = newfault.code;
newfault.typetext = "屏蔽门";
if(event.data.body.fault[1] == "FAULT_PSD_OPEN"){
newfault.text = "屏蔽门无法关闭故障";
}
}
faultList.push(newfault)
updateFaultList();
return;
}
@ -242,10 +282,67 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
scope.updateaction(event.data);
}
if(event.data.type == "Device_Fault_Over_3D"){
vrPlane.group.remove(textplane);
// console.log(event.data);
//
// deletefault(event.data.body.code);
for (let i = 0, leni = faultList.length; i < leni; i++) {
if (event.data.body.code == faultList[i].code) {
faultList.splice(i, 1);
updateFaultList();
break;
}
}
}
if(event.data.type == "Device_Load_Destroy_3D"){
let fault = event.data.body.faultInfoList;
for(let i=0,leni= fault.length;i<leni;i++){
let newfault = {
code:fault[i].code,
name:'',
type:fault[i].type,
typetext:'',
text:fault[i].fault,
fault:fault[i].fault,
}
if(fault[i].type == "SIGNAL"){
newfault.name = lableCodeMap.signal[newfault.code];
newfault.typetext = "信号机";
if(fault[i].fault[1] == "MAIN_FILAMENT_BROKEN"){
newfault.text = "主灯丝断丝故障";
}
}
if(fault[i].type == "SWITCH"){
newfault.name = lableCodeMap.switch[newfault.code];
newfault.typetext = "道岔";
if(fault[i].fault[1] == "SPLIT"){
newfault.text = "道岔挤岔";
}
}
if(fault[i].type == "SECTION"){
newfault.name = lableCodeMap.section[newfault.code];
newfault.typetext = "区段";
if(fault[i].fault[1] == "FAULT"){
newfault.text = "计轴故障";
}
}
if(fault[i].type == "STAND"){
newfault.name = newfault.code;
newfault.typetext = "屏蔽门";
if(fault[i].fault[1] == "FAULT_PSD_OPEN"){
newfault.text = "屏蔽门无法关闭故障";
}
}
faultList.push(newfault)
}
updateFaultList();
return;
}
};
@ -263,27 +360,228 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
this.modelmanager = new ModelManagerVR();
// getPublish3dMapDetail(skinCode).then(netdata => {
getPublishMapDetail(skinCode).then(netdata => {
let mapnetdata = netdata.data;
for(let i=0,leni=mapnetdata.switchList.length;i<leni;i++){
lableCodeMap.switch[mapnetdata.switchList[i].code] = mapnetdata.switchList[i].name;
}
for(let i=0,leni=mapnetdata.psdList.length;i<leni;i++){
lableCodeMap.psd[mapnetdata.psdList[i].code] = mapnetdata.psdList[i].name;
}
for(let i=0,leni=mapnetdata.signalList.length;i<leni;i++){
lableCodeMap.signal[mapnetdata.signalList[i].code] = mapnetdata.signalList[i].name;
}
for(let i=0,leni=mapnetdata.sectionList.length;i<leni;i++){
lableCodeMap.section[mapnetdata.sectionList[i].code] = mapnetdata.sectionList[i].name;
}
initstationlist(netdata.data.stationList,netdata.data.stationStandList,netdata.data.psdList);
getPublish3dMapDetail(skinCode).then(netdata3d => {
Materialload(scope,JSON.parse(netdata3d.data.assets).stationTextureList[0]);
// let netDataAssets = JSON.parse(netdata.data.assets);
// setpsdstationmap(JSON.parse(netdata.data.stands));
scope.modelmanager.loadpromise(scope.mixers).then(function (data) {
console.log(scope.modelmanager.testmodel);
switchModel = scope.modelmanager.testmodel.mesh.getObjectByName("SWITCH");
switchModel = scope.modelmanager.otherDevice.mesh.getObjectByName("SWITCH");
moveanima.initlistnew(switchModel);
console.log(switchModel);
scope.devicetext.initdevicetext(switchModel);
// scope.scene.add(switchModel);
// switchModel.position.set(switchPos.x,switchPos.y,switchPos.z);
human.position.set(switchModel.matrixWorld.elements[12],switchModel.matrixWorld.elements[13],switchModel.matrixWorld.elements[14]);
// scope.modelmanager.testmodel.mesh.scale.set(0.1,0.1,0.1);
scope.scene.add(scope.modelmanager.testmodel.mesh);
// scope.modelmanager.otherDevice.mesh.scale.set(0.1,0.1,0.1);
if(scope.nowstation.inside == true){
scope.nowStationModel = scope.modelmanager.stationOut.mesh;
scope.scene.add(scope.nowStationModel);
}else{
scope.nowStationModel = scope.modelmanager.stationIn.mesh;
scope.scene.add(scope.nowStationModel);
}
console.log(scope.nowstation);
console.log(scope.nowStationModel);
if(scope.stationtexture["stationlist"]){
vrPlane.setStationPlane(stationList,scope.stationtexture);
console.log(scope.nowStationModel.getObjectByName("zhantailiebiao"));
scope.nowStationModel.getObjectByName("zhantailiebiao").material.map =scope.stationtexture["stationlist"];
scope.nowStationModel.getObjectByName("zhantailiebiao").material.map.needsUpdate = true;
if(scope.nowStationModel.getObjectByName("menkuangyanse")){
scope.nowStationModel.getObjectByName("menkuangyanse").material.map =scope.stationtexture["pingbimen"];
scope.nowStationModel.getObjectByName("menkuangyanse").material.map.needsUpdate = true;
}
scope.nowStationModel.getObjectByName("zhantaiming").material.map = scope.stationtexture[scope.nowstation.code];
scope.nowStationModel.getObjectByName("zhantaiming").material.map.needsUpdate = true;
}
scope.scene.add(scope.modelmanager.otherDevice.mesh);
scope.scene.add( vrPlane.group );
vrwebworker.postMessage("connect");
animate();
});
});
// });
});
function onselect(event){
//定义光线
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, scope.camera );
let intersects = raycaster.intersectObjects( vrPlane.group.children,true);
if(intersects[0]){
console.log(intersects[0]);
var object = intersects[0].object;
if(object.name == "buttonHome"){
vrPlane.homeButtonClick();
}
if(object.name == "buttonStationList"){
vrPlane.stationListButtonClick();
}
if(object.name == "buttonFaultList"){
vrPlane.faultListButtonClick();
}
// if(object.name == "buttonPrevious"){
// vrPlane.previousButtonClick();
// }
//
// if(object.name == "buttonNext"){
// vrPlane.nextButtonClick();
// }
if(object.name == "stationList"){
for(let i=0,leni=stationList.length;i<leni;i++){
if(stationList[i].code == object.code){
if(scope.nowstation.inside != stationList[i].inside){
if(stationList[i].inside == true){
scope.scene.remove(scope.nowStationModel);
scope.nowStationModel = scope.modelmanager.stationOut.mesh;
scope.scene.add(scope.nowStationModel);
}else{
scope.scene.remove(scope.nowStationModel);
scope.nowStationModel = scope.modelmanager.stationIn.mesh;
scope.scene.add(scope.nowStationModel);
}
}
scope.nowstation = stationList[i];
vrPlane.updataStationMsg(scope.nowstation);
scope.nowStationModel.getObjectByName("zhantaiming").material.map = scope.stationtexture[scope.nowstation.code];
scope.nowStationModel.getObjectByName("zhantaiming").material.map.needsUpdate = true;
i = leni;
}
}
}
if(object.name == "faultList"){
for(let i=0,leni=faultList.length;i<leni;i++){
if(faultList[i].code == object.code){
nowdevice = faultList[i];
vrPlane.updataDeviceFaultMsg(faultList[i]);
i = leni;
}
}
}
if(object.name == "shebeijian"){
human.position.set( -199.90, 0.20+0.6, -5.76 );
}
if(object.name == "jiankongshi"){
human.position.set( -213.610, 0.20+0.6,5.38);
}
if(object.name == "station1"){
human.position.set( -242.37, -4.46+0.6, 4.13);
}
if(object.name == "station2"){
human.position.set( -242.621, 0.20+0.6, 4.90 );
}
if(object.name == "anime"){
if(scope.animastats){
scope.animastats = false;
moveanima.setplaylist(moveanima.animatelist["undefinedon"],true)
}else{
scope.animastats = true;
moveanima.setplaylist(moveanima.animatelist["undefinedoff"],true);
}
}
if(object.name == "nav"){
if(navMesh){
scope.scene.remove( navMesh );
}
if(navStatus){
navStatus = false;
}else{
navStatus = true;
pathPoints = [];
let startPoint = new THREE.Vector3(human.position.x,human.position.y-0.6,human.position.z);
pathPoints.push(new THREE.Vector3(human.position.x,human.position.y,human.position.z));
groupID = pathFinder.getGroup( ZONE, startPoint );
targetPosition = new THREE.Vector3(switchModel.matrixWorld.elements[12],-5.596,switchModel.matrixWorld.elements[14]);
//
// console.log(pathPoints[0]);
// console.log(targetPosition);
// console.log(ZONE);
// console.log(groupID);
let path = pathFinder.findPath( startPoint, targetPosition, ZONE, groupID );
if(path){
for(let i=0;i<path.length;i++){
pathPoints.push(new THREE.Vector3(path[i].x,path[i].y+0.6,path[i].z));
}
let curve = new THREE.CatmullRomCurve3(pathPoints,false);
var geometry = new THREE.TubeGeometry( curve, 100, 0.2, 50, false );
navMesh = new THREE.Mesh( geometry, materialNav );
scope.scene.add( navMesh );
}
}
}
if(object.name == "reset"){
scope.resetmodel();
}
if(object.name == "repire"){
if(nowdevice){
let command = {
code:nowdevice.code,
faultType:nowdevice.fault,
};
sendCommandNew(group,"Cancel_Fault", command).then((response) => {
resolve(response);
if(response.code == 200){
nowdevice = null;
}
}).catch(error => {
});
}
}
}
}
function onSelectStart( event ) {
@ -333,14 +631,14 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
pathPoints = [];
let startPoint = new THREE.Vector3(human.position.x,human.position.y-0.6,human.position.z);
pathPoints.push(new THREE.Vector3(human.position.x,human.position.y,human.position.z));
groupID = pathfinder.getGroup( ZONE, startPoint );
groupID = pathFinder.getGroup( ZONE, startPoint );
targetPosition = new THREE.Vector3(switchModel.matrixWorld.elements[12],-5.596,switchModel.matrixWorld.elements[14]);
//
// console.log(pathPoints[0]);
// console.log(targetPosition);
// console.log(ZONE);
// console.log(groupID);
let path = pathfinder.findPath( startPoint, targetPosition, ZONE, groupID );
let path = pathFinder.findPath( startPoint, targetPosition, ZONE, groupID );
if(path){
for(let i=0;i<path.length;i++){
@ -425,7 +723,6 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
// for(){}
// console.log(intersections);
var intersection = intersections[ 0 ];
console.log(intersection.object);
// console.log(intersection);
// tempMatrix.getInverse( controller.matrixWorld );
//
@ -454,8 +751,7 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
function squeezeStart(){
console.log("squeez");
scope.modelmanager.testmodel.action.play();
console.log(moveanima.animatelist);
scope.modelmanager.otherDevice.action.play();
if(vrPlaneStatus){
vrPlaneStatus = false;
@ -557,12 +853,6 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
}
// function setpsdstationmap(stationlist){
// for(let i=0,leni=stationlist.length;i<leni;i++){
// psdtexturemap[stationlist[i].direction1.code] = stationlist[i].code;
// psdtexturemap[stationlist[i].direction2.code] = stationlist[i].code;
// }
// }
function animate() {
@ -581,7 +871,7 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
}
}
}
scope.controls.update();
// scope.controls.update();
scope.renderer.render(scope.scene, scope.camera);
}
@ -596,18 +886,18 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
console.log("pay");
if (data.normal == "0") {
console.log("play1");
scope.modelmanager.testmodel.normalPosition = "0";
scope.modelmanager.testmodel.action.reset();
scope.modelmanager.testmodel.action.time = 0;
scope.modelmanager.testmodel.action.timeScale = 1;
scope.modelmanager.testmodel.action.play();
scope.modelmanager.otherDevice.normalPosition = "0";
scope.modelmanager.otherDevice.action.reset();
scope.modelmanager.otherDevice.action.time = 0;
scope.modelmanager.otherDevice.action.timeScale = 1;
scope.modelmanager.otherDevice.action.play();
} else if (data.normal == "1") {
console.log("play2");
scope.modelmanager.testmodel.normalPosition = "1";
scope.modelmanager.testmodel.action.reset();
scope.modelmanager.testmodel.action.time = scope.modelmanager.testmodel.action._clip.duration;
scope.modelmanager.testmodel.action.timeScale = -1;
scope.modelmanager.testmodel.action.play();
scope.modelmanager.otherDevice.normalPosition = "1";
scope.modelmanager.otherDevice.action.reset();
scope.modelmanager.otherDevice.action.time = scope.modelmanager.otherDevice.action._clip.duration;
scope.modelmanager.otherDevice.action.timeScale = -1;
scope.modelmanager.otherDevice.action.play();
}
}
@ -630,6 +920,66 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
scope.windowstatus == nowwindowstatus;
}
function initstationlist(stationdata,standdata,psddata){
let list = [];
if(psddata){
for(let i=0,leni = standdata.length;i<leni;i++){
for(let j=0,lenj = psddata.length;j<lenj;j++){
if(standdata[i].code == psddata[j].standCode){
standdata[i].name = psddata[j].code;
}
}
}
for(let i=0,leni = stationdata.length;i<leni;i++){
if(stationdata[i].depot == false){
list[stationdata[i].name] = [];
for(let j=0,lenj = standdata.length;j<lenj;j++){
if(standdata[j].stationCode == stationdata[i].code){
list[stationdata[i].name].push(standdata[j]);
}
}
}
}
for(let k in list){
if(list[k].length>0){
let stationobject = {
code : list[k][0].stationCode,
name : k,
toppsd:null,
downpsd:null,
topsection:null,
downsection:null,
inside:null,
};
if(list[k][0].position.y<list[k][1].position.y){
stationobject.toppsd = list[k][0].name;
stationobject.downpsd = list[k][1].name;
stationobject.topsection = list[k][0].standTrackCode;
stationobject.downsection = list[k][1].standTrackCode;
stationobject.inside = list[k][0].inside;
}else{
stationobject.toppsd = list[k][1].name;
stationobject.downpsd = list[k][0].name;
stationobject.topsection = list[k][1].standTrackCode;
stationobject.downsection = list[k][0].standTrackCode;
stationobject.inside = list[k][0].inside;
}
stationList.push(stationobject);
}
}
scope.nowstation = stationList[0];
console.log(scope.nowstation);
}
// console.log(scope.nowstation);
}
function updateFaultList(){
vrPlane.updataFaultList(faultList);
}
function setTextVr(intersects,plane){
console.log(intersects);
console.log(plane);

View File

@ -1,6 +1,20 @@
export function VrGui(){
let scope = this;
this.group = new THREE.Group();
this.deviceGroup = new THREE.Group();
this.deviceGroup.name = "deviceGroup";
this.faultListGroup = new THREE.Group();
this.faultListGroup.name = "faultListGroup";
this.stationListGroup = new THREE.Group();
this.stationListGroup.name = "stationListGroup";
this.homeGroup = new THREE.Group();
this.homeGroup.name = "homeGroup";
var geometryPlane = new THREE.PlaneBufferGeometry( 1.4, 2, 16);
var texturePlane = new THREE.TextureLoader().load( '../../static/texture/devicemsgpane.png' );
@ -14,21 +28,196 @@ export function VrGui(){
// plane.position.z = -1.5;
// plane.rotation.x = -Math.PI/6;
scope.group.add( plane );
let nowGroupComponent = scope.homeGroup;
plane.add(nowGroupComponent);
var geometry = new THREE.PlaneBufferGeometry( 0.3, 0.3, 16 );
var geometryButtonPane = new THREE.PlaneBufferGeometry( 0.4, 0.2, 16 );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/buttonHome.png' );
var material = new THREE.MeshBasicMaterial( {
map: texture,
transparent: true,
} );
var buttonHome = new THREE.Mesh( geometryButtonPane, material );
buttonHome.name = "buttonHome";
buttonHome.position.x = -0.45;
buttonHome.position.y = 0.8;
buttonHome.position.z = 0.02;
plane.add( buttonHome );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/buttonStationList.png' );
var material = new THREE.MeshBasicMaterial( {
map: texture,
transparent: true,
} );
var buttonStationList = new THREE.Mesh( geometryButtonPane, material );
buttonStationList.name = "buttonStationList";
buttonStationList.position.x = 0;
buttonStationList.position.y = 0.8;
buttonStationList.position.z = 0.02;
plane.add( buttonStationList );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/buttonFaultList.png' );
var material = new THREE.MeshBasicMaterial( {
map: texture,
transparent: true,
} );
var buttonFaultList = new THREE.Mesh( geometryButtonPane, material );
buttonFaultList.name = "buttonFaultList";
buttonFaultList.position.x = 0.45;
buttonFaultList.position.y = 0.8;
buttonFaultList.position.z = 0.02;
plane.add( buttonFaultList );
var geometryButtonPage = new THREE.PlaneBufferGeometry( 0.3, 0.1, 16 );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/buttonPrevious.png' );
var material = new THREE.MeshBasicMaterial( {
map: texture,
transparent: true,
} );
var buttonPreviousFault = new THREE.Mesh( geometryButtonPage, material );
buttonPreviousFault.name = "buttonPrevious";
buttonPreviousFault.position.x = -0.3;
buttonPreviousFault.position.y = -0.55;
buttonPreviousFault.position.z = 0.02;
scope.faultListGroup.add( buttonPreviousFault );
//
// var texture = new THREE.TextureLoader().load( '../../static/vrtest/nav.png' );
// var material = new THREE.MeshBasicMaterial( {
// map: texture,
// transparent: true,
// } );
// var buttonPrevious = new THREE.Mesh( geometryButtonPage, material );
// buttonPrevious.name = "nav";
// buttonPrevious.position.x = 0;
// buttonPrevious.position.y = 0;
// buttonPrevious.position.z = 0.02;
// plane.add( buttonPrevious );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/buttonNext.png' );
var material = new THREE.MeshBasicMaterial( {
map: texture,
transparent: true,
} );
var buttonNextFault = new THREE.Mesh( geometryButtonPage, material );
buttonNextFault.name = "buttonNext";
buttonNextFault.position.x = 0.3;
buttonNextFault.position.y = -0.55;
buttonNextFault.position.z = 0.02;
scope.faultListGroup.add( buttonNextFault );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/buttonPrevious.png' );
var material = new THREE.MeshBasicMaterial( {
map: texture,
transparent: true,
} );
var buttonPreviousStation = new THREE.Mesh( geometryButtonPage, material );
buttonPreviousStation.name = "buttonPrevious";
buttonPreviousStation.position.x = -0.3;
buttonPreviousStation.position.y = -0.55;
buttonPreviousStation.position.z = 0.02;
scope.stationListGroup.add( buttonPreviousStation );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/buttonNext.png' );
var material = new THREE.MeshBasicMaterial( {
map: texture,
transparent: true,
} );
var buttonNextStation = new THREE.Mesh( geometryButtonPage, material );
buttonNextStation.name = "buttonNext";
buttonNextStation.position.x = 0.3;
buttonNextStation.position.y = -0.55;
buttonNextStation.position.z = 0.02;
scope.stationListGroup.add( buttonNextStation );
var geometryButtonBox = new THREE.PlaneBufferGeometry( 0.25, 0.25, 16 );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/nav.png' );
var material = new THREE.MeshBasicMaterial( {
map: texture,
transparent: true,
} );
var button1 = new THREE.Mesh( geometryButtonBox, material );
button1.name = "nav";
button1.position.x = -0.45;
button1.position.y = -0.45;
button1.position.z = 0.02;
scope.deviceGroup.add( button1 );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/anime.png' );
var material = new THREE.MeshBasicMaterial( {
map: texture,
transparent: true,
} );
var buttonnav = new THREE.Mesh( geometryButtonBox, material );
buttonnav.name = "anime";
buttonnav.position.x = -0.15;
buttonnav.position.y = -0.45;
buttonnav.position.z = 0.02;
scope.deviceGroup.add( buttonnav );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/reset.png' );
var material = new THREE.MeshBasicMaterial( {
map: texture,
transparent: true,
} );
var button2 = new THREE.Mesh( geometryButtonBox, material );
button2.name = "reset";
button2.position.x = 0.15;
button2.position.y = -0.45;
button2.position.z = 0.02;
scope.deviceGroup.add( button2 );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/repire.png' );
var material = new THREE.MeshBasicMaterial( {
map: texture,
transparent: true,
} );
var buttonreset = new THREE.Mesh( geometryButtonBox, material );
buttonreset.name = "repire";
buttonreset.position.x = 0.45;
buttonreset.position.y = -0.45;
buttonreset.position.z = 0.02;
scope.deviceGroup.add( buttonreset );
let textgeometry = new THREE.PlaneBufferGeometry( 1.2, 1.2, 1 );
let textmaterial = new THREE.MeshBasicMaterial( { color: 0xffffff } );
let textplane= new THREE.Mesh( textgeometry, textmaterial );
textplane.name = "deviceText";
textplane.position.x = 0;
textplane.position.y = 0;
textplane.position.z = 0.01;
scope.deviceGroup.add(textplane);
var geometryButtonBox = new THREE.PlaneBufferGeometry( 0.3, 0.3, 16 );
var textureshebei = new THREE.TextureLoader().load( '../../static/vrtest/shebei.png' );
var material = new THREE.MeshBasicMaterial( {
map: textureshebei,
transparent: true,
} );
var buttonShiBei = new THREE.Mesh( geometry, material );
var buttonShiBei = new THREE.Mesh( geometryButtonBox, material );
buttonShiBei.name = "shebeijian";
buttonShiBei.position.x = -0.45;
buttonShiBei.position.y = -0.15;
buttonShiBei.position.z = 0.01;
buttonShiBei.position.y = -0.8;
buttonShiBei.position.z = 0.02;
plane.add( buttonShiBei );
var texturezhankong = new THREE.TextureLoader().load( '../../static/vrtest/zhankong.png' );
@ -36,11 +225,11 @@ export function VrGui(){
map: texturezhankong,
transparent: true,
} );
var buttonZhankong = new THREE.Mesh( geometry, material );
var buttonZhankong = new THREE.Mesh( geometryButtonBox, material );
buttonZhankong.name = "jiankongshi";
buttonZhankong.position.x = -0.15;
buttonZhankong.position.y = -0.15;
buttonZhankong.position.z = 0.01;
buttonZhankong.position.y = -0.8;
buttonZhankong.position.z = 0.02;
plane.add( buttonZhankong );
@ -50,11 +239,11 @@ export function VrGui(){
map: texture,
transparent: true,
} );
var buttonStation1 = new THREE.Mesh( geometry, material );
var buttonStation1 = new THREE.Mesh( geometryButtonBox, material );
buttonStation1.name = "station1";
buttonStation1.position.x = 0.15;
buttonStation1.position.y = -0.15;
buttonStation1.position.z = 0.01;
buttonStation1.position.y = -0.8;
buttonStation1.position.z = 0.02;
plane.add( buttonStation1 );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/station2.png' );
@ -62,62 +251,321 @@ export function VrGui(){
map: texture,
transparent: true,
} );
var buttonStation2 = new THREE.Mesh( geometry, material );
var buttonStation2 = new THREE.Mesh( geometryButtonBox, material );
buttonStation2.name = "station2";
buttonStation2.position.x = 0.45;
buttonStation2.position.y = -0.15;
buttonStation2.position.z = 0.01;
buttonStation2.position.y = -0.8;
buttonStation2.position.z = 0.02;
plane.add( buttonStation2 );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/nav.png' );
var material = new THREE.MeshBasicMaterial( {
map: texture,
transparent: true,
} );
var button1 = new THREE.Mesh( geometry, material );
button1.name = "nav";
button1.position.x = -0.45;
button1.position.y = -0.6;
button1.position.z = 0.01;
plane.add( button1 );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/anime.png' );
var material = new THREE.MeshBasicMaterial( {
map: texture,
transparent: true,
} );
var buttonnav = new THREE.Mesh( geometry, material );
buttonnav.name = "anime";
buttonnav.position.x = -0.15;
buttonnav.position.y = -0.6;
buttonnav.position.z = 0.01;
plane.add( buttonnav );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/reset.png' );
var material = new THREE.MeshBasicMaterial( {
map: texture,
transparent: true,
} );
var button2 = new THREE.Mesh( geometry, material );
button2.name = "reset";
button2.position.x = 0.15;
button2.position.y = -0.6;
button2.position.z = 0.01;
plane.add( button2 );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/repire.png' );
var material = new THREE.MeshBasicMaterial( {
map: texture,
transparent: true,
} );
var buttonreset = new THREE.Mesh( geometry, material );
buttonreset.name = "repire";
buttonreset.position.x = 0.45;
buttonreset.position.y = -0.6;
buttonreset.position.z = 0.01;
plane.add( buttonreset );
//
// this.deviceGroup = new THREE.Group();
// this.deviceGroup.name = "deviceGroup";
//
// this.faultListGroup = new THREE.Group();
// this.faultListGroup.name = "faultListGroup";
//
// this.stationListGroup = new THREE.Group();
// this.stationListGroup.name = "stationListGroup";
//
// this.homeGroup = new THREE.Group();
// this.homeGroup.name = "homeGroup";
//
//
// let nowGroupComponent = scope.homeGroup;
this.setStationPlane = function(stations){
// console.log(stations);
// console.log(textures);
let posX,posY;
for(let i=0,leni = stations.length;i<leni;i++){
if(i<4){
posX = i*0.34;
}else{
posX = (i%4)*0.34;
}
posY = Math.floor(i/4)*0.16;
console.log(posY);
setTextStation(stations[i],scope.stationListGroup,posX-0.5,0.6-posY,"stationList");
}
setTextMsg(stations[0],scope.homeGroup,0,0,"stationMsg");
}
this.homeButtonClick = function(){
if(nowGroupComponent.name != "homeGroup"){
plane.remove(nowGroupComponent);
nowGroupComponent = scope.homeGroup;
plane.add(nowGroupComponent);
}
}
this.stationListButtonClick = function(){
if(nowGroupComponent.name != "stationListGroup"){
plane.remove(nowGroupComponent);
nowGroupComponent = scope.stationListGroup;
plane.add(nowGroupComponent);
}
}
this.faultListButtonClick = function(){
if(nowGroupComponent.name != "faultListGroup"){
plane.remove(nowGroupComponent);
nowGroupComponent = scope.faultListGroup;
plane.add(nowGroupComponent);
}
}
this.previousButtonClick = function(){
// if(nowGroupComponent.name != "homeGroup"){
// // plane.remove(nowGroupComponent);
// // nowGroupComponent = scope.homeGroup;
// // plane.add(nowGroupComponent);
// }
}
this.nextButtonClick = function(){
// if(nowGroupComponent.name != "homeGroup"){
// // plane.remove(nowGroupComponent);
// // nowGroupComponent = scope.homeGroup;
// // plane.add(nowGroupComponent);
// }
}
this.updataStationMsg = function(newStationMsg){
let textt = new THREE.CanvasTexture(getTextCanvas(newStationMsg,"stationMsg"));
scope.homeGroup.children[0].material.map = textt;
scope.homeGroup.children[0].material.map.needsUpdate = true;
plane.remove(nowGroupComponent);
nowGroupComponent = scope.homeGroup;
plane.add(nowGroupComponent);
}
this.updataFaultList = function(faultList){
let posX,posY;
scope.faultListGroup = new THREE.Group();
for(let i=0,leni = faultList.length;i<leni;i++){
if(i<4){
posX = i*0.34;
}else{
posX = (i%4)*0.34;
}
posY = Math.floor(i/4)*0.16;
setFaultMsg(faultList[i],scope.faultListGroup,posX-0.5,0.6-posY,"faultList");
}
plane.remove(nowGroupComponent);
nowGroupComponent = scope.faultListGroup;
plane.add(nowGroupComponent);
console.log(scope.faultListGroup.children);
}
this.updataDeviceFaultMsg = function(faultData){
console.log(faultData);
let textt = new THREE.CanvasTexture(getTextCanvas(faultData,"faultMsg"));
scope.deviceGroup.getObjectByName("deviceText").material.map = textt;
scope.deviceGroup.getObjectByName("deviceText").material.map.needsUpdate = true;
plane.remove(nowGroupComponent);
nowGroupComponent = scope.deviceGroup;
plane.add(nowGroupComponent);
}
function setFaultMsg(intersects,plane,posX,posY,type){
let textgeometry = new THREE.PlaneBufferGeometry( 0.25, 0.15, 1 );
let textt = new THREE.CanvasTexture(getTextCanvas(intersects,type));
let textmaterial = new THREE.MeshBasicMaterial( {
side: THREE.DoubleSide,
map:textt ,
} );
let textplane= new THREE.Mesh( textgeometry, textmaterial );
// textplane.name = data[i].code;
textplane.name = "faultList";
textplane.code = intersects.code;
textplane.position.x = posX;
textplane.position.y = posY;
textplane.position.z = 0.01;
plane.add(textplane);
textgeometry.dispose();
textmaterial.dispose();
textt.dispose();
}
function setTextMsg(intersects,plane,posX,posY,type){
let textgeometry = new THREE.PlaneBufferGeometry( 1.2, 1.2, 1 );
let textt = new THREE.CanvasTexture(getTextCanvas(intersects,type));
let textmaterial = new THREE.MeshBasicMaterial( {
side: THREE.DoubleSide,
map:textt ,
} );
let textplane= new THREE.Mesh( textgeometry, textmaterial );
// textplane.name = data[i].code;
textplane.position.x = posX;
textplane.position.y = posY;
textplane.position.z = 0.01;
plane.add(textplane);
textgeometry.dispose();
textmaterial.dispose();
textt.dispose();
}
function setTextStation(intersects,plane,posX,posY,type){
let textgeometry = new THREE.PlaneBufferGeometry( 0.25, 0.15, 1 );
let textt = new THREE.CanvasTexture(getTextCanvas(intersects,type));
let textmaterial = new THREE.MeshBasicMaterial( {
side: THREE.DoubleSide,
map:textt ,
} );
let textplane= new THREE.Mesh( textgeometry, textmaterial );
// textplane.name = data[i].code;
textplane.name = "stationList";
textplane.code = intersects.code;
textplane.position.x = posX;
textplane.position.y = posY;
textplane.position.z = 0.01;
plane.add(textplane);
textgeometry.dispose();
textmaterial.dispose();
textt.dispose();
}
var beauty = new Image();
beauty.src = "../../static/texture/scene.png";
//canvas文字贴图方法
//PS:待提炼 增强功能
function getTextCanvas(text,type){
var canvas = document.getElementById('canvastexture');
let data;
var ctx = canvas.getContext('2d');
if(type == "stationList"){
canvas.width = 128;
canvas.height = 64;
//var bg = canvas.createPattern(img, "no-repeat");
//ctx.fillStyle = bg;
ctx.fillRect(0, 0,128,64);
ctx.font = "16px Verdana";
ctx.fillStyle = '#FFFFFF';
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.clearRect(0,0,128,64);
//console.log(text.groupNumber);
ctx.drawImage(beauty,0,0,128, 64);
ctx.fillText(text.name, 64,32);
//ctx.fillText(text.trainModel.name, width/2,height*3/4);
data = ctx.getImageData(0, 0,128, 64);
}
if(type == "faultList"){
canvas.width = 128;
canvas.height = 64;
//var bg = canvas.createPattern(img, "no-repeat");
//ctx.fillStyle = bg;
ctx.fillRect(0, 0,128,64);
ctx.font = "16px Verdana";
ctx.fillStyle = '#FFFFFF';
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.clearRect(0,0,128,64);
//console.log(text.groupNumber);
ctx.drawImage(beauty,0,0,128, 64);
ctx.fillText("故障设备编号:", 64,16);
ctx.fillText(text.name, 64,48);
//ctx.fillText(text.trainModel.name, width/2,height*3/4);
data = ctx.getImageData(0, 0,128, 64);
}
if(type == "stationMsg"){
canvas.width = 256;
canvas.height = 256;
//var bg = canvas.createPattern(img, "no-repeat");
//ctx.fillStyle = bg;
ctx.fillRect(0, 0,256,256);
ctx.font = "16px Verdana";
ctx.fillStyle = '#FFFFFF';
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.clearRect(0,0,256,256);
//console.log(text.groupNumber);
ctx.drawImage(beauty,0,0,256, 256);
ctx.fillText("当前车站信息", 128,32);
ctx.fillText("车站名:"+text.name, 128,64);
if(text.inside == true){
ctx.fillText("车站类型:外侧车站", 128,96);
}else{
ctx.fillText("车站类型:内侧车站", 128,96);
}
ctx.fillText("车站运行状态:运行中", 128,128);
ctx.fillText("站内温度:25℃", 128,160);
//ctx.fillText(text.trainModel.name, width/2,height*3/4);
data = ctx.getImageData(0, 0,256, 256);
}
if(type == "faultMsg"){
canvas.width = 256;
canvas.height = 256;
//var bg = canvas.createPattern(img, "no-repeat");
//ctx.fillStyle = bg;
ctx.fillRect(0, 0,256,256);
ctx.font = "16px Verdana";
ctx.fillStyle = '#FFFFFF';
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.clearRect(0,0,256,256);
//console.log(text.groupNumber);
ctx.drawImage(beauty,0,0,256, 256);
ctx.fillText("当前故障信息", 128,32);
ctx.fillText("故障设备:"+text.code, 128,64);
if(text.type == "SECTION"){
ctx.fillText("设备类型:铁轨", 128,96);
ctx.fillText("故障名称:计轴故障", 128,128);
}
if(text.type == "SIGNAL"){
ctx.fillText("设备类型:信号机", 128,96);
ctx.fillText("故障名称:主灯丝熔断", 128,128);
}
if(text.type == "STAND"){
ctx.fillText("设备类型:屏蔽门", 128,96);
ctx.fillText("故障名称:屏蔽门故障打开", 128,128);
}
if(text.type == "SWITCH"){
ctx.fillText("设备类型:道岔", 128,96);
ctx.fillText("故障名称:失表", 128,128);
}
//ctx.fillText(text.trainModel.name, width/2,height*3/4);
data = ctx.getImageData(0, 0,256, 256);
}
return data;
}
}

View File

@ -1,18 +1,42 @@
export function ModelManagerVR(){
let scope = this;
//
// this.testmodel = {
// code:"test",
// locateType:"01",
// mesh:null,
// url:"../../static/vrtest/vrtest.FBX"
// };
this.testmodel = {
code:"test",
locateType:"01",
this.stationIn = {
code:"stationIn",
locateType:"1",
mesh:null,
url:"../../static/vrtest/vrtest.FBX"
url:"../../static/vrtest/stationIn.FBX"
};
this.stationOut = {
code:"stationOut",
locateType:"2",
mesh:null,
url:"../../static/vrtest/stationOut.FBX"
};
this.otherDevice = {
code:"otherDevice",
locateType:"3",
mesh:null,
url:"../../static/vrtest/otherDevice.FBX"
};
this.loadpromise = function (mixers){
let initlist = [];
initlist.push(fbxpromise(mixers,scope.testmodel));
// initlist.push(fbxpromise(mixers,scope.testmodel));
initlist.push(fbxpromise(mixers,scope.stationIn));
initlist.push(fbxpromise(mixers,scope.stationOut));
initlist.push(fbxpromise(mixers,scope.otherDevice));
// initlist.push(fbxpromise(data.Switch,mixers,scope.switchmodel));
// initlist.push(fbxpromise(data.Signal,mixers,scope.signalmodel));
// initlist.push(fbxpromise(data.stationstand,mixers,scope.standmodel));

View File

@ -16,6 +16,7 @@ const Jlmap3dPassFlow = () => import('@/views/jlmap3d/passflow/jl3dpassflow');
const Jlmap3dStation = () => import('@/views/jlmap3d/station/jl3dstation');
const Jlmap3dModel = () => import('@/views/jlmap3d/device/jl3ddevice');
const Jlmap3dTrain = () => import('@/views/jlmap3d/devicetrain/jl3ddevicetrain');
const Jlmap3dMaintainer = () => import('@/views/jlmap3d/maintainer/jl3dmaintainer');
const Jlmap3dMaintainerVr = () => import('@/views/jlmap3d/maintainer/jl3dmaintainervr');
// const Jl3dMaintainer = () => import('@/views/jlmap3d/maintainer/jl3dmaintainer');
@ -232,7 +233,13 @@ export const constantRoutes = [
hidden: true
},
{
path: '/jlmap3d/maintainervr', // 贵阳 继电器
path: '/jlmap3d/maintainer',
component: Jlmap3dMaintainer,
hidden: true
},
{
path: '/jlmap3d/maintainervr',
component: Jlmap3dMaintainerVr,
hidden: true

View File

@ -9,7 +9,7 @@
<el-button type="primary" @click="switchhide">{{switchshow}}</el-button>
</el-button-group>
</div> -->
<div id="jl3ddevicerepir" class="repirbutton" @click="devicerepir"></div>
<div id="jl3ddevicerepir" class="repirbutton" :style="repirBG" @click="devicerepir"></div>
<div id="jl3dclose" class="backbutton" @click="close3ddeviceview"></div>
<Jl3ddevice-Msg v-show="isswitch">
@ -33,6 +33,7 @@
import Jl3ddeviceMsg from '@/views/jlmap3d/maintainer/component/devicemsg';
import Jl3ddeviceList from '@/views/jlmap3d/maintainer/component/devicelist';
import { getSimulationInfoNew } from '@/api/simulation';
import { sendCommandNew } from '@/api/jmap/training';
import Command from '@/scripts/cmdPlugin/Command';
import Handler from '@/scripts/cmdPlugin/Handler';
@ -50,7 +51,7 @@
jl3d: null,
windowstatus:false,
nowdevice:null,
repirBG:null,
//
equiplist:[],
switchstatus:true,
@ -118,8 +119,8 @@
code() {
return this.$route.query.code;
},
mapId() {
return this.$route.query.mapId;
mapid() {
return this.$route.query.mapid;
},
group(){
return this.$route.query.group;
@ -137,12 +138,14 @@
this.datastatus = "new";
this.initnewdata(group,header);
// const mapdata = this.$store.getters['map/map'];
// console.log(mapdata);
// if (group) {
// this.init(group,header);
// // this.subscribe(code,group,header);
// }
if(group){
getSimulationInfoNew(group).then(netdata => {
if(netdata.data.type == "SCRIPT_MAKING"){
this.repirBG = {backgroundImage:'url("/static/texture/gousuo.png")'}
}
});
}
},
beforeDestroy() {
},
@ -150,7 +153,7 @@
initnewdata: function (group,header){
let dom = document.getElementById('jl3ddevicefault');
this.jl3d = new Jl3dfaultdevice(dom,group,header,this.mapId);
this.jl3d = new Jl3dfaultdevice(dom,group,header,this.mapid);
},
close3ddeviceview: function(){
this.$emit('closedevice3dview');
@ -209,8 +212,10 @@
// }
//
// },
startAnimate(){
this.jl3d.startAnimate();
},
showmodel(devicedata){
console.log(devicedata);
this.jl3d.updatewindowstatus('1');
this.jl3d.selectmodel(devicedata);
this.nowdevice = devicedata;

View File

@ -1,13 +1,10 @@
<template>
<div class="jalmap3ddiv">
<div v-show="selectShow" class="jl3dmap3dMaintainerSelect">
<div class="maintainerSelectButton" style="left:33%" @click="initNormal">通号检修模式</div>
<div class="maintainerSelectButton" style="right:33%" @click="initVR">通号检修模式(VR)</div>
</div>
<div class="jl3dmap3dMaintainer">
<div class="display-draft">
<el-button-group>
<!-- <el-button v-if="isAdmin" @click="memberManage">成员管理</el-button> -->
<el-button type="primary" @click="back">{{ $t('global.back') }}</el-button>
</el-button-group>
@ -72,14 +69,7 @@ export default {
// Jlmap3dMsg
// ShowProperty
},
props: {
isAdmin: {
type: Boolean,
default() {
return false;
}
}
},
data() {
return {
training: {
@ -99,7 +89,8 @@ export default {
devicelist:[],
deviceShow:true,
msgshow:false,
controlmsg:''
controlmsg:'',
};
},
@ -108,7 +99,6 @@ export default {
if (this.jlmap3d) {
this.jlmap3d.webwork.postMessage('off');
this.jlmap3d.webwork.terminate();
console.log('www');
this.jlmap3d.jsonwebworknew.terminate();
this.jlmap3d.dispose();
this.jlmap3d = null;
@ -124,13 +114,13 @@ export default {
window.deletefault = this.deletefault;
window.warningmsg = this.warningmsg;
this.getParams();
this.initNormal();
// console.log("");
},
methods: {
getParams:function() {
var routerParams = this.$route.query.group;
this.mapid = this.$route.query.mapId;
this.mapid = this.$route.query.mapid;
this.group = this.$route.query.group;
this.token = this.$route.query.token;
},
@ -146,13 +136,10 @@ export default {
}
},
initNormal: function () {
this.selectShow = false;
this.deviceShow = false;
// this.deviceShow = true;
// this.faultlistshow = true;
const mapdata = this.$store.getters['map/map'];
const dom = document.getElementById('app');
document.querySelector('.schema').style.zIndex = 34;
// document.querySelector('.schema').style.zIndex = 34;
const project = this.$route.query.project;
// console.log(project);
@ -163,20 +150,11 @@ export default {
this.jlmap3d = new JLmap3dMaintainer(dom, mapdata, this.mapid, this.$store, this.group, '');
}
this.$refs.faultdevice.startAnimate();
this.jlmap3d.eventon();
},
initVR:function (skinCode, group) {
const routeData = this.$router.resolve({
path:'/jlmap3d/maintainervr',
query:{
mapid:this.mapid,
group:this.group,
token:this.token,
noPreLogout: true
}
});
window.open(routeData.href);
},
raystand() {
this.jlmap3d.rayswitch('stand');
},
@ -208,8 +186,6 @@ export default {
this.devicelist.push(fault);
},
deletefault(code) {
console.log(code);
console.log(this.devicelist);
for (let i = 0, leni = this.devicelist.length; i < leni; i++) {
if (code == this.devicelist[i].code) {
this.devicelist.splice(i, 1);
@ -244,7 +220,19 @@ export default {
back() {
this.$emit('back');
this.isswitch = false;
}
},
onMouseOverNormal() {
this.normalShow=true;
},
onMouseOutNormal() {
this.normalShow=false;
},
onMouseOverVr() {
this.vrShow=true;
},
onMouseOutVr() {
this.vrShow=false;
},
}
};
</script>
@ -294,39 +282,13 @@ export default {
#testjlmap3d {
}
.jalmap3ddiv {
.jl3dmap3dMaintainer {
position:absolute;
width: 100%;
height: 100%;
z-index: 35;
}
.jl3dmap3dMaintainerSelect{
position:absolute;
width: 100%;
height: 100%;
z-index: 350;
top:0;
left:0;
background-image:url("/static/texture/bg.jpg");
// background-repeat:no-repeat;
background-size:100%;
}
.maintainerSelectButton{
position:absolute;
width: 200px;
height: 100px;
position:absolute;
top:49%;
text-align: center;
font-size: 20px;
line-height:100px;
background-image:url("/static/texture/scene.png");
background-repeat:no-repeat;
background-size:100%;
}
.jlmap3ddraw {
float: left;
left: 0;

View File

@ -0,0 +1,159 @@
<template>
<div class="jl3dmap3dMaintainer">
<div class="jl3dmap3dMaintainerSelect">
<div class="maintainerSelectButton selectButtonImg1" style="left:20%" @mouseenter="onMouseOverNormal"></div>
<div class="maintainerSelectButton selectButtonImg2" style="left:20%;" v-show="normalShow"@mouseleave="onMouseOutNormal" @click="initNormal"></div>
<div class="maintainerSelectButton selectButtonImg3" style="right:20%;" @mouseenter="onMouseOverVr"></div>
<div class="maintainerSelectButton selectButtonImg4" style="right:20%;" v-show="vrShow" @mouseleave="onMouseOutVr" @click="initVR"></div>
</div>
</div>
</template>
<script>
import { ProjectIcon } from '@/scripts/ProjectConfig';
import bgPsdImg from '@/assets/bg_psd.png';
// import Jlmap3dMsg from '@/views/jlmap3d/show/msg';
var train;
export default {
name: 'Jl3dMaintainerSelect',
components: {
},
data() {
return {
normalShow:false,
vrShow:false,
};
},
beforeDestroy() {
},
created() {
// document.querySelector("link[rel*='icon']").href = loginInfo[this.$route.query.project].linkIcon || ProjectIcon[this.$route.query.project];
},
mounted() {
this.getParams();
// console.log("");
},
methods: {
getParams:function() {
var routerParams = this.$route.query.group;
this.mapid = this.$route.query.mapId;
this.group = this.$route.query.group;
this.token = this.$route.query.token;
},
initNormal: function () {
const routeData = this.$router.resolve({
path:'/jlmap3d/maintainer',
query:{
mapid:this.mapid,
group:this.group,
token:this.token,
noPreLogout: true
}
});
window.open(routeData.href);
},
initVR:function (skinCode, group) {
const routeData = this.$router.resolve({
path:'/jlmap3d/maintainervr',
query:{
mapid:this.mapid,
group:this.group,
token:this.token,
noPreLogout: true
}
});
window.open(routeData.href);
},
onMouseOverNormal() {
this.normalShow=true;
},
onMouseOutNormal() {
this.normalShow=false;
},
onMouseOverVr() {
this.vrShow=true;
},
onMouseOutVr() {
this.vrShow=false;
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.jl3dmap3dMaintainer {
position:absolute;
width: 100%;
height: 100%;
z-index: 35;
}
.jl3dmap3dMaintainerSelect{
position:absolute;
width: 100%;
height: 100%;
z-index: 350;
top:0;
left:0;
background-image:url("/static/background/other.jpg");
// background-repeat:no-repeat;
z-index: 350;
background-size:100%;
}
.maintainerSelectButton{
position:absolute;
width: 20%;
height: 55%;
position:absolute;
top:22.5%;
text-align: center;
font-size: 20px;
line-height:100px;
}
.selectButtonImg1{
background-image:url("/static/vrtest/maintainer.png");
background-repeat:no-repeat;
background-size:100% 100%;
}
.selectButtonImg2{
background-image:url("/static/vrtest/zc.png");
background-repeat:no-repeat;
background-size:100% 100%;
}
.selectButtonImg3{
background-image:url("/static/vrtest/maintainervr.png");
background-repeat:no-repeat;
background-size:100% 100%;
}
.selectButtonImg4{
background-image:url("/static/vrtest/vr.png");
background-repeat:no-repeat;
background-size:100% 100%;
}
</style>

View File

@ -1,7 +1,7 @@
<template>
<div class="main" :style="{width: canvasWidth+'px'}">
<Jl3d-Drive v-show="drivingShow" ref="Jl3dDrive" :panel-show="drivingShow" @showdriving="showdriving" />
<Jl3d-Maintainer v-if="jl3dmaintainershow" :is-admin="isAdmin" @back="back" @handlerMemberManage="handlerMemberManage" />
<Jl3d-MaintainerSelect v-if="jl3dmaintainershow" :is-admin="isAdmin" @back="back" @handlerMemberManage="handlerMemberManage" />
<ibp-plate v-show="ibpShow" ref="ibpPlate" @hideIbp="hideIbp" />
<template v-show="panelShow" :panelShow="panelShow">
<transition name="el-zoom-in-bottom">
@ -19,6 +19,7 @@
:device-code="deviceCode"
:countdown-time="countdownTime"
@passflow="passflow"
@faultdevice = "faultdevice"
@getUserRole="getUserRole"
@hidepanel="hidepanel"
@devicemodel="devicemodel"
@ -76,7 +77,7 @@ import {getRaceUserById, getTestPaperDatail} from '@/api/competition';
import { getSessionStorage } from '@/utils/auth';
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
import Jl3dDevice from '@/views/jlmap3d/device/jl3ddevice';
import Jl3dMaintainer from '@/views/jlmap3d/maintainer/jl3dmaintainer';
import Jl3dMaintainerSelect from '@/views/jlmap3d/maintainer/jl3dmaintainerselect';
import { EventBus } from '@/scripts/event-bus';
import { timeFormat } from '@/utils/date';
import { Message } from 'element-ui';
@ -97,7 +98,7 @@ export default {
MenuTrainList,
menuSystemTime,
Jl3dDrive,
Jl3dMaintainer,
Jl3dMaintainerSelect,
IbpPlate,
JsQuestion,
MembersManage,
@ -485,6 +486,18 @@ export default {
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
},
faultdevice() {
const routeData = this.$router.resolve({
path:'/jlmap3d/maintainer',
query:{
mapid:this.mapId,
group:this.group,
project: this.project,
noPreLogout: true
}
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
},
showdriving() {
this.panelShow = true;
this.drivingShow = false;

View File

@ -261,7 +261,7 @@ export default {
const self = this;
assignUsersPlayRoles(data, this.$route.query.group).then(resp => {
this.$message.success('调整角色成员成功!');
document.querySelector('.schema').style.zIndex = 35;
document.querySelector('.schema').style.zIndex = 34;
}).catch(() => {
self.memberData[nodeData.id].userId = '';
this.$message.error('调整角色成员失败!');

View File

@ -13,6 +13,8 @@
<el-button v-if="isShowScheduling || isDriver" size="small" @click="jumpjlmap3d">{{ jl3dname }}</el-button>
<!-- cctv视图 -->
<el-button v-if="isShowScheduling || isStationSupervisor" size="small" @click="jumpjl3dpassflow">{{ $t('display.demon.passengerflow') }}</el-button>
<el-button v-if="isShowScheduling || isStationSupervisor" size="small" @click="jumpjl3dfaultdevice">{{ $t('display.demon.maintainer') }}</el-button>
<el-button v-if="isAdmin && !noQrcodeList.includes(project)" type="primary" size="small" @click="generateQrCode">生成二维码</el-button>
<el-button v-if="isAdmin" size="small" @click="memberManage">成员管理</el-button>
<el-button v-if="isAdmin && isProject" size="small" @click="handleEquipment">设备管理</el-button>
@ -355,6 +357,9 @@ export default {
jumpjl3dpassflow() {
this.$emit('passflow');
},
jumpjl3dfaultdevice() {
this.$emit('faultdevice');
},
jumpjlmap3dmodel() {
this.$emit('devicemodel');
},

BIN
static/texture/gousuo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

BIN
static/vrtest/stationIn.FBX Normal file

Binary file not shown.

Binary file not shown.

BIN
static/vrtest/vr.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
static/vrtest/zc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB