Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
82415903f5
@ -70,7 +70,7 @@ export default {
|
|||||||
},
|
},
|
||||||
subscribeMessage(res) {
|
subscribeMessage(res) {
|
||||||
if (this.$refs.deomonTopic && !window.location.href.includes('trainroom')) {
|
if (this.$refs.deomonTopic && !window.location.href.includes('trainroom')) {
|
||||||
if (getSessionStorage('project') != 'refereeJsxt' && getSessionStorage('project') != 'jsxt') {
|
if (getSessionStorage('project') != 'refereeJsxt' && getSessionStorage('project') != 'jsxt' && !(getSessionStorage('project').includes('design'))) {
|
||||||
this.$refs.deomonTopic.doShow(res);
|
this.$refs.deomonTopic.doShow(res);
|
||||||
}
|
}
|
||||||
this.$store.dispatch('socket/setRoomInvite');
|
this.$store.dispatch('socket/setRoomInvite');
|
||||||
|
@ -18,6 +18,15 @@ export function setFailureMode(data, group) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 设置自动故障(新版)*/
|
||||||
|
export function setFailureModeNew(data, group) {
|
||||||
|
return request({
|
||||||
|
url: `/simulation/${group}/faultMode`,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 仿真系统按计划行车
|
* 仿真系统按计划行车
|
||||||
*/
|
*/
|
||||||
|
@ -106,6 +106,9 @@ const exam = {
|
|||||||
countUsedTime({ commit }) {
|
countUsedTime({ commit }) {
|
||||||
commit('countUsedTime');
|
commit('countUsedTime');
|
||||||
},
|
},
|
||||||
|
stopCountTime({ commit }) {
|
||||||
|
commit('stopCountTime');
|
||||||
|
},
|
||||||
setRuleList({ commit }, ruleList) {
|
setRuleList({ commit }, ruleList) {
|
||||||
commit('setRuleList', ruleList);
|
commit('setRuleList', ruleList);
|
||||||
},
|
},
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="handleShow">
|
<div class="handleShow">
|
||||||
<span v-if="show" class="el-icon-arrow-right" @click="handleSliderShow(true)">{{ $t('display.lesson.unfold') }}</span>
|
<span v-if="show" class="el-icon-arrow-right" style="cursor:pointer" @click="handleSliderShow(true)">{{ $t('display.lesson.unfold') }}</span>
|
||||||
<span v-else class="el-icon-arrow-left" @click="handleSliderShow(false)">{{ $t('display.lesson.fold') }}</span>
|
<span v-else class="el-icon-arrow-left" style="cursor:pointer" @click="handleSliderShow(false)">{{ $t('display.lesson.fold') }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="slider-tree">
|
<div class="slider-tree">
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper" style="background: #fff;">
|
<el-scrollbar wrap-class="scrollbar-wrapper" style="background: #fff;">
|
||||||
|
@ -151,6 +151,7 @@ export default {
|
|||||||
if (data == 'min') {
|
if (data == 'min') {
|
||||||
this.minimize = true;
|
this.minimize = true;
|
||||||
this.$refs.chatSetting.doClose();
|
this.$refs.chatSetting.doClose();
|
||||||
|
this.$refs.createGroup.doClose();
|
||||||
} else {
|
} else {
|
||||||
this.minimize = false;
|
this.minimize = false;
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getFailureGenerateRules, setFailureMode } from '@/api/simulation';
|
import { getFailureGenerateRules, setFailureModeNew } from '@/api/simulation';
|
||||||
import { FaultStatusEnum } from '@/scripts/FaultDic';
|
import { FaultStatusEnum } from '@/scripts/FaultDic';
|
||||||
import ModelType from '@/jmap/constant/deviceType';
|
import ModelType from '@/jmap/constant/deviceType';
|
||||||
|
|
||||||
@ -138,7 +138,7 @@ export default {
|
|||||||
handleConfirm() {
|
handleConfirm() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
const faultModel = this.getFailureModel(this.auto);
|
const faultModel = this.getFailureModel(this.auto);
|
||||||
setFailureMode(faultModel, this.group).then(() => {
|
setFailureModeNew(faultModel, this.group).then(() => {
|
||||||
this.$message.success(this.$t('display.faultChoose.setFaultSuccess'));
|
this.$message.success(this.$t('display.faultChoose.setFaultSuccess'));
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$messageBox(this.$t('display.faultChoose.setFaultFail'));
|
this.$messageBox(this.$t('display.faultChoose.setFaultFail'));
|
||||||
|
@ -10,12 +10,9 @@
|
|||||||
ref="menuDemon"
|
ref="menuDemon"
|
||||||
:offset="offset"
|
:offset="offset"
|
||||||
:offset-bottom="offsetBottom"
|
:offset-bottom="offsetBottom"
|
||||||
:group="group"
|
:script-id="scriptId"
|
||||||
:quest-id="questId"
|
|
||||||
:user-role="userRole"
|
|
||||||
@tryTime="tryTime"
|
|
||||||
@hidepanel="hidepanel"
|
|
||||||
@quitQuest="quitQuest"
|
@quitQuest="quitQuest"
|
||||||
|
@hidepanel="hidepanel"
|
||||||
@showScheduling="showScheduling"
|
@showScheduling="showScheduling"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@ -24,7 +21,6 @@
|
|||||||
ref="menuSchema"
|
ref="menuSchema"
|
||||||
:offset="offset"
|
:offset="offset"
|
||||||
:offset-bottom="offsetBottom"
|
:offset-bottom="offsetBottom"
|
||||||
:group="group"
|
|
||||||
:show-station="showStation"
|
:show-station="showStation"
|
||||||
:station-list="stationList"
|
:station-list="stationList"
|
||||||
:show-select-station="showSelectStation"
|
:show-select-station="showSelectStation"
|
||||||
@ -42,7 +38,7 @@
|
|||||||
<fault-choose ref="faultChoose" :group="group" />
|
<fault-choose ref="faultChoose" :group="group" />
|
||||||
<run-plan-Load ref="runPlanLoad" :group="group" />
|
<run-plan-Load ref="runPlanLoad" :group="group" />
|
||||||
<run-plan-view ref="runPlanView" :group="group" />
|
<run-plan-view ref="runPlanView" :group="group" />
|
||||||
<add-quest ref="addQuest" @selectQuest="selectQuest" />
|
<!-- <add-quest ref="addQuest" @selectQuest="selectQuestNew" /> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -54,16 +50,14 @@ import MapSystemDraft from '@/views/newMap/mapsystemNew/index';
|
|||||||
import MenuDemon from '@/views/newMap/displayNew/menuDemon';
|
import MenuDemon from '@/views/newMap/displayNew/menuDemon';
|
||||||
import MenuSchema from '@/views/newMap/displayNew/menuSchema';
|
import MenuSchema from '@/views/newMap/displayNew/menuSchema';
|
||||||
import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime';
|
import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime';
|
||||||
import AddQuest from './demon/addQuest';
|
// import AddQuest from './demon/addQuest';
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import { setGoodsTryUse } from '@/api/management/goods';
|
import { setGoodsTryUse } from '@/api/management/goods';
|
||||||
import { clearSimulation, getSimulationInfoNew, scriptExecuteNew } from '@/api/simulation';
|
import { clearSimulation, getSimulationInfoNew } from '@/api/simulation';
|
||||||
import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
|
import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
|
||||||
import { checkLoginLine } from '@/api/login';
|
import { checkLoginLine } from '@/api/login';
|
||||||
import { loadNewMapDataByGroup } from '@/utils/loaddata';
|
import { loadNewMapDataByGroup } from '@/utils/loaddata';
|
||||||
import { EventBus } from '@/scripts/event-bus';
|
import { EventBus } from '@/scripts/event-bus';
|
||||||
import Vue from 'vue';
|
|
||||||
import {loadDraftScript, loadDraftScriptNew} from '@/api/designPlatform';
|
|
||||||
|
|
||||||
// 三维
|
// 三维
|
||||||
// import Jl3dSimulation from '@/views/jlmap3d/simulation/jl3dsimulation';
|
// import Jl3dSimulation from '@/views/jlmap3d/simulation/jl3dsimulation';
|
||||||
@ -76,7 +70,7 @@ export default {
|
|||||||
RunPlanLoad,
|
RunPlanLoad,
|
||||||
RunPlanView,
|
RunPlanView,
|
||||||
FaultChoose,
|
FaultChoose,
|
||||||
AddQuest,
|
// AddQuest,
|
||||||
MapSystemDraft,
|
MapSystemDraft,
|
||||||
MenuDemon,
|
MenuDemon,
|
||||||
MenuSchema,
|
MenuSchema,
|
||||||
@ -108,7 +102,7 @@ export default {
|
|||||||
panelShow: true,
|
panelShow: true,
|
||||||
simulationShow: false,
|
simulationShow: false,
|
||||||
drivingShow: false,
|
drivingShow: false,
|
||||||
questId: 0, // 加载任务的Id
|
scriptId:0, // 加载任务的Id
|
||||||
showStation: '',
|
showStation: '',
|
||||||
stationList: [],
|
stationList: [],
|
||||||
showSelectStation: false, // 是否展示现地选择设备集中站select
|
showSelectStation: false, // 是否展示现地选择设备集中站select
|
||||||
@ -270,6 +264,10 @@ export default {
|
|||||||
mousemove(e) {
|
mousemove(e) {
|
||||||
this.mouseNum = 1;
|
this.mouseNum = 1;
|
||||||
},
|
},
|
||||||
|
// 退出脚本
|
||||||
|
async quitQuest() {
|
||||||
|
this.scriptId = 0;
|
||||||
|
},
|
||||||
setPosition() {
|
setPosition() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
let offset = 15;
|
let offset = 15;
|
||||||
@ -351,41 +349,18 @@ export default {
|
|||||||
const row = {group: this.$route.query.group, id: this.$route.query.scriptId};
|
const row = {group: this.$route.query.group, id: this.$route.query.scriptId};
|
||||||
this.$refs.addQuest.handleLoad(1, row);
|
this.$refs.addQuest.handleLoad(1, row);
|
||||||
},
|
},
|
||||||
|
// selectQuestNew(row, id, mapLocation, roleName) {
|
||||||
|
// this.$refs.
|
||||||
|
// },
|
||||||
// 选择脚本
|
// 选择脚本
|
||||||
async selectQuest(row, id, mapLocation, roleName) {
|
async selectQuest(row) {
|
||||||
try {
|
this.scriptId = parseInt(row.id);
|
||||||
const res = this.drawWay ? await loadDraftScriptNew(id, this.group) : await loadDraftScript(row.id, id, this.group);
|
if (this.isDemon) {
|
||||||
if (res && res.code == 200) {
|
this.$refs.menuDemon.initLoadPage();
|
||||||
this.questId = parseInt(row.id);
|
|
||||||
if (mapLocation) {
|
|
||||||
const newMapLocation = {'offsetX': mapLocation.x, 'offsetY': mapLocation.y, 'scaleRate': mapLocation.scale};
|
|
||||||
Vue.prototype.$jlmap.setOptions(newMapLocation);
|
|
||||||
}
|
}
|
||||||
if (this.drawWay) {
|
if (this.isScript) {
|
||||||
scriptExecuteNew(this.group).then(data=>{
|
this.$refs.menuScript.initLoadPage();
|
||||||
}).catch(error=>{
|
|
||||||
console.log(error);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
// if (res.data && res.data.mapLocation) {
|
|
||||||
// const mapLocation={'offsetX': res.data.mapLocation.x, 'offsetY': res.data.mapLocation.y, 'scaleRate': res.data.mapLocation.scale};
|
|
||||||
// Vue.prototype.$jlmap.setOptions(mapLocation);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
if (this.$refs.menuDemon) {
|
|
||||||
await this.$refs.menuDemon.initLoadPage();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.$refs.menuScript) {
|
|
||||||
await this.$refs.menuScript.initLoadPage();
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
this.$messageBox(error.message);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 退出脚本
|
|
||||||
async quitQuest() {
|
|
||||||
this.questId = 0;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 通过id加载地图数据
|
// 通过id加载地图数据
|
||||||
|
@ -1,24 +1,27 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- -->
|
|
||||||
<div class="main" :style="{width: canvasWidth+'px'}">
|
<div class="main" :style="{width: canvasWidth+'px'}">
|
||||||
<div v-show="panelShow" :panelShow="panelShow">
|
<div v-show="panelShow" :panelShow="panelShow">
|
||||||
<transition name="el-zoom-in-bottom">
|
<transition name="el-zoom-in-bottom">
|
||||||
<map-system-draft ref="mapCanvas" @back="back" />
|
<map-system-draft ref="mapCanvas" @back="back" />
|
||||||
</transition>
|
</transition>
|
||||||
<status-icon v-if="$route.query.lineCode == '11' || $route.query.lineCode == '10'" ref="statusIcon" />
|
<status-icon v-if="$route.query.lineCode == '11' || $route.query.lineCode == '10'" ref="statusIcon" />
|
||||||
<menu-exam
|
<!-- :group="group" -->
|
||||||
v-if="isExam"
|
<!-- :show-station="showStation" -->
|
||||||
ref="menuExam"
|
<menu-demon
|
||||||
|
v-if="isDemon"
|
||||||
|
ref="menuDemon"
|
||||||
:offset="offset"
|
:offset="offset"
|
||||||
:data-error="dataError"
|
|
||||||
:offset-bottom="offsetBottom"
|
:offset-bottom="offsetBottom"
|
||||||
:group="group"
|
:data-error="dataError"
|
||||||
:show-station="showStation"
|
:script-id="scriptId"
|
||||||
:station-list="stationList"
|
@hidepanel="hidepanel"
|
||||||
:show-select-station="showSelectStation"
|
@passflow="passflow"
|
||||||
@switchStationMode="switchStationMode"
|
@quitQuest="quitQuest"
|
||||||
|
@jl3dstation="jl3dstation"
|
||||||
|
@devicemodel="devicemodel"
|
||||||
|
@showScheduling="showScheduling"
|
||||||
/>
|
/>
|
||||||
|
<!-- :training-obj="trainingObj" -->
|
||||||
<menu-lesson
|
<menu-lesson
|
||||||
v-if="isLesson"
|
v-if="isLesson"
|
||||||
ref="lessonMenu"
|
ref="lessonMenu"
|
||||||
@ -26,39 +29,42 @@
|
|||||||
:data-error="dataError"
|
:data-error="dataError"
|
||||||
:offset-bottom="offsetBottom"
|
:offset-bottom="offsetBottom"
|
||||||
:tip-bottom="tipBottom"
|
:tip-bottom="tipBottom"
|
||||||
:group="group"
|
:show-station="showStation"
|
||||||
:training-obj="trainingObj"
|
:station-list="stationList"
|
||||||
|
:show-select-station="showSelectStation"
|
||||||
|
@switchStationMode="switchStationMode"
|
||||||
|
/>
|
||||||
|
<menu-exam
|
||||||
|
v-if="isExam"
|
||||||
|
ref="menuExam"
|
||||||
|
:offset="offset"
|
||||||
|
:data-error="dataError"
|
||||||
|
:offset-bottom="offsetBottom"
|
||||||
:show-station="showStation"
|
:show-station="showStation"
|
||||||
:station-list="stationList"
|
:station-list="stationList"
|
||||||
:show-select-station="showSelectStation"
|
:show-select-station="showSelectStation"
|
||||||
@switchStationMode="switchStationMode"
|
@switchStationMode="switchStationMode"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<menu-demon
|
<menu-schema
|
||||||
v-if="isDemon"
|
v-if="isDemon || isScript "
|
||||||
ref="menuDemon"
|
ref="menuSchema"
|
||||||
:offset="offset"
|
:offset="offset"
|
||||||
:data-error="dataError"
|
:data-error="dataError"
|
||||||
:offset-bottom="offsetBottom"
|
:offset-bottom="offsetBottom"
|
||||||
:group="group"
|
|
||||||
:quest-id="questId"
|
|
||||||
:show-station="showStation"
|
:show-station="showStation"
|
||||||
:user-role="userRole"
|
:station-list="stationList"
|
||||||
@tryTime="tryTime"
|
:show-select-station="showSelectStation"
|
||||||
@hidepanel="hidepanel"
|
@switchMode="switchMode"
|
||||||
@passflow="passflow"
|
@selectQuest="selectQuest"
|
||||||
@jl3dstation="jl3dstation"
|
@switchStationMode="switchStationMode"
|
||||||
@devicemodel="devicemodel"
|
|
||||||
@quitQuest="quitQuest"
|
|
||||||
@showScheduling="showScheduling"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<menu-script v-if="isScript" ref="menuScript" :offset-bottom="offsetBottom" :group="group" :data-error="dataError" @script3ddriveshow="script3ddriveshow" />
|
<menu-script v-if="isScript" ref="menuScript" :offset-bottom="offsetBottom" :data-error="dataError" @script3ddriveshow="script3ddriveshow" />
|
||||||
|
|
||||||
<menu-practice
|
<menu-practice
|
||||||
v-if="isPractice"
|
v-if="isPractice"
|
||||||
ref="menuPractice"
|
ref="menuPractice"
|
||||||
:group="group"
|
|
||||||
:offset="offset"
|
:offset="offset"
|
||||||
:offset-bottom="offsetBottom"
|
:offset-bottom="offsetBottom"
|
||||||
:show-station="showStation"
|
:show-station="showStation"
|
||||||
@ -71,27 +77,8 @@
|
|||||||
|
|
||||||
<menu-train-list v-if="isDemon" @setCenter="setCenter" />
|
<menu-train-list v-if="isDemon" @setCenter="setCenter" />
|
||||||
|
|
||||||
<menu-schema
|
|
||||||
v-if="isDemon || isScript "
|
|
||||||
ref="menuSchema"
|
|
||||||
:offset="offset"
|
|
||||||
:data-error="dataError"
|
|
||||||
:offset-bottom="offsetBottom"
|
|
||||||
:group="group"
|
|
||||||
:show-station="showStation"
|
|
||||||
:station-list="stationList"
|
|
||||||
:show-select-station="showSelectStation"
|
|
||||||
@switchMode="switchMode"
|
|
||||||
@selectQuest="selectQuest"
|
|
||||||
@switchStationMode="switchStationMode"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<menu-system-time ref="menuSystemTime" :offset="offset" :right="right" :group="group" />
|
<menu-system-time ref="menuSystemTime" :offset="offset" :right="right" :group="group" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <Jl3d-Simulation v-show="simulationShow" ref="Jl3dSimulation" :panel-show="simulationShow" @showpanel="showpanel" /> -->
|
|
||||||
<left-slider v-if="isShowLeftSlider" :offset-bottom="offsetBottom" @overallTranslation="overallTranslation" />
|
|
||||||
|
|
||||||
<Jl3d-Device
|
<Jl3d-Device
|
||||||
v-if="deviceShow"
|
v-if="deviceShow"
|
||||||
ref="Jl3dDevice"
|
ref="Jl3dDevice"
|
||||||
@ -99,99 +86,84 @@
|
|||||||
@closedevice3dview="devicemodel"
|
@closedevice3dview="devicemodel"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<!-- <Jl3d-Simulation v-show="simulationShow" ref="Jl3dSimulation" :panel-show="simulationShow" @showpanel="showpanel" /> -->
|
||||||
<Jl3d-Drive v-show="drivingShow" ref="Jl3dDrive" :panel-show="drivingShow" @showdriving="showdriving" />
|
<Jl3d-Drive v-show="drivingShow" ref="Jl3dDrive" :panel-show="drivingShow" @showdriving="showdriving" />
|
||||||
|
|
||||||
<scheduling v-if="isShowScheduling" ref="scheduling" :group="group" />
|
<scheduling v-if="isShowScheduling" ref="scheduling" :group="group" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import MapSystemDraft from '@/views/newMap/mapsystemNew/index';
|
import MapSystemDraft from '@/views/newMap/mapsystemNew/index';
|
||||||
|
import MenuDemon from '@/views/newMap/displayNew/menuDemon';
|
||||||
|
import StatusIcon from '@/views/components/StatusIcon/statusIcon';
|
||||||
import MenuExam from '@/views/newMap/displayNew/menuExam';
|
import MenuExam from '@/views/newMap/displayNew/menuExam';
|
||||||
import MenuLesson from '@/views/newMap/displayNew/menuLesson';
|
import MenuLesson from '@/views/newMap/displayNew/menuLesson';
|
||||||
import MenuDemon from '@/views/newMap/displayNew/menuDemon';
|
|
||||||
import MenuSchema from '@/views/newMap/displayNew/menuSchema';
|
import MenuSchema from '@/views/newMap/displayNew/menuSchema';
|
||||||
import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime';
|
import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime';
|
||||||
|
import MenuTrainList from '@/views/newMap/displayNew/menuTrainList';
|
||||||
import MenuScript from '@/views/newMap/displayNew/menuScript';
|
import MenuScript from '@/views/newMap/displayNew/menuScript';
|
||||||
import MenuPractice from '@/views/newMap/displayNew/menuPractice';
|
import MenuPractice from '@/views/newMap/displayNew/menuPractice';
|
||||||
import Scheduling from './demon/scheduling';
|
|
||||||
import { mapGetters } from 'vuex';
|
|
||||||
import { getTrainingStepsDetailNew, getTrainingDetailNew } from '@/api/jmap/training';
|
|
||||||
import { setGoodsTryUse } from '@/api/management/goods';
|
|
||||||
import { clearSimulation, loadScriptNew, getSimulationInfoNew, scriptExecuteNew } from '@/api/simulation';
|
|
||||||
import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
|
|
||||||
import { checkLoginLine } from '@/api/login';
|
|
||||||
import { loadNewMapDataByGroup } from '@/utils/loaddata';
|
|
||||||
import { EventBus } from '@/scripts/event-bus';
|
|
||||||
import Vue from 'vue';
|
|
||||||
import LeftSlider from '@/views/newMap/displayNew/LeftSlider';
|
|
||||||
import { getSessionStorage } from '@/utils/auth';
|
|
||||||
import MenuTrainList from '@/views/newMap/displayNew/menuTrainList';
|
|
||||||
import StatusIcon from '@/views/components/StatusIcon/statusIcon';
|
|
||||||
|
|
||||||
// 三维
|
// 三维
|
||||||
// import Jl3dSimulation from '@/views/jlmap3d/simulation/jl3dsimulation';
|
// import Jl3dSimulation from '@/views/jlmap3d/simulation/jl3dsimulation';
|
||||||
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
|
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
|
||||||
import Jl3dDevice from '@/views/jlmap3d/device/jl3ddevice';
|
import Jl3dDevice from '@/views/jlmap3d/device/jl3ddevice';
|
||||||
|
import Scheduling from './demon/scheduling';
|
||||||
|
import { clearSimulation, getSimulationInfoNew} from '@/api/simulation';
|
||||||
|
import { getTrainingDetailNew } from '@/api/jmap/training';
|
||||||
|
// loadScriptNew, , scriptExecuteNew
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
|
import { checkLoginLine } from '@/api/login';
|
||||||
|
import { EventBus } from '@/scripts/event-bus';
|
||||||
|
import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
|
import { loadNewMapDataByGroup } from '@/utils/loaddata';
|
||||||
import { timeFormat } from '@/utils/date';
|
import { timeFormat } from '@/utils/date';
|
||||||
|
import { getSessionStorage } from '@/utils/auth';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DisplayDraft',
|
name: 'DisplayDraft',
|
||||||
components: {
|
components: {
|
||||||
MenuExam,
|
|
||||||
MenuLesson,
|
|
||||||
MapSystemDraft,
|
MapSystemDraft,
|
||||||
MenuDemon,
|
MenuDemon,
|
||||||
MenuScript,
|
StatusIcon,
|
||||||
MenuSchema,
|
|
||||||
MenuSystemTime,
|
MenuSystemTime,
|
||||||
|
MenuExam,
|
||||||
|
MenuLesson,
|
||||||
|
MenuSchema,
|
||||||
MenuTrainList,
|
MenuTrainList,
|
||||||
|
MenuScript,
|
||||||
MenuPractice,
|
MenuPractice,
|
||||||
// Jl3dSimulation,
|
// Jl3dSimulation,
|
||||||
Jl3dDrive,
|
Jl3dDrive,
|
||||||
Jl3dDevice,
|
Jl3dDevice,
|
||||||
Scheduling,
|
Scheduling
|
||||||
LeftSlider,
|
|
||||||
StatusIcon
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
size: {
|
|
||||||
type: Object,
|
|
||||||
default() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
mode: '',
|
panelShow: true,
|
||||||
trainingObj: {},
|
drivingShow: false,
|
||||||
timeDemonNum: 0,
|
deviceShow: false,
|
||||||
checkLine: null,
|
// simulationShow: false,
|
||||||
offset: 15,
|
offset: 15,
|
||||||
offsetBottom: 15,
|
offsetBottom: 15,
|
||||||
tipBottom: 0,
|
tipBottom: 0,
|
||||||
mouseNum: 1,
|
scriptId:0,
|
||||||
|
dataError: false,
|
||||||
|
group:'',
|
||||||
|
checkLine: null,
|
||||||
ierval: null,
|
ierval: null,
|
||||||
mouseNumTime: 0,
|
|
||||||
// mapBox: null,
|
|
||||||
mapBoxP: null,
|
mapBoxP: null,
|
||||||
panelShow: true,
|
|
||||||
simulationShow: false,
|
|
||||||
drivingShow: false,
|
|
||||||
deviceShow: false,
|
|
||||||
questId: 0, // 加载任务的Id
|
|
||||||
showStation: '',
|
showStation: '',
|
||||||
stationList: [],
|
stationList: [],
|
||||||
grouper:'',
|
|
||||||
showSelectStation: false, // 是否展示现地选择设备集中站select
|
showSelectStation: false, // 是否展示现地选择设备集中站select
|
||||||
|
mouseNum: 1,
|
||||||
|
mouseNumTime: 0,
|
||||||
prdTypeMap: {
|
prdTypeMap: {
|
||||||
'01': '01', // 现地 => 现地
|
'01': '01', // 现地 => 现地
|
||||||
'02': '02', // 行调 => 行调
|
'02': '02', // 行调 => 行调
|
||||||
'04': '02', // 司机 => 行调
|
'04': '02', // 司机 => 行调
|
||||||
'05': '' // 派班 => null
|
'05': '' // 派班 => null
|
||||||
},
|
},
|
||||||
dataError: false,
|
|
||||||
planRunning:false
|
planRunning:false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -199,47 +171,44 @@ export default {
|
|||||||
...mapGetters([
|
...mapGetters([
|
||||||
'canvasWidth'
|
'canvasWidth'
|
||||||
]),
|
]),
|
||||||
...mapGetters('map', [
|
mode() {
|
||||||
'map'
|
return this.$route.params.mode;
|
||||||
]),
|
},
|
||||||
...mapGetters('training', [
|
isDemon() {
|
||||||
'offsetStationCode'
|
return this.mode === 'demon';
|
||||||
]),
|
},
|
||||||
...mapGetters('config', [
|
isExam() {
|
||||||
'canvasId'
|
return this.mode === 'exam';
|
||||||
]),
|
},
|
||||||
|
isLesson() {
|
||||||
|
return (this.mode === 'teach' || this.mode === 'manage');
|
||||||
|
},
|
||||||
|
isScript() {
|
||||||
|
return this.mode === 'script';
|
||||||
|
},
|
||||||
width() {
|
width() {
|
||||||
return this.$store.state.app.width;
|
return this.$store.state.app.width;
|
||||||
},
|
},
|
||||||
height() {
|
height() {
|
||||||
return this.$store.state.app.height;
|
return this.$store.state.app.height;
|
||||||
},
|
},
|
||||||
right() {
|
...mapGetters('training', [
|
||||||
return this.$store.state.config.width / 2 - 55;
|
'offsetStationCode'
|
||||||
},
|
]),
|
||||||
trainingId() {
|
...mapGetters('config', [
|
||||||
return this.$route.query.trainingId;
|
'canvasId'
|
||||||
},
|
]),
|
||||||
mapId() {
|
mapId() {
|
||||||
return this.$route.query.mapId;
|
return this.$route.query.mapId;
|
||||||
},
|
},
|
||||||
prdType() {
|
prdType() {
|
||||||
return this.$route.query.prdType;
|
return this.$route.query.prdType;
|
||||||
},
|
},
|
||||||
isLesson() {
|
project() {
|
||||||
return (this.mode === 'teach' || this.mode === 'manage');
|
return getSessionStorage('project');
|
||||||
},
|
},
|
||||||
isShowLeftSlider() {
|
isShowScheduling() {
|
||||||
return (this.mode === 'teach' || this.mode === 'manage') && (this.$route.query.lessonId != '0');
|
return this.$route.query.prdType == '05';
|
||||||
},
|
|
||||||
isExam() {
|
|
||||||
return this.mode === 'exam';
|
|
||||||
},
|
|
||||||
isDemon() {
|
|
||||||
return this.mode === 'demon';
|
|
||||||
},
|
|
||||||
isScript() {
|
|
||||||
return this.mode === 'script';
|
|
||||||
},
|
},
|
||||||
isPractice() {
|
isPractice() {
|
||||||
return this.mode === 'practice';
|
return this.mode === 'practice';
|
||||||
@ -247,25 +216,11 @@ export default {
|
|||||||
isDrive() {
|
isDrive() {
|
||||||
return this.prdType == '04';
|
return this.prdType == '04';
|
||||||
},
|
},
|
||||||
isShowScheduling() {
|
right() {
|
||||||
return this.$route.query.prdType == '05';
|
return this.$store.state.config.width / 2 - 55;
|
||||||
},
|
},
|
||||||
project() {
|
trainingId() {
|
||||||
return getSessionStorage('project');
|
return this.$route.query.trainingId;
|
||||||
},
|
|
||||||
group() {
|
|
||||||
return this.$route.query.group;
|
|
||||||
},
|
|
||||||
userRole() {
|
|
||||||
if (this.$route.query.prdType == '02') {
|
|
||||||
return 'DISPATCHER';
|
|
||||||
} else if (this.$route.query.prdType == '01') {
|
|
||||||
return 'STATION_SUPERVISOR';
|
|
||||||
} else if (this.$route.query.prdType == '04') {
|
|
||||||
return 'DRIVER';
|
|
||||||
} else {
|
|
||||||
return 'AUDIENCE';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -275,40 +230,9 @@ export default {
|
|||||||
'$store.state.training.prdType': function (val) { // 根据权限类型计算高度
|
'$store.state.training.prdType': function (val) { // 根据权限类型计算高度
|
||||||
this.setPosition();
|
this.setPosition();
|
||||||
},
|
},
|
||||||
'$store.state.map.mapViewLoadedCount': function (val) { // 地图视图加载完成标识 开始加载默认状态
|
|
||||||
this.mapBoxP = document.getElementById(this.canvasId).children[0];
|
|
||||||
this.mapBoxP.style.cursor = '';
|
|
||||||
// this.mapBox = document.getElementsByTagName('canvas');
|
|
||||||
if (this.planRunning) {
|
|
||||||
this.$store.dispatch('training/simulationStart');
|
|
||||||
}
|
|
||||||
if (this.trainingId) {
|
|
||||||
getTrainingStepsDetailNew(this.trainingId, { group: this.group }).then(resp => {
|
|
||||||
this.trainingObj = resp.data;
|
|
||||||
this.$store.dispatch('training/setTrainingData', this.trainingObj);
|
|
||||||
|
|
||||||
}).catch(error => {
|
|
||||||
this.$messageBox(`初始化失败实训内容失败: ${error.message}`);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.switchStationMode(this.showStation);
|
|
||||||
},
|
|
||||||
'$store.state.training.centerStationCode': function(code) {
|
|
||||||
if (code) {
|
|
||||||
this.showStation = code;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'$store.state.map.mousemove': function (val) {
|
'$store.state.map.mousemove': function (val) {
|
||||||
this.mousemove();
|
this.mousemove();
|
||||||
},
|
},
|
||||||
'$store.state.socket.permissionOver': function () {
|
|
||||||
this.$alert('用户权限已被收回', '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
callback: action => {
|
|
||||||
this.back();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
'size.width': function(val) {
|
'size.width': function(val) {
|
||||||
this.setWindowSize();
|
this.setWindowSize();
|
||||||
},
|
},
|
||||||
@ -323,41 +247,178 @@ export default {
|
|||||||
this.initLoadData();
|
this.initLoadData();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
'$store.state.training.centerStationCode': function(code) {
|
||||||
|
if (code) {
|
||||||
|
this.showStation = code;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'$store.state.socket.permissionOver': function () {
|
||||||
|
this.$alert('用户权限已被收回', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
callback: action => {
|
||||||
|
this.back();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
'$store.state.map.map': function (val) {
|
'$store.state.map.map': function (val) {
|
||||||
this.showSelectStation = val.skinVO.code === '06' && this.$store.state.training.prdType === '01';
|
this.showSelectStation = val.skinVO.code === '06' && this.$store.state.training.prdType === '01';
|
||||||
this.showSelectStation && this.setStationList(val);
|
this.showSelectStation && this.setStationList(val);
|
||||||
},
|
},
|
||||||
'group':function(group) {
|
'$store.state.map.mapViewLoadedCount': function (val) { // 地图视图加载完成标识 开始加载默认状态
|
||||||
this.grouper = group;
|
this.mapBoxP = document.getElementById(this.canvasId).children[0];
|
||||||
|
this.mapBoxP.style.cursor = '';
|
||||||
|
// this.mapBox = document.getElementsByTagName('canvas');
|
||||||
|
if (this.planRunning) {
|
||||||
|
this.$store.dispatch('training/simulationStart');
|
||||||
|
}
|
||||||
|
this.switchStationMode(this.showStation);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async created() {
|
|
||||||
this.mode = this.$route.params.mode;
|
|
||||||
},
|
|
||||||
async mounted() {
|
async mounted() {
|
||||||
this.grouper = this.group;
|
this.group = this.$route.query.group;
|
||||||
await this.setWindowSize();
|
await this.setWindowSize();
|
||||||
await this.initLoadData();
|
await this.initLoadData();
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
this.quit(this.grouper);
|
this.quit(this.group);
|
||||||
this.clearAllTimer();
|
this.clearAllTimer();
|
||||||
this.$store.dispatch('training/reset');
|
this.$store.dispatch('training/reset');
|
||||||
this.$store.dispatch('map/mapClear');
|
this.$store.dispatch('map/mapClear');
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
|
// 仿真错误时,被动退出时调用
|
||||||
|
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');
|
||||||
|
},
|
||||||
// 清除检查在线定时器
|
// 清除检查在线定时器
|
||||||
clearAllTimer() {
|
clearAllTimer() {
|
||||||
if (this.ierval) {
|
if (this.ierval) {
|
||||||
clearTimeout(this.ierval);
|
clearTimeout(this.ierval);
|
||||||
this.ierval = null;
|
this.ierval = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.checkLine) {
|
if (this.checkLine) {
|
||||||
clearTimeout(this.checkLine);
|
clearTimeout(this.checkLine);
|
||||||
this.checkLine = null;
|
this.checkLine = null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mousemove() {
|
||||||
|
this.mouseNum = 1;
|
||||||
|
},
|
||||||
|
// 缩放设置
|
||||||
|
setWindowSize() {
|
||||||
|
// this.size ? this.size.width :
|
||||||
|
const width = this.width;
|
||||||
|
// this.size ? this.size.height :
|
||||||
|
const height = this.height;
|
||||||
|
this.$store.dispatch('config/resize', { width, height });
|
||||||
|
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });
|
||||||
|
},
|
||||||
|
// 加载地图数据
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
this.checkLoginLineTimer();
|
||||||
|
this.checkMouseStatusTimer();
|
||||||
|
} catch (error) {
|
||||||
|
this.$messageBox(`初始化失败: ${error.message}`);
|
||||||
|
this.endViewLoading();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 任务录制系统
|
||||||
|
async initLoadScriptData() {
|
||||||
|
this.$store.dispatch('training/end', TrainingMode.NORMAL);
|
||||||
|
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式
|
||||||
|
this.switchMode('01');
|
||||||
|
|
||||||
|
if (parseInt(this.mapId)) {
|
||||||
|
await this.loadNewMapDataByGroup(this.group);
|
||||||
|
} else {
|
||||||
|
this.endViewLoading();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
script3ddriveshow() {
|
||||||
|
this.panelShow = false;
|
||||||
|
this.drivingShow = true;
|
||||||
|
this.$refs.Jl3dDrive.show(this.mapId, this.group);
|
||||||
|
},
|
||||||
|
// 课程和考试系统
|
||||||
|
async initLoadLessonOrExamData() {
|
||||||
|
this.$store.dispatch('training/end', null);
|
||||||
|
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式
|
||||||
|
|
||||||
|
if (parseInt(this.trainingId)) {
|
||||||
|
// 设置地图数据
|
||||||
|
// 设置实训数据
|
||||||
|
const resp = await getTrainingDetailNew(this.trainingId);
|
||||||
|
if (resp && resp.code == 200) {
|
||||||
|
const detail = resp.data;
|
||||||
|
await this.$store.dispatch('training/setPrdType', this.prdTypeMap[detail.prdType]);
|
||||||
|
await this.loadNewMapDataByGroup(this.group);
|
||||||
|
} else {
|
||||||
|
this.$messageBox(`获取实训步骤数据失败`);
|
||||||
|
this.endViewLoading();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.endViewLoading();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 加载实操地图数据
|
||||||
|
async initPracticeData() {
|
||||||
|
this.$store.dispatch('training/end', TrainingMode.NORMAL);
|
||||||
|
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式
|
||||||
|
this.switchMode('01');
|
||||||
|
|
||||||
|
if (parseInt(this.mapId)) {
|
||||||
|
await this.loadNewMapDataByGroup(this.group);
|
||||||
|
} else {
|
||||||
|
this.endViewLoading();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 加载仿真信息
|
||||||
|
async loadSimulationInfo() {
|
||||||
|
// this.dataError = false;
|
||||||
|
const resp = await getSimulationInfoNew(this.group);
|
||||||
|
if (resp && resp.code == 200 && resp.data && !resp.data.dataError) {
|
||||||
|
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;
|
||||||
|
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('此地图数据正在维护中,无法运行!');
|
||||||
|
}
|
||||||
|
},
|
||||||
// 设置检查在线定时器
|
// 设置检查在线定时器
|
||||||
checkLoginLineTimer() {
|
checkLoginLineTimer() {
|
||||||
if (this.checkLine) {
|
if (this.checkLine) {
|
||||||
@ -387,12 +448,112 @@ export default {
|
|||||||
this.mapBoxP.style.cursor = 'none';
|
this.mapBoxP.style.cursor = 'none';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(this.mapBoxP.style.cursor);
|
|
||||||
}, 1000);
|
}, 1000);
|
||||||
},
|
},
|
||||||
mousemove() {
|
// 结束加载状态
|
||||||
this.mouseNum = 1;
|
endViewLoading(isSuccess) {
|
||||||
|
if (!isSuccess) {
|
||||||
|
this.$store.dispatch('map/mapClear');
|
||||||
|
}
|
||||||
|
this.$nextTick(() => {
|
||||||
|
EventBus.$emit('viewLoading', false);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
switchMode(prdType) {
|
||||||
|
this.$store.dispatch('training/setPrdType', prdType);
|
||||||
|
},
|
||||||
|
// 选择脚本
|
||||||
|
selectQuest(row) {
|
||||||
|
this.scriptId = parseInt(row.id);
|
||||||
|
if (this.isDemon) {
|
||||||
|
this.$refs.menuDemon.initLoadPage();
|
||||||
|
}
|
||||||
|
if (this.isScript) {
|
||||||
|
this.$refs.menuScript.initLoadPage();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 仿真系统
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 通过group加载地图数据
|
||||||
|
async loadNewMapDataByGroup(group) {
|
||||||
|
try {
|
||||||
|
await loadNewMapDataByGroup(group);
|
||||||
|
await this.$store.dispatch('training/setMapDefaultState');
|
||||||
|
} catch (error) {
|
||||||
|
this.$messageBox(`获取地图数据失败: ${error.message}`);
|
||||||
|
this.endViewLoading();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 退出脚本
|
||||||
|
async quitQuest() {
|
||||||
|
this.scriptId = 0;
|
||||||
|
},
|
||||||
|
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,
|
||||||
|
token:getToken(),
|
||||||
|
project: this.project
|
||||||
|
}
|
||||||
|
});
|
||||||
|
window.open(routeData.href, '_blank', 'noopener noreferrer');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
passflow() {
|
||||||
|
const routeData = this.$router.resolve({
|
||||||
|
path:'/jlmap3d/passengerflow',
|
||||||
|
query:{
|
||||||
|
mapid:this.mapId,
|
||||||
|
group:this.group,
|
||||||
|
project: this.project
|
||||||
|
}
|
||||||
|
});
|
||||||
|
window.open(routeData.href, '_blank', 'noopener noreferrer');
|
||||||
|
},
|
||||||
|
devicemodel() {
|
||||||
|
if (this.deviceShow == false) {
|
||||||
|
this.deviceShow = true;
|
||||||
|
} else {
|
||||||
|
this.deviceShow = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
jl3dstation() {
|
||||||
|
const routeData = this.$router.resolve({
|
||||||
|
path:'/jlmap3d/jl3dstation',
|
||||||
|
query:{
|
||||||
|
mapid:this.mapId,
|
||||||
|
project: this.project
|
||||||
|
}
|
||||||
|
});
|
||||||
|
window.open(routeData.href, '_blank', 'noopener noreferrer');
|
||||||
|
},
|
||||||
|
showScheduling() {
|
||||||
|
this.$refs.scheduling.doShow();
|
||||||
|
},
|
||||||
|
showdriving() {
|
||||||
|
this.panelShow = true;
|
||||||
|
this.drivingShow = false;
|
||||||
|
},
|
||||||
|
// showpanel() {
|
||||||
|
// this.panelShow = true;
|
||||||
|
// this.simulationShow = false;
|
||||||
|
// }
|
||||||
setPosition() {
|
setPosition() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
let offset = 15;
|
let offset = 15;
|
||||||
@ -424,271 +585,6 @@ export default {
|
|||||||
setCenter(code) {
|
setCenter(code) {
|
||||||
this.$refs.mapCanvas.setCenter(code);
|
this.$refs.mapCanvas.setCenter(code);
|
||||||
},
|
},
|
||||||
// 结束加载状态
|
|
||||||
endViewLoading(isSuccess) {
|
|
||||||
if (!isSuccess) {
|
|
||||||
this.$store.dispatch('map/mapClear');
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$nextTick(() => {
|
|
||||||
EventBus.$emit('viewLoading', false);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 加载仿真信息
|
|
||||||
async loadSimulationInfo() {
|
|
||||||
this.dataError = false;
|
|
||||||
const resp = await getSimulationInfoNew(this.group);
|
|
||||||
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)}`));
|
|
||||||
if (resp.data.planRunning) {
|
|
||||||
this.planRunning = resp.data.planRunning;
|
|
||||||
} else {
|
|
||||||
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('此地图数据正在维护中,无法运行!');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 加载地图数据
|
|
||||||
async initLoadData() {
|
|
||||||
this.$store.dispatch('training/reset');
|
|
||||||
try {
|
|
||||||
await this.loadSimulationInfo();
|
|
||||||
if (this.isDemon) {
|
|
||||||
await this.initLoadDemonData();
|
|
||||||
} else if (this.isScript) {
|
|
||||||
await this.initLoadTaskData();
|
|
||||||
} else if (this.isPractice) {
|
|
||||||
await this.initPracticeData();
|
|
||||||
} else {
|
|
||||||
await this.initLoadLessonOrExamData();
|
|
||||||
}
|
|
||||||
this.checkLoginLineTimer();
|
|
||||||
this.checkMouseStatusTimer();
|
|
||||||
} catch (error) {
|
|
||||||
this.$messageBox(`初始化失败: ${error.message}`);
|
|
||||||
this.endViewLoading();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 课程和考试系统
|
|
||||||
async initLoadLessonOrExamData() {
|
|
||||||
this.$store.dispatch('training/end', null);
|
|
||||||
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式
|
|
||||||
|
|
||||||
if (parseInt(this.trainingId)) {
|
|
||||||
// 设置地图数据
|
|
||||||
// 设置实训数据
|
|
||||||
const resp = await getTrainingDetailNew(this.trainingId);
|
|
||||||
if (resp && resp.code == 200) {
|
|
||||||
const detail = resp.data;
|
|
||||||
await this.$store.dispatch('training/setPrdType', this.prdTypeMap[detail.prdType]);
|
|
||||||
await this.loadNewMapDataByGroup(this.group);
|
|
||||||
} else {
|
|
||||||
this.$messageBox(`获取实训步骤数据失败`);
|
|
||||||
this.endViewLoading();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.endViewLoading();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 仿真系统
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 任务录制系统
|
|
||||||
async initLoadTaskData() {
|
|
||||||
this.$store.dispatch('training/end', TrainingMode.NORMAL);
|
|
||||||
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式
|
|
||||||
this.switchMode('01');
|
|
||||||
|
|
||||||
if (parseInt(this.mapId)) {
|
|
||||||
await this.loadNewMapDataByGroup(this.group);
|
|
||||||
} else {
|
|
||||||
this.endViewLoading();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 加载实操地图数据
|
|
||||||
async initPracticeData() {
|
|
||||||
this.$store.dispatch('training/end', TrainingMode.NORMAL);
|
|
||||||
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式
|
|
||||||
this.switchMode('01');
|
|
||||||
|
|
||||||
if (parseInt(this.mapId)) {
|
|
||||||
await this.loadNewMapDataByGroup(this.group);
|
|
||||||
} else {
|
|
||||||
this.endViewLoading();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 选择脚本
|
|
||||||
async selectQuest(row, id, mapLocation, roleName) {
|
|
||||||
try {
|
|
||||||
const res = await loadScriptNew(row.id, id, this.group);
|
|
||||||
if (res && res.code == 200) {
|
|
||||||
this.questId = parseInt(row.id);
|
|
||||||
if (mapLocation) {
|
|
||||||
const newMapLocation = {'offsetX': mapLocation.x, 'offsetY': mapLocation.y, 'scaleRate': mapLocation.scale};
|
|
||||||
Vue.prototype.$jlmap.setOptions(newMapLocation);
|
|
||||||
}
|
|
||||||
scriptExecuteNew(this.group).then(data=>{
|
|
||||||
}).catch(error=>{
|
|
||||||
console.log(error);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (this.$refs.menuDemon) {
|
|
||||||
await this.$refs.menuDemon.initLoadPage();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.$refs.menuScript) {
|
|
||||||
await this.$refs.menuScript.initLoadPage();
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (error) {
|
|
||||||
this.$messageBox(error.message);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 退出脚本
|
|
||||||
async quitQuest() {
|
|
||||||
this.questId = 0;
|
|
||||||
this.$store.dispatch('scriptRecord/updateSimulationPause', false);
|
|
||||||
},
|
|
||||||
// 通过id加载地图数据
|
|
||||||
async loadNewMapDataByGroup(group) {
|
|
||||||
try {
|
|
||||||
await loadNewMapDataByGroup(group);
|
|
||||||
await this.$store.dispatch('training/setMapDefaultState');
|
|
||||||
} catch (error) {
|
|
||||||
this.$messageBox(`获取地图数据失败: ${error.message}`);
|
|
||||||
this.endViewLoading();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// 销毁仿真
|
|
||||||
quit(group) {
|
|
||||||
clearSimulation(group);
|
|
||||||
this.$store.dispatch('training/over');
|
|
||||||
},
|
|
||||||
// 仿真错误时,被动退出时调用
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 设置使用时间
|
|
||||||
async tryTime(param) {
|
|
||||||
const data = {
|
|
||||||
goodsId: param.goodsId,
|
|
||||||
time: param.time
|
|
||||||
};
|
|
||||||
if (data.goodsId) {
|
|
||||||
await setGoodsTryUse(data);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
switchMode(prdType) {
|
|
||||||
this.$store.dispatch('training/setPrdType', prdType);
|
|
||||||
},
|
|
||||||
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,
|
|
||||||
token:getToken(),
|
|
||||||
project: this.project
|
|
||||||
}
|
|
||||||
});
|
|
||||||
window.open(routeData.href, '_blank', 'noopener noreferrer');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
script3ddriveshow() {
|
|
||||||
this.panelShow = false;
|
|
||||||
this.drivingShow = true;
|
|
||||||
this.$refs.Jl3dDrive.show(this.mapId, this.group);
|
|
||||||
},
|
|
||||||
passflow() {
|
|
||||||
const routeData = this.$router.resolve({
|
|
||||||
path:'/jlmap3d/passengerflow',
|
|
||||||
query:{
|
|
||||||
mapid:this.mapId,
|
|
||||||
group:this.group,
|
|
||||||
project: this.project
|
|
||||||
}
|
|
||||||
});
|
|
||||||
window.open(routeData.href, '_blank', 'noopener noreferrer');
|
|
||||||
},
|
|
||||||
jl3dstation() {
|
|
||||||
const routeData = this.$router.resolve({
|
|
||||||
path:'/jlmap3d/jl3dstation',
|
|
||||||
query:{
|
|
||||||
mapid:this.mapId,
|
|
||||||
project: this.project
|
|
||||||
}
|
|
||||||
});
|
|
||||||
window.open(routeData.href, '_blank', 'noopener noreferrer');
|
|
||||||
},
|
|
||||||
devicemodel() {
|
|
||||||
if (this.deviceShow == false) {
|
|
||||||
this.deviceShow = true;
|
|
||||||
} else {
|
|
||||||
this.deviceShow = false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
showScheduling() {
|
|
||||||
this.$refs.scheduling.doShow();
|
|
||||||
},
|
|
||||||
showpanel() {
|
|
||||||
this.panelShow = true;
|
|
||||||
this.simulationShow = false;
|
|
||||||
},
|
|
||||||
showdriving() {
|
|
||||||
this.panelShow = true;
|
|
||||||
this.drivingShow = false;
|
|
||||||
},
|
|
||||||
setWindowSize() {
|
|
||||||
// this.$nextTick(() => {
|
|
||||||
const width = this.size ? this.size.width : this.width;
|
|
||||||
const height = this.size ? this.size.height : this.height;
|
|
||||||
|
|
||||||
this.$store.dispatch('config/resize', { width, height });
|
|
||||||
|
|
||||||
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });
|
|
||||||
// });
|
|
||||||
},
|
|
||||||
overallTranslation(flag) {
|
|
||||||
const panel = document.getElementById('leftSlider');
|
|
||||||
this.$refs.lessonMenu.handelGroupButtonTranslate(flag);
|
|
||||||
if (flag) {
|
|
||||||
panel.style.transform = 'translateX(400px)';
|
|
||||||
} else {
|
|
||||||
panel.style.transform = '';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
switchStationMode(val) {
|
switchStationMode(val) {
|
||||||
if (this.stationList.length > 0) {
|
if (this.stationList.length > 0) {
|
||||||
if (val == null) {
|
if (val == null) {
|
||||||
@ -727,21 +623,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style>
|
|
||||||
.main {
|
|
||||||
z-index: 10;
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
-moz-user-select: none;
|
|
||||||
-o-user-select: none;
|
|
||||||
-khtml-user-select: none;
|
|
||||||
-webkit-user-select: none;
|
|
||||||
-ms-user-select: none;
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<chat-box ref="chatbox" :group="group" :user-role="userRole" />
|
<chat-box ref="chatbox" :group="group" :user-role="userRole" />
|
||||||
<div class="display-card" :style="{top: offset+'px'}">
|
<!-- :style="{top: offset+'px'}" -->
|
||||||
|
<div class="display-card">
|
||||||
<el-row>
|
<el-row>
|
||||||
<span v-if="countTime" class="display-score">{{ $t('display.demon.trialTime') }} {{ countTime }}</span>
|
<span v-if="countTime" class="display-score">{{ $t('display.demon.trialTime') }} {{ countTime }}</span>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<div class="display-draft" :style="{bottom: offsetBottom + 'px'}">
|
<!-- :style="{bottom: offsetBottom + 'px'}" -->
|
||||||
|
<div class="display-draft">
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button v-if="isShowScheduling && !dataError" type="primary" @click="jumpScheduling">{{ $t('display.demon.dispatchingPlan') }}</el-button>
|
<el-button v-if="isShowScheduling && !dataError" type="primary" @click="jumpScheduling">{{ $t('display.demon.dispatchingPlan') }}</el-button>
|
||||||
<el-button v-if="!isShowScheduling && !dataError" type="jl3dpassflow" @click="jumpjl3dpassflow">{{ jl3dpassflow }}</el-button>
|
<el-button v-if="!isShowScheduling && !dataError" type="jl3dpassflow" @click="jumpjl3dpassflow">{{ jl3dpassflow }}</el-button>
|
||||||
@ -40,6 +42,7 @@ import { ranAsPlan, exitRunPlan, clearSimulation, getSimulationInfoNew } from '@
|
|||||||
import { PermissionType } from '@/scripts/ConstDic';
|
import { PermissionType } from '@/scripts/ConstDic';
|
||||||
import { getCountTime } from '@/utils/index';
|
import { getCountTime } from '@/utils/index';
|
||||||
import { quitScriptNew, scriptRePreview } from '@/api/simulation';
|
import { quitScriptNew, scriptRePreview } from '@/api/simulation';
|
||||||
|
import { setGoodsTryUse } from '@/api/management/goods';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'MenuDemon',
|
name: 'MenuDemon',
|
||||||
@ -48,10 +51,6 @@ export default {
|
|||||||
ChatBox
|
ChatBox
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
group: {
|
|
||||||
type: String,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
offset: {
|
offset: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: true
|
required: true
|
||||||
@ -60,27 +59,17 @@ export default {
|
|||||||
type: Number,
|
type: Number,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
questId: {
|
scriptId: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default() {
|
default() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showStation: {
|
|
||||||
type: String,
|
|
||||||
default() {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
dataError: {
|
dataError: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default() {
|
default() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
|
||||||
userRole: {
|
|
||||||
type: String,
|
|
||||||
required: true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@ -107,7 +96,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
isShowQuest() {
|
isShowQuest() {
|
||||||
return this.questId;
|
return this.scriptId;
|
||||||
},
|
},
|
||||||
isShowScheduling() {
|
isShowScheduling() {
|
||||||
return this.$route.query.prdType == '05';
|
return this.$route.query.prdType == '05';
|
||||||
@ -117,6 +106,20 @@ export default {
|
|||||||
},
|
},
|
||||||
isHebLine() {
|
isHebLine() {
|
||||||
return this.$route.query.lineCode === '07';
|
return this.$route.query.lineCode === '07';
|
||||||
|
},
|
||||||
|
group() {
|
||||||
|
return this.$route.query.group;
|
||||||
|
},
|
||||||
|
userRole() {
|
||||||
|
if (this.$route.query.prdType == '02') {
|
||||||
|
return 'DISPATCHER';
|
||||||
|
} else if (this.$route.query.prdType == '01') {
|
||||||
|
return 'STATION_SUPERVISOR';
|
||||||
|
} else if (this.$route.query.prdType == '04') {
|
||||||
|
return 'DRIVER';
|
||||||
|
} else {
|
||||||
|
return 'AUDIENCE';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -236,7 +239,7 @@ export default {
|
|||||||
quitScriptNew(this.group).then(resp => {
|
quitScriptNew(this.group).then(resp => {
|
||||||
scriptRePreview(this.group).then(resp=>{
|
scriptRePreview(this.group).then(resp=>{
|
||||||
getSimulationInfoNew(this.group).then(()=>{
|
getSimulationInfoNew(this.group).then(()=>{
|
||||||
this.$emit('quitQuest');
|
this.quitQuest();
|
||||||
this.initLoadPage();
|
this.initLoadPage();
|
||||||
this.clearAllData();
|
this.clearAllData();
|
||||||
}).catch(()=>{
|
}).catch(()=>{
|
||||||
@ -251,7 +254,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
quitScriptNew(this.group).then(resp => {
|
quitScriptNew(this.group).then(resp => {
|
||||||
getSimulationInfoNew(this.group).then(()=>{
|
getSimulationInfoNew(this.group).then(()=>{
|
||||||
this.$emit('quitQuest');
|
this.quitQuest();
|
||||||
this.initLoadPage();
|
this.initLoadPage();
|
||||||
this.clearAllData();
|
this.clearAllData();
|
||||||
}).catch(()=>{
|
}).catch(()=>{
|
||||||
@ -262,6 +265,10 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
quitQuest() {
|
||||||
|
this.$emit('quitQuest');
|
||||||
|
this.$store.dispatch('scriptRecord/updateSimulationPause', false);
|
||||||
|
},
|
||||||
clearAllData() {
|
clearAllData() {
|
||||||
this.$refs.chatbox.clearAllData();
|
this.$refs.chatbox.clearAllData();
|
||||||
},
|
},
|
||||||
@ -289,7 +296,11 @@ export default {
|
|||||||
},
|
},
|
||||||
setTryTime() {
|
setTryTime() {
|
||||||
if (this.try) {
|
if (this.try) {
|
||||||
this.$emit('tryTime', { time: this.tryTime, goodsId: this.goodsId });
|
const data = { time: this.tryTime, goodsId: this.goodsId };
|
||||||
|
if (data.goodsId) {
|
||||||
|
setGoodsTryUse(data);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
change3dname() {
|
change3dname() {
|
||||||
|
@ -33,10 +33,6 @@ export default {
|
|||||||
TipExamList
|
TipExamList
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
group: {
|
|
||||||
type: String,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
offset: {
|
offset: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: true
|
required: true
|
||||||
@ -82,6 +78,9 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
group() {
|
||||||
|
return this.$route.query.group;
|
||||||
|
},
|
||||||
formatUsedTime() {
|
formatUsedTime() {
|
||||||
return timeFormat(this.$store.state.training.usedTime);
|
return timeFormat(this.$store.state.training.usedTime);
|
||||||
}
|
}
|
||||||
|
@ -22,34 +22,28 @@
|
|||||||
</el-button-group>
|
</el-button-group>
|
||||||
</div>
|
</div>
|
||||||
<tip-training-detail :training-obj="trainingObj" :offset-bottom="offsetBottom + tipBottom" />
|
<tip-training-detail :training-obj="trainingObj" :offset-bottom="offsetBottom + tipBottom" />
|
||||||
|
<left-slider v-if="isShowLeftSlider" :offset-bottom="offsetBottom" @overallTranslation="overallTranslation" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import TipTrainingDetail from './tipTrainingDetail';
|
import TipTrainingDetail from './tipTrainingDetail';
|
||||||
|
import LeftSlider from '@/views/newMap/displayNew/LeftSlider';
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import { Notification } from 'element-ui';
|
import { Notification } from 'element-ui';
|
||||||
import { startTrainingNew, endTrainingNew } from '@/api/jmap/training';
|
import { startTrainingNew, endTrainingNew } from '@/api/jmap/training';
|
||||||
import { trainingNotifyNew } from '@/api/simulation';
|
import { trainingNotifyNew } from '@/api/simulation';
|
||||||
import { TrainingMode, UrlConfig } from '@/scripts/ConstDic';
|
import { TrainingMode, UrlConfig } from '@/scripts/ConstDic';
|
||||||
import { timeFormat } from '@/utils/date';
|
import { timeFormat } from '@/utils/date';
|
||||||
|
import { getTrainingStepsDetailNew } from '@/api/jmap/training';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'MenuLesson',
|
name: 'MenuLesson',
|
||||||
components: {
|
components: {
|
||||||
TipTrainingDetail
|
TipTrainingDetail,
|
||||||
|
LeftSlider
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
group: {
|
|
||||||
type: String,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
trainingObj: {
|
|
||||||
type: Object,
|
|
||||||
default() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
offset: {
|
offset: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: true
|
required: true
|
||||||
@ -91,6 +85,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
timeInterval: null,
|
timeInterval: null,
|
||||||
TrainingMode: TrainingMode,
|
TrainingMode: TrainingMode,
|
||||||
|
trainingObj:{},
|
||||||
demoMode: TrainingMode.TEACH,
|
demoMode: TrainingMode.TEACH,
|
||||||
isDisable: false,
|
isDisable: false,
|
||||||
backDisable: false,
|
backDisable: false,
|
||||||
@ -104,11 +99,17 @@ export default {
|
|||||||
'usedTime',
|
'usedTime',
|
||||||
'basicInfo'
|
'basicInfo'
|
||||||
]),
|
]),
|
||||||
|
group() {
|
||||||
|
return this.$route.query.group;
|
||||||
|
},
|
||||||
formatScore() {
|
formatScore() {
|
||||||
return this.score;
|
return this.score;
|
||||||
},
|
},
|
||||||
formatUsedTime() {
|
formatUsedTime() {
|
||||||
return timeFormat(this.usedTime);
|
return timeFormat(this.usedTime);
|
||||||
|
},
|
||||||
|
isShowLeftSlider() {
|
||||||
|
return this.$route.query.lessonId != '0';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -121,6 +122,15 @@ export default {
|
|||||||
this.isDisable = false;
|
this.isDisable = false;
|
||||||
},
|
},
|
||||||
'$store.state.map.mapViewLoadedCount': function (val) {
|
'$store.state.map.mapViewLoadedCount': function (val) {
|
||||||
|
if (this.$route.query.trainingId) {
|
||||||
|
getTrainingStepsDetailNew(this.$route.query.trainingId, { group: this.group }).then(resp => {
|
||||||
|
this.trainingObj = resp.data;
|
||||||
|
this.$store.dispatch('training/setTrainingData', this.trainingObj);
|
||||||
|
|
||||||
|
}).catch(error => {
|
||||||
|
this.$messageBox(`初始化失败实训内容失败: ${error.message}`);
|
||||||
|
});
|
||||||
|
}
|
||||||
this.$store.dispatch('training/end', null);
|
this.$store.dispatch('training/end', null);
|
||||||
this.$store.dispatch('training/reset');
|
this.$store.dispatch('training/reset');
|
||||||
this.$store.dispatch('training/emitTipFresh');
|
this.$store.dispatch('training/emitTipFresh');
|
||||||
@ -142,6 +152,14 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
overallTranslation(flag) {
|
||||||
|
const panel = document.getElementById('leftSlider');
|
||||||
|
if (flag) {
|
||||||
|
panel.style.transform = 'translateX(400px)';
|
||||||
|
} else {
|
||||||
|
panel.style.transform = '';
|
||||||
|
}
|
||||||
|
},
|
||||||
start() {
|
start() {
|
||||||
// 清空按钮操作
|
// 清空按钮操作
|
||||||
this.$store.dispatch('menuOperation/setButtonOperation', null);
|
this.$store.dispatch('menuOperation/setButtonOperation', null);
|
||||||
@ -231,14 +249,6 @@ export default {
|
|||||||
history.go(-1);
|
history.go(-1);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handelGroupButtonTranslate(flag) {
|
|
||||||
// const buttons = document.getElementById('teachGroupButton');
|
|
||||||
// if (flag) {
|
|
||||||
// buttons.style.transform = 'translateX(-400px)';
|
|
||||||
// } else {
|
|
||||||
// buttons.style.transform = 'translateX(0px)';
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
switchStationMode(val) {
|
switchStationMode(val) {
|
||||||
this.$emit('switchStationMode', val);
|
this.$emit('switchStationMode', val);
|
||||||
}
|
}
|
||||||
|
@ -30,10 +30,6 @@ export default {
|
|||||||
SetTime
|
SetTime
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
group: {
|
|
||||||
type: String,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
offset: {
|
offset: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: true
|
required: true
|
||||||
@ -78,6 +74,11 @@ export default {
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
computed:{
|
||||||
|
group() {
|
||||||
|
return this.$route.query.group;
|
||||||
|
}
|
||||||
|
},
|
||||||
watch:{
|
watch:{
|
||||||
'showStation':function(val) {
|
'showStation':function(val) {
|
||||||
this.showStationContent = this.showStation;
|
this.showStationContent = this.showStation;
|
||||||
|
@ -38,7 +38,9 @@ import { mapGetters } from 'vuex';
|
|||||||
import { OperateMode } from '@/scripts/ConstDic';
|
import { OperateMode } from '@/scripts/ConstDic';
|
||||||
// import { getStationList } from '@/api/runplan';
|
// import { getStationList } from '@/api/runplan';
|
||||||
import { getByGroupStationList } from '@/api/jmap/map';
|
import { getByGroupStationList } from '@/api/jmap/map';
|
||||||
import { getEveryDayRunPlanNew } from '@/api/simulation';
|
import {loadDraftScript, loadDraftScriptNew} from '@/api/designPlatform';
|
||||||
|
import { getEveryDayRunPlanNew, loadScriptNew, scriptExecuteNew } from '@/api/simulation';
|
||||||
|
import Vue from 'vue';
|
||||||
|
|
||||||
// 右上角操作
|
// 右上角操作
|
||||||
export default {
|
export default {
|
||||||
@ -50,10 +52,6 @@ export default {
|
|||||||
AddQuest
|
AddQuest
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
group: {
|
|
||||||
type: String,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
offset: {
|
offset: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: true
|
required: true
|
||||||
@ -102,6 +100,9 @@ export default {
|
|||||||
...mapGetters('runPlan', [
|
...mapGetters('runPlan', [
|
||||||
'stations'
|
'stations'
|
||||||
]),
|
]),
|
||||||
|
group() {
|
||||||
|
return this.$route.query.group;
|
||||||
|
},
|
||||||
notScript() {
|
notScript() {
|
||||||
return this.$route.params.mode !== 'script';
|
return this.$route.params.mode !== 'script';
|
||||||
},
|
},
|
||||||
@ -197,8 +198,29 @@ export default {
|
|||||||
const row = {id: this.$route.query.scriptId, group:this.$route.query.group, drawWay:this.$route.query.drawWay};
|
const row = {id: this.$route.query.scriptId, group:this.$route.query.group, drawWay:this.$route.query.drawWay};
|
||||||
this.$refs.addQuest.handleLoad(1, row);
|
this.$refs.addQuest.handleLoad(1, row);
|
||||||
},
|
},
|
||||||
selectQuest(row, id, mapLocation, roleName) {
|
async selectQuest(row, id, mapLocation, roleName) {
|
||||||
this.$emit('selectQuest', row, id, mapLocation, roleName);
|
try {
|
||||||
|
let res;
|
||||||
|
if (this.isDesignPlatform) {
|
||||||
|
res = this.drawWay ? await loadDraftScriptNew(id, this.group) : await loadDraftScript(row.id, id, this.group);
|
||||||
|
} else {
|
||||||
|
res = await loadScriptNew(row.id, id, this.group);
|
||||||
|
}
|
||||||
|
if (res && res.code == 200) {
|
||||||
|
this.questId = parseInt(row.id);
|
||||||
|
if (mapLocation) {
|
||||||
|
const newMapLocation = {'offsetX': mapLocation.x, 'offsetY': mapLocation.y, 'scaleRate': mapLocation.scale};
|
||||||
|
Vue.prototype.$jlmap.setOptions(newMapLocation);
|
||||||
|
}
|
||||||
|
scriptExecuteNew(this.group).then(data=>{
|
||||||
|
}).catch(error=>{
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.$emit('selectQuest', row);
|
||||||
|
} catch (error) {
|
||||||
|
this.$messageBox(error.message);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
switchMode(swch) {
|
switchMode(swch) {
|
||||||
this.$emit('switchMode', swch);
|
this.$emit('switchMode', swch);
|
||||||
|
@ -38,10 +38,6 @@ export default {
|
|||||||
TipScriptRecordNew
|
TipScriptRecordNew
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
group: {
|
|
||||||
type: String,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
offsetBottom: {
|
offsetBottom: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: true
|
required: true
|
||||||
@ -78,6 +74,9 @@ export default {
|
|||||||
...mapGetters('map', [
|
...mapGetters('map', [
|
||||||
'trainList'
|
'trainList'
|
||||||
]),
|
]),
|
||||||
|
group() {
|
||||||
|
return this.$route.query.group;
|
||||||
|
},
|
||||||
userRole() {
|
userRole() {
|
||||||
if (this.$store.state.training.prdType == '02') {
|
if (this.$store.state.training.prdType == '02') {
|
||||||
return 'DISPATCHER';
|
return 'DISPATCHER';
|
||||||
|
@ -129,6 +129,7 @@ export default {
|
|||||||
if (data == 'min') {
|
if (data == 'min') {
|
||||||
this.minimize = true;
|
this.minimize = true;
|
||||||
this.$refs.chatSetting.doClose();
|
this.$refs.chatSetting.doClose();
|
||||||
|
this.$refs.createGroup.doClose();
|
||||||
} else {
|
} else {
|
||||||
this.minimize = false;
|
this.minimize = false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user