diff --git a/src/jlmap3d/edit/neweditmodel/StationStandList.js b/src/jlmap3d/edit/neweditmodel/StationStandList.js index f1cc25e89..2c8f09d2a 100644 --- a/src/jlmap3d/edit/neweditmodel/StationStandList.js +++ b/src/jlmap3d/edit/neweditmodel/StationStandList.js @@ -161,7 +161,9 @@ export function StationStandList() { } this.loadpromise = function(jlmap3ddata,standsdata,jlmapstanddata,scene,assetloader){ return new Promise(function(resolve, reject){ - + console.log(jlmap3ddata); + console.log(standsdata); + console.log(jlmapstanddata); let stations = jlmap3ddata.stationstandlist.list; let num; let num2; diff --git a/src/jlmap3d/jl3ddevice/jl3ddeviceNew.js b/src/jlmap3d/jl3ddevice/jl3ddeviceNew.js index 9ae34a205..38a56a619 100644 --- a/src/jlmap3d/jl3ddevice/jl3ddeviceNew.js +++ b/src/jlmap3d/jl3ddevice/jl3ddeviceNew.js @@ -17,11 +17,15 @@ import store from '@/store/index_APP_TARGET'; var clock = new THREE.Clock(); export function Jl3ddeviceNew(dom,group,token,skinCode) { + + window.speechSynthesis.getVoices() + let voices = speechSynthesis.getVoices(); + var scope = this; let helpbox,textplane; let daochamodel; let psdtexturemap = []; - + let psdVoiceStationList = []; this.dom = dom; this.nowcode = null; @@ -114,6 +118,48 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) { for(let i=0,leni=mapnetdata.sectionList.length;i { that.subscribe(subscribe.dest, subscribe.handler); }); - }, ()=> { + }, (e)=> { + console.log('socket连接错误:' + e); this.status = false; }); // sock断开回调 that.clientIns.ws.onclose = () => { + that.status = false; console.info(`通信连接已断开!`); checkLoginLine().then((resp) => { if (resp.code == 200) { @@ -83,6 +85,14 @@ StompClient.prototype = { console.info(`尝试第${count || 1}次连接.`); // Message.warning(`正在尝试第${count || 1}次通讯连接。`); const that = this; + if (this.clientIns) { // 初始化stomp和websocket + if (this.clientIns.connected) { + this.clientIns.disconnect(); + } + this.websocket.close(); + this.websocket = null; + this.clientIns = null; + } setTimeout(() => { that.connect(); }, reconnectInterval[that.count] || reconnectInterval[reconnectInterval.length - 1] ); diff --git a/src/views/jsxt/competition/theory/quiz/index.vue b/src/views/jsxt/competition/theory/quiz/index.vue index cc38a94db..7a1b8af89 100644 --- a/src/views/jsxt/competition/theory/quiz/index.vue +++ b/src/views/jsxt/competition/theory/quiz/index.vue @@ -30,6 +30,7 @@ import Question from './question'; import localStore from 'storejs'; import { postCompetitionTheory, getTheoryQuestion, quitCurrentRace } from '@/api/competition'; +import { computationTime } from '@/utils/date'; export default { components: { @@ -125,7 +126,7 @@ export default { const storeValue = new Date().getTime(); localStore.set(storeKey, storeValue); } - this.countdownTime = this.computationTime(this.theoryExamTime); + this.countdownTime = computationTime(this.theoryExamTime); this.countdown = setInterval(() => { if (this.theoryExamTime <= 0) { @@ -135,7 +136,7 @@ export default { this.commit(); } this.theoryExamTime--; - this.countdownTime = this.computationTime(this.theoryExamTime); + this.countdownTime = computationTime(this.theoryExamTime); }, 1000); } }).catch(error => { this.$message.error(`加载考试详情失败:${error.message}`); }); @@ -199,28 +200,6 @@ export default { const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'theoryAnswers'; localStore.set(storeKey, this.theoryAnswersMap); - }, - computationTime(time) { - let hours = Math.floor(time / 3600); - const newTime = time % 3600; - let minutes = Math.floor(newTime / 60) + ''; - let seconds = newTime % 60; - if (hours < 0) { - hours = '00'; - } else if (hours < 10) { - hours = '0' + hours; - } - if (minutes < 0) { - minutes = '00'; - } else if (minutes < 10) { - minutes = '0' + minutes; - } - if (seconds < 0) { - seconds = '00'; - } else if (seconds < 10) { - seconds = '0' + seconds; - } - return hours + ':' + minutes + ':' + seconds; } } }; diff --git a/src/views/newMap/jointTrainingNew/index.vue b/src/views/newMap/jointTrainingNew/index.vue index 729c5829b..bd93e1db6 100644 --- a/src/views/newMap/jointTrainingNew/index.vue +++ b/src/views/newMap/jointTrainingNew/index.vue @@ -85,6 +85,7 @@ import Vue from 'vue'; import localStore from 'storejs'; import MembersManage from './memberManage/membersManage'; import AddMember from './memberManage/addMember'; +import { computationTime } from '@/utils/date'; export default { name: 'JointTrainingDraft', @@ -389,11 +390,12 @@ export default { this.deviceShow = false; } }, + /* 设置仿真初始时间以及运行状态 */ async loadSimulationInfo() { const resp = await getSimulationInfoNew(this.group); + debugger; if (resp && resp.code == 200 && resp.data && !resp.data.dataError) { this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause); - this.questId = Number(resp.data.questId) || 0; this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`)); this.$store.dispatch('map/setRunPlanStatus', resp.data.planRunning); if (resp.data.planRunning) { @@ -406,6 +408,7 @@ export default { this.$messageBox('此地图数据正在维护中,无法运行!'); } }, + /* 获取个人仿真信息*/ async getUserRole() { const res = await getSimulationUserInfo(this.group); const data = res.data || {}; @@ -446,7 +449,7 @@ export default { } else { this.practicalTime = this.practicalExamTime * 60; } - this.countdownTime = this.computationTime(this.practicalTime); + this.countdownTime = computationTime(this.practicalTime); paperResp.data.practicalQuestions.forEach(elem => { this.questionList.push({name: elem.question.name, description:elem.question.description}); }); @@ -469,7 +472,6 @@ export default { setSimulationPrdType(swch) { // Admin 管理员 Dispatcher 行调 STATION_SUPERVISOR 车站 Audience 观众 Driver 司机 MAINTAINER 通号 IBP:IBP盘 switch (this.userRole) { - // case 'ADMIN': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'ADMIN'); this.hideIbp(); break; case 'DISPATCHER': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'DISPATCHER'); @@ -499,6 +501,7 @@ export default { break; } }, + /* 竞赛系统倒计时 */ startCounting() { const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'practical'; const startTime = localStore.get(storeKey); @@ -514,7 +517,7 @@ export default { this.$refs.demonMenu.submit(); } this.practicalTime--; - this.countdownTime = this.computationTime(this.practicalTime); + this.countdownTime = computationTime(this.practicalTime); }, 1000); }, async getTrainDetail() { @@ -541,28 +544,6 @@ export default { faultChooseShow() { // 故障列表加载 this.$refs.faultChoose.doShow(); }, - computationTime(time) { - let hours = Math.floor(time / 3600); - const newTime = time % 3600; - let minutes = Math.floor(newTime / 60) + ''; - let seconds = newTime % 60; - if (hours < 0) { - hours = '00'; - } else if (hours < 10) { - hours = '0' + hours; - } - if (minutes < 0) { - minutes = '00'; - } else if (minutes < 10) { - minutes = '0' + minutes; - } - if (seconds < 0) { - seconds = '00'; - } else if (seconds < 10) { - seconds = '0' + seconds; - } - return hours + ':' + minutes + ':' + seconds; - }, showdriving() { this.panelShow = true; this.drivingShow = false; diff --git a/src/views/newMap/jointTrainingNew/menuSchema.vue b/src/views/newMap/jointTrainingNew/menuSchema.vue index 442ef9871..8998632d4 100644 --- a/src/views/newMap/jointTrainingNew/menuSchema.vue +++ b/src/views/newMap/jointTrainingNew/menuSchema.vue @@ -32,7 +32,6 @@