北交大 项目 菜单代码调整
This commit is contained in:
parent
b79202c70e
commit
5c948ea596
@ -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);
|
||||
// 全部跳停
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
141
src/views/newMap/display/flowData.vue
Normal file
141
src/views/newMap/display/flowData.vue
Normal 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>
|
@ -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();
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user