剧本录制调整
This commit is contained in:
parent
84562c94dc
commit
32f0006726
@ -27,8 +27,8 @@ import UserExam from '@/views/system/userExam/index';
|
||||
import UserSimulation from '@/views/system/userSimulation/index';
|
||||
import ExistingSimulation from '@/views/system/existingSimulation/index';
|
||||
import CacheControl from '@/views/system/cacheControl/index';
|
||||
import Trainingrecord from '@/views/system/trainingrecord/index';
|
||||
import TrainingrecordManage from '@/views/system/trainingrecord/trainingrecordmanage/index';
|
||||
// import Trainingrecord from '@/views/system/trainingrecord/index';
|
||||
// import TrainingrecordManage from '@/views/system/trainingrecord/trainingrecordmanage/index';
|
||||
import SystemGenerate from '@/views/system/systemGenerate/index';
|
||||
import IbpDraw from '@/views/system/ibpDraw/index';
|
||||
|
||||
@ -362,11 +362,11 @@ export const asyncRouter = [
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'lesson/training/:trainingId/:trainingName',
|
||||
component: TrainingrecordManage,
|
||||
hidden: true
|
||||
},
|
||||
// {
|
||||
// path: 'lesson/training/:trainingId/:trainingName',
|
||||
// component: TrainingrecordManage,
|
||||
// hidden: true
|
||||
// },
|
||||
{ // 地图预览
|
||||
path: 'mapPreview/:mapId',
|
||||
component: MapPreview,
|
||||
@ -817,23 +817,23 @@ export const asyncRouter = [
|
||||
i18n: 'router.productEdit'
|
||||
}
|
||||
},
|
||||
{
|
||||
// 实训录制
|
||||
path: 'record',
|
||||
redirect: 'record/training/0/null',
|
||||
component: Trainingrecord,
|
||||
meta: {
|
||||
i18n: 'router.trainingRecord'
|
||||
},
|
||||
hidden: !isDev,
|
||||
children: [
|
||||
{
|
||||
path: 'training/:trainingId/:trainingName',
|
||||
component: TrainingrecordManage,
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
},
|
||||
// {
|
||||
// // 实训录制
|
||||
// path: 'record',
|
||||
// redirect: 'record/training/0/null',
|
||||
// component: Trainingrecord,
|
||||
// meta: {
|
||||
// i18n: 'router.trainingRecord'
|
||||
// },
|
||||
// hidden: !isDev,
|
||||
// children: [
|
||||
// {
|
||||
// path: 'training/:trainingId/:trainingName',
|
||||
// component: TrainingrecordManage,
|
||||
// hidden: true
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
path: 'news',
|
||||
component: News,
|
||||
|
@ -36,6 +36,9 @@ const menuOperation = {
|
||||
},
|
||||
checkDialogIsOpen: (state) => (menu) => {
|
||||
return state.menu == menu;
|
||||
},
|
||||
selectedCount:(state)=>{
|
||||
return state.selectedCount;
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="mainContext">
|
||||
<map-common ref="mapCommon" />
|
||||
<map-common ref="mapCommon" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -11,125 +11,125 @@ import { creatSubscribe, clearSubscribe, displayTopic, screenTopic, planTopic }
|
||||
import { sendCommand } from '@/api/jmap/training';
|
||||
|
||||
export default {
|
||||
name: 'MapSystemDraft',
|
||||
components: {
|
||||
MapCommon
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
topic: '/user/queue/training',
|
||||
stomp: null,
|
||||
currentMap: null,
|
||||
mode: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
group() { return this.$route.query.group; }
|
||||
},
|
||||
watch: {
|
||||
'$store.state.map.mapViewLoadedCount': function (val) {
|
||||
this.subscribe();
|
||||
},
|
||||
'$store.state.socket.equipmentStatus': function (val) {
|
||||
if (val.length) {
|
||||
this.statusMessage(val);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.trainStationList': function (val) {
|
||||
if (val.length) {
|
||||
this.runFactMessage(val);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.simulationError': function (val) {
|
||||
if (val) {
|
||||
this.simulationError(val);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.simulationReset': function (val) {
|
||||
if (val) {
|
||||
this.simulationReset(val);
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
window.onbeforeunload = this.clearSubscribe;
|
||||
this.mode = this.$route.params.mode || '';
|
||||
this.currentMap = this.$refs.mapCommon;
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
this.$store.dispatch('config/resetCanvasOffset');
|
||||
}, 100);
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.clearSubscribe();
|
||||
},
|
||||
methods: {
|
||||
async mapViewLoaded(loading) {
|
||||
this.currentMap.mapViewLoaded(loading);
|
||||
},
|
||||
async statusMessage(list) {
|
||||
await this.$store.dispatch('training/updateMapState', list);
|
||||
await this.$store.dispatch('socket/setEquipmentStatus');
|
||||
},
|
||||
async runFactMessage(list) {
|
||||
await this.$store.dispatch('runPlan/updateRunPlanData', list);
|
||||
await this.$store.dispatch('socket/setTrainStationList');
|
||||
},
|
||||
async simulationError() {
|
||||
await this.$store.dispatch('map/clearJlmapTrainView');
|
||||
await this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
await this.$store.dispatch('socket/setSimulationError');
|
||||
await this.$store.dispatch('training/setMapDefaultState');
|
||||
this.clearSubscribe();
|
||||
this.$confirm(this.$t('tip.getMapStateDataException'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
showCancelButton: false,
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$emit('back');
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
async simulationReset() {
|
||||
await this.$store.dispatch('map/clearJlmapTrainView');
|
||||
await this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
await this.$store.dispatch('training/over');
|
||||
await this.$store.dispatch('socket/setSimulationReset');
|
||||
await this.$store.dispatch('socket/setSimulationStart');
|
||||
await this.$store.dispatch('training/setMapDefaultState');
|
||||
},
|
||||
async subscribe() {
|
||||
this.clearSubscribe();
|
||||
const header = { group: this.group || '', 'X-Token': handleToken() };
|
||||
name: 'MapSystemDraft',
|
||||
components: {
|
||||
MapCommon
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
topic: '/user/queue/training',
|
||||
stomp: null,
|
||||
currentMap: null,
|
||||
mode: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
group() { return this.$route.query.group; }
|
||||
},
|
||||
watch: {
|
||||
'$store.state.map.mapViewLoadedCount': function (val) {
|
||||
this.subscribe();
|
||||
},
|
||||
'$store.state.socket.equipmentStatus': function (val) {
|
||||
if (val.length) {
|
||||
this.statusMessage(val);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.trainStationList': function (val) {
|
||||
if (val.length) {
|
||||
this.runFactMessage(val);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.simulationError': function (val) {
|
||||
if (val) {
|
||||
this.simulationError(val);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.simulationReset': function (val) {
|
||||
if (val) {
|
||||
this.simulationReset(val);
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
window.onbeforeunload = this.clearSubscribe;
|
||||
this.mode = this.$route.params.mode || '';
|
||||
this.currentMap = this.$refs.mapCommon;
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
this.$store.dispatch('config/resetCanvasOffset');
|
||||
}, 100);
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.clearSubscribe();
|
||||
},
|
||||
methods: {
|
||||
async mapViewLoaded(loading) {
|
||||
this.currentMap.mapViewLoaded(loading);
|
||||
},
|
||||
async statusMessage(list) {
|
||||
await this.$store.dispatch('training/updateMapState', list);
|
||||
await this.$store.dispatch('socket/setEquipmentStatus');
|
||||
},
|
||||
async runFactMessage(list) {
|
||||
await this.$store.dispatch('runPlan/updateRunPlanData', list);
|
||||
await this.$store.dispatch('socket/setTrainStationList');
|
||||
},
|
||||
async simulationError() {
|
||||
await this.$store.dispatch('map/clearJlmapTrainView');
|
||||
await this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
await this.$store.dispatch('socket/setSimulationError');
|
||||
await this.$store.dispatch('training/setMapDefaultState');
|
||||
this.clearSubscribe();
|
||||
this.$confirm(this.$t('tip.getMapStateDataException'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
showCancelButton: false,
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$emit('back');
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
async simulationReset() {
|
||||
await this.$store.dispatch('map/clearJlmapTrainView');
|
||||
await this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
await this.$store.dispatch('training/over');
|
||||
await this.$store.dispatch('socket/setSimulationReset');
|
||||
await this.$store.dispatch('socket/setSimulationStart');
|
||||
await this.$store.dispatch('training/setMapDefaultState');
|
||||
},
|
||||
async subscribe() {
|
||||
this.clearSubscribe();
|
||||
const header = { group: this.group || '', 'X-Token': handleToken() };
|
||||
|
||||
if (this.mode === 'dp') {
|
||||
creatSubscribe(screenTopic, header);
|
||||
} else if (this.mode === 'plan') {
|
||||
creatSubscribe(planTopic, header);
|
||||
} else {
|
||||
creatSubscribe(displayTopic, header);
|
||||
}
|
||||
if (this.mode === 'dp') {
|
||||
creatSubscribe(screenTopic, header);
|
||||
} else if (this.mode === 'plan') {
|
||||
creatSubscribe(planTopic, header);
|
||||
} else {
|
||||
creatSubscribe(displayTopic, header);
|
||||
}
|
||||
|
||||
await this.$store.dispatch('training/setHasSubscribed');
|
||||
},
|
||||
clearSubscribe() {
|
||||
if (this.mode === 'dp') {
|
||||
clearSubscribe(screenTopic);
|
||||
} else if (this.mode === 'plan') {
|
||||
clearSubscribe(planTopic);
|
||||
} else {
|
||||
clearSubscribe(displayTopic);
|
||||
}
|
||||
},
|
||||
sendDeviceChangeEvent(data, header) {
|
||||
// 发送设备操作事件到服务器
|
||||
sendCommand('', data).then(response => {
|
||||
}).catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
}
|
||||
await this.$store.dispatch('training/setHasSubscribed');
|
||||
},
|
||||
clearSubscribe() {
|
||||
if (this.mode === 'dp') {
|
||||
clearSubscribe(screenTopic);
|
||||
} else if (this.mode === 'plan') {
|
||||
clearSubscribe(planTopic);
|
||||
} else {
|
||||
clearSubscribe(displayTopic);
|
||||
}
|
||||
},
|
||||
sendDeviceChangeEvent(data, header) {
|
||||
// 发送设备操作事件到服务器
|
||||
sendCommand('', data).then(response => {
|
||||
}).catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -62,9 +62,10 @@ export default {
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.selected':function(em) {
|
||||
if (em.code) {
|
||||
this.deviceSelect(em);
|
||||
'$store.state.menuOperation.selectedCount':function(em) {
|
||||
const device = this.$store.state.menuOperation.selected;
|
||||
if (device.code) {
|
||||
this.deviceSelect(device);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user