北交大 项目 菜单代码调整

This commit is contained in:
joylink_cuiweidong 2022-09-20 16:17:02 +08:00
parent b79202c70e
commit 5c948ea596
8 changed files with 291 additions and 26 deletions

View File

@ -53,7 +53,8 @@ class ESolidStand extends Group {
}
const path = window.location.href;
if (path.includes('/practiceDisplay')) {
const search = window.location.search;
if (path.includes('/display/demon') && search.includes('project=bjd')) {
// 文字描述
this.arrowText = new Text({
zlevel: this.model.zlevel,
@ -124,7 +125,8 @@ class ESolidStand extends Group {
setState(model) {
const style = this.model.style;
const path = window.location.href;
if (!path.includes('/practiceDisplay')) {
const search = window.location.search;
if (!(path.includes('/display/demon') && search.includes('project=bjd'))) {
// 列车跳停
model.assignSkip && this.setColor(style.StationStand.solidStand.designatedJumpStopColor);
// 全部跳停

View File

@ -104,8 +104,9 @@ class EMouse extends Group {
};
// \nNumber of people: ${this.device.model.num ? this.device.model.num : 0}
const path = window.location.href;
const search = window.location.search;
const stationNames = new Map(store.state.map.map.stationList.map(s=>[s.code, s.name]));
if (!path.includes('/practiceDisplay')) {
if (!(path.includes('/display/demon') && search.includes('project=bjd'))) {
if (LangStorage.getLang() == 'en') {
text = ` The planned train: ${trainType} \n Table No.: ${this.device.model.serviceNumber} \n Train Trip No.: ${this.device.model.tripNumber}\n Destination: ${this.device.model.destinationCode ? this.device.model.destinationCode : ''}\n Train No.: ${this.device.model.groupNumber}\n Early or late: ${destinationText}\n Direction: ${direction ? 'up' : 'down'}\n Crew No.: \n Start Station: \n Terminal Station: \n Occupied Track: ${this.device.model.sectionModel ? (this.device.model.sectionModel.parentName ? this.device.model.sectionModel.parentName : this.device.model.sectionModel.name) : ''}\n Current Station: \n Train-ground communication: normal \n Operation Speed level: 4 \n Detained: ${this.device.model.hold ? 'Detained' : 'Normal'}\n \n 跳停状态: ${this.device.model.jump ? 'Skip to continue moving' : 'Normal'}Stationary: ${!this.device.model.stop ? 'No' : 'Yes'}\n Blocked: No \n Speed: ${this.device.model.speed || 0} km/h \n Authorized Distance: ${this.device.model.maLen || 0} m`;
} else {
@ -137,7 +138,7 @@ class EMouse extends Group {
}
});
if (path.includes('/practiceDisplay')) {
if (path.includes('/display/demon') && search.includes('project=bjd')) {
this.arrowText.setStyle('textFont', 12 + 'px consolas');
this.arrowText.setStyle('y', this.device.model.point.y + 15);
this.arrowText.setStyle('x', this.device.model.point.x + 55);

View File

@ -385,7 +385,8 @@ export default class Train extends Group {
// }
this.setRunStatus(model.stop, flag);
const path = window.location.href;
if (!path.includes('/practiceDisplay')) {
const search = window.location.search;
if (!(path.includes('/display/demon') && search.includes('project=bjd'))) {
if (this.style.Train.common.trainHeadColorChangeMode) {
this.setDriveMode(model.driveMode + model.runLevel);
} else {
@ -408,7 +409,7 @@ export default class Train extends Group {
if (style.Section.trainPosition.display) {
this.updateSection(object);
}
if (path.includes('/practiceDisplay')) {
if (path.includes('/display/demon') && search.includes('project=bjd')) {
this.handlePassagerColor(model.num);
}
if (style.Train.trainBody.trainBodyFaultFlashColor) {

View File

@ -31,7 +31,8 @@ function handle(state, data) {
// console.log(data, 'socket订阅');
const msg = data.body;
const path = window.location.href;
if ((path.includes('/practiceDisplay') || path.includes('/planSchedule/window')) && !state.isFirst) { state.isFirst = true; }
const search = window.location.search;
if (((path.includes('/display/demon') && search.includes('project=bjd')) || path.includes('/planSchedule/window')) && !state.isFirst) { state.isFirst = true; }
switch (data.type) {
case 'Order_Pay_Result': // 订单支付结果消息
state.payOrder = msg;

View File

@ -580,7 +580,8 @@ export default {
}});
} else {
this.$store.dispatch('app/transitionAnimations');
this.$router.push({ path: `/practiceDisplay`, query: {
// /practiceDisplay
this.$router.push({ path: `/display/demon`, query: {
lineCode: resp.data.map.lineCode,
group: res.data.group,
prdType: resp.data.prodType,

View File

@ -0,0 +1,141 @@
<template>
<el-dialog
title="切换客流数据"
:visible.sync="flowDataShow"
top="150px"
width="400px"
:before-do-close="flowDataClose"
:close-on-click-modal="false"
:z-index="5000"
>
<div>
<el-form ref="ruleForm" label-width="100px">
<el-form-item label="客流数据:" prop="role">
<el-select v-model="currentFlowDataId" placeholder="请选择客流数据" @change="changeData">
<el-option
v-for="item in flowDataList"
:key="item.id"
:label="item.name==currentFlowDataName?item.name+' [运行中]':item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="flowDataClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" :disabled="isDisabled" :loading="loading" @click="confirmFlowData">{{ $t('global.confirm') }}</el-button>
</span>
</el-dialog>
</template>
<script>
// clearSimulation, getSimulationInfoNew, ranAsPlan, exitRunPlan, ,
import { getPassengerFlowData, changePassengerFlowData } from '@/api/simulation';
import { getToken } from '@/utils/auth';
// displayTopic,
import { creatSubscribe, clearSubscribe, LPFTopic} from '@/utils/stomp';
export default {
name:'FlowData',
data() {
return {
group:'',
flowDataList:[],
currentFlowDataName:'',
currentFlowDataId:'',
flowDataShow:false,
isDisabled:false,
loading:false
};
},
computed:{
mapId() {
return this.$route.query.mapId;
},
running() {
return this.$store.state.training.started;
},
isDisable() {
return this.$store.state.training.started;
}
},
watch:{
'$store.state.map.mapViewLoadedCount':function() {
// this.$store.dispatch('map/setTrainWindowShow', false);
// this.$jlmap.off('zoom');
if (this.group) {
getPassengerFlowData(this.mapId).then(res=>{
this.flowDataList = res.data;
const currentFlowData = res.data.find(each=>{ return each.initial; });
if (currentFlowData) {
this.currentFlowDataName = currentFlowData.name;
this.currentFlowDataId = currentFlowData.id;
}
// this.subscribe();
});
}
},
'$store.state.socket.isFirst':function(val) {
if (val) {
const header = { group: this.group || '', 'X-Token': getToken() };
creatSubscribe(`${LPFTopic}\/${this.$route.query.group}`, header);
}
}
},
beforeDestroy() {
// this.$store.dispatch('map/mapClear');
if (this.group) {
// clearSimulation(this.group);
this.clearSubscribe();
this.$store.dispatch('socket/resetTrainPassagerNum');
this.$store.dispatch('socket/setIsFirst', false);
}
},
mounted() {
this.group = this.$route.query.group;
},
methods:{
doShow() {
if (!this.flowDataShow) {
this.flowDataShow = true;
this.isDisabled = true;
const currentFlowData = this.flowDataList.find(each=>{ return each.name == this.currentFlowDataName; });
if (currentFlowData) { this.currentFlowDataId = currentFlowData.id; }
}
},
clearSubscribe() {
clearSubscribe(`${LPFTopic}\/${this.group}`);
// clearSubscribe(`${displayTopic}\/${this.group}`);
},
flowDataClose() {
this.flowDataShow = false;
},
confirmFlowData() {
if (this.currentFlowDataId) {
this.loading = true;
changePassengerFlowData(this.group, this.currentFlowDataId).then(res=>{
this.$store.dispatch('socket/resetTrainPassagerNum');
// this.$store.dispatch('map/mapClear');
this.flowDataShow = false;
const currentFlowData = this.flowDataList.find(each=>{ return each.id == this.currentFlowDataId; });
if (currentFlowData) { this.currentFlowDataName = currentFlowData.name; }
this.loading = false;
}).catch(error=>{
this.loading = false;
this.$messageBox('切换客流数据失败');
console.log(error.message);
});
} else {
this.$messageBox('当前的客流数据不存在');
}
},
changeData(id) {
const currentFlowData = this.flowDataList.find(each=>{ return each.id == id; });
if (currentFlowData && currentFlowData.name == this.currentFlowDataName) {
this.isDisabled = true;
} else {
this.isDisabled = false;
}
}
}
};
</script>

View File

@ -22,19 +22,24 @@
<Jl3d-Device v-if="deviceif" v-show="deviceShow" ref="Jl3dDevice" :panel-show="deviceShow" @closedevice3dview="jlmap3dmodel" />
<modify-time v-if="datie" ref="modifySysTime" />
<set-time ref="setTime" @ConfirmSelectBeginTime="start" />
<distribute-draft ref="distribute" @QrCodeShow="QrCodeShow" />
<flow-data ref="flowData" />
</div>
</template>
<script>
import DistributeDraft from '@/views/components/limits/distribute';
import { getPostByProjectCode } from '@/api/learn';
import { getSessionStorage } from '@/utils/auth';
import { ProjectCode } from '@/scripts/ProjectConfig';
import ContectUs from './contectUs';
import ModifyTime from './modifyTime';
import FlowData from './flowData';
import SetTime from './setTime';
import Jl3dDevice from '@/views/jlmap3d/device/jl3ddevice';
import { clearSimulation, ranAsPlan, exitRunPlan} from '@/api/simulation';
import { getToken } from '@/utils/auth';
import { Notification } from 'element-ui';
import { PermissionType } from '@/scripts/ConstDic';
export default {
name:'SimulationMenu',
components: {
@ -43,6 +48,8 @@ export default {
// QrCode,
SetTime,
ModifyTime,
DistributeDraft,
FlowData,
// Equipment,
ContectUs,
Jl3dDevice
@ -59,6 +66,7 @@ export default {
isShowMenuList:false,
menuList:[],
active: -1,
openBigLPF:null,
messageBoardShow:false,
menuMap:{
'demon':[
@ -174,6 +182,74 @@ export default {
'script':[
]
},
// {value:'xty', label:'西'},
// {value: 'gzb', label: ''},
// {value: 'xadt', label: '西'},
// {value: 'heb', label: ''},
// {value: 'drts', label: ''},
// {value: 'nty', label: '()'},
// {value: 'ntyc', label: '()'},
// {value: 'ntyl', label: '()'},
// {value: 'bjd', label: ''},
// {value: 'urtss', label: ''},
// {value: 'sdy', label: ''},
// {value: 'cgy', label: ''},
// {value: 'wjls', label: ''},
// {value: 'zzww', label: ''},
// {value: 'zzwwtest', label: ''},
// {value: 'richor', label: ''},
// {value: 'richorlesson3d', label: '()'},
// {value: 'richor_joint', label: ''},
// {value: 'nologo', label: 'logo' },
// {value: 'sr_sandbox', label: ''},
// {value: 'jxgm', label: '西' },
// {value: 'richor_ygy', label: ''},
// {value: 'say', label: ''},
// {value: 'unittec_sty', label: '-'},
// {value: 'richor_hhcj', label: ''},
// {value: 'teaching', label: ''},
// {value: 'richor_cxjs', label: ''},
// {value: 'hyd_railway', label: ''},
// {value: 'wh', label: '8线'}
projectMenuMap:{
//
'bjd':[
{label:'切换客流数据', name:'changeFlowData', click:this.changeFlowData, isShow:true},
{label:'大客流策略', name:'bigLPFStrategy', click:this.bigLPFStrategy, isShow:true},
{label:'权限分发', name:'distribute', click:this.distribute, isShow:true},
{label:'留言板', name:'messageBoard', click:this.messageBoard, isShow:true},
{label:'联系方式', name:'contectUs', click:this.contectUs, isShow:true},
{label:'按计划行车', name:'drivingPlan', click:this.drivingPlan, isShow:true},
{label:'初始化', name:'initialize', click:this.initialize, isShow:true},
{label:'退出', name:'backBJD', click:this.backBJD, isShow:true}
// ATS
],
'designBjd':[
],
//
'urtss':[
],
//
'wjls':[
],
'login':[
],
'design':[
],
//
'zzww':[
]
// srsandbox jxgm ===> noChat
// 'say':{}, //
// 'teaching':{} //
},
deviceif:false,
deviceShow: true
};
@ -215,23 +291,25 @@ export default {
},
mounted() {
// jl3dmodel
const dataMap = {
'messageBoard':this.judgeMessageBoard(),
'contectUs':this.judgeContectUs(),
'jlmap3dmodel':this.judgeJlmap3dmodel(),
'modifySysTime':this.judgeModifySysTime(),
'cctvView':this.judgeCctvView(),
'digitalStand':this.judgeDigitalStand()
};
const list = ['messageBoard', 'contectUs', 'jlmap3dmodel', 'modifySysTime', 'cctvView', 'digitalStand'];
this.menuList = this.menuMap[this.mode];
this.menuList.map(each=>{
each.children && each.children.map(menu=>{
if (list.includes(menu.name)) {
menu.isShow = dataMap[menu.name];
}
});
});
// const dataMap = {
// 'messageBoard':this.judgeMessageBoard(),
// 'contectUs':this.judgeContectUs(),
// 'jlmap3dmodel':this.judgeJlmap3dmodel(),
// 'modifySysTime':this.judgeModifySysTime(),
// 'cctvView':this.judgeCctvView(),
// 'digitalStand':this.judgeDigitalStand()
// };
// const list = ['messageBoard', 'contectUs', 'jlmap3dmodel', 'modifySysTime', 'cctvView', 'digitalStand'];
// this.menuList = this.menuMap[this.mode];
// this.menuList.map(each=>{
// each.children && each.children.map(menu=>{
// if (list.includes(menu.name)) {
// menu.isShow = dataMap[menu.name];
// }
// });
// });
this.menuList = this.projectMenuMap[this.project];
window.addEventListener('click', this.close, false);
},
beforeDestroy() {
@ -506,6 +584,45 @@ export default {
this.$messageBox(message + '' + this.$t('error.startSimulationFailed'));
});
},
/** 大客流策略 */
bigLPFStrategy() {
if (this.openBigLPF) {
this.openBigLPF.close();
}
const routeData = this.$router.resolve({
path:'/bigLPFStrategy',
query:{
mapId:this.$route.query.mapId,
group:this.$route.query.group,
project: this.$route.query.project,
noPreLogout: true
}
});
this.openBigLPF = window.open(routeData.href);
},
/** 权限分发 */
distribute() {
if (this.$refs) {
this.$refs.distribute.doShow({PermissionType:PermissionType.SIMULATION, mapId: this.$route.query.mapId, prdType: this.$route.query.prdType});
}
},
QrCodeShow() {
},
changeFlowData() {
this.$refs.flowData.doShow();
},
async backBJD() {
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();
});
});
});
},
noEvent() {
this.hideMenuList();
}

View File

@ -393,7 +393,8 @@ export default {
//
onSelected(em) {
const path = window.location.href;
if (path.includes('/practiceDisplay')) {
const search = window.location.search;
if (path.includes('/display/demon') && search.includes('project=bjd')) {
if (em.deviceType == 'StationStand') {
runPassenger(this.$route.query.group, em.deviceCode).then(netdata => {
if (netdata.data) {