diff --git a/src/api/jlmap3d/load3ddata.js b/src/api/jlmap3d/load3ddata.js index bb7cac424..7f702d359 100644 --- a/src/api/jlmap3d/load3ddata.js +++ b/src/api/jlmap3d/load3ddata.js @@ -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 }); diff --git a/src/jlmap3d/edit/connect/newgetmodels.js b/src/jlmap3d/edit/connect/newgetmodels.js index 882699430..678744ba3 100644 --- a/src/jlmap3d/edit/connect/newgetmodels.js +++ b/src/jlmap3d/edit/connect/newgetmodels.js @@ -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轨道 diff --git a/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnectNew.js b/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnectNew.js index 8e25808d5..bad4ec644 100644 --- a/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnectNew.js +++ b/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnectNew.js @@ -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; } diff --git a/src/store/modules/training.js b/src/store/modules/training.js index 823740f81..97f4a0167 100644 --- a/src/store/modules/training.js +++ b/src/store/modules/training.js @@ -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); diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 55d352581..778caeb7b 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -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'; // 杜康 diff --git a/src/views/jlmap3d/drive/drivecontrol/drivecontrol.vue b/src/views/jlmap3d/drive/drivecontrol/drivecontrol.vue index e0668d1f4..ec9486a85 100644 --- a/src/views/jlmap3d/drive/drivecontrol/drivecontrol.vue +++ b/src/views/jlmap3d/drive/drivecontrol/drivecontrol.vue @@ -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; diff --git a/src/views/scriptManage/display/tipScriptRecordNew.vue b/src/views/scriptManage/display/tipScriptRecordNew.vue index bd7a4a9dc..32349bdb1 100644 --- a/src/views/scriptManage/display/tipScriptRecordNew.vue +++ b/src/views/scriptManage/display/tipScriptRecordNew.vue @@ -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();