北交大客流仿真系统代码调整

This commit is contained in:
joylink_cuiweidong 2020-12-02 17:45:19 +08:00
parent 84d7d145c2
commit b51ebde280
5 changed files with 222 additions and 87 deletions

View File

@ -646,7 +646,7 @@ class SkinCode extends defaultStyle {
trainHeadArrowOffsetX: 2 // 列车车头三角偏移
},
common: {
trainHeight: 16, // 列车高度
trainHeight: 10, // 列车高度
trainHeadDistance: 2, // 列车和车头之间的间距
trainWidth: 76, // 列车长度
trainTextFontSize: 10, // 列车字号

View File

@ -534,15 +534,26 @@ export default {
getLoginInfo(getToken()).then(res => {
getSimulationInfoNew(res.data.group).then(resp => {
this.$store.dispatch('app/transitionAnimations');
this.$router.push({ path: `/displayNew/demon`, query: {
lineCode: resp.data.map.lineCode,
group: res.data.group,
prdType: resp.data.prodType,
mapId: resp.data.map.id,
goodsId:'',
try:'0',
project:this.project
}});
if (this.project === 'drts') {
this.$router.push({ path: `/displayNew/demon`, query: {
lineCode: resp.data.map.lineCode,
group: res.data.group,
prdType: resp.data.prodType,
mapId: resp.data.map.id,
goodsId:'',
try:'0',
project:this.project
}});
} else {
this.$router.push({ path: `/practiceDisplay`, query: {
lineCode: resp.data.map.lineCode,
group: res.data.group,
prdType: resp.data.prodType,
mapId: resp.data.map.id,
project:this.project
}});
}
this.loading = false;
launchFullscreen();
});

View File

@ -1,14 +1,11 @@
<template>
<div>
<div v-if="isAllShow" class="display_top_draft" :style="allStyle">
<div v-if="isAllShow&&project != 'bjd'" class="display_top_draft" :style="allStyle">
<div class="btn_hover" @click="menuClick">菜单</div>
<el-button-group ref="button_group_box" class="button_group_box" :style="`margin-left:-${btnWidth}px`">
<!-- 地图错误判断 -->
<template v-if="project === 'bjd'">
<el-button size="small" @click="passengersView">客流视图</el-button>
<el-button v-if="running" size="small" @click="viewRunPlan">{{ $t('joinTraining.runGraphPreview') }}</el-button>
<el-button v-if="!running" size="small" type="warning" @click="loadRunPlan">{{ $t('joinTraining.runGraphLoading') }}</el-button><!-- 运行图加载 -->
</template>
<!-- <template v-if="project === 'bjd'">
</template> -->
<!-- 设备视图 -->
<el-button v-if="jl3dmodelShow && !isContest && project !== 'bjd'" size="small" @click="jumpjlmap3dmodel">{{ jl3dmodel }}</el-button>
<!-- 三维视图/数字沙盘 -->
@ -30,9 +27,8 @@
<!-- <el-button v-if="isContest" size="small" @click=" fieldTeach">实操教学</el-button> -->
<!-- <el-button v-if="isContest" size="small" @click=" fieldExam">实操测验</el-button> -->
<el-button v-if="isContest" size="small" @click="goTheoryQuiz">理论考试</el-button>
<el-button v-if="project === 'bjd'" size="small" @click="distribute">权限分发</el-button>
<el-button v-if="isContest || project === 'bjd'" size="small" @click="messageBoardShow">留言板</el-button>
<el-button v-if="isContest || project === 'bjd'" size="small" @click="contectUs">联系方式</el-button>
<el-button v-if="isContest" size="small" @click="messageBoardShow">留言板</el-button>
<el-button v-if="isContest" size="small" @click="contectUs">联系方式</el-button>
</el-button-group>
</div>
<Jl3d-Device
@ -41,11 +37,9 @@
:panel-show="deviceShow"
@closedevice3dview="jumpjlmap3dmodel"
/>
<distribute-draft ref="distribute" @QrCodeShow="QrCodeShow" />
<Jl3d-Drive v-show="drivingShow" ref="Jl3dDrive" :panel-show="drivingShow" @showdriving="showdriving" />
<scheduling v-if="scheduleLoadShow" ref="scheduling" :group="group" />
<scheduling-view v-if="schedulePreviewShow" ref="schedulingView" :group="group" />
<qr-code ref="qrCode" />
<contect-us ref="contectUs" />
</div>
</template>
@ -57,10 +51,7 @@ import { getSessionStorage } from '@/utils/auth';
import Scheduling from '@/views/newMap/displayNew/demon/scheduling';
import SchedulingView from '@/views/newMap/displayNew/demon/schedulingView';
import { EventBus } from '@/scripts/event-bus';
import DistributeDraft from '@/views/components/limits/distribute';
import QrCode from '@/components/QrCode';
import ContectUs from '@/views/newMap/displayNew/dispatherContest/contectUs';
import { PermissionType } from '@/scripts/ConstDic';
export default {
name:'DemonMenu',
components:{
@ -68,8 +59,6 @@ export default {
Jl3dDrive,
Scheduling,
SchedulingView,
DistributeDraft,
QrCode,
ContectUs
},
props:{
@ -134,8 +123,7 @@ export default {
jl3dtraffictrain:this.$t('display.demon.traffictraintext'),
jl3dpassflow:this.$t('display.demon.passengerflow'),
jl3dname: this.$t('display.demon.threeDimensionalView'),
jl3dmodel: this.$t('display.demon.deviceView'),
openWindow:null
jl3dmodel: this.$t('display.demon.deviceView')
};
},
computed:{
@ -269,54 +257,9 @@ export default {
fieldPractice() {
this.$emit('fieldPractice');
},
viewRunPlan() {
const routeData = this.$router.resolve({
path:'/planSchedule/window',
query:{
mapId:this.$route.query.mapId,
group:this.$route.query.group,
lineCode: this.$route.query.lineCode,
project: this.$route.query.project,
noPreLogout: true,
initTime: this.$store.state.training.initTime
}
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
},
passengersView() {
if (this.openWindow) {
this.openWindow.close();
}
const routeData = this.$router.resolve({
path:'/practiceDisplay',
query:{
mapId:this.$route.query.mapId,
group:this.$route.query.group,
lineCode: this.$route.query.lineCode,
project: this.$route.query.project,
noPreLogout: true
// initTime: this.$store.state.training.initTime
}
});
// this.openWindow = window.open(routeData.href, '_blank', 'noopener noreferrer');
this.openWindow = window.open(routeData.href);
},
loadRunPlan() {
this.$emit('runPlanLoadShow');
},
goTheoryQuiz() {
this.$emit('goTheoryQuiz');
},
QrCodeShow(data) {
if (this.$refs && data) {
this.$refs.qrCode.doShow(data);
}
},
distribute() {
if (this.$refs) {
this.$refs.distribute.doShow({PermissionType:PermissionType.SIMULATION, mapId: this.$route.query.mapId, prdType: this.$route.query.prdType});
}
},
messageBoardShow() {
// this.$refs.messageBoard.doShow();
const routeData = this.$router.resolve({

View File

@ -25,8 +25,8 @@
<div class="display-draft" :class="{'haerbin_btn_box': $route.query.lineCode == '07'}" :style="{bottom: offsetBottom + 'px'}">
<el-button-group class="button-group-box">
<el-button type="primary" size="small" @click="back">{{ projectDevice||project==='bjd'?'退出':$t('display.demon.back') }}</el-button>
<template v-if="!dataError">
<el-button v-if="project !='bjd'" type="primary" size="small" @click="back">{{ projectDevice?'退出':$t('display.demon.back') }}</el-button>
<template v-if="!dataError&&project != 'bjd'">
<template v-if="isScriptRun">
<el-button type="danger" size="small" @click="handleQuitQuest">退出剧本</el-button>
</template>
@ -38,6 +38,8 @@
</el-button-group>
</div>
<div style="position:absolute;right:0;bottom:0"><el-button v-if="project ==='bjd'" type="primary" @click="quit">退出</el-button></div>
<menu-schema
ref="menuSchema"
:offset="offset"
@ -343,7 +345,8 @@ export default {
},
async back() {
this.isGoback = true;
if (this.projectDevice || this.project === 'bjd') {
if (this.projectDevice) {
// || this.project === 'bjd'
clearSimulation(this.group).then(res=>{
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('LogOut').then(() => {
@ -370,6 +373,9 @@ export default {
},
runPlanLoadShow() {
this.$refs.menuSchema.loadRunPlan();
},
quit() {
window.close();
}
}
};

View File

@ -3,11 +3,22 @@
<div v-show="maskOpen" class="mask" :style="{'width': maskWidth}" />
<jlmap-visual ref="jlmapVisual" />
<div class="menudown">
<el-button-group>
<el-button type="primary" @click="back">退出</el-button>
<el-button-group class="button-group-box">
<el-button type="success" :disabled="isDisable" size="small" @click="selectBeginTime">{{ $t('display.demon.drivingByPlan') }}</el-button>
<el-button type="danger" size="small" @click="end">{{ $t('display.demon.initialize') }}</el-button>
<el-button type="primary" size="small" @click="back">退出</el-button>
</el-button-group>
</div>
<menu-system-time ref="menuSystemTime" :offset="15" :group="group" />
<el-button-group ref="button_group_box" class="button_group">
<!-- {{ $t('joinTraining.runGraphPreview') }} -->
<el-button v-if="running" size="small" @click="viewRunPlan">运行图视图</el-button>
<!-- 运行图加载 -->
<el-button size="small" @click="dispatcherWorkStation">ATS行调工作站</el-button>
<!-- <el-button v-if="!running" size="small" type="warning" @click="loadRunPlan">{{ $t('joinTraining.runGraphLoading') }}</el-button> -->
<el-button size="small" @click="distribute">权限分发</el-button>
<el-button size="small" @click="messageBoardShow">留言板</el-button>
<el-button size="small" @click="contectUs">联系方式</el-button>
</el-button-group>
<div class="trainExample">
<div class="trainExampleL">
<div class="trainExampleName">车站 颜色图例</div>
@ -40,13 +51,25 @@
</div>
</div>
</div>
<distribute-draft ref="distribute" @QrCodeShow="QrCodeShow" />
<qr-code ref="qrCode" />
<menu-system-time ref="menuSystemTime" :offset="15" :group="group" />
<contect-us ref="contectUs" />
<run-plan-Load ref="runPlanLoad" :group="group" />
<set-time ref="setTime" @ConfirmSelectBeginTime="start" />
</div>
</template>
<script>
import JlmapVisual from '@/views/newMap/jlmapNew/index';
import DistributeDraft from '@/views/components/limits/distribute';
import QrCode from '@/components/QrCode';
import ContectUs from '@/views/newMap/displayNew/dispatherContest/contectUs';
import RunPlanLoad from './demon/runPlanLoad';
import SetTime from './demon/setTime';
// import { Notification } from 'element-ui';
import { PermissionType } from '@/scripts/ConstDic';
import { loadMapDataById } from '@/utils/loaddata';
import { clearSimulation, getSimulationInfoNew } from '@/api/simulation';
import { clearSimulation, getSimulationInfoNew, ranAsPlan, exitRunPlan } from '@/api/simulation';
import { creatSubscribe, clearSubscribe, displayTopic, jl3dTopic} from '@/utils/stomp';
import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime';
import { getToken } from '@/utils/auth';
@ -56,13 +79,19 @@ export default {
name:'PracticeDisplay',
components: {
JlmapVisual,
MenuSystemTime
MenuSystemTime,
QrCode,
DistributeDraft,
ContectUs,
SetTime,
RunPlanLoad
},
data() {
return {
maskOpen: false,
maskWidth: '100%',
group:''
group:'',
openWindow:null
};
},
computed:{
@ -77,6 +106,12 @@ export default {
},
height() {
return this.$store.state.app.height;
},
running() {
return this.$store.state.training.started;
},
isDisable() {
return this.$store.state.training.started;
}
},
watch:{
@ -161,7 +196,16 @@ export default {
this.$store.dispatch('config/resize', { width, height });
},
async back() {
window.close();
// this.isGoback = true;
clearSimulation(this.group).then(res=>{
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('LogOut').then(() => {
// this.$store.dispatch('training/reset');
// this.$store.dispatch('map/mapClear');
location.reload();
});
});
});
},
async statusMessage(list) {
await this.$store.dispatch('training/updateMapState', list);
@ -193,6 +237,132 @@ export default {
}
this.dataError = resp.data.dataError;
}
},
distribute() {
if (this.$refs) {
this.$refs.distribute.doShow({PermissionType:PermissionType.SIMULATION, mapId: this.$route.query.mapId, prdType: this.$route.query.prdType});
}
},
QrCodeShow(data) {
if (this.$refs && data) {
this.$refs.qrCode.doShow(data);
}
},
messageBoardShow() {
// this.$refs.messageBoard.doShow();
const routeData = this.$router.resolve({
path:'/messageBoard',
query:{
project: this.$route.query.project,
noPreLogout: true
}
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
},
contectUs() {
this.$refs.contectUs.doShow();
},
viewRunPlan() {
const routeData = this.$router.resolve({
path:'/planSchedule/window',
query:{
mapId:this.$route.query.mapId,
group:this.$route.query.group,
lineCode: this.$route.query.lineCode,
project: this.$route.query.project,
noPreLogout: true,
initTime: this.$store.state.training.initTime
}
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
},
dispatcherWorkStation() {
if (this.openWindow) {
this.openWindow.close();
}
const routeData = this.$router.resolve({
path:'/displayNew/demon',
query:{
mapId:this.$route.query.mapId,
group:this.$route.query.group,
prdType: this.$route.query.prdType,
lineCode: this.$route.query.lineCode,
project: this.$route.query.project,
noPreLogout: true,
goodsId:'',
try:'0'
}
});
this.openWindow = window.open(routeData.href);
},
loadRunPlan() {
this.$refs.runPlanLoad.doShow();
},
selectBeginTime() {
this.$refs.setTime.doShow();
},
end() {
exitRunPlan(this.group).then(() => {
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => {
this.$store.dispatch('map/clearJlmapTrainView');
this.$store.dispatch('map/resetActiveTrainList', false);
this.$store.dispatch('map/setTrainWindowShow', false);
});
});
}).catch(() => {
this.$messageBox(this.$t('display.demon.endSimulationFail'));
});
},
start(model) { // 仿
const data = {
time: model.initTime
};
if (this.$route.query.prdType === '04') {
data.loadNumber = model.loadNum;
}
ranAsPlan(data, this.group).then(res => {
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`));
}).catch(error => {
let message = '';
switch (error.code) {
case '5001':
message = this.$t('error.mapDataError');
break;
case '5002':
message = this.$t('error.runningChartDataError');
break;
case '5003':
message = this.$t('error.runningChartIsNotLoaded');
break;
case '5004':
message = this.$t('error.runningDataError');
break;
case '5000':
message = this.$t('error.systemError');
break;
case '4000':
message = this.$t('error.simulationDoesNotExist');
break;
case '4001':
message = this.$t('error.simulationOperationIsNotDefined');
break;
case '4002':
message = this.$t('error.simulationOperationProcessingMethodNotFound');
break;
case '4003':
message = this.$t('error.simulationOperationFailed');
break;
case '4004':
message = this.$t('error.operationConflict');
break;
default:
message = '按计划行车异常,请退出重试!';
// this.$messageBox(',退!');
break;
}
this.$messageBox(message + '' + this.$t('error.startSimulationFailed'));
});
}
}
};
@ -209,7 +379,7 @@ export default {
width: 360px;
padding: 10px;
left: 20px;
top: 20px;
bottom: 40px;
color: #fff;
border: 1px #fff solid;
border-radius: 3px;
@ -237,9 +407,14 @@ export default {
margin-left: 10px;
}
.menudown{
bottom:0;
right:0;
position:absolute;
position: absolute;
right: 10px;
bottom: 15px;
}
.trainExampleR{display: inline-block;}
.button_group{
position: absolute;
left: 10px;
top: 15px;
}
</style>