剧本预览提示代码调整

This commit is contained in:
joylink_cuiweidong 2022-08-01 16:37:04 +08:00
parent b9cd660a7e
commit ec72904bef

View File

@ -273,6 +273,54 @@ export const operateEnum = {
] ]
} }
}, },
CTCZONE:{
function: getCTCDevicename,
CTC_ZONE_SAVE_RUN_PLAN:{
code:'planParam',
name:'添加行车计划',
isList:true,
params:[
{
code:'stationCode',
name:'车站',
function:getStationNameById
},
{
code:'trainType',
name:'列车类型',
result:trainTypeList
},
{
code:'runType',
name:'运行类型',
result:[
{code:'FAST_PASSENGER_TRAIN', name:'快速旅客列车'}
]
},
{
code:'arriveTripNumber',
name:'到达车次'
},
{
code:'arriveDirectionCode',
name:'接车口'
},
{
code:'arrivePlanTime',
name:'到达时间'
},
{
code:'startRunPlan',
name:' 始发'
},
{
code:'transfinite',
name:' 超限',
result:transfiniteList
}
]
}
},
CTC: { CTC: {
function: getCTCDevicename, function: getCTCDevicename,
CTC_READ_DISPATCH_COMMAND: { CTC_READ_DISPATCH_COMMAND: {
@ -381,79 +429,79 @@ export const operateEnum = {
} }
}; };
// 调度台操作 // // 调度台操作
export const ctcZoneMap = { // export const ctcZoneMap = {
CTC_ZONE_SAVE_RUN_PLAN:{ // CTC_ZONE_SAVE_RUN_PLAN:{
name:'添加行车计划', // name:'添加行车计划',
isList:true, // isList:true,
objName:'planParam', // objName:'planParam',
params:[ // params:[
{ // {
code:'stationCode', // code:'stationCode',
name:'车站', // name:'车站',
function:getStationNameById // function:getStationNameById
}, // },
{ // {
code:'trainType', // code:'trainType',
name:'列车类型', // name:'列车类型',
result:trainTypeList // result:trainTypeList
}, // },
{ // {
code:'runType', // code:'runType',
name:'运行类型', // name:'运行类型',
result:[ // result:[
{code:'FAST_PASSENGER_TRAIN', name:'快速旅客列车'} // {code:'FAST_PASSENGER_TRAIN', name:'快速旅客列车'}
] // ]
}, // },
{ // {
code:'arriveTripNumber', // code:'arriveTripNumber',
name:'到达车次' // name:'到达车次'
}, // },
{ // {
code:'arriveDirectionCode', // code:'arriveDirectionCode',
name:'接车口' // name:'接车口'
}, // },
{ // {
code:'arriveSectionCode', // code:'arriveSectionCode',
name:'接车股道' // name:'接车股道'
}, // },
{ // {
code:'arrivePlanTime', // code:'arrivePlanTime',
name:'到达时间' // name:'到达时间'
}, // },
{ // {
code:'startRunPlan', // code:'startRunPlan',
name:' 始发' // name:' 始发'
}, // },
{ // {
code:'transfinite', // code:'transfinite',
name:' 超限', // name:' 超限',
result:transfiniteList // result:transfiniteList
} // }
// // //
] // ]
// planParam: Object // // planParam: Object
// arriveDirectionCode: "Station32295_SF" // // arriveDirectionCode: "Station32295_SF"
// arrivePlanTime: "2022-07-27 17:12" // // arrivePlanTime: "2022-07-27 17:12"
// arriveSectionCode: "T97" // // arriveSectionCode: "T97"
// arriveTripNumber: "2056" // // arriveTripNumber: "2056"
// departDirectionCode: "" // // departDirectionCode: ""
// departPlanTime: "" // // departPlanTime: ""
// departSectionCode: "" // // departSectionCode: ""
// departTripNumber: "" // // departTripNumber: ""
// electrical: true // // electrical: true
// endRunPlan: true // // endRunPlan: true
// entryOutDiscordant: false // // entryOutDiscordant: false
// passenger: true // // passenger: true
// runType: "FAST_PASSENGER_TRAIN" // // runType: "FAST_PASSENGER_TRAIN"
// startRunPlan: false // // startRunPlan: false
// stationCode: "Station32295" // // stationCode: "Station32295"
// trackDiscordant: true // // trackDiscordant: true
// trainType: "LOCAL_EXPRESS_PASSENGER_TRAIN" // // trainType: "LOCAL_EXPRESS_PASSENGER_TRAIN"
// transfinite: "NO" // // transfinite: "NO"
} // }
}; // };
// 转换函数 // 转换函数
export function covertOperate(operationType, operationParamMap) { export function covertOperate(operationType, operationParamMap) {
@ -484,72 +532,74 @@ export function covertOperate(operationType, operationParamMap) {
}); });
return tip; return tip;
} else if (operationType.includes('CTC_ZONE')) { }
let tip = '请点击运行图'; // else if (operationType.includes('CTC_ZONE')) {
// let operateName = null; // let tip = '请点击运行图';
// Object.keys(CMD).forEach(key => { // // let operateName = null;
// Object.values(CMD[key]).forEach(el => { // // Object.keys(CMD).forEach(key => {
// if (el.value == operationType) { // // Object.values(CMD[key]).forEach(el => {
// operateName = el; // // if (el.value == operationType) {
// return; // // operateName = el;
// } // // return;
// }); // // }
// }); // // });
// tip += ',执行【' + operateName.label + '】操作'; // // });
let operationParam = operationParamMap; // // tip += ',执行【' + operateName.label + '】操作';
const paramInfo = ctcZoneMap[operationType]; // let operationParam = operationParamMap;
tip += ',执行【' + paramInfo.name + '】操作'; // const paramInfo = ctcZoneMap[operationType];
if (paramInfo.objName) { // tip += ',执行【' + paramInfo.name + '】操作';
operationParam = operationParamMap[paramInfo.objName]; // if (paramInfo.objName) {
} // operationParam = operationParamMap[paramInfo.objName];
if (paramInfo.isList) { // }
tip += ',参数:【'; // if (paramInfo.isList) {
paramInfo.params.forEach(param=>{ // tip += ',参数:【';
if (param.result) { // paramInfo.params.forEach(param=>{
param.result.forEach(result=>{ // if (param.result) {
if (result.code == operationParam[param.code]) { // param.result.forEach(result=>{
tip += param.name + '为' + result.name + ''; // if (result.code == operationParam[param.code]) {
} // tip += param.name + '为' + result.name + '';
}); // }
} else if (param.function) { // });
tip += param.name + '为' + covertFunction(param.function, operationParam[param.code]) + ''; // } else if (param.function) {
} else { // tip += param.name + '为' + covertFunction(param.function, operationParam[param.code]) + '';
tip += param.name + '为' + operationParam[param.code] + ''; // } else {
} // tip += param.name + '为' + operationParam[param.code] + '';
}); // }
tip += '】'; // });
} // tip += '】';
debugger; // }
// operationParamMap[] // debugger;
// // operationParamMap[]
// if (paramInfo) { // // if (paramInfo) {
// if (paramInfo.isDevice) { // // if (paramInfo.isDevice) {
// if (paramInfo.isList) { // // if (paramInfo.isList) {
// paramName += '【' + paramInfo.name + ' '; // // paramName += '【' + paramInfo.name + ' ';
// const deviceList = operationParamMap[paramInfo.code]; // // const deviceList = operationParamMap[paramInfo.code];
// deviceList.forEach((device, index)=>{ // // deviceList.forEach((device, index)=>{
// paramName += covertFunction(paramInfo.function, device); // // paramName += covertFunction(paramInfo.function, device);
// if (index != deviceList.length - 1) { // // if (index != deviceList.length - 1) {
// paramName += ''; // // paramName += '';
// } // // }
// }); // // });
// paramName += '】'; // // paramName += '】';
// } else { // // } else {
// operationParamMap[] // // operationParamMap[]
return tip; // return tip;
// ctcZoneMap[operationType] // // ctcZoneMap[operationType]
// 调度台添加行车计划 // // 调度台添加行车计划
// CTC_ZONE_SAVE_TRACK_SECTION:{value:'CTC_ZONE_SAVE_TRACK_SECTION', label: '调度台行车计划修改股道'}, // // CTC_ZONE_SAVE_TRACK_SECTION:{value:'CTC_ZONE_SAVE_TRACK_SECTION', label: '调度台行车计划修改股道'},
// CTC_ZONE_SAVE_TRIP_NUMBER:{value:'CTC_ZONE_SAVE_TRIP_NUMBER', label: '调度台行车计划修改车次'}, // // CTC_ZONE_SAVE_TRIP_NUMBER:{value:'CTC_ZONE_SAVE_TRIP_NUMBER', label: '调度台行车计划修改车次'},
// CTC_ZONE_SAVE_PLAN_TIME:{value:'CTC_ZONE_SAVE_PLAN_TIME', label: '调度台行车计划修改时间'}, // // 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_DIRECTION:{value:'CTC_ZONE_SAVE_DIRECTION', label: '调度台行车计划修改出入口'},
// CTC_ZONE_SAVE_STATION:{value:'CTC_ZONE_SAVE_STATION', 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_SAVE_RUN_PLAN:{value:'CTC_ZONE_SAVE_RUN_PLAN', label: '调度台添加行车计划'},
// CTC_ZONE_DELETE_RUN_PLAN:{value:'CTC_ZONE_DELETE_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_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_ZONE_RELEASE_STATION_RUN_PLAN:{value:'CTC_ZONE_RELEASE_STATION_RUN_PLAN', label: '调度台发布车站行车计划'},
} else { // }
else {
let device = operationType.split('_')[0]; let device = operationType.split('_')[0];
if (device == 'CM') { if (device == 'CM') {
device = 'ControlConvertMenu'; device = 'ControlConvertMenu';
@ -560,6 +610,9 @@ export function covertOperate(operationType, operationParamMap) {
if (operationType.includes('ASSIST')) { if (operationType.includes('ASSIST')) {
device = 'Station'; device = 'Station';
} }
if (operationType.includes('CTC_ZONE')) {
device = 'CTCZONE';
}
const list = ['Train_Update_Type', const list = ['Train_Update_Type',
'Train_Add_Train_Trace', 'Train_Add_Train_Trace',
'Train_Remove_Train_Trace', 'Train_Remove_Train_Trace',
@ -628,7 +681,9 @@ function covertDeviceName(deviceInfo, deviceType) {
function getCTCDevicename(operationType) { function getCTCDevicename(operationType) {
let deviceName = ''; let deviceName = '';
if (operationType == 'CTC_QUERY_DISPATCH_COMMAND') { if (operationType.includes('CTC_ZONE')) {
deviceName = '请点击运行图';
} else if (operationType == 'CTC_QUERY_DISPATCH_COMMAND') {
const roles = store.state.training.roles; const roles = store.state.training.roles;
if (roles == 'DISPATCHER') { if (roles == 'DISPATCHER') {
deviceName = '调度命令'; deviceName = '调度命令';