修改录制三维驾驶托管模块

This commit is contained in:
sunzhenyu 2020-07-14 15:03:31 +08:00
parent 30b1bf3646
commit 54a773aa84
7 changed files with 54 additions and 21 deletions

View File

@ -75,9 +75,9 @@ export function getPublish3dMapDetail(id) {
}
/** 更新地图3d数据*/
export function tuoguan3ddrive(group,on,data) {
export function tuoguan3ddrive(group,data) {
return request({
url: `/api/scriptSimulation/${group}/trust?on=${on}`,
url: `/api/scriptSimulation/${group}/trust`,
method: 'put',
data: data
});

View File

@ -102,13 +102,13 @@ export function getmodels(data) {
deviceType:"suidaobg",
type:"nbsuidao",
picUrl:"",
assetUrl:"../../static/model/suidao/suidao.FBX"
assetUrl:"../../static/model/suidao/xiansuidao.FBX"
}
assets.push(backgroundmodel);
models.assets = assets;
models.stationtexture = "fz1";
models.istexture = false;
models.stationtexture = "xian3";
models.istexture = true;
console.log(models);
postmap.assets = JSON.stringify(models);
//link轨道

View File

@ -96,7 +96,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,sta
let data = JSON.parse(Response.body);
// stats.update();
// 遍历后台数据
// console.log(data);
if(data.type == "Train_Position"){
@ -106,6 +106,11 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,sta
if(data.type == "Train_Hmi_3D"){
console.log(data);
updatestatus(data.body);
if(data.body.trust == '1'){
updateDriverTrust(data.body.code,true);
}else{
updateDriverTrust(data.body.code,false);
}
// trainhmi(data.body);
return;
}

View File

@ -228,6 +228,14 @@ const training = {
setSimulationUserList: (state, simulationUserList) => {
state.simulationUserList = simulationUserList;
},
updateMemberTrust:(state, {deviceCode,trust}) => {
for(let k in state.memberData){
if(state.memberData[k].deviceCode == deviceCode){
state.memberData[k].trust = trust;
break;
}
}
},
updateMemberListInScript:(state, {oldMemberId, newMemberId, userId, name}) => {
if (oldMemberId) {
// 重置旧数据
@ -240,7 +248,7 @@ const training = {
state.memberData[newMemberId].name = name;
state.memberData[newMemberId].disabled = true;
},
updateMemberAndUser: (state, {simulationUserList, userId}) => {
simulationUserList.forEach(item => {
let memberIndex = -1;
@ -677,6 +685,9 @@ const training = {
setSimulationUserList: ({ commit }, simulationUserList) => {
commit('setSimulationUserList', simulationUserList);
},
updateMemberTrust:({ commit }, data) => {
commit('updateMemberTrust', data);
},
/** 更新综合演练仿真成员和用户列表 */
updateMemberAndUser: ({ commit }, data) => {
commit('updateMemberAndUser', data);

View File

@ -2,10 +2,10 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康

View File

@ -92,14 +92,14 @@ import axios from 'axios';
}
},
watch: {
'$store.state.training.memberData':{
handler(val){
if(this.tuoguanbutton == true){
console.log(val);
}
},
deep:true //true
}
// '$store.state.training.memberData':{
// handler(val){
// if(this.tuoguanbutton == true){
// console.log(val);
// }
// },
// deep:true //true
// }
},
onLoad(e) {
@ -125,6 +125,8 @@ import axios from 'axios';
this.updatetrainlist();
});
}
window.updateDriverTrust = this.updateDriverTrust;
// this.teststomp = new StompClient();
@ -168,7 +170,8 @@ import axios from 'axios';
}else{
posttrust = true;
}
tuoguan3ddrive(this.$route.query.group,posttrust,{}).then(netdata => {
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){
@ -180,6 +183,20 @@ import axios from 'axios';
});
},
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});
}
},
updatetrainlist(){
getSimulationTrainlistNew(this.group).then(netdata => {
this.options = [];
@ -242,8 +259,9 @@ import axios from 'axios';
console.log(netdata);
for(let k in netdata){
if(netdata[k].userId == this.userId){
console.log(this.$store.state.scriptRecord.userRole);
this.userrole = this.$store.state.scriptRecord.userRole;
console.log("=================");
// console.log(this.$store.state.scriptRecord.type);
this.userrole = netdata[k].type;
console.log(netdata[k].trust);
if(netdata[k].trust){
this.tuoguanstatus = netdata[k].trust;

View File

@ -120,7 +120,6 @@ export default {
initData() {
getSimulationMemberList(this.group).then(resp => {
const lastData = JSON.stringify(resp.data);
console.log(resp.data);
this.$store.dispatch('training/setMemberList', {memberList:resp.data, userId:this.$store.state.user.id});
this.allMemberList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
this.changeRunPlanStatus();