删除仿真里的回放
This commit is contained in:
parent
1ad20fe522
commit
25ff5bdb6b
@ -25,8 +25,6 @@
|
||||
|
||||
<menu-plan v-if="isPlan" ref="menuPlan" :offset="offset" :group="group" />
|
||||
|
||||
<menu-replay v-if="isReplay" ref="menuReplay" :offset="offset" :group="group" />
|
||||
|
||||
<menu-script v-if="isScript" ref="menuScript" :offset="offset" :group="group" />
|
||||
|
||||
<menu-schema
|
||||
@ -59,7 +57,7 @@ import FaultChoose from './demon/faultChoose';
|
||||
import MapSystemDraft from '@/views/mapsystem/index';
|
||||
import MenuExam from '@/views/display/menuExam';
|
||||
import MenuLesson from '@/views/display/menuLesson';
|
||||
import MenuReplay from '@/views/display/menuReplay';
|
||||
// import MenuReplay from '@/views/display/menuReplay';
|
||||
import MenuDemon from '@/views/display/menuDemon';
|
||||
import MenuScreen from '@/views/display/menuScreen';
|
||||
import MenuSchema from '@/views/display/menuSchema';
|
||||
@ -93,7 +91,7 @@ export default {
|
||||
AddQuest,
|
||||
MenuExam,
|
||||
MenuLesson,
|
||||
MenuReplay,
|
||||
// MenuReplay,
|
||||
MapSystemDraft,
|
||||
MenuPlan,
|
||||
MenuDemon,
|
||||
@ -191,9 +189,6 @@ export default {
|
||||
isScreen() {
|
||||
return this.mode === 'dp';
|
||||
},
|
||||
isReplay() {
|
||||
return this.mode === 'replay';
|
||||
},
|
||||
isScript() {
|
||||
return this.mode === 'script';
|
||||
},
|
||||
@ -260,9 +255,6 @@ export default {
|
||||
},
|
||||
async beforeDestroy() {
|
||||
await this.clearAllTimer();
|
||||
if (!this.isReplay) {
|
||||
await this.quit();
|
||||
}
|
||||
await this.$store.dispatch('training/reset');
|
||||
await this.$store.dispatch('map/mapClear');
|
||||
EventBus.$off('clearCheckLogin');
|
||||
@ -357,15 +349,11 @@ export default {
|
||||
// 加载地图数据
|
||||
async initLoadData() {
|
||||
this.$store.dispatch('training/reset');
|
||||
debugger;
|
||||
|
||||
try {
|
||||
if (!this.isReplay) {
|
||||
await this.loadSimulationInfo();
|
||||
}
|
||||
|
||||
if (this.isReplay) {
|
||||
await this.initLoadReplayData();
|
||||
} else if (this.isDemon) {
|
||||
await this.loadSimulationInfo();
|
||||
if (this.isDemon) {
|
||||
await this.initLoadDemonData();
|
||||
} else if (this.isScreen) {
|
||||
await this.initLoadScreenData();
|
||||
@ -395,6 +383,7 @@ export default {
|
||||
const resp = await getTrainingDetail(this.trainingId);
|
||||
if (resp && resp.code == 200) {
|
||||
const detail = resp.data;
|
||||
debugger;
|
||||
const rest = await getProductDetail(detail.prdId);
|
||||
if (rest && rest.code == 200) {
|
||||
const data = rest.data;
|
||||
@ -409,18 +398,6 @@ export default {
|
||||
this.endViewLoading();
|
||||
}
|
||||
},
|
||||
// 回放系统
|
||||
async initLoadReplayData() {
|
||||
this.$store.dispatch('training/end', TrainingMode.NORMAL);
|
||||
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式
|
||||
this.$store.dispatch('training/setPrdType', '');
|
||||
|
||||
if (parseInt(this.mapId)) {
|
||||
await this.loadMapDataById(this.mapId);
|
||||
} else {
|
||||
this.endViewLoading();
|
||||
}
|
||||
},
|
||||
// 仿真系统
|
||||
async initLoadDemonData() {
|
||||
this.$store.dispatch('training/end', TrainingMode.NORMAL);
|
||||
|
@ -26,8 +26,6 @@
|
||||
|
||||
<menu-plan v-if="isPlan" ref="menuPlan" :offset="offset" :group="group" />
|
||||
|
||||
<menu-replay v-if="isReplay" ref="menuReplay" :offset="offset" :group="group" />
|
||||
|
||||
<menu-script v-if="isScript" ref="menuScript" :offset="offset" :group="group" />
|
||||
|
||||
<menu-schema
|
||||
@ -55,7 +53,6 @@
|
||||
import MapSystemDraft from '@/views/mapsystem/index';
|
||||
import MenuExam from '@/views/display/menuExam';
|
||||
import MenuLesson from '@/views/display/menuLesson';
|
||||
import MenuReplay from '@/views/display/menuReplay';
|
||||
import MenuDemon from '@/views/display/menuDemon';
|
||||
import MenuScreen from '@/views/display/menuScreen';
|
||||
import MenuSchema from '@/views/display/menuSchema';
|
||||
@ -84,7 +81,6 @@ export default {
|
||||
components: {
|
||||
MenuExam,
|
||||
MenuLesson,
|
||||
MenuReplay,
|
||||
MapSystemDraft,
|
||||
MenuPlan,
|
||||
MenuDemon,
|
||||
@ -177,9 +173,6 @@ export default {
|
||||
isScreen() { // 暂时不用
|
||||
return this.mode === 'dp';
|
||||
},
|
||||
isReplay() { // 回放 暂时不用
|
||||
return this.mode === 'replay';
|
||||
},
|
||||
isScript() {
|
||||
return this.mode === 'script';
|
||||
},
|
||||
@ -243,9 +236,6 @@ export default {
|
||||
},
|
||||
async beforeDestroy() {
|
||||
await this.clearAllTimer();
|
||||
if (!this.isReplay) {
|
||||
await this.quit();
|
||||
}
|
||||
await this.$store.dispatch('training/reset');
|
||||
await this.$store.dispatch('map/mapClear');
|
||||
EventBus.$off('clearCheckLogin');
|
||||
@ -342,13 +332,9 @@ export default {
|
||||
this.$store.dispatch('training/reset');
|
||||
|
||||
try {
|
||||
if (!this.isReplay) {
|
||||
await this.loadSimulationInfo();
|
||||
}
|
||||
await this.loadSimulationInfo();
|
||||
|
||||
if (this.isReplay) {
|
||||
await this.initLoadReplayData();
|
||||
} else if (this.isDemon) {
|
||||
if (this.isDemon) {
|
||||
await this.initLoadDemonData();
|
||||
} else if (this.isScreen) {
|
||||
await this.initLoadScreenData();
|
||||
@ -392,18 +378,6 @@ export default {
|
||||
this.endViewLoading();
|
||||
}
|
||||
},
|
||||
// 回放系统
|
||||
async initLoadReplayData() {
|
||||
this.$store.dispatch('training/end', TrainingMode.NORMAL);
|
||||
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式
|
||||
this.$store.dispatch('training/setPrdType', '');
|
||||
|
||||
if (parseInt(this.mapId)) {
|
||||
await this.loadMapDataById(this.mapId);
|
||||
} else {
|
||||
this.endViewLoading();
|
||||
}
|
||||
},
|
||||
// 仿真系统
|
||||
async initLoadDemonData() {
|
||||
this.$store.dispatch('training/end', TrainingMode.NORMAL);
|
||||
@ -532,23 +506,23 @@ export default {
|
||||
this.drivingShow = true;
|
||||
this.$refs.Jl3dDrive.show(this.mapId, this.group);
|
||||
} else {
|
||||
let routeData = this.$router.resolve({
|
||||
path:'/jlmap3d/sandbox',
|
||||
query:{
|
||||
mapid:this.mapId,
|
||||
group:this.group,
|
||||
token:getToken(),
|
||||
}
|
||||
});
|
||||
window.open(routeData.href, '_blank','noopener noreferrer');
|
||||
const routeData = this.$router.resolve({
|
||||
path:'/jlmap3d/sandbox',
|
||||
query:{
|
||||
mapid:this.mapId,
|
||||
group:this.group,
|
||||
token:getToken()
|
||||
}
|
||||
});
|
||||
window.open(routeData.href, '_blank', 'noopener noreferrer');
|
||||
}
|
||||
},
|
||||
devicemodel(){
|
||||
if(this.deviceShow == false){
|
||||
this.deviceShow = true;
|
||||
}else{
|
||||
this.deviceShow = false;
|
||||
}
|
||||
devicemodel() {
|
||||
if (this.deviceShow == false) {
|
||||
this.deviceShow = true;
|
||||
} else {
|
||||
this.deviceShow = false;
|
||||
}
|
||||
|
||||
},
|
||||
showScheduling() {
|
||||
|
@ -1,180 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<div>
|
||||
<chart-view ref="chatView" :group="group" />
|
||||
</div>
|
||||
<div class="draft-box">
|
||||
<div class="draft-menu">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-select v-model="speed" :placeholder="$t('display.replay.pleaseSelect')" @change="changeSpeed">
|
||||
<el-option
|
||||
v-for="item in optionsList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
size="mini"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-button type="primary" class="back btn" @click="play">{{ playName }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-progress class="progress" :percentage="progress" style="width: 100%" :show-text="false" />
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-button type="primary" class="back" @click="back">{{ $t('display.replay.back') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 回放界面 -->
|
||||
<script>
|
||||
import { Notification } from 'element-ui';
|
||||
// import { exitFullscreen } from '@/utils/screen';
|
||||
import { putsSimulationRecord, putsSimulationRecordPause, putsSimulationRecordPlay, putsSimulationRecordPlaySpeed, putsSimulationRecordplayTime } from '@/api/simulationRecord';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
|
||||
export default {
|
||||
name: 'MenuReplay',
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
offset: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isDisable: false,
|
||||
startLoading: false,
|
||||
speed: '1X',
|
||||
level: 1,
|
||||
isPlay: false,
|
||||
time: '',
|
||||
timeInterval: null,
|
||||
progress: 0,
|
||||
schedule: 0,
|
||||
optionsList: [
|
||||
{
|
||||
label: '1X',
|
||||
value: '1'
|
||||
},
|
||||
{
|
||||
label: '2X',
|
||||
value: '2'
|
||||
},
|
||||
{
|
||||
label: '4X',
|
||||
value: '4'
|
||||
},
|
||||
{
|
||||
label: '8X',
|
||||
value: '8'
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
playName() {
|
||||
return this.isPlay ? this.$t('display.replay.pause') : this.$t('display.replay.play');
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.map.mapViewLoadedCount': function() {
|
||||
this.isPlay = true;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
EventBus.$emit('showChat');
|
||||
this.time = (+new Date(this.$route.query.destroyTime) - +new Date(this.$route.query.createTime)) / 1000;
|
||||
this.timeIntervals();
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearInterval(this.timeInterval);
|
||||
this.timeInterval = null;
|
||||
},
|
||||
methods: {
|
||||
timeIntervals() {
|
||||
const timebili = 100 / this.time;
|
||||
if (!this.timeInterval) {
|
||||
this.timeInterval = setInterval(() => {
|
||||
if (this.isPlay) {
|
||||
this.progress += (this.level) * timebili;
|
||||
if (this.progress >= 100) {
|
||||
clearInterval(this.timeInterval);
|
||||
this.timeInterval = null;
|
||||
this.progress = 100;
|
||||
this.isPlay = false;
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
async play() {
|
||||
this.isPlay = !this.isPlay;
|
||||
if (this.isPlay) {
|
||||
if (this.progress >= 100) {
|
||||
this.progress = 0;
|
||||
this.timeIntervals();
|
||||
this.$refs.chatView.clearTextList();
|
||||
await putsSimulationRecordplayTime(this.$route.query.replayId, 0);
|
||||
} else {
|
||||
await putsSimulationRecordPlay(this.$route.query.replayId);
|
||||
}
|
||||
} else {
|
||||
await putsSimulationRecordPause(this.$route.query.replayId);
|
||||
}
|
||||
},
|
||||
async changeSpeed(val) {
|
||||
this.level = val;
|
||||
await putsSimulationRecordPlaySpeed(this.$route.query.replayId, val);
|
||||
},
|
||||
async back() {
|
||||
await putsSimulationRecord(this.$route.query.replayId);
|
||||
history.go(-1);
|
||||
Notification.closeAll();
|
||||
// exitFullscreen();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
.draft-box {
|
||||
position: absolute;
|
||||
display: inline;
|
||||
bottom: 10px;
|
||||
right: 0px;
|
||||
|
||||
.draft-menu {
|
||||
position: static;
|
||||
width: 800px;
|
||||
float: right;
|
||||
|
||||
.back {
|
||||
z-index: 100000;
|
||||
|
||||
/deep/ .el-button {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.progress {
|
||||
left: -30px;
|
||||
position: relative;
|
||||
top: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user