修改三维列车驾驶

This commit is contained in:
sunzhenyu 2021-09-24 10:04:05 +08:00
parent cd2aecc566
commit f9ed9cca22
23 changed files with 1109 additions and 920 deletions

View File

@ -76,8 +76,8 @@ export default {
open: '开', open: '开',
front: '前', front: '前',
later: '后', later: '后',
electricGongSheng: '受电弓升', electricGongSheng: '',
pantographFall: '受电弓降', pantographFall: '',
lampButton: '试灯按钮', lampButton: '试灯按钮',
removalATP: 'ATP切除', removalATP: 'ATP切除',
infliction: '施加', infliction: '施加',

View File

@ -146,3 +146,11 @@ export function trainSimulationDoorMode(group, data) {
data: data data: data
}); });
} }
export function trainSimulationCommand(group,data,operate) {
return request({
url: `/simulation/${group}/operate/${operate}`,
method: 'post',
data: data
});
}

View File

@ -1006,7 +1006,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
} }
function signalupdate(data) { function signalupdate(data) {
code = data.code; code = data.code;
console.log(data);
if(data.command == 'No'){ if(data.command == 'No'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"]; signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true; signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;

View File

@ -183,7 +183,8 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
updatePlayer( deltaTime ); updatePlayer( deltaTime );
updateSpheres( deltaTime ); updateSpheres( deltaTime );
// console.log(scope.eventHitMode);
// console.log(roleMode);
if(scope.eventHitMode == true && roleMode){ if(scope.eventHitMode == true && roleMode){
if(eventBoxs.length>0){ if(eventBoxs.length>0){
attachBox.position.copy(fpsCamera.position); attachBox.position.copy(fpsCamera.position);
@ -268,9 +269,9 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
document.addEventListener( 'mousedown', (event) => { document.addEventListener( 'mousedown', (event) => {
fpsMouseStatus = true; fpsMouseStatus = true;
// document.body.requestPointerLock(); // document.body.requestPointerLock();
// console.log("mousedown-----------------------"); console.log("mousedown-----------------------");
// console.log(raycasterBoxs); console.log(raycasterBoxs);
// console.log(roleMode); console.log(roleMode);
if(raycasterBoxs.length>0 && roleMode){ if(raycasterBoxs.length>0 && roleMode){
var mouse = new THREE.Vector2(); var mouse = new THREE.Vector2();

View File

@ -415,7 +415,7 @@ export function ZzwwTrain() {
text:"", text:"",
devices:[ devices:[
{ {
id:"GWS", id:"GWX",
name:"钩尾销", name:"钩尾销",
color:"#ff0000", color:"#ff0000",
status:"", status:"",

View File

@ -17,6 +17,9 @@ const Jlmap3dLesson3dEdit = () => import('@/views/jlmap3d/lesson3dedit/lesson3de
const Jlmap3dLesson3dPlayer = () => import('@/views/jlmap3d/lesson3dplayer/lesson3dplayer'); const Jlmap3dLesson3dPlayer = () => import('@/views/jlmap3d/lesson3dplayer/lesson3dplayer');
const Jlmap3dLesson3dSelect = () => import('@/views/jlmap3d/lesson3dplayer/lesson3dselect'); const Jlmap3dLesson3dSelect = () => import('@/views/jlmap3d/lesson3dplayer/lesson3dselect');
const Jlmap3dZzwwTest = () => import('@/views/jlmap3d/zzwwtest/zzwwtest');
const Jlmap3d = () => import('@/views/jlmap3d/drive/jl3ddrive'); const Jlmap3d = () => import('@/views/jlmap3d/drive/jl3ddrive');
const Jlmap3dSandbox = () => import('@/views/jlmap3d/simulation/jl3dsimulation'); const Jlmap3dSandbox = () => import('@/views/jlmap3d/simulation/jl3dsimulation');
const Jlmap3dPassFlow = () => import('@/views/jlmap3d/passflow/jl3dpassflow'); const Jlmap3dPassFlow = () => import('@/views/jlmap3d/passflow/jl3dpassflow');
@ -296,6 +299,12 @@ export const constantRoutes = [
component: Jlmap3dLesson3dSelect, component: Jlmap3dLesson3dSelect,
hidden: true hidden: true
}, },
{
path: '/jlmap3d/zzwwtest',
component: Jlmap3dZzwwTest,
hidden: true
},
{ {
path: '/data2json', path: '/data2json',

View File

@ -2,10 +2,10 @@ export function getBaseUrl() {
let BASE_API; let BASE_API;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud'; // 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.152:9000'; // 袁琪 // BASE_API = 'http://192.168.8.152:9000'; // 袁琪
// BASE_API = 'http://192.168.8.177:9000'; // 旭强 // BASE_API = 'http://192.168.8.177:9000'; // 旭强
// BASE_API = 'http://192.168.2.183:9000'; // 张赛 BASE_API = 'http://192.168.8.109:9000'; // 张赛
// BASE_API = 'http://192.168.8.140:9000'; // 杜康 // BASE_API = 'http://192.168.8.140:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康

View File

@ -1,19 +1,21 @@
<template> <template>
<div style="width:100%;height:50%;position:absolute;bottom:4%"> <div style="width:100%;height:50%;position:absolute;bottom:4%;z-index:3;">
<div id="start" class="panebutton2" style="bottom:1%;left:5%;" > <!-- <div id="start" class="panebutton2" style="bottom:1%;left:5%;" >
<img class="buttonimg2" :src="start" /> <img class="buttonimg2" :src="start" />
</div> -->
<div id="direct" class="directpanediv" style="bottom:1%;right:10px;">
<img class="directimg" :src="direct" />
<img id="directimg" class="directimg" :src="directoffpng" :style="{transform:toutransform}" />
<div class="directbutton" style="top:55px;left:-5px;" @click="directSelect('0')">后退</div>
<div class="directbutton" style="top:28px;left:1px;"@click="directSelect('1')">断开</div>
<div class="directbutton" style="top:8px;left:20px;"@click="directSelect('2')">洗车</div>
<div class="directbutton" style="top:0px;left:50px;"@click="directSelect('3')">手动</div>
<div class="directbutton" style="top:5px;left:80px;"@click="directSelect('4')">ATO</div>
</div> </div>
<div id="direct" class="panebutton2" style="bottom:1%;left:25%;"> <div id="div1" class ="pane-box" @mouseleave="speedout" >
<img class="buttonimg2" :src="direct" /> <img class="paneimg" :src="pane" />
<img id="directimg" class="buttonimg2" :src="directoffpng" :style="{transform:toutransform}" @mousedown="touchstart" />
<div class="directbutton" style="top:0px;right:0;">{{ $t('jlmap3d.front') }}</div>
<div class="directbutton" style="top:18px;right:0;">0</div>
<div class="directbutton" style="top:36px;right:0;">{{ $t('jlmap3d.later') }}</div>
</div>
<div id="div1" class ="pane-box" >
<img class="paneimg" :src="pane" @mouseout="speedout"/>
<div class="panelb" :style="{right: isZh? '80px': '80px', top: isZh? '0px': '0px'}">{{ $t('jlmap3d.traction') }}</div> <div class="panelb" :style="{right: isZh? '80px': '80px', top: isZh? '0px': '0px'}">{{ $t('jlmap3d.traction') }}</div>
<div class="panelb" :style="{right: isZh? '80px': '80px', top: '70px'}">0</div> <div class="panelb" :style="{right: isZh? '80px': '80px', top: '70px'}">0</div>
<div class="panelb" :style="{right: isZh? '80px': '80px', top: isZh? '130px': '130px'}">{{ $t('jlmap3d.braking') }}</div> <div class="panelb" :style="{right: isZh? '80px': '80px', top: isZh? '130px': '130px'}">{{ $t('jlmap3d.braking') }}</div>
@ -51,7 +53,7 @@
apoimg:"", apoimg:"",
touchcontrol:true, touchcontrol:true,
touchstate:"Neutral", touchstate:"Neutral",
toutransform:"rotate(175deg)", toutransform:"rotate(300deg)",
start:JL3D_LOCAL_STATIC+"/jl3d/control/start.png", start:JL3D_LOCAL_STATIC+"/jl3d/control/start.png",
direct:JL3D_LOCAL_STATIC+"/jl3d/control/direct.png", direct:JL3D_LOCAL_STATIC+"/jl3d/control/direct.png",
directz:JL3D_LOCAL_STATIC+"/jl3d/control/directfront.png", directz:JL3D_LOCAL_STATIC+"/jl3d/control/directfront.png",
@ -144,12 +146,17 @@
methods: { methods: {
centerstate : function(gear){ centerstate : function(gear){
this.touchstate = gear; this.touchstate = gear;
if(this.touchstate == "Drive"){ console.log(gear);
this.toutransform = "rotate(140deg)"; if(this.touchstate == "ATO"){
}else if(this.touchstate == "Neutral"){ this.toutransform = "rotate(30deg)";
this.toutransform = "rotate(175deg)"; }else if(this.touchstate == "MANUAL"){
}else if(this.touchstate == "Reverse"){ this.toutransform = "rotate(360deg)";
this.toutransform = "rotate(205deg)"; }else if(this.touchstate == "WASH"){
this.toutransform = "rotate(330deg)";
}else if(this.touchstate == "DISCONNECT"){
this.toutransform = "rotate(300deg)";
}else if(this.touchstate == "REVERSE"){
this.toutransform = "rotate(270deg)";
} }
}, },
centercontrol : function(){ centercontrol : function(){
@ -200,9 +207,9 @@
speedchange: function(event){ speedchange: function(event){
this.moveheight = event.pageY-this.movelimit.y; this.moveheight = event.pageY-this.movelimit.y;
this.movex = this.moveheight-7 +"px"; this.movex = this.moveheight-7 +"px";
// if(this.atostate == true){ if(this.atostate == true){
// this.$store.dispatch('app/setAtoState', false); this.$store.dispatch('app/setAtoState', false);
// } }
if(this.moveheight<=1){ if(this.moveheight<=1){
this.moveheight=1; this.moveheight=1;
this.movex=-6+"px"; this.movex=-6+"px";
@ -242,13 +249,14 @@
console.log(error); console.log(error);
}) })
,200,true); ,200,true);
// updatemmic1(this.move); updatemmic1(this.move);
}, },
speedend: function(event){ speedend: function(event){
document.getElementById("div1").onmousemove = null; document.getElementById("div1").onmousemove = null;
document.getElementById("div2").onmouseup = null; document.getElementById("div2").onmouseup = null;
}, },
speedout: function(event){ speedout: function(event){
// console.log("out");
document.getElementById("div1").onmousemove = null; document.getElementById("div1").onmousemove = null;
document.getElementById("div2").onmouseup = null; document.getElementById("div2").onmouseup = null;
}, },
@ -261,119 +269,39 @@
this.iconrotate=0; this.iconrotate=0;
} }
}, },
touchstart:function(e){ directSelect:function(type){
let domoffset = document.getElementById("directimg").getBoundingClientRect();
// movelimit
this.angleoffset.x = domoffset.x;
this.angleoffset.y = domoffset.y;
e.preventDefault();
document.getElementById("directimg").onmousemove = this.touchmove;
document.getElementById("directimg").onmouseup = this.touchend;
},
touchmove:function(e){//finger move
// console.log(e);
this.getAngle(e.pageX-this.angleoffset.x ,e.pageY-this.angleoffset.y);
},
touchend:function(e){
document.getElementById("directimg").onmousemove = null;
document.getElementById("directimg").onmouseup = null;
},
getAngle:function(mx,my){
//
// console.log(mx);
// console.log(my);
let px=30;
let py=30;
let x = Math.abs(px-mx);
let y = Math.abs(py-my);
let z = Math.sqrt(Math.pow(x,2)+Math.pow(y,2));
let cos = y/z;
let radina = Math.acos(cos);//
let angle = Math.floor(180/(Math.PI/radina));//
if(mx>px&&my>py){//
angle = 180 - angle;
}
if(mx==px&&my>py){//y
angle = 180;
}
if(mx>px&&my==py){//x
angle = 90;
}
if(mx<px&&my>py){//
angle = 180+angle;
}
if(mx<px&&my==py){//鼠标在x轴负方向
angle = 270;
}
if(mx<px&&my<py){//鼠标在第二象限
angle = 360 - angle;
}
// console.log(angle);
// console.log(this.userRole );
if(angle<127 && angle>46){
if(angle<63 && angle>46){
if(this.touchstate != "Drive"){
let data = {
groupNumber:this.groupNum,
gear:"Drive"
};
trainSimulationGear(this.group,data).then(netdata => {
// console.log(netdata);
if(netdata.code == "200"){
this.toutransform = "rotate(140deg)";
this.touchstate = "Drive";
document.getElementById("directimg").onmousemove = null;
document.getElementById("directimg").onmouseup = null;
}
});
}
}else if(angle<93 && angle>68){
if(this.touchstate != "Neutral"){
let data = { let data = {
groupNumber:this.groupNum, groupNumber:this.groupNum,
gear:"Neutral" gear:"Neutral"
}; };
let directAngle = "";
if(type == "0"){
directAngle = "rotate(270deg)";
data.gear = "REVERSE";
}
if(type == "1"){
directAngle = "rotate(300deg)";
data.gear = "DISCONNECT";
}
if(type == "2"){
directAngle = "rotate(330deg)";
data.gear = "WASH";
}
if(type == "3"){
directAngle = "rotate(360deg)";
data.gear = "MANUAL";
}
if(type == "4"){
directAngle = "rotate(30deg)";
data.gear = "ATO";
}
trainSimulationGear(this.group,data).then(netdata => { trainSimulationGear(this.group,data).then(netdata => {
if(netdata.code == "200"){ if(netdata.code == "200"){
this.toutransform = "rotate(175deg)"; this.toutransform = directAngle;
this.touchstate = "Neutral"; this.touchstate = data.gear;
document.getElementById("directimg").onmousemove = null;
document.getElementById("directimg").onmouseup = null;
}
});
}
}else if(angle<127 && angle>101){
if(this.touchstate != "Reverse"){
let data = {
groupNumber:this.groupNum,
gear:"Reverse"
};
trainSimulationGear(this.group,data).then(netdata => {
if(netdata.code == "200"){
this.toutransform = "rotate(205deg)";
this.touchstate = "Reverse";
document.getElementById("directimg").onmousemove = null;
document.getElementById("directimg").onmouseup = null;
}
});
}
} }
} });
}, },
}, },
@ -382,7 +310,7 @@
<style > <style >
.pane-box{ .pane-box{
right: 30px; left: 230px;
top: 0px; top: 0px;
width:120px; width:120px;
height:160px; height:160px;
@ -429,4 +357,17 @@
position:absolute; position:absolute;
} }
.directpanediv{
width:120px;
height:120px;
position:absolute;
}
.directimg{
top:10px;
left:10px;
position: absolute;
height: 100px;
width: 100px;
}
</style> </style>

View File

@ -2,27 +2,15 @@
<div class="drivepane" :style="{'background-image': 'url('+localStatic+'/jl3d/control/scene.png)'}"> <div class="drivepane" :style="{'background-image': 'url('+localStatic+'/jl3d/control/scene.png)'}">
<div style="position: absolute;right:50%;top:50%;z-index:10;background: #EBEBEB;" v-show="tuoguanbutton" @click="tuoguan">{{ tuoguanbuttonmsg }}</div>
<div style="position: absolute;right:50%;top:60%;z-index:10;background: #EBEBEB;" v-show="isTraining" >
<el-select v-model="value" :placeholder="initMsg" @change="currentsel" @visible-change="clickselect" >
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
:disabled="item.disabled"
>
</el-option>
</el-select>
</div>
<Centerc-Pane ref="centercontrol" :group-num="groupnum" :user-role="userrole" />
<Centerc-Pane ref="centercontrol" :group-num="groupNum" :user-role="userRole" />
<!-- <Left-Pane ref="leftcontrol" /> --> <!-- <Left-Pane ref="leftcontrol" /> -->
<!-- <Right-Pane ref="rightcontrol" /> --> <!-- <Right-Pane ref="rightcontrol" /> -->
<TopRight-Pane ref="topcontrol" :group-num="groupnum" /> <TopRight-Pane ref="topcontrol" :group-num="groupNum" />
@ -56,8 +44,7 @@
import RightPane from '@/views/jlmap3d/drive/drivecontrol/rightpane'; import RightPane from '@/views/jlmap3d/drive/drivecontrol/rightpane';
import TopRightPane from '@/views/jlmap3d/drive/drivecontrol/toprightpane'; import TopRightPane from '@/views/jlmap3d/drive/drivecontrol/toprightpane';
import { bindSimulationTrain,getSimulationTrainlistNew,getSimulationMembersNew,trainSimulationEb,trainSimulationForce,trainSimulationGear} from '@/jlmap3d/jl3ddrive/drivecontrol/simulation.js';
import { getSimulationInfoNew } from '@/api/simulation';
import { tuoguan3ddrive } from '@/api/jlmap3d/load3ddata'; import { tuoguan3ddrive } from '@/api/jlmap3d/load3ddata';
@ -70,24 +57,23 @@ import axios from 'axios';
RightPane, RightPane,
TopRightPane, TopRightPane,
}, },
props: {
groupNum: {
type: String,
default: null
},
userRole: {
type: String,
default: null
}
},
data() { data() {
return { return {
isTraining:true,
localStatic:JL3D_LOCAL_STATIC, localStatic:JL3D_LOCAL_STATIC,
options: [],
initMsg:"请选择列车",
value: '',
teststomp:null,
topid:null,
trainlist:null,
groupnum:"",
userrole:'',
nowdrive:null,
tuoguanbutton:false,
tuoguanbuttonmsg:"托管",
tuoguanstatus:false,
} }
}, },
watch: { watch: {
@ -107,267 +93,21 @@ import axios from 'axios';
}, },
computed: { computed: {
group() {
return this.$route.query.group;
},
userId() {
return this.$store.state.user ? this.$store.state.user.id : '';
},
}, },
async mounted() { async mounted() {
if(this.$route.query.group){
getSimulationInfoNew(this.$route.query.group).then(netdata => {
if(netdata.data.type == "SCRIPT_MAKING"){
this.tuoguanbutton = true;
}
this.inittrainlist();
});
}
window.updateDriverTrust = this.updateDriverTrust;
window.updateDriveValue = this.updateDriveValue;
}, },
beforeDestroy() { beforeDestroy() {
}, },
methods: { methods: {
changeTrainSelect(mode){
if(mode == "isTraining"){ centerstate : function(gear){
// this.isTraining = false;
} this.$refs.centercontrol.centerstate(gear);
}, },
currentsel(selVal){
let oldgroupnum = this.groupnum;
this.groupnum = selVal;
bindSimulationTrain(this.group,this.groupnum).then(netdata => {
this.selVal = selVal;
this.dialogVisible = true;
// this.groupnum = selVal;
for(let i=0;i<this.trainlist.length;i++){
if(this.trainlist[i].groupNumber == this.groupnum){
// console.log(this.trainlist[i].gear);
// this.groupnum
this.$refs.centercontrol.centerstate(this.trainlist[i].gear);
}
}
this.nowdrive = this.groupnum;
}).catch(error => {
this.groupnum = oldgroupnum;
this.selVal = oldgroupnum;
this.$emit('warningmsg',error.message);
this.value = this.nowdrive;
});
},
clickselect(e){
if(e == true){
this.updatetrainlist();
}
},
tuoguan(){
let posttrust = null;
if(this.tuoguanstatus){
posttrust = false;
}else{
posttrust = true;
}
tuoguan3ddrive(this.$route.query.group,{}).then(netdata => {
// this.$store.dispatch('training/updateMemberListInScript', {oldMemberId:this.oldMemberId, newMemberId:role, userId:this.userId});
this.tuoguanstatus = posttrust;
if(this.tuoguanstatus){
this.tuoguanbuttonmsg = "取消托管";
}else{
this.tuoguanbuttonmsg = "托管";
}
}).catch((error) => {
});
},
updateDriverTrust(code,trustStatus){
if(this.tuoguanstatus != trustStatus){
this.tuoguanstatus = trustStatus;
if(this.tuoguanstatus){
this.tuoguanbuttonmsg = "取消托管";
}else{
this.tuoguanbuttonmsg = "托管";
}
this.$store.dispatch('training/updateMemberTrust', {deviceCode:code,trust:trustStatus});
}
},
inittrainlist(){
getSimulationTrainlistNew(this.group).then(netdata => {
this.options = [];
this.trainlist = netdata.data;
for(let i=0;i<netdata.data.length;i++){
let option= {
value: netdata.data[i].groupNumber,
label: netdata.data[i].groupNumber,
name:null,
}
option.disabled = false;
if(netdata.data[i].name){
option.label = netdata.data[i].name+"正在驾驶"+netdata.data[i].groupNumber;
this.initMsg = netdata.data[i].name+"正在驾驶"+netdata.data[i].groupNumber;
this.groupNumber = netdata.data[i].groupNumber;
option.disabled = true;
}
if(netdata.data[i].driverId){
if(netdata.data[i].driverId == this.userId){
this.selVal = netdata.data[i].groupNumber;
this.groupnum = netdata.data[i].groupNumber;
this.dialogVisible = true;
for(let i=0;i<this.trainlist.length;i++){
if(this.trainlist[i].groupNumber == this.groupnum){
// console.log(this.trainlist[i].gear);
// this.groupnum
this.$refs.centercontrol.centerstate(this.trainlist[i].gear);
}
}
this.value = this.groupnum;
this.nowdrive = this.groupnum;
// bindSimulationTrain(this.group,this.selVal).then(netdata => {
//
//
// }).catch(error => {
// });
}
}
this.options.push(option);
}
this.options.sort(
function(obj1,obj2) {
let val1 = obj1.value;
let val2 = obj2.value;
return val1 - val2;
}
);
});
//
if(this.tuoguanbutton == true){
let netdata = this.$store.state.training.memberData;
for(let k in netdata){
if(netdata[k].userId == this.userId){
// console.log(this.$store.state.scriptRecord.type);
this.userrole = netdata[k].type;
if(netdata[k].trust){
this.tuoguanstatus = netdata[k].trust;
if(this.tuoguanstatus){
this.tuoguanbuttonmsg = "取消托管";
}else{
this.tuoguanbuttonmsg = "托管";
}
}
break;
}
}
}
},
updateDriveValue(newvalue){
if(newvalue != this.value){
this.value = newvalue;
this.groupnum = newvalue;
}
},
updatetrainlist(){
getSimulationTrainlistNew(this.group).then(netdata => {
this.options = [];
this.trainlist = netdata.data;
for(let i=0;i<netdata.data.length;i++){
let option= {
value: netdata.data[i].groupNumber,
label: netdata.data[i].groupNumber,
name:null,
}
option.disabled = false;
if(netdata.data[i].name){
option.label = netdata.data[i].name+"正在驾驶"+netdata.data[i].groupNumber;
this.initMsg = netdata.data[i].name+"正在驾驶"+netdata.data[i].groupNumber;
this.groupNumber = netdata.data[i].groupNumber;
option.disabled = true;
}
if(netdata.data[i].driverId){
if(netdata.data[i].driverId == this.userId){
this.selVal = netdata.data[i].groupNumber;
this.groupnum = netdata.data[i].groupNumber;
}
}
this.options.push(option);
}
this.options.sort(
function(obj1,obj2) {
let val1 = obj1.value;
let val2 = obj2.value;
return val1 - val2;
}
);
});
//
if(this.tuoguanbutton == true){
let netdata = this.$store.state.training.memberData;
for(let k in netdata){
if(netdata[k].userId == this.userId){
// console.log(this.$store.state.scriptRecord.type);
this.userrole = netdata[k].type;
if(netdata[k].trust){
this.tuoguanstatus = netdata[k].trust;
if(this.tuoguanstatus){
this.tuoguanbuttonmsg = "取消托管";
}else{
this.tuoguanbuttonmsg = "托管";
}
}
break;
}
}
// getSimulationMembersNew(this.group).then(netdata => {
// for(let i=0,leni=netdata.data.length;i<leni;i++){
// if(netdata.data[i].userId){
// if(netdata.data[i].userId == this.userId){
// this.userrole = netdata.data[i].role;
// if(netdata.data[i].trust){
// this.tuoguanstatus = netdata.data[i].trust;
// if(this.tuoguanstatus){
// this.tuoguanbuttonmsg = "";
// }else{
// this.tuoguanbuttonmsg = "";
// }
// }
// i=leni;
// }
// }
// }
// this.userrole = netdata.data.role;
// if(netdata.data.trust){
// this.tuoguanstatus = netdata.data.trust;
// if(this.tuoguanstatus){
// this.tuoguanbuttonmsg = "";
// }else{
// this.tuoguanbuttonmsg = "";
// }
// }
// });
}
}
}, },
} }
</script> </script>

View File

@ -1,442 +0,0 @@
<template>
<div style="width:25%;height:100%;position:absolute;bottom:0;left:0;">
<!-- 高速断路器 -->
<!-- <div id="breaker" class="panebutton" style="top:3%;left:3%;" @tap="breakerclick">
<img class="buttonimg" :src="greenzimg" />
<div class="buttontext">{{ $t('jlmap3d.highSpeedCircuitBreaker') }}</div>
</div> -->
<!-- 洗车模式 -->
<!-- <div id="carwash" class="panebutton" style="top:3%;left:14%;" @tap="carwashclick">
<img class="buttonimg" :src="redzimg" />
<div class="buttontext">{{ $t('jlmap3d.washCarModel') }}</div>
</div> -->
<!-- 空压机强迫启动 -->
<!-- <div id="aircom" class="panebutton" style="top:3%;left:28%;" @tap="aircomclick">
<img class="buttonimg" :src="aircomimg" />
<div class="buttontext">{{ $t('jlmap3d.forcedAirCompressor') }}</div>
</div> -->
<!-- ATB启动 -->
<div id="atb" class="panebutton" style="top:3%;left:42%;" @tap="atbclick">
<img class="buttonimg" :src="greenimg" />
<div class="buttontext">{{ $t('jlmap3d.ATBStart') }}</div>
</div>
<!-- BM/CBTC -->
<div id="bmcbtc" class="panebutton" style="top:3%;left:56%;" @tap="bmcbtcclick">
<img class="buttonimg" :src="greenimg" />
<div class="buttontext">BM/CBTC</div>
</div>
<!-- RM -->
<div id="rm" class="panebutton" style="top:3%;left:70%;" @tap="rmclick">
<img class="buttonimg" :src="greenimg" />
<div class="buttontext">RM</div>
</div>
<!-- 强迫缓解 -->
<!-- <div id="relieve" class="panebutton" style="top:3%;left:84%;" @tap="relieveclick">
<img class="buttonimg" :src="aircomimg" />
<div class="buttontext">{{ $t('jlmap3d.forcedRelieve') }}</div>
</div> -->
<!-- 关左门 -->
<div id="dlclose" class="panebutton" style="bottom:3%;left:3%;" @tap="dlcclick">
<img class="buttonimg" :src="greenimg" />
<div class="buttontext">{{ $t('jlmap3d.closeLeftDoor') }}</div>
</div>
<!-- 开左门A -->
<div id="dlopen" class="panebutton" style="bottom:3%;left:14%;" @tap="dloclick">
<img class="buttonimg" :src="redimg" />
<div class="buttontext">{{ $t('jlmap3d.openLeftDoor') }}</div>
</div>
<!-- 开左门B -->
<!-- <div id="dlopen" class="panebutton" style="bottom:3%;left:28%;" @tap="dloclick">
<img class="buttonimg" :src="redimg" />
<div class="buttontext">{{ $t('jlmap3d.openLeftDoor') }}</div>
</div> -->
<!-- ATO启动A -->
<div id="atoa" class="panebutton" style="bottom:3%;left:42%;" @tap="atoaclick">
<img class="buttonimg" :src="apoimg" />
<div class="buttontext">{{ $t('jlmap3d.ATOStart') }}</div>
</div>
<!-- ATO启动B -->
<!-- <div id="atob" class="panebutton" style="bottom:3%;left:56%;" @tap="atobclick">
<img class="buttonimg" :src="apoimg" />
<div class="buttontext">{{ $t('jlmap3d.ATOStart') }}</div>
</div> -->
<!-- cbtc -->
<div id="cbtc" class="panebutton" style="bottom:3%;left:70%;" @tap="cbtcclick">
<img class="buttonimg" :src="greenimg" />
<div class="buttontext">CBTC</div>
</div>
<!-- 电笛按钮 -->
<div id="elflute" class="panebutton" style="bottom:3%;left:84%;" @tap="elfluteclick">
<img class="buttonimg" :src="grayimg" />
<div class="buttontext">{{ $t('jlmap3d.electricHornButton') }}</div>
</div>
</div>
</template>
<script>
import Vue from 'vue';
// import { sendSimulationCommand } from '@/api/simulation.js';
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
export default {
name: 'LeftPane',
components: {
},
data() {
return {
apoimg:JL3D_LOCAL_STATIC+"/jl3d/control/green.png",
greenzimg:JL3D_LOCAL_STATIC+"/jl3d/control/greenz.png",
redzimg:JL3D_LOCAL_STATIC+"/jl3d/control/redz.png",
greenimg:JL3D_LOCAL_STATIC+"/jl3d/control/green.png",
redimg:JL3D_LOCAL_STATIC+"/jl3d/control/red.png",
greenlimg:JL3D_LOCAL_STATIC+"/jl3d/control/greenl.png",
grayimg:JL3D_LOCAL_STATIC+"/jl3d/control/gray.png",
zuoimg:JL3D_LOCAL_STATIC+"/jl3d/control/zuo.png",
niuimg:JL3D_LOCAL_STATIC+"/jl3d/control/niu.png",
aircomimg:JL3D_LOCAL_STATIC+"/jl3d/control/aircom.png",
passlighttf:"rotate(0deg)",
sivtf:"rotate(0deg)",
driverlighttf:"rotate(0deg)",
headlighttf:"rotate(0deg)",
}
},
watch: {
'$store.state.app.atostate': function (val,newval) {
if(val != newval){
if(newval == true){
this.apoimg = this.greenimg;
this.$store.dispatch('app/setAtoState', false);
}else{
this.apoimg = this.greenlimg;
this.$store.dispatch('app/setAtoState', true);
}
}
},
},
computed: {
group() {
return this.$store.state.app.group;
},
code() {
return this.$store.state.app.code;
},
traincode() {
return this.$store.state.app.driverTrain;
},
movespeed() {
return this.$store.state.app.movespeed;
},
drivedirect() {
return this.$store.state.app.drivedirect;
},
atostate(){
return this.$store.state.app.atostate;
}
},
mounted() {
},
beforeDestroy() {
},
methods: {
leftstate : function(lefts){
if(lefts.ato == true){
this.apoimg = this.greenlimg;
this.$store.dispatch('app/setAtoState', true);
}else{
this.apoimg = this.greenimg;
this.$store.dispatch('app/setAtoState', false);
}
},
leftcontrol : function(){
},
showmsg:function(data){
wx.showToast({
title: data,
icon: 'loading',
duration: 2000
});
},
setData : function(){
this.msgshow = false;
},
showcontrolmsg:function(data,callback){
this.controlmsg = data;
this.msgshow = true;
callback = callback || function(){
this.setData();
};
setTimeout( callback.bind(this),2000);
},
//
dloclick: function (e){
console.log(this.$t('jlmap3d.leftDoorOpen'));
if(this.movespeed == 0){
//this.showcontrolmsg("");
this.controlsend(this.traincode,"603","07","");
}
},
//
dlcclick: function (e){
console.log(this.$t('jlmap3d.leftDoorClose'));
if(this.movespeed == 0){
//this.showcontrolmsg("");
this.controlsend(this.traincode,"605","07","");
}
},
//
breakerclick: function (e){
Vue.prototype.$stomp.send("/app/topic/simulation/drive","breaker");
},
//
carwashclick: function (e){
Vue.prototype.$stomp.send("/app/topic/simulation/drive","carwash");
},
//
aircomclick : function (e){
Vue.prototype.$stomp.send("/app/topic/simulation/drive","aircom");
},
//ATB
atbclick : function (e){
Vue.prototype.$stomp.send("/app/topic/simulation/drive","atb");
},
//BMCBTC
bmcbtcclick : function (e){
Vue.prototype.$stomp.send("/app/topic/simulation/drive","bm");
},
//RM
rmclick : function (e){
Vue.prototype.$stomp.send("/app/topic/simulation/drive","rm");
},
//
relieveclick : function (e){
Vue.prototype.$stomp.send("/app/topic/simulation/drive","relieve");
},
//ATOA
atoaclick : function (e){
//console.log("ato");
if(this.movespeed == 0){
if(this.drivedirect == "Drive"){
this.controlsend(this.traincode,"601","07","");
this.apoimg = this.greenlimg;
this.showcontrolmsg(this.$t('jlmap3d.ATOStart'));
this.$store.dispatch('app/setAtoState', true);
}
}
},
//ATOB
atobclick : function (e){
if(this.movespeed == 0){
if(this.drivedirect == "Drive"){
this.controlsend(this.traincode,"601","07","");
this.apoimg = this.greenimg;
this.showcontrolmsg(this.$t('jlmap3d.ATOStart'));
this.$store.dispatch('app/setAtoState', true);
}
}
},
//CBTC
cbtcclick : function (e){
Vue.prototype.$stomp.send("/app/topic/simulation/drive","cbtc");
},
//
elfluteclick : function (e){
Vue.prototype.$stomp.send("/app/topic/simulation/drive","elflute");
},
controlsend:function(traincode,operation,type,param){
if(this.$store.state.app.userRole == "Driver"){
let command ={
code: traincode,
operation: operation,
type: type,
param: param
};
// sendSimulationCommand(this.group,command);
}else{
}
},
passlighttouchstart:function(e){
// let command ={
// code:this.traincode,
// operation:"607",
// type:"07",
// param:""
// };
// command.param = this.touchstate;
// sendSimulationCommand(this.group,command).then(netdata => {
// if(netdata.data == true){
this.touchcontrol = true;
// }
// });
},
passlighttouchmove:function(e){//finger move
if(this.touchcontrol == true){
let px=75;
let py=155;
let angle = this.getAngle(px,py,e.changedTouches[0].clientX,e.changedTouches[0].clientY);
if(angle<360 && angle>245){
if(angle<327 && angle>245){
this.passlighttf = "rotate(359deg)";
}else if(angle<360 && angle>327){
this.passlighttf = "rotate(90deg)";
}
}
}
},
passlighttouchend:function(e){
this.touchcontrol = false;
},
sivtouchstart:function(e){
// let command ={
// code:this.traincode,
// operation:"607",
// type:"07",
// param:""
// };
// command.param = this.touchstate;
// sendSimulationCommand(this.group,command).then(netdata => {
// if(netdata.data == true){
this.touchcontrol = true;
// }
// });
},
sivtouchmove:function(e){//finger move
if(this.touchcontrol == true){
let px=75;
let py=255;
let angle = this.getAngle(px,py,e.changedTouches[0].clientX,e.changedTouches[0].clientY);
if(angle<360 && angle>245){
if(angle<327 && angle>245){
this.sivtf = "rotate(359deg)";
}else if(angle<360 && angle>327){
this.sivtf = "rotate(90deg)";
}
}
}
},
sivtouchend:function(e){
this.touchcontrol = false;
},
driverlighttouchstart:function(e){
// let command ={
// code:this.traincode,
// operation:"607",
// type:"07",
// param:""
// };
// command.param = this.touchstate;
// sendSimulationCommand(this.group,command).then(netdata => {
// if(netdata.data == true){
this.touchcontrol = true;
// }
// });
},
driverlighttouchmove:function(e){//finger move
if(this.touchcontrol == true){
let px=75;
let py=355;
let angle = this.getAngle(px,py,e.changedTouches[0].clientX,e.changedTouches[0].clientY);
if(angle<360 && angle>245){
if(angle<327 && angle>245){
this.driverlighttf = "rotate(359deg)";
}else if(angle<360 && angle>327){
this.driverlighttf = "rotate(90deg)";
}
}
}
},
driverlighttouchend:function(e){
this.touchcontrol = false;
},
headlighttouchstart:function(e){
// let command ={
// code:this.traincode,
// operation:"607",
// type:"07",
// param:""
// };
// command.param = this.touchstate;
// sendSimulationCommand(this.group,command).then(netdata => {
// if(netdata.data == true){
this.touchcontrol = true;
// }
// });
},
headlighttouchmove:function(e){//finger move
if(this.touchcontrol == true){
let px=75;
let py=455;
let angle = this.getAngle(px,py,e.changedTouches[0].clientX,e.changedTouches[0].clientY);
if(angle<360 && angle>245){
if(angle<295 && angle>245){
this.headlighttf = "rotate(359deg)";
}else if(angle<338 && angle>295){
this.headlighttf = "rotate(405deg)";
}else if(angle<360 && angle>338){
this.headlighttf = "rotate(90deg)";
}
}
}
},
headlighttouchend:function(e){
this.touchcontrol = false;
},
getAngle:function(px,py,mx,my){
//
let x = Math.abs(px-mx);
let y = Math.abs(py-my);
let z = Math.sqrt(Math.pow(x,2)+Math.pow(y,2));
let cos = y/z;
let radina = Math.acos(cos);//
let angle = Math.floor(180/(Math.PI/radina));//
if(mx>px&&my>py){//
angle = 180 - angle;
}
if(mx==px&&my>py){//y
angle = 180;
}
if(mx>px&&my==py){//x
angle = 90;
}
if(mx<px&&my>py){//
angle = 180+angle;
}
if(mx<px&&my==py){//鼠标在x轴负方向
angle = 270;
}
if(mx<px&&my<py){//鼠标在第二象限
angle = 360 - angle;
}
return angle;
},
},
}
</script>
<style>
</style>

View File

@ -1,5 +1,5 @@
<template> <template>
<div style="width:100%;height:48%;position:absolute;top:0px;"> <div style="width:100%;height:100%;position:absolute;top:0px;z-index:2;">
<!-- ATB启动 --> <!-- ATB启动 -->
<!-- <div id="atb" class="panebutton" style="top:8%;left:3%;" @click="atbclick"> <!-- <div id="atb" class="panebutton" style="top:8%;left:3%;" @click="atbclick">
<img class="buttonimg" :src="greenimg" /> <img class="buttonimg" :src="greenimg" />
@ -12,32 +12,48 @@
<img class="buttonimg" :src="greenimg" /> <img class="buttonimg" :src="greenimg" />
<div class="buttontext">{{ $t('jlmap3d.ChangeHead') }}</div> <div class="buttontext">{{ $t('jlmap3d.ChangeHead') }}</div>
</div> </div>
<!-- 紧急制动 -->
<div id="urgestop" class="panebutton" style="top:8%;left:17%;" @click="ebstop">
<img class="buttonimg" :style="urgestopStyle" :src="urgestopimg" />
<div class="buttontext">{{ $t('jlmap3d.emergencyBraking') }}</div>
</div>
<!-- BM/CBTC --> <!-- BM/CBTC -->
<div id="bmcbtc" class="panebutton" style="top:8%;left:17%;" @click="bmcbtcclick"> <!-- <div id="bmcbtc" class="panebutton" style="top:8%;left:17%;" @click="bmcbtcclick">
<img class="buttonimg" :src="cbtcbuttonimg" /> <img class="buttonimg" :src="cbtcbuttonimg" />
<div class="buttontext">BM/CBTC</div> <div class="buttontext">BM/CBTC</div>
</div> </div> -->
<!-- RM --> <!-- RM -->
<div id="rm" class="panebutton" style="top:8%;left:31%;" @click="rmclick"> <!-- <div id="rm" class="panebutton" style="top:8%;left:31%;" @click="rmclick">
<img class="buttonimg" :src="rmbuttonimg" /> <img class="buttonimg" :src="rmbuttonimg" />
<div class="buttontext">RM</div> <div class="buttontext">RM</div>
</div> -->
<!-- 模式升级 -->
<div id="atoa" class="panebutton" style="top:8%;left:73%;" @click="modechange('up')">
<img class="buttonimg" :src="otherbuttonimg" />
<div class="buttontext">模式升级</div>
</div> </div>
<!-- 关左门 -->
<div id="dlclose" class="panebutton" style="top:8%;left:45%;" @click="dlcclick"> <!-- 模式降级 -->
<img class="buttonimg" :src="doorleftimg" /> <div id="atoa" class="panebutton" style="top:8%;left:87%;" @click="modechange('down')">
<div class="buttontext">{{ $t('jlmap3d.closeLeftDoor') }}</div> <img class="buttonimg" :src="otherbuttonimg" />
</div> <div class="buttontext">模式降级</div>
<!-- 开左门A -->
<div id="dlopen" class="panebutton" style="top:8%;left:59%;" @click="dloclick">
<img class="buttonimg" :src="redimg" />
<div class="buttontext">{{ $t('jlmap3d.openLeftDoor') }}</div>
</div> </div>
<!-- ATO启动A --> <!-- ATO启动A -->
<div id="atoa" class="panebutton" style="top:8%;left:73%;" @click="atoaclick"> <div id="atoa" class="panebutton" style="top:28%;left:73%;" @click="atoaclick">
<img class="buttonimg" :src="atobuttonimg" /> <img class="buttonimg" :src="atobuttonimg" />
<div class="buttontext">{{ $t('jlmap3d.ATOStart') }}</div> <div class="buttontext">{{ $t('jlmap3d.ATOStart') }}</div>
</div> </div>
<!-- 确认 -->
<div id="atoa" class="panebutton" style="top:28%;left:87%;" @click="modeconfirm">
<img class="buttonimg" :src="otherbuttonimg" />
<div class="buttontext">确认</div>
</div>
<!-- cbtc --> <!-- cbtc -->
<!-- <div id="cbtc" class="panebutton" style="top:8%;left:87%;" @click="cbtcclick"> <!-- <div id="cbtc" class="panebutton" style="top:8%;left:87%;" @click="cbtcclick">
<img class="buttonimg" :src="cbtcbuttonimg" /> <img class="buttonimg" :src="cbtcbuttonimg" />
@ -83,39 +99,41 @@
</div> --> </div> -->
<!-- 受电弓升 --> <!-- 受电弓升 -->
<div id="sg" class="panebutton" style="bottom:6%;left:3%;" @click="sgclink"> <div id="sg" class="panebutton" style="top:28%;left:3%;" @click="sgclink">
<img class="buttonimg" :src="sgimg" /> <img class="buttonimg" :src="sgimg" />
<div class="buttontext">{{ $t('jlmap3d.electricGongSheng') }}</div> <div class="buttontext">{{ $t('jlmap3d.electricGongSheng') }}</div>
</div> </div>
<!-- 受电弓降 --> <!-- 受电弓降 -->
<div id="jg" class="panebutton" style="bottom:6%;left:17%;" @click="jgclick"> <div id="jg" class="panebutton" style="top:28%;left:17%;" @click="jgclick">
<img class="buttonimg" :src="jgimg" /> <img class="buttonimg" :src="jgimg" />
<div class="buttontext">{{ $t('jlmap3d.pantographFall') }}</div> <div class="buttontext">{{ $t('jlmap3d.pantographFall') }}</div>
</div> </div>
<!-- 试灯按钮 --> <!-- 试灯按钮 -->
<!-- <div id="sl" class="panebutton" style="bottom:6%;left:40%;" @click="slclick"> <!-- <div id="sl" class="panebutton" style="top:28%;left:40%;" @click="slclick">
<img class="buttonimg" :src="slimg" /> <img class="buttonimg" :src="slimg" />
<div class="buttontext">{{ $t('jlmap3d.lampButton') }}</div> <div class="buttontext">{{ $t('jlmap3d.lampButton') }}</div>
</div> -->
<!-- 关左门 -->
<div id="dlclose" class="panebutton" style="top:50%;left:3%;" @click="dlcclick">
<img class="buttonimg" :src="doorleftimg" />
<div class="buttontext">{{ $t('jlmap3d.closeLeftDoor') }}</div>
</div> </div>
<!-- ATP切除 --> <!-- 开左门A -->
<div id="atp" class="panebutton" style="bottom:6%;left:31%;" @click="atpclick"> <div id="dlopen" class="panebutton" style="top:50%;left:17%;" @click="dloclick">
<img class="buttonimg" :src="atpimg" /> <img class="buttonimg" :src="redimg" />
<div class="buttontext">{{ $t('jlmap3d.removalATP') }}</div> <div class="buttontext">{{ $t('jlmap3d.openLeftDoor') }}</div>
</div> </div>
<div id="dropen" class="panebutton" style="bottom:6%;left:45%;" @click="droclick"> <div id="dropen" class="panebutton" style="top:72%;left:3%;" @click="droclick">
<img class="buttonimg" :src="redlimg" /> <img class="buttonimg" :src="redlimg" />
<div class="buttontext">{{ $t('jlmap3d.openRightDoor') }}</div> <div class="buttontext">{{ $t('jlmap3d.openRightDoor') }}</div>
</div> </div>
<div id="drclose" class="panebutton" style="bottom:6%;left:59%;" @click="drcclick"> <div id="drclose" class="panebutton" style="top:72%;left:17%;" @click="drcclick">
<img class="buttonimg" :src="doorrightimg" /> <img class="buttonimg" :src="doorrightimg" />
<div class="buttontext">{{ $t('jlmap3d.closeRightDoor') }}</div> <div class="buttontext">{{ $t('jlmap3d.closeRightDoor') }}</div>
</div> </div>
<div id="urgestop" class="panebutton" style="bottom:6%;left:73%;" @click="ebstop"> <div id="doorpick" class="panebutton2" style="top:6%;left:31%;">
<img class="buttonimg" :style="urgestopStyle" :src="urgestopimg" />
<div class="buttontext">{{ $t('jlmap3d.emergencyBraking') }}</div>
</div>
<div id="doorpick" class="panebutton2" style="top:6%;left:85%;">
<img class="buttonimg2" :src="zuoimg" @mouseout='doorModeOut'/> <img class="buttonimg2" :src="zuoimg" @mouseout='doorModeOut'/>
<img id="doormodeniu" class="buttonimg2" :src="niuimg" :style="{transform:doormodetou}" @mousedown='doormodetouchstart'/> <img id="doormodeniu" class="buttonimg2" :src="niuimg" :style="{transform:doormodetou}" @mousedown='doormodetouchstart'/>
<div class="tfbutton" style="font-size:8px;top:11px;left:18px;">AA</div> <div class="tfbutton" style="font-size:8px;top:11px;left:18px;">AA</div>
@ -124,7 +142,7 @@
<div class="buttontext2">{{ $t('jlmap3d.doorModel') }}</div> <div class="buttontext2">{{ $t('jlmap3d.doorModel') }}</div>
</div> </div>
<div id="doorpick" class="panebutton2" style="bottom:6%;left:85%;"> <div id="doorpick" class="panebutton2" style="top:28%;left:31%;">
<img class="buttonimg2" :src="zuoimg" @mouseout='doorSelectionOut'/> <img class="buttonimg2" :src="zuoimg" @mouseout='doorSelectionOut'/>
<img id="doorpickniu" class="buttonimg2" :src="niuimg" :style="{transform:doordirecttou}" @mousedown='doordirecttouchstart'/> <img id="doorpickniu" class="buttonimg2" :src="niuimg" :style="{transform:doordirecttou}" @mousedown='doordirecttouchstart'/>
<div class="tfbutton" style="font-size:8px;top:11px;left:18px;">{{ $t('jlmap3d.leftSide') }}</div> <div class="tfbutton" style="font-size:8px;top:11px;left:18px;">{{ $t('jlmap3d.leftSide') }}</div>
@ -144,12 +162,12 @@
import { import {
trainSimulationDriveMode, trainSimulationDriveMode,
trainSimulationAto , trainSimulationAto ,
trainSimulationAtp,
trainSimulationChangeHead, trainSimulationChangeHead,
trainSimulationDoorControl, trainSimulationDoorControl,
trainSimulationEb, trainSimulationEb,
trainSimulationDoorSelection, trainSimulationDoorSelection,
trainSimulationDoorMode trainSimulationDoorMode,
trainSimulationCommand
} from '@/jlmap3d/jl3ddrive/drivecontrol/simulation.js'; } from '@/jlmap3d/jl3ddrive/drivecontrol/simulation.js';
@ -193,6 +211,7 @@
driverlighttf:"rotate(0deg)", driverlighttf:"rotate(0deg)",
headlighttf:"rotate(0deg)", headlighttf:"rotate(0deg)",
otherbuttonimg:JL3D_LOCAL_STATIC+"/jl3d/control/green.png",
// atoOn:null, // atoOn:null,
atobuttonimg:JL3D_LOCAL_STATIC+"/jl3d/control/green.png", atobuttonimg:JL3D_LOCAL_STATIC+"/jl3d/control/green.png",
// driveMode:null, // driveMode:null,
@ -425,16 +444,7 @@
slclick: function (e){ slclick: function (e){
//console.log(""); //console.log("");
}, },
atpclick: function (e){
//console.log("atp");
let data = {
groupNumber:this.groupNum,
cutOff:true,
};
trainSimulationAtp(this.group,data).then(netdata => {
// console.log(netdata);
});
},
atbclick: function (e){ atbclick: function (e){
@ -536,6 +546,27 @@
// console.log(netdata); // console.log(netdata);
}); });
}, },
modechange: function (type){
let data = {
groupNumber:this.groupNum,
};
if(type == "up"){
trainSimulationCommand(this.group,data,"Driver_Preselection_Mode_Up").then(netdata => {});
}
if(type == "down"){
trainSimulationCommand(this.group,data,"Driver_Preselection_Mode_Down").then(netdata => {});
}
},
modeconfirm: function (){
let data = {
groupNumber:this.groupNum,
};
trainSimulationCommand(this.group,data,"Driver_Confirm").then(netdata => {
// console.log(netdata);
jl3dUpdateMmiMsg("");
});
},
cbtcclick: function (e){ cbtcclick: function (e){
}, },

View File

@ -103,7 +103,7 @@
<div id="doorpick" class="ebpanebutton2" style="top:33%;left:70%;"> <div id="doorpick" class="ebpanebutton2" style="top:33%;left:70%;">
<img class="ebbuttonimg2" :src="zuoimg" /> <img class="ebbuttonimg2" :src="zuoimg" />
<img class="ebbuttonimg2" :src="niuimg"/> <img class="ebbuttonimg2" :src="niuimg" @click="atpclick"/>
<div class="tfbutton" style="font-size:1px;top:13px;left:5px;">{{ $t('jlmap3d.leftSide') }}</div> <div class="tfbutton" style="font-size:1px;top:13px;left:5px;">{{ $t('jlmap3d.leftSide') }}</div>
<div class="tfbutton" style="font-size:1px;top:5px;left:33px;">{{ $t('jlmap3d.location0') }}</div> <div class="tfbutton" style="font-size:1px;top:5px;left:33px;">{{ $t('jlmap3d.location0') }}</div>
<div class="tfbutton" style="font-size:1px;top:13px;left:50px;">{{ $t('jlmap3d.rightSide') }}</div> <div class="tfbutton" style="font-size:1px;top:13px;left:50px;">{{ $t('jlmap3d.rightSide') }}</div>
@ -160,7 +160,9 @@
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js'; import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
import { EbUiData } from '@/views/jlmap3d/drive/equipbox/ebuidata'; import { EbUiData } from '@/views/jlmap3d/drive/equipbox/ebuidata';
import {
trainSimulationAtp,
} from '@/jlmap3d/jl3ddrive/drivecontrol/simulation.js';
export default { export default {
name: 'EquipBox', name: 'EquipBox',
components: { components: {
@ -215,7 +217,18 @@
switchbt.statuspic = JL3D_LOCAL_STATIC+"/jl3d/equipbox/open2.png"; switchbt.statuspic = JL3D_LOCAL_STATIC+"/jl3d/equipbox/open2.png";
} }
} }
} },
atpclick: function (e){
//console.log("atp");
let data = {
groupNumber:this.groupNum,
cutOff:true,
};
trainSimulationAtp(this.group,data).then(netdata => {
// console.log(netdata);
});
},
}, },
} }

View File

@ -2,6 +2,20 @@
<div id="drivediv" class="jalmap3ddiv" > <div id="drivediv" class="jalmap3ddiv" >
<div style="position: absolute;right:50%;top:40px;z-index:10;background: #EBEBEB;" v-show="tuoguanbutton" @click="tuoguan">{{ tuoguanbuttonmsg }}</div>
<div style="position: absolute;right:50%;top:0%;z-index:10;background: #EBEBEB;" v-show="isTraining" >
<el-select v-model="value" :placeholder="initMsg" @change="currentsel" @visible-change="clickselect" >
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
:disabled="item.disabled"
>
</el-option>
</el-select>
</div>
<!-- <div class="trainstatus"> <!-- <div class="trainstatus">
{{$t('jlmap3d.trainGroupNumber')}}{{ trainnum }}</br> {{$t('jlmap3d.trainGroupNumber')}}{{ trainnum }}</br>
{{ stoptimes }} {{ stoptimes }}
@ -36,7 +50,7 @@
<Drive-Mmi v-if="mmishow" ref="mmiui" /> <Drive-Mmi v-if="mmishow" ref="mmiui" />
<Drive-Tms v-if="tmsshow" ref="tmsui"/> <Drive-Tms v-if="tmsshow" ref="tmsui"/>
<Drive-Control v-if="dcontrolshow" ref="dcontrol" @warningmsg="warningmsg" @warningmsgoff="warningmsgoff" /> <Drive-Control v-if="dcontrolshow" ref="dcontrol" :group-num="groupnum" :user-role="userrole"/>
<Equip-Box v-if="equipboxshow" /> <Equip-Box v-if="equipboxshow" />
</div> </div>
@ -55,6 +69,8 @@ import { mapGetters } from 'vuex';
import { simulationNotify, setTrainingCbtcInitTime } from '@/api/simulation'; import { simulationNotify, setTrainingCbtcInitTime } from '@/api/simulation';
import { getPublishMapDetail, getPublish3dMapDetail } from '@/api/jlmap3d/load3ddata'; import { getPublishMapDetail, getPublish3dMapDetail } from '@/api/jlmap3d/load3ddata';
import { getSimulationInfoNew } from '@/api/simulation';
import { bindSimulationTrain,getSimulationTrainlistNew,getSimulationMembersNew,trainSimulationEb,trainSimulationForce,trainSimulationGear} from '@/jlmap3d/jl3ddrive/drivecontrol/simulation.js';
import { UrlConfig } from '@/scripts/ConstDic'; import { UrlConfig } from '@/scripts/ConstDic';
@ -77,6 +93,9 @@ export default {
}, },
data() { data() {
return { return {
groupnum:"",
userrole:'',
driveIndex:1500, driveIndex:1500,
trainlist: null, trainlist: null,
stationlist: null, stationlist: null,
@ -104,6 +123,18 @@ export default {
msgshow:false, msgshow:false,
controlmsg:"不能选择其它列车", controlmsg:"不能选择其它列车",
tuoguanbutton:false,
tuoguanbuttonmsg:"托管",
tuoguanstatus:false,
isTraining:true,
options: [],
initMsg:"请选择列车",
value: '',
topid:null,
trainlist:null,
groupnum:"",
userrole:'',
nowdrive:null,
}; };
}, },
watch: { watch: {
@ -184,6 +215,9 @@ export default {
// window.removeEventListener('popstate', this.goBack, false); // window.removeEventListener('popstate', this.goBack, false);
}, },
computed: { computed: {
group() {
return this.$route.query.group;
},
userId() { userId() {
return this.$store.state.user ? this.$store.state.user.id : ''; return this.$store.state.user ? this.$store.state.user.id : '';
}, },
@ -194,6 +228,19 @@ export default {
// window.datanew = this.datanew; // window.datanew = this.datanew;
window.updatestatus = this.updatestatus; window.updatestatus = this.updatestatus;
window.updateDriverTrust = this.updateDriverTrust;
window.updateDriveValue = this.updateDriveValue;
if(this.$route.query.group){
getSimulationInfoNew(this.$route.query.group).then(netdata => {
if(netdata.data.type == "SCRIPT_MAKING"){
this.tuoguanbutton = true;
}
this.inittrainlist();
});
}
if(this.$route.query.type == "DRIVE"){ if(this.$route.query.type == "DRIVE"){
this.backmsg = "退出"; this.backmsg = "退出";
} }
@ -374,8 +421,211 @@ export default {
}, },
warningmsgoff(){ warningmsgoff(){
this.msgshow = false; this.msgshow = false;
}, },
tuoguan(){
let posttrust = null;
if(this.tuoguanstatus){
posttrust = false;
}else{
posttrust = true;
}
tuoguan3ddrive(this.$route.query.group,{}).then(netdata => {
// this.$store.dispatch('training/updateMemberListInScript', {oldMemberId:this.oldMemberId, newMemberId:role, userId:this.userId});
this.tuoguanstatus = posttrust;
if(this.tuoguanstatus){
this.tuoguanbuttonmsg = "取消托管";
}else{
this.tuoguanbuttonmsg = "托管";
}
}).catch((error) => {
});
},
currentsel(selVal){
let oldgroupnum = this.groupnum;
this.groupnum = selVal;
bindSimulationTrain(this.group,this.groupnum).then(netdata => {
this.selVal = selVal;
this.dialogVisible = true;
// this.groupnum = selVal;
for(let i=0;i<this.trainlist.length;i++){
if(this.trainlist[i].groupNumber == this.groupnum){
// console.log(this.trainlist[i].gear);
// this.groupnum
this.$refs.dcontrol.centerstate(this.trainlist[i].gear);
}
}
this.nowdrive = this.groupnum;
}).catch(error => {
this.groupnum = oldgroupnum;
this.selVal = oldgroupnum;
this.$emit('warningmsg',error.message);
this.value = this.nowdrive;
});
},
clickselect(e){
if(e == true){
this.updatetrainlist();
}
},
updateDriverTrust(code,trustStatus){
if(this.tuoguanstatus != trustStatus){
this.tuoguanstatus = trustStatus;
if(this.tuoguanstatus){
this.tuoguanbuttonmsg = "取消托管";
}else{
this.tuoguanbuttonmsg = "托管";
}
this.$store.dispatch('training/updateMemberTrust', {deviceCode:code,trust:trustStatus});
}
},
inittrainlist(){
getSimulationTrainlistNew(this.group).then(netdata => {
this.options = [];
this.trainlist = netdata.data;
for(let i=0;i<netdata.data.length;i++){
let option= {
value: netdata.data[i].groupNumber,
label: netdata.data[i].groupNumber,
name:null,
}
option.disabled = false;
if(netdata.data[i].name){
option.label = netdata.data[i].name+"正在驾驶"+netdata.data[i].groupNumber;
this.initMsg = netdata.data[i].name+"正在驾驶"+netdata.data[i].groupNumber;
this.groupNumber = netdata.data[i].groupNumber;
option.disabled = true;
}
if(netdata.data[i].driverId){
if(netdata.data[i].driverId == this.userId){
this.selVal = netdata.data[i].groupNumber;
this.groupnum = netdata.data[i].groupNumber;
this.dialogVisible = true;
for(let i=0;i<this.trainlist.length;i++){
if(this.trainlist[i].groupNumber == this.groupnum){
// console.log(this.trainlist[i].gear);
// this.groupnum
this.$refs.dcontrol.centerstate(this.trainlist[i].gear);
}
}
this.value = this.groupnum;
this.nowdrive = this.groupnum;
// bindSimulationTrain(this.group,this.selVal).then(netdata => {
//
//
// }).catch(error => {
// });
}
}
this.options.push(option);
}
this.options.sort(
function(obj1,obj2) {
let val1 = obj1.value;
let val2 = obj2.value;
return val1 - val2;
}
);
});
//
if(this.tuoguanbutton == true){
let netdata = this.$store.state.training.memberData;
for(let k in netdata){
if(netdata[k].userId == this.userId){
// console.log(this.$store.state.scriptRecord.type);
this.userrole = netdata[k].type;
if(netdata[k].trust){
this.tuoguanstatus = netdata[k].trust;
if(this.tuoguanstatus){
this.tuoguanbuttonmsg = "取消托管";
}else{
this.tuoguanbuttonmsg = "托管";
}
}
break;
}
}
}
},
updateDriveValue(newvalue){
if(newvalue != this.value){
this.value = newvalue;
this.groupnum = newvalue;
}
},
updatetrainlist(){
getSimulationTrainlistNew(this.group).then(netdata => {
this.options = [];
this.trainlist = netdata.data;
for(let i=0;i<netdata.data.length;i++){
let option= {
value: netdata.data[i].groupNumber,
label: netdata.data[i].groupNumber,
name:null,
}
option.disabled = false;
if(netdata.data[i].name){
option.label = netdata.data[i].name+"正在驾驶"+netdata.data[i].groupNumber;
this.initMsg = netdata.data[i].name+"正在驾驶"+netdata.data[i].groupNumber;
this.groupNumber = netdata.data[i].groupNumber;
option.disabled = true;
}
if(netdata.data[i].driverId){
if(netdata.data[i].driverId == this.userId){
this.selVal = netdata.data[i].groupNumber;
this.groupnum = netdata.data[i].groupNumber;
}
}
this.options.push(option);
}
this.options.sort(
function(obj1,obj2) {
let val1 = obj1.value;
let val2 = obj2.value;
return val1 - val2;
}
);
});
//
if(this.tuoguanbutton == true){
let netdata = this.$store.state.training.memberData;
for(let k in netdata){
if(netdata[k].userId == this.userId){
// console.log(this.$store.state.scriptRecord.type);
this.userrole = netdata[k].type;
if(netdata[k].trust){
this.tuoguanstatus = netdata[k].trust;
if(this.tuoguanstatus){
this.tuoguanbuttonmsg = "取消托管";
}else{
this.tuoguanbuttonmsg = "托管";
}
}
break;
}
}
}
}
} }
}; };

View File

@ -19,12 +19,17 @@ export function mmiimage() {
this.m1['am'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m1-am.png'; this.m1['am'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m1-am.png';
this.m1['cm'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m1-cm.png'; this.m1['cm'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m1-cm.png';
this.m1['rm'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m1-rm.png'; this.m1['rm'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m1-rm.png';
this.m1['sm'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/ m1-sm.png';
this.m2 = []; this.m2 = [];
this.m2['start'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/none.png'; this.m2['start'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/none.png';
this.m2['il'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m2-il.png'; this.m2['il'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m2-il.png';
this.m2['itc'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m2-itc.png'; this.m2['itc'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m2-itc.png';
this.m2['cbtc'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m2-cbtc.png'; this.m2['cbtc'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m2-cbtc.png';
this.m2['ctc'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m2-ctc.png';
this.m2['ixl'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/ixl.png';
this.m3 = []; this.m3 = [];
this.m3['zhefan'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m3-zhefan.png'; this.m3['zhefan'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m3-zhefan.png';
@ -80,11 +85,13 @@ export function mmiimage() {
this.c2 = []; this.c2 = [];
this.c2['rm'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m1-rm.png'; this.c2['RM'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m1-rm.png';
this.c2['cmi'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/c2-cm-i.png'; this.c2['cmi'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/c2-cm-i.png';
this.c2['cmc'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/c2-cm-c.png'; this.c2['cmc'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/c2-cm-c.png';
this.c2['ami'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/c2-am-i.png'; this.c2['AM_I'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/c2-am-i.png';
this.c2['amc'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/c2-am-c.png'; this.c2['AM_C'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/c2-am-c.png';
this.c2['SM_I'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/c2-sm-i.png';
this.c2['SM_C'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/c2-sm-c.png';
this.c2['none'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/none.png'; this.c2['none'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/none.png';
this.c3 = []; this.c3 = [];

View File

@ -58,7 +58,7 @@
</div> </div>
<div class = "righttext" style="left:0px;bottom:0;"> <div class = "righttext" style="left:0px;bottom:0;">
{{$t('jlmap3d.confirmSignalOpen')}} {{mmimsg}}
</div> </div>
</div> </div>
@ -75,7 +75,7 @@
</div> </div>
<div class="errortext"> <div class="errortext">
{{$t('jlmap3d.faultInformation')}}
</div> </div>
<div id="time" class="timetext"> <div id="time" class="timetext">
@ -157,10 +157,12 @@ export default {
newa1state:"black", newa1state:"black",
a1state:"black", a1state:"black",
ebStatus:false, ebStatus:false,
mmimsg:"",
} }
}, },
mounted() { mounted() {
window.updatemmic1 = this.updatemmic1; window.updatemmic1 = this.updatemmic1;
window.jl3dUpdateMmiMsg = this.jl3dUpdateMmiMsg;
this.init(); this.init();
}, },
beforeDestroy() { beforeDestroy() {
@ -186,7 +188,7 @@ export default {
this.tiaotingimage = this.images.n['none']; this.tiaotingimage = this.images.n['none'];
this.dimage = this.images.d['info']; this.dimage = this.images.d['info'];
this.m1image = this.images.m1['rm']; this.m1image = this.images.m1['rm'];
this.m2image = this.images.m2['cbtc']; this.m2image = this.images.m2['ctc'];
this.m3image = this.images.m3['none']; this.m3image = this.images.m3['none'];
this.m4image = this.images.m4['none']; this.m4image = this.images.m4['none'];
this.m5image = this.images.m5['noalloffdoor']; this.m5image = this.images.m5['noalloffdoor'];
@ -215,6 +217,7 @@ export default {
}, },
updatetrainstatus(newdata){ updatetrainstatus(newdata){
if(typeof(newdata.eb) != "undefined"){ if(typeof(newdata.eb) != "undefined"){
this.updateEbStatus(newdata.eb); this.updateEbStatus(newdata.eb);
@ -276,7 +279,18 @@ export default {
} }
this.updatemmidoormode(newdata.leftDoorCanClose,newdata.rightDoorCanClose); this.updatemmidoormode(newdata.leftDoorCanClose,newdata.rightDoorCanClose);
if(newdata.preselectionMode){
this.updateBfhm(newdata.preselectionMode);
}
console.log(newdata);
if(newdata.message){
this.jl3dUpdateMmiMsg("",newdata.message);
}
}, },
updatemmistate(aaa){ updatemmistate(aaa){
}, },
@ -464,10 +478,13 @@ export default {
if(runlevel){ if(runlevel){
if(runlevel == "CBTC"){ if(runlevel == "CBTC"){
this.m2state = runlevel; this.m2state = runlevel;
this.m2image = this.images.m2['cbtc']; this.m2image = this.images.m2['ctc'];
}else if(runlevel == "ITC"){
this.m2state = runlevel;
this.m2image = this.images.m2['itc'];
}else if(runlevel == "IL"){ }else if(runlevel == "IL"){
this.m2state = runlevel; this.m2state = runlevel;
this.m2image = this.images.m2['il']; this.m2image = this.images.m2['ixl'];
}else{ }else{
this.m2state = runlevel; this.m2state = runlevel;
this.m2image = this.images.m2['start']; this.m2image = this.images.m2['start'];
@ -477,7 +494,7 @@ export default {
if(dirvemode){ if(dirvemode){
if(dirvemode == "CM"){ if(dirvemode == "CM"){
this.m1state = dirvemode; this.m1state = dirvemode;
this.m1image = this.images.m1['cm']; this.m1image = this.images.m1['sm'];
}else if(dirvemode == "RM"){ }else if(dirvemode == "RM"){
this.m1state = dirvemode; this.m1state = dirvemode;
this.m1image = this.images.m1['rm']; this.m1image = this.images.m1['rm'];
@ -596,6 +613,34 @@ export default {
this.endstation = end; this.endstation = end;
} }
}, },
updateBfhm(type){
this.c2state = type;
this.c2image = this.images.c2[type];
},
jl3dUpdateMmiMsg(msg,type){
if(type){
if(type == "Exit_TGMT"){
msg = "由于离开TGMT区域确认转换到RM模式的请求";
}
if(type == "Confirm_Release_Speed"){
msg = "确认释放速度";
}
if(type == "Confirm_Preselection"){
msg = "确认模式/级别预选";
}
if(type == "Confirm_Control_Level_Down"){
msg = "确认控制级别降级的请求";
}
if(type == "Switch_To_RM"){
msg = "确认切换到RM模式";
}
}
this.mmimsg = msg;
}
}, },
beforeDestroy() { beforeDestroy() {
} }

View File

@ -0,0 +1,586 @@
<template>
<div id="lesson3ddiv" class="lesson3ddiv">
<div class="selectjobdiv"
:style="{'background-image': 'url('+staticImg+'/texture/bg.jpg)'}"
v-if="showSelectJob">
<div class="selectjobbuttondiv">
<div
class="selectjobimg"
v-for="(job,index) in selectJobList"
@click="selectJob(job)"
:style="{'background-image': 'url('+staticImg+'/lesson3d/mst.png)'}">
<!-- <div>{{job}}</div> -->
<div style="width:100%;position:absolute;bottom:0;font-size:30px;textAlign:center;">{{job}}</div>
</div>
</div>
</div>
<div class="lessontopdiv"
:style="{'background-image': 'url('+lessonbg+')'}">
<div class="lessontopdivtittle"
:style="{'background-image': 'url('+lessonbg+')'}">
课程:{{lessonMsg.lessonTittle}}
</div>
<div class="lessontopdivmsg"
:style="{'background-image': 'url('+lessonbg+')'}"
@click="openBack">
退出
</div>
<div class="lessontopdivmsg"
:style="{'background-image': 'url('+lessonbg+')'}">
用户ID:{{lessonMsg.userId}}
</div>
<div class="lessontopdivmsg"
:style="{'background-image': 'url('+lessonbg+')'}"
v-if="lessonMsg.userJob">
当前岗位:{{lessonMsg.userJob}}
</div>
</div>
<div class="lesson3dplayer">
<Step-Tips
:lessonData='lessonData'
:lessonPlayIndex='lessonPlayIndex'
:nowRole ='nowRole'
v-show="lessonTools[0].isShow"
@jumpEvent="jumpEvent">
</Step-Tips>
<Process-Log
:lessonData='lessonData'
:lessonPlayIndex='lessonPlayIndex'
ref="processlog"
v-show="lessonTools[1].isShow">
</Process-Log>
<Explain-Pane
:lessonData='lessonData'
:lessonPlayIndex='lessonPlayIndex'
v-show="lessonTools[2].isShow && !examMode"
>
</Explain-Pane>
<Job-Pane
:jobPaneData='jobPaneData'
:lessonData='lessonData'
:lessonPlayIndex='lessonPlayIndex'
:nowRole='nowRole'
ref="jobpane"
v-show="lessonTools[3].isShow">
</Job-Pane>
<Tool-Bar
v-show="lessonTools[4].isShow "
@changeCameraPos="changeCameraPos">
</Tool-Bar>
<TrainTest-Pane
:trainDeviceData='trainDeviceData'
:lessonData='lessonData'
:lessonPlayIndex='lessonPlayIndex'
ref="jobpane"
v-show="lessonTools[5].isShow ">
</TrainTest-Pane>
<Result-Tips
:examStatus='examStatus'
ref="rtui">
</Result-Tips>
<div id="lesson3ddraw" class="lesson3ddraw">
</div>
</div>
<div class="lessondowndiv"
:style="{'background-image': 'url('+lessonbg+')'}">
<div class="lessondowndivroommsg"
:style="{'background-image': 'url('+lessonbg+')'}">
房间编号:1
</div>
<div class="lessondowndivmsg"
:style="{'background-image': 'url('+lessonbg+')'}"
v-show = "endExam && examMode"
@click="showResult">
考试成绩分析
</div>
<div class="lessondowndivmsg"
:style="{'background-image': 'url('+lessonbg+')'}"
v-show = "examMode">
考试计时:{{this.lastPlayTime}}
</div>
<div class="lessondowndivmsg"
:style="{'background-image': 'url('+lessonbg+')'}"
v-show = "examMode">
考核步骤:{{examStatus.nowStep}}/{{examStatus.allStep}}
</div>
<div class="lessondowndivmsg"
:style="{'background-image': 'url('+lessonbg+')'}"
v-show = "examMode">
考试得分:{{examStatus.lastScore}}/{{examStatus.allScore}}
</div>
</div>
<canvas id="canvastexture" width="128px" height="64px"></canvas>
</div>
</template>
<script>
import Vue from 'vue';
import localStore from 'storejs';
// import AssetsModel from '@/views/jlmap3d/lesson3dedit/component/assetsmodel';
import ResultTips from '@/views/jlmap3d/lesson3dplayer/tools/resulttips';
import StepTips from '@/views/jlmap3d/lesson3dplayer/tools/stepstips';
import ProcessLog from '@/views/jlmap3d/lesson3dplayer/tools/processlog';
import ExplainPane from '@/views/jlmap3d/lesson3dplayer/tools/explainpane';
import JobPane from '@/views/jlmap3d/lesson3dplayer/tools/jobpane';
import ToolBar from '@/views/jlmap3d/lesson3dplayer/tools/toolbar';
import TrainTestPane from '@/views/jlmap3d/lesson3dplayer/tools/traintestpane';
import { Lesson3dPlayer } from '@/jlmap3d/lesson3d/lesson3dplayer.js';
import { LessonData } from '@/jlmap3d/lesson3d/model/lessondata.js';
import { JobPaneData } from '@/jlmap3d/lesson3d/toolsmodel/jobpanedata.js';
import { ZzwwTrain } from '@/jlmap3d/lesson3dedit/toolsmodel/zzwwtrain.js';
import { getLesson3dData,updateLesson3dData } from '@/api/jmap/lesson3d';
import { JL3D_LOCAL_STATIC,BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
export default {
name: 'ZzwwTest',
components: {
// AssetsModel,
StepTips,
ProcessLog,
ExplainPane,
JobPane,
ToolBar,
ResultTips,
TrainTestPane
},
data() {
return {
lessonbg:JL3D_LOCAL_STATIC+"/lesson3d/lessonbg.png",
staticImg:JL3D_LOCAL_STATIC,
examMode:false,
examStatus:{
allScore:0,
nowStep:0,
lastScore:0,
allStep:0,
trueStep:[],
falseStep:[],
time:0,
},
playTime:{
h:0,
m:0,
s:0,
},
time:'',
ms:0,
lastPlayTime:"",
endExam:false,
examResultShow:false,
showSelectJob:true,
lessonMsg:{},
selectJobList:[],
nowRole:"",
jl3d: null,
netData:{
name:'',
type:'',
data:{},
},
triggerList:[],
lessonData:{
lessonData:{
lessonProgress:[
]
}
},
jobPaneData:{},
trainDeviceData:{},
lessonPlayIndex:0,
lessonTools:[
{
name:"步骤组件",
isShow:false,
},
{
name:"步骤进程日志",
isShow:false,
},
{
name:"步骤提示组件",
isShow:false,
},
{
name:"岗位联络操作",
isShow:false,
},
{
name:"导航工具栏",
isShow:false,
},
{
name:"大铁车检组件",
type:"",
isShow:false,
},
],
}
},
computed: {
},
watch: {
},
mounted() {
window.updateTriggerList = this.updateTriggerList;
window.jumpEvent = this.jumpEvent;
window.actionEvent = this.actionEvent;
window.startLesson = this.startLesson;
window.updataExamStatus = this.updataExamStatus;
window.lessonEnd = this.lessonEnd;
this.init(this.$route.query.lessonId);
},
beforeDestroy() {
},
methods: {
init(lessonId){
getLesson3dData(lessonId).then(data => {
this.netData.name = data.data.name;
this.netData.type = data.data.type;
let dom = document.getElementById('lesson3ddraw');
this.lessonData = new LessonData();
this.jobPaneData = new JobPaneData();
this.trainDeviceData = new ZzwwTrain();
let loadData;
if(data.data.data){
this.lessonMsg = {
lessonTittle:data.data.name,
userId:data.data.userId,
userJob:"",
};
loadData = JSON.parse(data.data.data);
if(this.$route.query.examMode == 1){
this.examMode = true;
}else{
this.examMode = loadData.setup.examMode;
}
if(loadData.setup.checkedRole.length == 0){
this.showSelectJob = false;
}
this.selectJobList = loadData.setup.checkedRole;
this.jobPaneData.dataList = loadData.toolJobPane;
this.$refs.jobpane.initJobList(this.jobPaneData.dataList);
console.log(loadData.lessonTools);
this.lessonTools = loadData.lessonTools;
this.lessonData.loadLessonProgress(loadData.lessonProgress);
if(this.lessonTools[5].isShow){
loadData.trainDeviceData = this.trainDeviceData.deviceList;
}
}else{
this.lessonData.initLessonProgress();
this.$refs.jobpane.initJobList(this.jobPaneData.dataList);
this.jl3d.initNowRole();
}
// console.log("loaddata----------------");
// console.log(loadData);
// console.log(this.lessonMsg);
this.jl3d = new Lesson3dPlayer(dom,loadData,this.lessonPlayIndex);
}).catch(() => {
});
},
updataExamStatus(newExamStatus){
this.examStatus = newExamStatus;
},
lessonEnd(){
if(this.examMode == true){
this.endExam = true;
this.showResult();
this.examStatus.time = this.lastPlayTime;
this.stopTime();
}
},
showResult(){
this.$refs.rtui.showdiv();
},
selectJob(job){
this.showSelectJob = false;
for(let i=0;i<this.jobPaneData.dataList.length;i++){
if(job == this.jobPaneData.dataList[i].name){
this.nowRole = this.jobPaneData.dataList[i].value;
this.lessonMsg.userJob = job;
this.jl3d.initNowRole(this.nowRole);
this.timeStart();
}
}
},
timeStart(){
this.time =setInterval(this.timer,100)
},
timer () {//
this.ms =this.ms +100 //
if (this.ms >=1000) {
this.ms =0
this.playTime.s =this.playTime.s +1 //
}
if (this.playTime.s >=60) {
this.playTime.s =0;
this.playTime.m =this.playTime.m +1 //
}
if (this.playTime.m >=60) {
this.playTime.m;
this.playTime.h =this.playTime.h +1 //
}
this.lastPlayTime =this.toDub(this.playTime.h) +':' +this.toDub(this.playTime.m) +':' +this.toDub(this.playTime.s)/*+""+this.toDubms(this.ms)+"毫秒"*/
},
toDub (n) {//0
if (n <10) {
return '0' + n
}else {
return '' + n
}
},
stopTime () {
clearInterval(this.time);
},
startLesson(){
this.$refs.processlog.startLog();
},
saveLesson3dData(){
this.lessonData.lessonData.lessonTools = this.lessonTools;
let saveData = this.lessonData.lessonData;
saveData.toolJobPane = this.jobPaneData.dataList;
let assetModelData = this.jl3d.saveAssetModel();
saveData.assetList = assetModelData.assetList;
saveData.modelList = assetModelData.modelList;
this.netData.data = JSON.stringify(saveData);
// console.log();
updateLesson3dData(this.$route.query.lessonId,this.netData).then(data => {
console.log(data);
}).catch(() => {
});
},
jumpEvent(type,action){
if(type == "action"){
this.lessonPlayIndex = action.jumpNode;
}
if(type == "tools"){
this.lessonPlayIndex = action.nextNode;
}
if(type == "jump"){
this.lessonPlayIndex = action.nextNode;
}
this.jl3d.changeIndex(this.lessonPlayIndex);
},
actionEvent(type,action,mesh){
this.jl3d.actionModelControl(type,mesh);
// this.jl3d.actionRemove(mesh);
},
updateTriggerList(newTriggerList){
this.triggerList = newTriggerList;
},
changeCameraPos(pos){
this.jl3d.changeCameraPos(pos);
},
openBack(){
history.go(-1);
},
},
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
* {
touch-action: none;
}
.selectjobdiv{
width:100%;
height:100%;
position: absolute;
z-index: 5;
background-size: 100%;
}
.selectjobimg{
width:250px;
height:250px;
background-size: 100%;
// float:left;
display: inline-block;
position:relative;
}
.selectjobbuttondiv{
position:absolute;
width:80%;
height:30%;
left:10%;
top:35%;
overflow-x:scroll;
overflow-y:hidden;
text-align: center;
}
.selectjobbackdiv{
}
.lessontopdiv{
width:100%;
height: 50px;
position: absolute;
top:0;
border-radius:10px;
border:solid 2px #000;
z-index: 10;
color:#fff;
}
.lessontopdivtittle{
width: 33%;
height:50px;
position: absolute;
left:0;
text-align: center;
font-size: 30px;
line-height: 40px;
border-radius:10px;
border:solid 2px #000;
}
.lessontopdivmsg{
width: 20%;
height:49px;
position: relative;
float:right;
text-align: center;
font-size: 18px;
line-height: 40px;
border-radius:10px;
border:solid 2px #000;
}
.lessondowndiv{
width:100%;
height: 40px;
position: absolute;
bottom:0;
border-radius:10px;
border:solid 2px #000;
z-index: 10;
color:#fff;
font-size: 18px;
line-height: 25px;
}
.lessondowndivroommsg{
width: 20%;
height:38px;
position: absolute;
left:0;
text-align: center;
border-radius:10px;
border:solid 2px #000;
}
.lessondowndivmsg{
width: 20%;
height:38px;
position: relative;
float:right;
text-align: center;
border-radius:10px;
border:solid 2px #000;
}
.lesson3ddiv {
width: 100%;
height: 100%;
}
.lesson3dplayer{
width:100%;
height:100%;
position: absolute;
// top: 0;
// left:15%;
// border:solid 2px #000;
}
.lesson3ddraw {
float: left;
//left:20%;
position: absolute;
width: 100%;
height: 100%;
z-inde: -1;
}
.activediv{
position: absolute;
width: 15%;
height:100%;
left:0;
border-radius:10px;
border:solid 2px #000;
}
.lessonsetup {
position: absolute;
width: 15%;
height: 20%;
right:0;
top:0;
border-radius:10px;
border:solid 2px #000;
text-align:center;
}
.el-tabs__content{
position: absolute;
}
</style>

View File

@ -581,7 +581,7 @@ export default {
} }
}); });
} else if (this.project === 'zzwwtest') { } else if (this.project === 'zzwwtest') {
this.$router.push({ path: '/design/jlmap3d/lesson3dplayer', query: {lessonId:'31'} }); this.$router.push({ path: '/jlmap3d/zzwwtest', query: {lessonId:'35'} });
} else if (this.project === 'richorlesson3d') { } else if (this.project === 'richorlesson3d') {
this.$router.push({ path: '/jlmap3d/lesson3dselect', query: {} }); this.$router.push({ path: '/jlmap3d/lesson3dselect', query: {} });
} else { } else {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

BIN
static/jl3d/mmi/c2-sm-c.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
static/jl3d/mmi/c2-sm-i.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
static/jl3d/mmi/m1-sm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
static/jl3d/mmi/m2-ctc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB