剧本切换角色 ctc 对应车站未更改bug 调整

This commit is contained in:
joylink_cuiweidong 2022-07-25 16:33:04 +08:00
parent 37b527d7cb
commit 856a5b676a
3 changed files with 164 additions and 11 deletions

View File

@ -395,25 +395,27 @@ export default {
CTC_CANCEL_DEPARTURE_NOTICE: {value: 'CTC_CANCEL_DEPARTURE_NOTICE', label: '取消发预'},
CTC_FINISH_DEPARTURE: {value: 'CTC_FINISH_DEPARTURE', label: '完成发点'},
CTC_CANCEL_DEPARTURE: {value: 'CTC_CANCEL_DEPARTURE', label: '取消发点'},
CTC_ASSIST_PRESS_DOWN_TURN_DIRECTION:{value:'ASSIST_PRESS_DOWN_TURN_DIRECTION', label:'改方'},
CTC_AUTO_TRIGGER: {value: 'CTC_AUTO_TRIGGER', label: '自动触发'},
CTC_ASSIST_PRESS_MAIN_ASSIST:{value: 'ASSIST_PRESS_MAIN_ASSIST', label: '总辅助'},
CTC_ASSIST_PRESS_RECEIVE_ASSIST:{value: 'ASSIST_PRESS_RECEIVE_ASSIST', label: '接辅助'},
CTC_ASSIST_PRESS_DELIVER_ASSIST:{value: 'ASSIST_PRESS_DELIVER_ASSIST', label: '发辅助'},
CTC_ASSIST_PRESS_BLOCK:{value: 'ASSIST_PRESS_BLOCK', label: '阻塞'},
CTC_ASSIST_PRESS_RESTORE:{value: 'ASSIST_PRESS_RESTORE', label: '复原'},
CTC_ASSIST_PRESS_ACCIDENT:{value: 'ASSIST_PRESS_ACCIDENT', label: '事故'},
CTC_ASSIST_PRESS_DOWN_TURN_DIRECTION:{value:'ASSIST_PRESS_DOWN_TURN_DIRECTION', label:'改方'},
// CTC_BATCH_MODIFY_RUN_PLAN:{value: 'CTC_BATCH_MODIFY_RUN_PLAN', label: '批量修改股道'},
CTC_MODIFY_SECTION:{value: 'CTC_MODIFY_SECTION', label: '修改股道'},
CTC_STATION_SEND_OUT_RUN_PLAN:{value: 'CTC_STATION_SEND_OUT_RUN_PLAN', label: '车站发送计划'},
CTC_CANCEL_TWINKLE:{value: 'CTC_CANCEL_TWINKLE', label: '车站取消红闪'},
// CTC_REMOVE_RUN_PLAN:{value: 'CTC_REMOVE_RUN_PLAN', label: '移除行车日志'},
CTC_MODIFY_ADJACENT_STATION:{value: 'CTC_MODIFY_ADJACENT_STATION', label: '修改邻站信息'},
CTC_MODIFY_TRIP_NUMBER:{value: 'CTC_MODIFY_TRIP_NUMBER', label: '修改车次号(大铁CTC)'},
CTC_SEND_NOTICE:{value: 'CTC_SEND_NOTICE', label: '发送发车预告'},
CTC_AGREE_NOTICE:{value: 'CTC_AGREE_NOTICE', label: '同意发车预告'},
CTC_LOG_CANCEL_ARRIVE:{value: 'CTC_LOG_CANCEL_ARRIVE', label: '取消到达'},
CTC_LOG_CANCEL_DEPARTURE:{value: 'CTC_LOG_CANCEL_DEPARTURE', label: '取消出发'},
CTC_LOG_CANCEL_BLOCK:{value: 'CTC_LOG_CANCEL_BLOCK', label: '取消闭塞'},
@ -432,10 +434,6 @@ export default {
CTC_RELEASE_RUN_PLAN_TO_SIMULATION:{value: 'CTC_RELEASE_RUN_PLAN_TO_SIMULATION', label: '运行计划发布至CTC'},
CTC_SET_ROUTE:{value: 'CTC_SET_ROUTE', label: 'CTC办理进路'},
CTC_ZONE_SAVE_RUN_PLAN:{value:'CTC_ZONE_SAVE_RUN_PLAN', label: '调度台添加行车计划'},
CTC_ZONE_DELETE_RUN_PLAN:{value:'CTC_ZONE_DELETE_RUN_PLAN', label: '调度台删除行车计划'},
CTC_ZONE_RELEASE_ALL_RUN_PLAN:{value:'CTC_ZONE_RELEASE_ALL_RUN_PLAN', label: '调度台发布所有行车计划'},
CTC_ZONE_RELEASE_STATION_RUN_PLAN:{value:'CTC_ZONE_RELEASE_STATION_RUN_PLAN', label: '调度台发布车站行车计划'},
CTC_STATION_SIGN_RUN_PLAN:{value:'CTC_STATION_SIGN_RUN_PLAN', label: '车站签收阶段计划'},
CTC_ZONE_SAVE_TRACK_SECTION:{value:'CTC_ZONE_SAVE_TRACK_SECTION', label: '调度台行车计划修改股道'},
@ -443,6 +441,11 @@ export default {
CTC_ZONE_SAVE_PLAN_TIME:{value:'CTC_ZONE_SAVE_PLAN_TIME', label: '调度台行车计划修改时间'},
CTC_ZONE_SAVE_DIRECTION:{value:'CTC_ZONE_SAVE_DIRECTION', label: '调度台行车计划修改出入口'},
CTC_ZONE_SAVE_STATION:{value:'CTC_ZONE_SAVE_STATION', label: '调度台行车计划修改到发车站'},
CTC_ZONE_SAVE_RUN_PLAN:{value:'CTC_ZONE_SAVE_RUN_PLAN', label: '调度台添加行车计划'},
CTC_ZONE_DELETE_RUN_PLAN:{value:'CTC_ZONE_DELETE_RUN_PLAN', label: '调度台删除行车计划'},
CTC_ZONE_RELEASE_ALL_RUN_PLAN:{value:'CTC_ZONE_RELEASE_ALL_RUN_PLAN', label: '调度台发布所有行车计划'},
CTC_ZONE_RELEASE_STATION_RUN_PLAN:{value:'CTC_ZONE_RELEASE_STATION_RUN_PLAN', label: '调度台发布车站行车计划'},
CTC_QUERY_DISPATCH_COMMAND:{value:'CTC_QUERY_DISPATCH_COMMAND', label: '调度台命令查询'},
CTC_SIGN_DISPATCH_COMMAND:{value:'CTC_SIGN_DISPATCH_COMMAND', label: '调度台命令发送'},
CTC_READ_DISPATCH_COMMAND:{value:'CTC_READ_DISPATCH_COMMAND', label: '调度台命令已读'}

View File

@ -98,7 +98,9 @@ export default {
swch: '02',
isScriptCommand:false,
faultMode: false,
speed: 1
speed: 1,
centralizedstationList: [],
centralizedStationMap: {}
// firstLoad: true
};
},
@ -148,6 +150,9 @@ export default {
isAdmin() {
return this.$store.state.user.roles.includes('04') || this.$store.state.user.roles.includes('05');
},
userId() {
return this.$store.state.user ? this.$store.state.user.id : '';
},
speedList() {
return this.isAdmin ? [
{ value: 1, label: '1倍速' },
@ -201,6 +206,21 @@ export default {
},
'$store.state.socket.simulationSpeed': function (val) {
this.speed = val;
},
'$store.state.map.map': function (map) {
if (map) {
this.setCentralizedstationList(map); //
}
},
'$store.state.training.simulationUserList': function(list) {
if (list && list.length && this.$route.query.lineCode == '16' && this.isCtc && !this.$route.query.joint) {
this.checkRoleInit(list);
}
},
'$store.state.socket.simulationRoleList':function(list) {
if (list && list.length && this.$route.query.lineCode == '16' && this.isCtc && !this.$route.query.joint) {
this.checkRoleChange(list);
}
}
},
mounted() {
@ -236,17 +256,33 @@ export default {
this.$emit('changeShowMap', false);
},
goCtc() {
// const routeData = this.$router.resolve({
// path:'/displayNew/demon',
// query:{
// lineCode:this.$route.query.lineCode,
// group: this.$route.query.group,
// prdType: this.$store.state.training.prdType,
// mapId:this.$route.query.mapId,
// project: this.project,
// newApi: this.$route.query.newApi,
// ctc: true,
// try: this.$route.query.try,
// token:getToken(),
// noPreLogout: true
// }
// });
const routeData = this.$router.resolve({
path:'/displayNew/demon',
query:{
lineCode:this.$route.query.lineCode,
group: this.$route.query.group,
prdType: this.$route.query.prdType,
prdType: '01',
mapId:this.$route.query.mapId,
project: this.project,
newApi: this.$route.query.newApi,
newApi: false,
// joint: true,
ctc: true,
try: this.$route.query.try,
try: this.$route.query.try || 0,
token:getToken(),
noPreLogout: true
}
@ -269,6 +305,59 @@ export default {
showRegisterBook() {
this.$refs.registerBook.doShow();
},
checkRoleInit(data) {
data.forEach(item => {
if ((item.admin && item.online) && item.userId == this.userId && item.type == 'STATION_SUPERVISOR') {
this.$store.dispatch('training/setRoleDeviceCode', item.deviceCode);
this.deviceCode = item.deviceCode;
this.setShowStation(item.deviceCode);
this.$store.dispatch('training/setPrdType', '01');
}
});
},
checkRoleChange(data) {
data.forEach(item => {
if ((item.messageType === 'PLAY_CHANGE' || item.messageType === 'ONLINE' ) && item.userId == this.userId && item.type == 'STATION_SUPERVISOR') {
// this.userRole = item.type || 'AUDIENCE';
this.$store.dispatch('training/setRoleDeviceCode', item.deviceCode);
this.deviceCode = item.deviceCode;
// this.setShowStation(item.deviceCode);
this.setShowStation(item.deviceCode);
this.$store.dispatch('training/setPrdType', '01');
// this.setSimulationPrdType(this.centralizedStationMap[item.deviceCode]);
// this.$nextTick(() => {
// if (item.deviceCode && this.$store.state.training.prdType !== '09') { this.setCenter(item.deviceCode); }
// });
}
});
},
setShowStation(stationCode) {
const showStation = this.centralizedStationMap[stationCode];
const list = [];
const mapDevice = this.$store.state.map.mapDevice;
for (const key in mapDevice) {
list.push(mapDevice[key]);
}
this.$jlmap.updateShowStation(list, showStation);
this.$nextTick(()=>{
this.$jlmap.setCenter(showStation);
});
},
setCentralizedstationList(map) {
this.centralizedstationList = [];
(map.stationList || []).forEach(item => {
if (item.centralized) {
this.centralizedstationList.push({value: item.code, name: item.name});
this.centralizedStationMap[item.code] = item.code;
item.chargeStationCodeList && item.chargeStationCodeList.length && item.chargeStationCodeList.forEach(ele => {
this.centralizedStationMap[ele] = item.code;
});
}
});
// if (this.centralizedstationList.length && !this.showStation) {
// this.showStation = this.centralizedstationList[0].value;
// }
},
// goRpManage() {
// const routeData = this.$router.resolve({
// path:'/bigTrainRunplanManage',

View File

@ -155,7 +155,42 @@ export const operateEnum = {
},
Station:{
code:'stationCode',
type:'车站'
type:'车站',
// 总辅助
ASSIST_PRESS_MAIN_ASSIST:{
isList:true,
params:[
{
code:'labelEnum',
name:'区间'
},
{
code:'pressDown',
name:'按钮',
result:[
{data:1, name:'按下', judge:'='},
{data:0, name:'弹起', judge:'='}
]
}
]
},
// 接辅助
ASSIST_PRESS_RECEIVE_ASSIST:{
code:'labelEnum',
name:'区间为'
},
// 发辅助
ASSIST_PRESS_DELIVER_ASSIST:{
code:'labelEnum',
name:'区间为'
}
// param:{
// labelEnum:model.labelEnum,
// stationCode:model.stationCode
// }
// labelEnum:model.labelEnum,
// stationCode:model.stationCode,
// pressDown:model.pressDown ? 0 : 1 // 1按下、0弹起
},
Driver:{
code:'groupNumber',
@ -239,6 +274,10 @@ export const operateEnum = {
}
};
export const ctcOperateEnum = {
};
// 转换函数
export function covertOperate(operationType, operationParamMap) {
if (operationType == 'Set_Fault' || operationType == 'Cancel_Fault') {
@ -268,6 +307,25 @@ export function covertOperate(operationType, operationParamMap) {
});
return tip;
} else if (operationType.includes('CTC')) {
const tip = '请打开';
// ctcOperateEnum
// 车务终端,找到
return tip;
// 总辅助按钮
// CTC_ASSIST_PRESS_MAIN_ASSIST
// labelEnum:model.labelEnum,
// stationCode:model.stationCode,
// pressDown:model.pressDown ? 0 : 1 // 1按下、0弹起
// CTC_ASSIST_PRESS_RECEIVE_ASSIST
// labelEnum;
// stationCode;
// CTC_ASSIST_PRESS_DELIVER_ASSIST
// CTC_ASSIST_PRESS_BLOCK
// CTC_ASSIST_PRESS_RESTORE
// CTC_ASSIST_PRESS_ACCIDENT
// CTC_ASSIST_PRESS_DOWN_TURN_DIRECTION
} else {
let device = operationType.split('_')[0];
if (device == 'CM') {
@ -276,6 +334,9 @@ export function covertOperate(operationType, operationParamMap) {
if (operationType == 'Train_Load_Spare_Train') {
device = 'Section';
}
if (operationType.includes('ASSIST')) {
device = 'Station';
}
const list = ['Train_Update_Type',
'Train_Add_Train_Trace',
'Train_Remove_Train_Trace',