线路:西安2
问题: 1.扣车和跳停互斥的问题; 2.为获取控制权时,没有限制排列进路的问题 3.修改车站AU/MN LA 的绘图处理
This commit is contained in:
parent
ab9a11ef60
commit
e48543d5ee
@ -415,54 +415,22 @@ class SkinCode extends defaultStyle {
|
|||||||
text: {
|
text: {
|
||||||
distance: 2, // 灯和文字之间的距离
|
distance: 2, // 灯和文字之间的距离
|
||||||
fontSize: 12, // 字体大小
|
fontSize: 12, // 字体大小
|
||||||
fontFormat: 'consolas', // 字体格式
|
offsetX: 30, // 偏移差值X
|
||||||
centerControlColor: '#ffffff', // 中控字体颜色
|
offsetY: 0, // 偏移差值Y
|
||||||
stationControlColor: '#ff0', // 站控字体颜色
|
fontFormat: 'consolas', // 字体格式
|
||||||
emergencyControlColor:'#f00', // 紧急站控字体颜色
|
centerControlColor: '#ffffff', // 中控字体颜色
|
||||||
|
stationControlColor: '#ff0', // 站控字体颜色
|
||||||
|
emergencyControlColor:'#f00', // 紧急站控字体颜色
|
||||||
|
automaticRouteColor: '#3CB960', // 自动进路
|
||||||
|
manualRouteColor: '#f00', // 人工进路
|
||||||
|
openCommunicationColor: '#3CB960', // 建立通信
|
||||||
|
closeCommunicationColor: '#f00', // 断开通信
|
||||||
|
testValidColor: '#3CB960', // 验证生效
|
||||||
|
testInvalidColor: '#f00', // 验证无效
|
||||||
fontWeight: 'normal', // 字体粗细
|
fontWeight: 'normal', // 字体粗细
|
||||||
textAlign: 'middle', // 字体水平对齐
|
textAlign: 'middle', // 字体水平对齐
|
||||||
textVerticalAlign: 'top' // 字体垂直对齐
|
textVerticalAlign: 'top', // 字体垂直对齐
|
||||||
}
|
}
|
||||||
// lamp: {
|
|
||||||
// count: 4, // 控制模式的个数
|
|
||||||
// offset: {x: 20, y: 0}, // 偏移量
|
|
||||||
// emergencyOffset: {x: 0, y: 0},
|
|
||||||
// radiusR: 4, // 控制模式灯的半径
|
|
||||||
// distance: 46, // 控制模式之间灯之间的距离
|
|
||||||
// grayColor: '#C0C0C0', // 控制模式灰色
|
|
||||||
// greenColor: 'green', // 控制模式绿色
|
|
||||||
// redColor: 'red', // 控制模式红色
|
|
||||||
// yellowColor: 'yellow' // 控制模式黄色
|
|
||||||
// },
|
|
||||||
// emergencyControl: { // 紧急站控
|
|
||||||
// show: true,
|
|
||||||
// offset: { x: 0, y: 0 },
|
|
||||||
// text: '紧急',
|
|
||||||
// arrowShow: false,
|
|
||||||
// grayColor: '#7F7F7F'
|
|
||||||
// },
|
|
||||||
// centerControl: { // 中控
|
|
||||||
// show: true,
|
|
||||||
// offset: { x: 0, y: 0 },
|
|
||||||
// text: '中控',
|
|
||||||
// buttonShow: false,
|
|
||||||
// arrowShow: false,
|
|
||||||
// grayColor: '#7F7F7F'
|
|
||||||
// },
|
|
||||||
// substationControl: { // 站控按钮
|
|
||||||
// show: true,
|
|
||||||
// offset: { x: 0, y: 0 },
|
|
||||||
// text: '站控',
|
|
||||||
// arrowShow: false,
|
|
||||||
// grayColor: '#7F7F7F'
|
|
||||||
// },
|
|
||||||
// interconnectedControl: { // 联锁控
|
|
||||||
// show: false,
|
|
||||||
// offset: { x: 0, y: 0 },
|
|
||||||
// text: '联锁控',
|
|
||||||
// arrowShow: false,
|
|
||||||
// grayColor: '#7F7F7F'
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -527,6 +527,7 @@ class Jlmap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
|
const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
|
||||||
|
|
||||||
if (elem.dispose) {
|
if (elem.dispose) {
|
||||||
this.$painter.delete(oDevice);
|
this.$painter.delete(oDevice);
|
||||||
} else {
|
} else {
|
||||||
|
@ -155,7 +155,10 @@ export default class Station extends Group {
|
|||||||
if (!this.style.Station.StationControl.disPlayNone) {
|
if (!this.style.Station.StationControl.disPlayNone) {
|
||||||
if (this.style.Station.StationControl.special) {
|
if (this.style.Station.StationControl.special) {
|
||||||
if (model.visible && model.createControlMode) { // model.createControlMode 控制模式
|
if (model.visible && model.createControlMode) { // model.createControlMode 控制模式
|
||||||
this.createSpecialControlMode();
|
this.createControlModeAU();
|
||||||
|
this.createControlModeCC();
|
||||||
|
this.createControlModeCL();
|
||||||
|
this.createControlModeVA();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (model.visible && model.createControlMode) { // model.createControlMode 控制模式
|
if (model.visible && model.createControlMode) { // model.createControlMode 控制模式
|
||||||
@ -170,14 +173,34 @@ export default class Station extends Group {
|
|||||||
this.setState(model);
|
this.setState(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
createSpecialControlMode() {
|
createControlModeAU() { // 西安二
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
this.stationControlText = new Text({
|
this.stationControlAU = new Text({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
style: {
|
style: {
|
||||||
x: model.controlModePoint.x,
|
x: model.controlModePoint.x + this.style.Station.StationControl.text.offsetX*-1,
|
||||||
y: model.controlModePoint.y,
|
y: model.controlModePoint.y + this.style.Station.StationControl.text.offsetY,
|
||||||
|
fontWeight: this.style.Station.StationControl.text.fontWeight,
|
||||||
|
fontSize: this.style.Station.StationControl.text.fontSize,
|
||||||
|
fontFamily: this.style.fontFamily,
|
||||||
|
text: 'AU',
|
||||||
|
textFill: this.style.Station.StationControl.text.automaticRouteColor,
|
||||||
|
textAlign: this.style.Station.StationControl.text.textAlign,
|
||||||
|
textVerticalAlign: this.style.Station.StationControl.text.textVerticalAlign
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.add(this.stationControlAU);
|
||||||
|
}
|
||||||
|
|
||||||
|
createControlModeCC() { // 西安二
|
||||||
|
const model = this.model;
|
||||||
|
this.stationControlCC = new Text({
|
||||||
|
zlevel: this.zlevel,
|
||||||
|
z: this.z,
|
||||||
|
style: {
|
||||||
|
x: model.controlModePoint.x + this.style.Station.StationControl.text.offsetX*0,
|
||||||
|
y: model.controlModePoint.y + this.style.Station.StationControl.text.offsetY,
|
||||||
fontWeight: this.style.Station.StationControl.text.fontWeight,
|
fontWeight: this.style.Station.StationControl.text.fontWeight,
|
||||||
fontSize: this.style.Station.StationControl.text.fontSize,
|
fontSize: this.style.Station.StationControl.text.fontSize,
|
||||||
fontFamily: this.style.fontFamily,
|
fontFamily: this.style.fontFamily,
|
||||||
@ -187,7 +210,47 @@ export default class Station extends Group {
|
|||||||
textVerticalAlign: this.style.Station.StationControl.text.textVerticalAlign
|
textVerticalAlign: this.style.Station.StationControl.text.textVerticalAlign
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.add(this.stationControlText);
|
this.add(this.stationControlCC);
|
||||||
|
}
|
||||||
|
|
||||||
|
createControlModeCL() { // 西安二
|
||||||
|
const model = this.model;
|
||||||
|
this.stationControlCL = new Text({
|
||||||
|
zlevel: this.zlevel,
|
||||||
|
z: this.z,
|
||||||
|
style: {
|
||||||
|
x: model.controlModePoint.x + this.style.Station.StationControl.text.offsetX*1,
|
||||||
|
y: model.controlModePoint.y + this.style.Station.StationControl.text.offsetY,
|
||||||
|
fontWeight: this.style.Station.StationControl.text.fontWeight,
|
||||||
|
fontSize: this.style.Station.StationControl.text.fontSize,
|
||||||
|
fontFamily: this.style.fontFamily,
|
||||||
|
text: 'CL',
|
||||||
|
textFill: this.style.Station.StationControl.text.openCommunicationColor,
|
||||||
|
textAlign: this.style.Station.StationControl.text.textAlign,
|
||||||
|
textVerticalAlign: this.style.Station.StationControl.text.textVerticalAlign
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.add(this.stationControlCL);
|
||||||
|
}
|
||||||
|
|
||||||
|
createControlModeVA() { // 西安二
|
||||||
|
const model = this.model;
|
||||||
|
this.stationControlVA = new Text({
|
||||||
|
zlevel: this.zlevel,
|
||||||
|
z: this.z,
|
||||||
|
style: {
|
||||||
|
x: model.controlModePoint.x + this.style.Station.StationControl.text.offsetX*2,
|
||||||
|
y: model.controlModePoint.y + this.style.Station.StationControl.text.offsetY,
|
||||||
|
fontWeight: this.style.Station.StationControl.text.fontWeight,
|
||||||
|
fontSize: this.style.Station.StationControl.text.fontSize,
|
||||||
|
fontFamily: this.style.fontFamily,
|
||||||
|
text: 'VA',
|
||||||
|
textFill: this.style.Station.StationControl.text.testValidColor,
|
||||||
|
textAlign: this.style.Station.StationControl.text.textAlign,
|
||||||
|
textVerticalAlign: this.style.Station.StationControl.text.textVerticalAlign
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.add(this.stationControlVA);
|
||||||
}
|
}
|
||||||
|
|
||||||
createEmergencyControl() { // 紧急站控
|
createEmergencyControl() { // 紧急站控
|
||||||
@ -418,7 +481,7 @@ export default class Station extends Group {
|
|||||||
this.stationText.setColor('#1fdc1f');
|
this.stationText.setColor('#1fdc1f');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.stationControlText && this.stationControlText.setStyle({text:'CC', textFill:this.style.Station.StationControl.text.centerControlColor});
|
this.stationControlCC && this.stationControlCC.setStyle({text:'CC', textFill:this.style.Station.StationControl.text.centerControlColor});
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// if (this.style.Station.StationControl.disPlayNone) {
|
// if (this.style.Station.StationControl.disPlayNone) {
|
||||||
@ -436,7 +499,7 @@ export default class Station extends Group {
|
|||||||
this.substationControl && this.substationControl.setTextColor(this.style.Station.StationControl.lamp.yellowColor); // 文字颜色
|
this.substationControl && this.substationControl.setTextColor(this.style.Station.StationControl.lamp.yellowColor); // 文字颜色
|
||||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||||
this.substationArrowsControl && this.substationArrowsControl.setColor(this.style.Station.StationControl.lamp.greenColor);
|
this.substationArrowsControl && this.substationArrowsControl.setColor(this.style.Station.StationControl.lamp.greenColor);
|
||||||
this.stationControlText && this.stationControlText.setStyle({text:'LC', textFill:this.style.Station.StationControl.text.stationControlColor});
|
this.stationControlCC && this.stationControlCC.setStyle({text:'LC', textFill:this.style.Station.StationControl.text.stationControlColor});
|
||||||
// if (this.style.Station.StationControl.disPlayNone) {
|
// if (this.style.Station.StationControl.disPlayNone) {
|
||||||
// this.stationText && this.stationText.setStyle('textFill', '#fff');
|
// this.stationText && this.stationText.setStyle('textFill', '#fff');
|
||||||
// if (this.model.subheadDisplay) { // 副标题
|
// if (this.model.subheadDisplay) { // 副标题
|
||||||
@ -454,7 +517,7 @@ export default class Station extends Group {
|
|||||||
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||||
this.emergencyArrowsControl && this.emergencyArrowsControl.setColor(this.style.Station.StationControl.lamp.greenColor);
|
this.emergencyArrowsControl && this.emergencyArrowsControl.setColor(this.style.Station.StationControl.lamp.greenColor);
|
||||||
this.stationControlText && this.stationControlText.setStyle({text:'EL', textFill:this.style.Station.StationControl.text.emergencyControlColor});
|
this.stationControlCC && this.stationControlCC.setStyle({text:'EL', textFill:this.style.Station.StationControl.text.emergencyControlColor});
|
||||||
// if (this.style.Station.StationControl.disPlayNone) {
|
// if (this.style.Station.StationControl.disPlayNone) {
|
||||||
// this.stationText && this.stationText.setStyle('textFill', '#fff');
|
// this.stationText && this.stationText.setStyle('textFill', '#fff');
|
||||||
// if (this.model.subheadDisplay) { // 副标题
|
// if (this.model.subheadDisplay) { // 副标题
|
||||||
|
@ -209,7 +209,11 @@ export default {
|
|||||||
handler: this.triggerFaultManagement,
|
handler: this.triggerFaultManagement,
|
||||||
cmdType: CMD.Fault.CMD_TRIGGER_FAULT
|
cmdType: CMD.Fault.CMD_TRIGGER_FAULT
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
prdType2ControlModeMap: {
|
||||||
|
'01': 'Local',
|
||||||
|
'02': 'Center'
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -224,6 +228,9 @@ export default {
|
|||||||
'routeList',
|
'routeList',
|
||||||
'routeData'
|
'routeData'
|
||||||
]),
|
]),
|
||||||
|
prdType() {
|
||||||
|
return this.$store.state.training.prdType;
|
||||||
|
},
|
||||||
group() {
|
group() {
|
||||||
return this.$route.query.group;
|
return this.$route.query.group;
|
||||||
}
|
}
|
||||||
@ -239,7 +246,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
'$store.state.menuOperation.leftClickCount': function (val) {
|
'$store.state.menuOperation.leftClickCount': function (val) {
|
||||||
if (this.selected._type === 'Signal') {
|
const control = MenuContextHandler.getStationControl(this.selected);
|
||||||
|
const controlMode = this.prdType2ControlModeMap[this.prdType];
|
||||||
|
if (this.selected._type === 'Signal' && control.controlMode == controlMode) {
|
||||||
this.arrangementRoute();
|
this.arrangementRoute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,6 @@ import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'
|
|||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||||
// import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
|
||||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||||
|
@ -19,8 +19,9 @@ import StopProfile from './dialog/stopProfile';
|
|||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
|
||||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||||
|
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||||
|
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'StationStandMenu',
|
name: 'StationStandMenu',
|
||||||
@ -65,17 +66,18 @@ export default {
|
|||||||
{
|
{
|
||||||
label: '列车跳停本站',
|
label: '列车跳停本站',
|
||||||
handler: this.setJumpStop,
|
handler: this.setJumpStop,
|
||||||
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME
|
cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP,
|
||||||
|
checkDisabled: (selected) => { return selected && (selected.centerHoldTrain||selected.stationHoldTrain) }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '取消列车跳停本站',
|
label: '取消列车跳停本站',
|
||||||
handler: this.cancelJumpStop,
|
handler: this.cancelJumpStop,
|
||||||
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME
|
cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '帮助',
|
label: '帮助',
|
||||||
handler: this.setStopTime,
|
handler: this.setStopTime,
|
||||||
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME
|
cmdType: CMD.Stand.CMD_STAND_VIEW_STATUS
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -90,7 +92,7 @@ export default {
|
|||||||
{
|
{
|
||||||
label: '帮助',
|
label: '帮助',
|
||||||
handler: this.setStopTime,
|
handler: this.setStopTime,
|
||||||
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME
|
cmdType: CMD.Stand.CMD_STAND_VIEW_STATUS
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -100,14 +102,13 @@ export default {
|
|||||||
{
|
{
|
||||||
label: '扣车',
|
label: '扣车',
|
||||||
handler: this.setStandDetain,
|
handler: this.setStandDetain,
|
||||||
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME,
|
cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN,
|
||||||
disabled: this.selected && this.selected.centerHoldTrain
|
checkDisabled: (selected) => { return selected && selected.allSkip }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '发车',
|
label: '发车',
|
||||||
handler: this.cancelStandDetain,
|
handler: this.cancelStandDetain,
|
||||||
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME,
|
cmdType: CMD.Stand.CMD_STAND_EARLY_DEPART
|
||||||
disabled: this.selected && !this.selected.centerHoldTrain
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -238,15 +239,15 @@ export default {
|
|||||||
this.menu = this.updateStandPlan.Center;
|
this.menu = this.updateStandPlan.Center;
|
||||||
break;
|
break;
|
||||||
case 'stopJumping':
|
case 'stopJumping':
|
||||||
this.menu = this.stopJumping.Center;
|
this.menu = MenuContextHandler.covertList(this.stopJumping.Center);
|
||||||
break;
|
break;
|
||||||
case 'allTrainStopJump':
|
case 'allTrainStopJump':
|
||||||
this.topTip = '所有列车跳停本站';
|
this.topTip = '所有列车跳停本站';
|
||||||
this.menu = this.allTrainStopJump.Center;
|
this.menu = MenuContextHandler.covertList(this.allTrainStopJump.Center);
|
||||||
break;
|
break;
|
||||||
case 'standDetain':
|
case 'standDetain':
|
||||||
this.topTip = '站台扣车 SET/CANCEL';
|
this.topTip = '站台扣车 SET/CANCEL';
|
||||||
this.menu = this.standDetain.Center;
|
this.menu = MenuContextHandler.covertList(this.standDetain.Center);
|
||||||
break;
|
break;
|
||||||
case 'psdInfoConfirm':
|
case 'psdInfoConfirm':
|
||||||
this.topTip = '站台屏蔽门报警-站台屏蔽门信息确认';
|
this.topTip = '站台屏蔽门报警-站台屏蔽门信息确认';
|
||||||
@ -259,8 +260,8 @@ export default {
|
|||||||
this.menu = this.downStopProfile.Center;
|
this.menu = this.downStopProfile.Center;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// this.menu = MenuContextHandler.covert(this.menuNormal);
|
|
||||||
// 故障模式菜单列表
|
// 故障模式菜单列表
|
||||||
if (this.operatemode === OperateMode.FAULT) {
|
if (this.operatemode === OperateMode.FAULT) {
|
||||||
this.menu = this.menuForce;
|
this.menu = this.menuForce;
|
||||||
}
|
}
|
||||||
|
@ -58,6 +58,7 @@ class CommandHandle {
|
|||||||
getDefinition(cmdType) {
|
getDefinition(cmdType) {
|
||||||
if (cmdType) {
|
if (cmdType) {
|
||||||
const simulationRole = Handler.getSimulationRole();
|
const simulationRole = Handler.getSimulationRole();
|
||||||
|
|
||||||
if (simulationRole) {
|
if (simulationRole) {
|
||||||
return this.definitionMap[simulationRole][cmdType.value] || this.definitionMap.Common[cmdType.value] || null;
|
return this.definitionMap[simulationRole][cmdType.value] || this.definitionMap.Common[cmdType.value] || null;
|
||||||
} else {
|
} else {
|
||||||
|
@ -147,7 +147,7 @@ class Handler {
|
|||||||
|
|
||||||
getOrder() {
|
getOrder() {
|
||||||
return store.state.training.order;
|
return store.state.training.order;
|
||||||
}
|
}
|
||||||
|
|
||||||
getSimulationRole() {
|
getSimulationRole() {
|
||||||
return State2SimulationMap[store.state.training.prdType];
|
return State2SimulationMap[store.state.training.prdType];
|
||||||
|
@ -4,7 +4,7 @@ import { State2SimulationMap, State2ControlMap } from './Config';
|
|||||||
import { OperateMode } from '@/scripts/ConstDic';
|
import { OperateMode } from '@/scripts/ConstDic';
|
||||||
|
|
||||||
class MenuContextHandler {
|
class MenuContextHandler {
|
||||||
constructor() {
|
constructor(store) {
|
||||||
this.operates = []; // 操作数据
|
this.operates = []; // 操作数据
|
||||||
this.command = {}; // 命令对象
|
this.command = {}; // 命令对象
|
||||||
}
|
}
|
||||||
@ -35,6 +35,10 @@ class MenuContextHandler {
|
|||||||
return store.state.training.prdType;
|
return store.state.training.prdType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getDeviceByCode(code) {
|
||||||
|
return store.state.map.mapDevice[code];
|
||||||
|
}
|
||||||
|
|
||||||
// 判断指令是否隐藏
|
// 判断指令是否隐藏
|
||||||
checkDisabled(data, selected) {
|
checkDisabled(data, selected) {
|
||||||
let result = false;
|
let result = false;
|
||||||
@ -60,7 +64,7 @@ class MenuContextHandler {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
covert2(menuList) {
|
covert2(menuMap) {
|
||||||
const selected = this.getCurrentStateObject();
|
const selected = this.getCurrentStateObject();
|
||||||
let menu = [];
|
let menu = [];
|
||||||
const control = this.getStationControl(selected);
|
const control = this.getStationControl(selected);
|
||||||
@ -69,14 +73,12 @@ class MenuContextHandler {
|
|||||||
const type = State2SimulationMap[this.getPrdType()];
|
const type = State2SimulationMap[this.getPrdType()];
|
||||||
const status = State2ControlMap[control.controlMode]; // 判断当前模式
|
const status = State2ControlMap[control.controlMode]; // 判断当前模式
|
||||||
if (type) {
|
if (type) {
|
||||||
menu = [...menuList[type]];
|
menu = [...menuMap[type]];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 特殊处理站台的右键操作( 因为小站台不允许有操作 )
|
// 特殊处理站台的右键操作( 因为小站台不允许有操作 )
|
||||||
if (selected._type == 'StationStand') {
|
if (selected._type == 'StationStand' && selected.small) {
|
||||||
if (selected.small) {
|
menu = [];
|
||||||
menu = [];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (menu.constructor === Array) {
|
if (menu.constructor === Array) {
|
||||||
@ -95,7 +97,7 @@ class MenuContextHandler {
|
|||||||
return menu;
|
return menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
covert(menuList) {
|
covert(menuMap) {
|
||||||
const selected = this.getCurrentStateObject();
|
const selected = this.getCurrentStateObject();
|
||||||
let menu = [];
|
let menu = [];
|
||||||
const control = this.getStationControl(selected);
|
const control = this.getStationControl(selected);
|
||||||
@ -104,13 +106,11 @@ class MenuContextHandler {
|
|||||||
const type = State2SimulationMap[this.getPrdType()];
|
const type = State2SimulationMap[this.getPrdType()];
|
||||||
const status = State2ControlMap[control.controlMode]; // 判断当前模式
|
const status = State2ControlMap[control.controlMode]; // 判断当前模式
|
||||||
if (type) {
|
if (type) {
|
||||||
menu = [...menuList[type]];
|
menu = [...menuMap[type]];
|
||||||
}
|
}
|
||||||
// 特殊处理站台的右键操作( 因为小站台不允许有操作 )
|
// 特殊处理站台的右键操作( 因为小站台不允许有操作 )
|
||||||
if (selected._type == 'StationStand') {
|
if (selected._type == 'StationStand' && selected.small) {
|
||||||
if (selected.small) {
|
menu = [];
|
||||||
menu = [];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (menu.constructor === Array) {
|
if (menu.constructor === Array) {
|
||||||
menu.forEach(elem => {
|
menu.forEach(elem => {
|
||||||
@ -128,18 +128,54 @@ class MenuContextHandler {
|
|||||||
return menu;
|
return menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
covertList(list) {
|
||||||
|
const menu = [...list];
|
||||||
|
const selected = this.getCurrentStateObject();
|
||||||
|
const control = this.getStationControl(selected);
|
||||||
|
if (control && !store.state.scriptRecord.audioPlay) {
|
||||||
|
if (this.getPrdType() != '' && this.getPrdType() != null) {
|
||||||
|
const type = State2SimulationMap[this.getPrdType()];
|
||||||
|
const status = State2ControlMap[control.controlMode]; // 判断当前模式
|
||||||
|
|
||||||
|
// 特殊处理站台的右键操作( 因为小站台不允许有操作 )
|
||||||
|
if (selected._type == 'StationStand' && selected.small) {
|
||||||
|
menu = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (menu.constructor === Array) {
|
||||||
|
menu.forEach(elem => {
|
||||||
|
if (elem.children && elem.children.length > 0) {
|
||||||
|
elem.children.forEach(each=>{
|
||||||
|
this.covertEachCommand(each, type, selected, status, false);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.covertEachCommand(elem, type, selected, status, false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return menu;
|
||||||
|
}
|
||||||
|
|
||||||
covertEachCommand(elem, type, selected, status, isSettingCommand = true) {
|
covertEachCommand(elem, type, selected, status, isSettingCommand = true) {
|
||||||
if (elem.type === 'separator') {
|
if (elem.type === 'separator') {
|
||||||
elem.show = true;
|
elem.show = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = CommandHandler.getDefinition(elem.cmdType);
|
const data = CommandHandler.getDefinition(elem.cmdType);
|
||||||
|
const model = this.getDeviceByCode(selected.code);
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
// 判断指令是否显示
|
// 判断指令是否显示
|
||||||
if (data.simulationRole.toUpperCase() == type.toUpperCase() && data.controlMode.indexOf(status) > -1) {
|
if (data.simulationRole.toUpperCase() == type.toUpperCase() && data.controlMode.indexOf(status) > -1) {
|
||||||
elem.show = true;
|
elem.show = true;
|
||||||
elem.disabled = this.checkDisabled(data, selected);
|
elem.disabled = this.checkDisabled(data, model);
|
||||||
|
if (!elem.disabled &&
|
||||||
|
elem.checkDisabled) {
|
||||||
|
elem.disabled = !!elem.checkDisabled(model);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
elem.show = true;
|
elem.show = true;
|
||||||
elem.disabled = true;
|
elem.disabled = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user