2019-12-26 11:01:54 +08:00
|
|
|
<template>
|
2019-12-30 14:06:42 +08:00
|
|
|
<div class="main" :style="{width: canvasWidth+'px'}">
|
2020-07-14 18:14:39 +08:00
|
|
|
<template v-show="panelShow" :panelShow="panelShow">
|
2019-12-26 11:01:54 +08:00
|
|
|
<transition name="el-zoom-in-bottom">
|
|
|
|
<map-system-draft ref="mapCanvas" @back="back" />
|
|
|
|
</transition>
|
2020-05-22 18:41:23 +08:00
|
|
|
<status-icon v-if="$route.query.lineCode == '11' || $route.query.lineCode == '10'" ref="statusIcon" />
|
2020-06-29 15:55:31 +08:00
|
|
|
<menu-demon
|
|
|
|
v-if="isDemon"
|
|
|
|
ref="menuDemon"
|
2020-04-02 14:46:21 +08:00
|
|
|
:offset="offset"
|
|
|
|
:offset-bottom="offsetBottom"
|
2020-06-29 15:55:31 +08:00
|
|
|
:data-error="dataError"
|
|
|
|
:script-id="scriptId"
|
|
|
|
@hidepanel="hidepanel"
|
|
|
|
@passflow="passflow"
|
2020-06-29 17:33:19 +08:00
|
|
|
@quitQuest="quitQuest"
|
2020-06-29 15:55:31 +08:00
|
|
|
@jl3dstation="jl3dstation"
|
|
|
|
@devicemodel="devicemodel"
|
|
|
|
@showScheduling="showScheduling"
|
2020-04-02 14:46:21 +08:00
|
|
|
/>
|
|
|
|
<menu-lesson
|
|
|
|
v-if="isLesson"
|
|
|
|
ref="lessonMenu"
|
|
|
|
:offset="offset"
|
2020-05-09 20:24:59 +08:00
|
|
|
:data-error="dataError"
|
2020-04-02 14:46:21 +08:00
|
|
|
:offset-bottom="offsetBottom"
|
2020-06-24 17:37:09 +08:00
|
|
|
:tip-bottom="tipBottom"
|
2020-04-02 14:46:21 +08:00
|
|
|
:show-station="showStation"
|
2020-07-24 11:01:22 +08:00
|
|
|
:station-list="stationListMode"
|
2020-04-02 14:46:21 +08:00
|
|
|
:show-select-station="showSelectStation"
|
|
|
|
@switchStationMode="switchStationMode"
|
|
|
|
/>
|
2020-06-29 15:55:31 +08:00
|
|
|
<menu-exam
|
|
|
|
v-if="isExam"
|
|
|
|
ref="menuExam"
|
2019-12-26 11:01:54 +08:00
|
|
|
:offset="offset"
|
2020-05-09 20:24:59 +08:00
|
|
|
:data-error="dataError"
|
2020-03-31 09:27:02 +08:00
|
|
|
:offset-bottom="offsetBottom"
|
2020-04-09 17:37:27 +08:00
|
|
|
:show-station="showStation"
|
2020-07-24 11:01:22 +08:00
|
|
|
:station-list="stationListMode"
|
2020-06-29 15:55:31 +08:00
|
|
|
:show-select-station="showSelectStation"
|
|
|
|
@switchStationMode="switchStationMode"
|
2019-12-26 11:01:54 +08:00
|
|
|
/>
|
|
|
|
|
2020-06-29 15:55:31 +08:00
|
|
|
<menu-schema
|
2020-07-10 17:23:17 +08:00
|
|
|
v-if="isDemon || isScript"
|
2020-06-29 15:55:31 +08:00
|
|
|
ref="menuSchema"
|
2020-05-27 14:45:32 +08:00
|
|
|
:offset="offset"
|
2020-06-29 15:55:31 +08:00
|
|
|
:data-error="dataError"
|
2020-05-27 14:45:32 +08:00
|
|
|
:offset-bottom="offsetBottom"
|
|
|
|
:show-station="showStation"
|
2020-07-24 11:01:22 +08:00
|
|
|
:station-list="stationListMode"
|
2020-05-27 14:45:32 +08:00
|
|
|
:show-select-station="showSelectStation"
|
|
|
|
@switchMode="switchMode"
|
2020-06-29 15:55:31 +08:00
|
|
|
@selectQuest="selectQuest"
|
2020-05-27 14:45:32 +08:00
|
|
|
@switchStationMode="switchStationMode"
|
|
|
|
/>
|
|
|
|
|
2020-06-29 15:55:31 +08:00
|
|
|
<menu-script v-if="isScript" ref="menuScript" :offset-bottom="offsetBottom" :data-error="dataError" @script3ddriveshow="script3ddriveshow" />
|
2020-03-31 19:06:23 +08:00
|
|
|
|
2020-06-29 15:55:31 +08:00
|
|
|
<menu-practice
|
|
|
|
v-if="isPractice"
|
|
|
|
ref="menuPractice"
|
2019-12-26 11:01:54 +08:00
|
|
|
:offset="offset"
|
2020-03-30 16:15:35 +08:00
|
|
|
:offset-bottom="offsetBottom"
|
2020-03-25 15:22:52 +08:00
|
|
|
:show-station="showStation"
|
2020-07-24 11:01:22 +08:00
|
|
|
:station-list="stationListMode"
|
2020-03-25 15:22:52 +08:00
|
|
|
:show-select-station="showSelectStation"
|
2020-06-29 15:55:31 +08:00
|
|
|
:data-error="dataError"
|
2019-12-26 11:01:54 +08:00
|
|
|
@switchMode="switchMode"
|
2020-03-25 15:22:52 +08:00
|
|
|
@switchStationMode="switchStationMode"
|
2019-12-26 11:01:54 +08:00
|
|
|
/>
|
|
|
|
|
2020-06-29 15:55:31 +08:00
|
|
|
<menu-train-list v-if="isDemon" @setCenter="setCenter" />
|
|
|
|
|
2020-07-28 11:29:39 +08:00
|
|
|
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" />
|
2020-07-14 18:14:39 +08:00
|
|
|
</template>
|
2020-05-11 10:13:54 +08:00
|
|
|
<Jl3d-Device
|
|
|
|
v-if="deviceShow"
|
|
|
|
ref="Jl3dDevice"
|
|
|
|
:panel-show="deviceShow"
|
|
|
|
@closedevice3dview="devicemodel"
|
|
|
|
/>
|
|
|
|
|
2020-06-29 15:55:31 +08:00
|
|
|
<!-- <Jl3d-Simulation v-show="simulationShow" ref="Jl3dSimulation" :panel-show="simulationShow" @showpanel="showpanel" /> -->
|
2019-12-26 11:01:54 +08:00
|
|
|
<Jl3d-Drive v-show="drivingShow" ref="Jl3dDrive" :panel-show="drivingShow" @showdriving="showdriving" />
|
|
|
|
|
|
|
|
<scheduling v-if="isShowScheduling" ref="scheduling" :group="group" />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import MapSystemDraft from '@/views/newMap/mapsystemNew/index';
|
2020-06-29 15:55:31 +08:00
|
|
|
import MenuDemon from '@/views/newMap/displayNew/menuDemon';
|
|
|
|
import StatusIcon from '@/views/components/StatusIcon/statusIcon';
|
2019-12-30 09:00:16 +08:00
|
|
|
import MenuExam from '@/views/newMap/displayNew/menuExam';
|
|
|
|
import MenuLesson from '@/views/newMap/displayNew/menuLesson';
|
|
|
|
import MenuSchema from '@/views/newMap/displayNew/menuSchema';
|
|
|
|
import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime';
|
2020-06-29 15:55:31 +08:00
|
|
|
import MenuTrainList from '@/views/newMap/displayNew/menuTrainList';
|
2019-12-30 09:00:16 +08:00
|
|
|
import MenuScript from '@/views/newMap/displayNew/menuScript';
|
2020-05-27 14:45:32 +08:00
|
|
|
import MenuPractice from '@/views/newMap/displayNew/menuPractice';
|
2019-12-26 11:01:54 +08:00
|
|
|
// 三维
|
|
|
|
// import Jl3dSimulation from '@/views/jlmap3d/simulation/jl3dsimulation';
|
|
|
|
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
|
|
|
|
import Jl3dDevice from '@/views/jlmap3d/device/jl3ddevice';
|
2020-06-29 15:55:31 +08:00
|
|
|
import Scheduling from './demon/scheduling';
|
2020-07-25 15:07:45 +08:00
|
|
|
import { clearSimulation, getSimulationInfoNew, getSimulationMemberList } from '@/api/simulation';
|
2020-06-29 15:55:31 +08:00
|
|
|
import { getTrainingDetailNew } from '@/api/jmap/training';
|
|
|
|
import { mapGetters } from 'vuex';
|
|
|
|
import { EventBus } from '@/scripts/event-bus';
|
|
|
|
import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
|
2019-12-26 11:01:54 +08:00
|
|
|
import { getToken } from '@/utils/auth';
|
2020-06-29 15:55:31 +08:00
|
|
|
import { loadNewMapDataByGroup } from '@/utils/loaddata';
|
2020-02-24 17:04:39 +08:00
|
|
|
import { timeFormat } from '@/utils/date';
|
2020-06-29 15:55:31 +08:00
|
|
|
import { getSessionStorage } from '@/utils/auth';
|
|
|
|
|
2019-12-26 11:01:54 +08:00
|
|
|
export default {
|
|
|
|
name: 'DisplayDraft',
|
|
|
|
components: {
|
|
|
|
MapSystemDraft,
|
|
|
|
MenuDemon,
|
2020-06-29 15:55:31 +08:00
|
|
|
StatusIcon,
|
2019-12-26 11:01:54 +08:00
|
|
|
MenuSystemTime,
|
2020-06-29 15:55:31 +08:00
|
|
|
MenuExam,
|
|
|
|
MenuLesson,
|
|
|
|
MenuSchema,
|
2020-03-31 19:06:23 +08:00
|
|
|
MenuTrainList,
|
2020-06-29 15:55:31 +08:00
|
|
|
MenuScript,
|
2020-05-27 14:45:32 +08:00
|
|
|
MenuPractice,
|
2019-12-26 11:01:54 +08:00
|
|
|
// Jl3dSimulation,
|
|
|
|
Jl3dDrive,
|
|
|
|
Jl3dDevice,
|
2020-06-29 15:55:31 +08:00
|
|
|
Scheduling
|
2019-12-26 11:01:54 +08:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2020-06-29 15:55:31 +08:00
|
|
|
panelShow: true,
|
|
|
|
drivingShow: false,
|
|
|
|
deviceShow: false,
|
|
|
|
// simulationShow: false,
|
2019-12-26 11:01:54 +08:00
|
|
|
offset: 15,
|
2020-03-30 16:15:35 +08:00
|
|
|
offsetBottom: 15,
|
2020-06-24 17:37:09 +08:00
|
|
|
tipBottom: 0,
|
2020-06-29 15:55:31 +08:00
|
|
|
scriptId:0,
|
|
|
|
dataError: false,
|
|
|
|
group:'',
|
2020-03-25 15:22:52 +08:00
|
|
|
showStation: '',
|
2020-07-24 11:01:22 +08:00
|
|
|
stationListMode: [],
|
2020-04-07 14:40:24 +08:00
|
|
|
showSelectStation: false, // 是否展示现地选择设备集中站select
|
2019-12-26 11:01:54 +08:00
|
|
|
prdTypeMap: {
|
|
|
|
'01': '01', // 现地 => 现地
|
|
|
|
'02': '02', // 行调 => 行调
|
|
|
|
'04': '02', // 司机 => 行调
|
|
|
|
'05': '' // 派班 => null
|
2020-05-09 19:24:12 +08:00
|
|
|
},
|
2020-06-01 11:21:10 +08:00
|
|
|
planRunning:false
|
2019-12-26 11:01:54 +08:00
|
|
|
};
|
|
|
|
},
|
2020-06-29 15:55:31 +08:00
|
|
|
computed:{
|
2019-12-26 11:01:54 +08:00
|
|
|
...mapGetters([
|
|
|
|
'canvasWidth'
|
2020-07-29 18:26:58 +08:00
|
|
|
]),
|
|
|
|
...mapGetters('map', [
|
|
|
|
'map',
|
|
|
|
'stationList'
|
|
|
|
]),
|
|
|
|
// ...mapGetters('training', [
|
2020-07-27 18:04:47 +08:00
|
|
|
// 'offsetStationCode'
|
|
|
|
// ]),
|
2020-06-29 15:55:31 +08:00
|
|
|
mode() {
|
|
|
|
return this.$route.params.mode;
|
|
|
|
},
|
|
|
|
isDemon() {
|
|
|
|
return this.mode === 'demon';
|
|
|
|
},
|
|
|
|
isExam() {
|
|
|
|
return this.mode === 'exam';
|
|
|
|
},
|
|
|
|
isLesson() {
|
|
|
|
return (this.mode === 'teach' || this.mode === 'manage');
|
|
|
|
},
|
|
|
|
isScript() {
|
|
|
|
return this.mode === 'script';
|
|
|
|
},
|
2019-12-26 11:01:54 +08:00
|
|
|
width() {
|
|
|
|
return this.$store.state.app.width;
|
|
|
|
},
|
|
|
|
height() {
|
|
|
|
return this.$store.state.app.height;
|
|
|
|
},
|
|
|
|
mapId() {
|
|
|
|
return this.$route.query.mapId;
|
|
|
|
},
|
|
|
|
prdType() {
|
|
|
|
return this.$route.query.prdType;
|
|
|
|
},
|
2020-06-29 15:55:31 +08:00
|
|
|
project() {
|
|
|
|
return getSessionStorage('project');
|
2019-12-26 11:01:54 +08:00
|
|
|
},
|
2020-06-29 15:55:31 +08:00
|
|
|
isShowScheduling() {
|
|
|
|
return this.$route.query.prdType == '05';
|
2019-12-26 11:01:54 +08:00
|
|
|
},
|
2020-05-27 14:45:32 +08:00
|
|
|
isPractice() {
|
|
|
|
return this.mode === 'practice';
|
|
|
|
},
|
2019-12-26 11:01:54 +08:00
|
|
|
isDrive() {
|
|
|
|
return this.prdType == '04';
|
|
|
|
},
|
2020-06-29 15:55:31 +08:00
|
|
|
trainingId() {
|
|
|
|
return this.$route.query.trainingId;
|
2019-12-26 11:01:54 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
'$store.state.config.menuBarLoadedCount': function (val) {
|
|
|
|
this.setPosition();
|
|
|
|
},
|
2020-07-27 17:26:32 +08:00
|
|
|
'$store.state.training.prdType': function (val) { // 根据权限类型计算高度
|
|
|
|
this.setPosition();
|
|
|
|
this.setMode();
|
2020-03-20 17:56:20 +08:00
|
|
|
},
|
2019-12-26 11:01:54 +08:00
|
|
|
'$store.state.app.windowSizeCount': function() {
|
2020-07-29 18:26:58 +08:00
|
|
|
this.setWindowSize();
|
|
|
|
this.setPosition();
|
2019-12-26 11:01:54 +08:00
|
|
|
},
|
|
|
|
$route() {
|
2020-07-23 17:57:36 +08:00
|
|
|
this.initLoadData();
|
2020-03-25 15:22:52 +08:00
|
|
|
},
|
2020-06-29 15:55:31 +08:00
|
|
|
'$store.state.training.centerStationCode': function(code) {
|
|
|
|
if (code) {
|
|
|
|
this.showStation = code;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'$store.state.socket.permissionOver': function () {
|
|
|
|
this.$alert('用户权限已被收回', '提示', {
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
callback: action => {
|
|
|
|
this.back();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
2020-07-24 11:01:22 +08:00
|
|
|
'stationList': function () {
|
2020-07-29 18:26:58 +08:00
|
|
|
!this.isExam && !this.isLesson && this.setStationList();
|
2020-07-27 17:26:32 +08:00
|
|
|
},
|
2020-06-29 15:55:31 +08:00
|
|
|
'$store.state.map.mapViewLoadedCount': function (val) { // 地图视图加载完成标识 开始加载默认状态
|
|
|
|
if (this.planRunning) {
|
|
|
|
this.$store.dispatch('training/simulationStart');
|
|
|
|
}
|
2020-07-29 18:26:58 +08:00
|
|
|
this.isExam && this.$store.state.exam.deviceCode && this.setCenter(this.$store.state.exam.deviceCode);
|
|
|
|
!this.isExam && !this.isLesson && this.switchStationMode(this.showStation);
|
2019-12-26 11:01:54 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
async mounted() {
|
2020-06-29 15:55:31 +08:00
|
|
|
this.group = this.$route.query.group;
|
2020-07-27 18:04:47 +08:00
|
|
|
this.setWindowSize();
|
2020-07-29 18:26:58 +08:00
|
|
|
await this.initLoadData();
|
|
|
|
this.setMode();
|
2019-12-26 11:01:54 +08:00
|
|
|
},
|
2020-06-19 18:58:55 +08:00
|
|
|
beforeDestroy() {
|
2020-06-29 15:55:31 +08:00
|
|
|
this.quit(this.group);
|
2020-06-19 18:58:55 +08:00
|
|
|
this.$store.dispatch('training/reset');
|
|
|
|
this.$store.dispatch('map/mapClear');
|
2019-12-26 11:01:54 +08:00
|
|
|
},
|
2020-06-29 15:55:31 +08:00
|
|
|
methods:{
|
2020-07-23 17:57:36 +08:00
|
|
|
// 加载地图数据
|
2020-07-23 17:09:29 +08:00
|
|
|
async initLoadData() {
|
|
|
|
this.$store.dispatch('training/reset');
|
|
|
|
try {
|
|
|
|
await this.loadSimulationInfo();
|
|
|
|
if (this.isDemon) {
|
|
|
|
await this.initLoadDemonData();
|
|
|
|
} else if (this.isScript) {
|
|
|
|
await this.initLoadScriptData();
|
|
|
|
} else if (this.isPractice) {
|
|
|
|
await this.initPracticeData();
|
|
|
|
} else {
|
|
|
|
await this.initLoadLessonOrExamData();
|
|
|
|
}
|
|
|
|
} catch (error) {
|
|
|
|
this.$messageBox(`初始化失败: ${error.message}`);
|
|
|
|
this.endViewLoading();
|
|
|
|
}
|
|
|
|
},
|
2020-06-29 15:55:31 +08:00
|
|
|
// 仿真错误时,被动退出时调用
|
|
|
|
async back() {
|
|
|
|
if (this.isExam) {
|
|
|
|
await this.$refs.menuExam.back();
|
|
|
|
} else if (this.isLesson) {
|
|
|
|
await this.$refs.lessonMenu.back();
|
|
|
|
} else if (this.isDemon) {
|
|
|
|
await this.$refs.menuDemon.back();
|
|
|
|
} else if (this.isScript) {
|
|
|
|
await this.$refs.menuScript.back();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
// 销毁仿真
|
|
|
|
quit(group) {
|
|
|
|
clearSimulation(group);
|
|
|
|
this.$store.dispatch('training/over');
|
|
|
|
},
|
|
|
|
// 缩放设置
|
|
|
|
setWindowSize() {
|
|
|
|
const width = this.width;
|
2020-07-29 18:26:58 +08:00
|
|
|
const height = this.height;
|
2020-06-29 15:55:31 +08:00
|
|
|
this.$store.dispatch('config/resize', { width, height });
|
2020-07-27 18:04:47 +08:00
|
|
|
// this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });
|
2019-12-26 11:01:54 +08:00
|
|
|
},
|
2020-06-29 15:55:31 +08:00
|
|
|
// 任务录制系统
|
|
|
|
async initLoadScriptData() {
|
|
|
|
this.$store.dispatch('training/end', TrainingMode.NORMAL);
|
|
|
|
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式
|
|
|
|
this.switchMode('01');
|
|
|
|
|
2020-07-10 18:41:29 +08:00
|
|
|
if (this.mapId) {
|
2020-06-29 15:55:31 +08:00
|
|
|
await this.loadNewMapDataByGroup(this.group);
|
|
|
|
} else {
|
|
|
|
this.endViewLoading();
|
|
|
|
}
|
|
|
|
},
|
2020-06-29 17:33:19 +08:00
|
|
|
script3ddriveshow() {
|
|
|
|
this.panelShow = false;
|
|
|
|
this.drivingShow = true;
|
|
|
|
this.$refs.Jl3dDrive.show(this.mapId, this.group);
|
|
|
|
},
|
2019-12-26 11:01:54 +08:00
|
|
|
// 课程和考试系统
|
|
|
|
async initLoadLessonOrExamData() {
|
|
|
|
this.$store.dispatch('training/end', null);
|
|
|
|
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式
|
|
|
|
|
|
|
|
if (parseInt(this.trainingId)) {
|
|
|
|
// 设置地图数据
|
|
|
|
// 设置实训数据
|
2020-03-26 18:42:01 +08:00
|
|
|
const resp = await getTrainingDetailNew(this.trainingId);
|
2019-12-26 11:01:54 +08:00
|
|
|
if (resp && resp.code == 200) {
|
|
|
|
const detail = resp.data;
|
2019-12-30 18:45:05 +08:00
|
|
|
await this.$store.dispatch('training/setPrdType', this.prdTypeMap[detail.prdType]);
|
2020-03-27 13:52:14 +08:00
|
|
|
await this.loadNewMapDataByGroup(this.group);
|
2019-12-26 11:01:54 +08:00
|
|
|
} else {
|
|
|
|
this.$messageBox(`获取实训步骤数据失败`);
|
|
|
|
this.endViewLoading();
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
this.endViewLoading();
|
|
|
|
}
|
|
|
|
},
|
2020-06-29 15:55:31 +08:00
|
|
|
// 加载实操地图数据
|
|
|
|
async initPracticeData() {
|
2019-12-26 11:01:54 +08:00
|
|
|
this.$store.dispatch('training/end', TrainingMode.NORMAL);
|
|
|
|
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式
|
2020-06-29 15:55:31 +08:00
|
|
|
this.switchMode('01');
|
2019-12-26 11:01:54 +08:00
|
|
|
|
|
|
|
if (parseInt(this.mapId)) {
|
2019-12-30 09:00:16 +08:00
|
|
|
await this.loadNewMapDataByGroup(this.group);
|
2019-12-26 11:01:54 +08:00
|
|
|
} else {
|
|
|
|
this.endViewLoading();
|
|
|
|
}
|
|
|
|
},
|
2020-06-29 15:55:31 +08:00
|
|
|
// 加载仿真信息
|
|
|
|
async loadSimulationInfo() {
|
2020-07-25 15:07:45 +08:00
|
|
|
// 单人仿真获取人员列表
|
|
|
|
getSimulationMemberList(this.$route.query.group).then(resp => {
|
|
|
|
this.$store.dispatch('training/setMemberList', {memberList:resp.data, userId: this.$store.state.user.id});
|
|
|
|
}).catch(() => {
|
|
|
|
this.$messageBox('获取仿真成员列表失败!');
|
|
|
|
});
|
2020-06-29 15:55:31 +08:00
|
|
|
const resp = await getSimulationInfoNew(this.group);
|
|
|
|
if (resp && resp.code == 200 && resp.data && !resp.data.dataError) {
|
2020-07-23 17:57:36 +08:00
|
|
|
this.dataError = false;
|
2020-06-29 15:55:31 +08:00
|
|
|
this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause);
|
|
|
|
this.scriptId = Number(resp.data.scriptId) || 0;
|
|
|
|
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`));
|
|
|
|
this.planRunning = resp.data.planRunning;
|
2020-07-09 17:39:43 +08:00
|
|
|
this.$store.dispatch('map/setRunPlanStatus', this.planRunning);
|
2020-06-29 15:55:31 +08:00
|
|
|
if (!resp.data.planRunning) {
|
|
|
|
this.$store.dispatch('training/over');
|
|
|
|
}
|
|
|
|
if (this.isDemon) {
|
|
|
|
this.$refs.menuDemon.initPlannedDriving(resp.data.planRunning);
|
|
|
|
} else if (this.isScript) {
|
|
|
|
// this.$refs.menuScript.initPlannedDriving(resp.data.planRunning);
|
|
|
|
}
|
|
|
|
} else if (resp && resp.code == 200 && resp.data && resp.data.dataError) {
|
|
|
|
this.dataError = true;
|
|
|
|
this.$messageBox('此地图数据正在维护中,无法运行!');
|
2019-12-26 11:01:54 +08:00
|
|
|
}
|
|
|
|
},
|
2020-06-29 15:55:31 +08:00
|
|
|
// 结束加载状态
|
|
|
|
endViewLoading(isSuccess) {
|
|
|
|
if (!isSuccess) {
|
|
|
|
this.$store.dispatch('map/mapClear');
|
|
|
|
}
|
|
|
|
this.$nextTick(() => {
|
|
|
|
EventBus.$emit('viewLoading', false);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
switchMode(prdType) {
|
2020-07-24 11:01:22 +08:00
|
|
|
this.$store.dispatch('training/setPrdType', prdType); // 改变prdType
|
2020-07-27 17:26:32 +08:00
|
|
|
},
|
|
|
|
setMode() {
|
|
|
|
if (this.map) {
|
|
|
|
this.showSelectStation = this.map.skinVO.code === '06' && this.$store.state.training.prdType === '01';
|
|
|
|
}
|
|
|
|
},
|
2020-06-29 15:55:31 +08:00
|
|
|
// 选择脚本
|
2020-06-29 17:33:19 +08:00
|
|
|
selectQuest(row) {
|
|
|
|
this.scriptId = parseInt(row.id);
|
2020-06-29 15:55:31 +08:00
|
|
|
if (this.isDemon) {
|
|
|
|
this.$refs.menuDemon.initLoadPage();
|
|
|
|
}
|
|
|
|
if (this.isScript) {
|
|
|
|
this.$refs.menuScript.initLoadPage();
|
2019-12-26 11:01:54 +08:00
|
|
|
}
|
|
|
|
},
|
2020-06-29 15:55:31 +08:00
|
|
|
// 仿真系统
|
|
|
|
async initLoadDemonData() {
|
|
|
|
this.$store.dispatch('training/end', TrainingMode.NORMAL);
|
|
|
|
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式
|
|
|
|
this.$store.dispatch('training/setPrdType', this.prdTypeMap[this.prdType]);
|
|
|
|
if (parseInt(this.mapId)) {
|
|
|
|
await this.loadNewMapDataByGroup(this.group);
|
|
|
|
} else {
|
|
|
|
this.endViewLoading();
|
|
|
|
}
|
2019-12-26 11:01:54 +08:00
|
|
|
},
|
2020-06-29 15:55:31 +08:00
|
|
|
// 通过group加载地图数据
|
2019-12-30 09:00:16 +08:00
|
|
|
async loadNewMapDataByGroup(group) {
|
2019-12-26 11:01:54 +08:00
|
|
|
try {
|
2019-12-30 09:00:16 +08:00
|
|
|
await loadNewMapDataByGroup(group);
|
2019-12-26 11:01:54 +08:00
|
|
|
await this.$store.dispatch('training/setMapDefaultState');
|
|
|
|
} catch (error) {
|
|
|
|
this.$messageBox(`获取地图数据失败: ${error.message}`);
|
|
|
|
this.endViewLoading();
|
|
|
|
}
|
|
|
|
},
|
2020-06-29 17:33:19 +08:00
|
|
|
// 退出脚本
|
|
|
|
async quitQuest() {
|
|
|
|
this.scriptId = 0;
|
|
|
|
},
|
2019-12-26 11:01:54 +08:00
|
|
|
hidepanel() {
|
|
|
|
if (this.isDrive) {
|
|
|
|
this.panelShow = false;
|
|
|
|
this.drivingShow = true;
|
|
|
|
this.$refs.Jl3dDrive.show(this.mapId, this.group);
|
|
|
|
} else {
|
|
|
|
const routeData = this.$router.resolve({
|
|
|
|
path:'/jlmap3d/sandbox',
|
|
|
|
query:{
|
|
|
|
mapid:this.mapId,
|
|
|
|
group:this.group,
|
2020-01-14 16:19:36 +08:00
|
|
|
token:getToken(),
|
2020-07-22 14:19:58 +08:00
|
|
|
project: this.project,
|
|
|
|
noPreLogout: true
|
2019-12-26 11:01:54 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
window.open(routeData.href, '_blank', 'noopener noreferrer');
|
|
|
|
}
|
|
|
|
},
|
2020-04-01 12:53:58 +08:00
|
|
|
passflow() {
|
|
|
|
const routeData = this.$router.resolve({
|
|
|
|
path:'/jlmap3d/passengerflow',
|
|
|
|
query:{
|
2020-04-01 16:24:03 +08:00
|
|
|
mapid:this.mapId,
|
2020-06-02 16:57:38 +08:00
|
|
|
group:this.group,
|
2020-07-22 14:19:58 +08:00
|
|
|
project: this.project,
|
|
|
|
noPreLogout: true
|
2020-04-01 12:53:58 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
window.open(routeData.href, '_blank', 'noopener noreferrer');
|
2020-02-14 18:22:11 +08:00
|
|
|
},
|
2020-06-29 15:55:31 +08:00
|
|
|
devicemodel() {
|
|
|
|
if (this.deviceShow == false) {
|
|
|
|
this.deviceShow = true;
|
|
|
|
} else {
|
|
|
|
this.deviceShow = false;
|
|
|
|
}
|
|
|
|
},
|
2020-04-27 18:33:29 +08:00
|
|
|
jl3dstation() {
|
|
|
|
const routeData = this.$router.resolve({
|
|
|
|
path:'/jlmap3d/jl3dstation',
|
|
|
|
query:{
|
|
|
|
mapid:this.mapId,
|
2020-07-22 14:19:58 +08:00
|
|
|
project: this.project,
|
|
|
|
noPreLogout: true
|
2020-04-27 18:33:29 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
window.open(routeData.href, '_blank', 'noopener noreferrer');
|
2020-04-24 18:00:12 +08:00
|
|
|
},
|
2019-12-26 11:01:54 +08:00
|
|
|
showScheduling() {
|
|
|
|
this.$refs.scheduling.doShow();
|
|
|
|
},
|
|
|
|
showdriving() {
|
|
|
|
this.panelShow = true;
|
|
|
|
this.drivingShow = false;
|
|
|
|
},
|
2020-06-29 15:55:31 +08:00
|
|
|
// showpanel() {
|
|
|
|
// this.panelShow = true;
|
|
|
|
// this.simulationShow = false;
|
|
|
|
// }
|
|
|
|
setPosition() {
|
|
|
|
this.$nextTick(() => {
|
2020-07-29 18:26:58 +08:00
|
|
|
this.offset = 10;
|
|
|
|
this.offsetBottom = 15;
|
2020-06-29 15:55:31 +08:00
|
|
|
const menuBar = document.getElementById('menuBar');
|
|
|
|
const menuTool = document.getElementById('menuTool');
|
|
|
|
const menuBottom = document.getElementById('menuButton');
|
|
|
|
const menuButtonsBox = document.getElementById('menuButtons_box');
|
|
|
|
if (menuBar) {
|
2020-07-28 11:29:39 +08:00
|
|
|
this.offset = (menuBar.offsetHeight || 0) + 15;
|
2020-06-29 15:55:31 +08:00
|
|
|
}
|
|
|
|
if (menuTool) {
|
2020-07-28 11:29:39 +08:00
|
|
|
this.offset = (menuTool.offsetHeight || 0) + 15;
|
2020-07-22 14:19:58 +08:00
|
|
|
}
|
2020-07-28 17:55:07 +08:00
|
|
|
const buttonWidth = this.width - 1200; // B box widht
|
|
|
|
if (menuBottom && buttonWidth < 780) {
|
2020-07-28 11:29:39 +08:00
|
|
|
this.offsetBottom = (menuBottom.offsetHeight || 0) + 15;
|
2020-06-29 15:55:31 +08:00
|
|
|
}
|
|
|
|
if (menuButtonsBox) {
|
2020-07-24 11:01:22 +08:00
|
|
|
this.tipBottom = (menuButtonsBox.offsetHeight || 0) + 15;
|
2020-06-29 15:55:31 +08:00
|
|
|
}
|
|
|
|
});
|
2019-12-31 13:15:28 +08:00
|
|
|
},
|
2020-06-29 15:55:31 +08:00
|
|
|
setCenter(code) {
|
2020-07-27 17:26:32 +08:00
|
|
|
this.$jlmap.setCenter(code);
|
2020-03-25 15:22:52 +08:00
|
|
|
},
|
2020-04-07 14:40:24 +08:00
|
|
|
switchStationMode(val) {
|
2020-07-24 11:01:22 +08:00
|
|
|
if (this.stationListMode.length > 0) {
|
2020-05-19 09:45:15 +08:00
|
|
|
if (val == null) {
|
2020-07-24 11:01:22 +08:00
|
|
|
this.showStation = this.stationListMode[0].value;
|
2020-05-19 09:45:15 +08:00
|
|
|
} else {
|
|
|
|
this.showStation = val;
|
|
|
|
}
|
2020-06-12 16:28:52 +08:00
|
|
|
const nameList = Object.keys(this.$store.state.map.map);
|
|
|
|
let list = [];
|
|
|
|
nameList.forEach(item => {
|
|
|
|
if (this.$store.state.map.map[item] && this.$store.state.map.map[item].constructor === Array) {
|
|
|
|
if (item === 'trainList') {
|
|
|
|
this.$store.state.map.map[item].forEach(elem => {
|
|
|
|
elem && list.push(elem);
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
list = [...list, ...this.$store.state.map.map[item]];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
this.$jlmap.updateShowStation(list, this.showStation);
|
|
|
|
this.setCenter(this.showStation);
|
|
|
|
// this.$store.dispatch('map/setShowCentralizedStationCode', this.showStation);
|
|
|
|
// this.$store.dispatch('map/setShowCentralizedStationNum');
|
2020-05-19 09:45:15 +08:00
|
|
|
}
|
2020-03-25 15:22:52 +08:00
|
|
|
},
|
2020-07-24 11:01:22 +08:00
|
|
|
setStationList() {
|
|
|
|
this.stationListMode = [];
|
|
|
|
(this.stationList || []).forEach(item => {
|
2020-03-25 15:22:52 +08:00
|
|
|
if (item.centralized) {
|
2020-07-24 11:01:22 +08:00
|
|
|
this.stationListMode.push({value: item.code, name: item.name});
|
2020-03-25 15:22:52 +08:00
|
|
|
}
|
|
|
|
});
|
2020-07-24 11:01:22 +08:00
|
|
|
if (this.stationListMode.length && this.showSelectStation) {
|
|
|
|
this.showStation = this.stationListMode[0].value;
|
2020-03-25 15:22:52 +08:00
|
|
|
}
|
2019-12-26 11:01:54 +08:00
|
|
|
}
|
|
|
|
}
|
2020-06-29 15:55:31 +08:00
|
|
|
|
2019-12-26 11:01:54 +08:00
|
|
|
};
|
|
|
|
</script>
|
2020-07-14 18:14:39 +08:00
|
|
|
|
|
|
|
<style scoped lang="scss" rel="stylesheep/scss">
|
|
|
|
.main {
|
|
|
|
display: block;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
overflow: hidden;
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
</style>
|