大铁CTC引导总锁
This commit is contained in:
parent
0583f03479
commit
06214aa258
@ -254,7 +254,7 @@ class SkinCode extends defaultStyle {
|
||||
|
||||
/** 引导总锁 */
|
||||
this[deviceType.GuideLock] = {
|
||||
// 是否显示
|
||||
// 是否显示s
|
||||
text: {
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
@ -264,8 +264,9 @@ class SkinCode extends defaultStyle {
|
||||
fill: 'rgba(0,0,0,0)', // 填充色
|
||||
radiusR: 6, // 控制灯大小
|
||||
controlColor: '#b5b3b3', // 控制灯颜色 (灰色)
|
||||
lightUpColor: '#FF0000' // 点亮灯颜色
|
||||
}
|
||||
lightUpColor: '#FF0000' // 点亮灯颜色
|
||||
},
|
||||
mouseOverStyle: true
|
||||
};
|
||||
|
||||
// 供电线路
|
||||
|
@ -586,7 +586,8 @@ class SkinCode extends defaultStyle {
|
||||
lamp: {
|
||||
radiusR: 6, // 控制灯大小
|
||||
controlColor: '#FFFF00' // 控制灯颜色
|
||||
}
|
||||
},
|
||||
mouseOverStyle: {}
|
||||
};
|
||||
this[deviceType.PowerSupply] = {
|
||||
text: {
|
||||
@ -808,14 +809,21 @@ class SkinCode extends defaultStyle {
|
||||
text: {
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
distance: 5 // 灯跟文字距离
|
||||
distance: 5, // 灯跟文字距离
|
||||
lightHighColor: '#0000FF', // 高亮颜色
|
||||
flashColor: '#0000FF' // 闪烁颜色
|
||||
},
|
||||
lamp: {
|
||||
fill: 'rgba(0,0,0,0)', // 填充色
|
||||
radiusR: 6, // 控制灯大小
|
||||
controlColor: '#b5b3b3', // 控制灯颜色 (灰色)
|
||||
lightUpColor: '#FF0000' // 点亮灯颜色
|
||||
}
|
||||
lightUpColor: '#FF0000', // 点亮灯颜色
|
||||
lightHighColor: '#00FFFF', // 高亮颜色
|
||||
flashColor: '#0000FF' // 闪烁颜色
|
||||
},
|
||||
mouseOverStyle: true,
|
||||
lightHigh: true, // 鼠标悬浮高亮
|
||||
selectFlash: true // 选中闪烁
|
||||
};
|
||||
|
||||
this[deviceType.TrainWindow] = {
|
||||
|
@ -124,7 +124,13 @@ export function parser(data, skinCode, showConfig) {
|
||||
|
||||
zrUtil.each(data.totalGuideLockButtonVOList || [], elem => { // 引导总锁列表
|
||||
mapDevice[elem.code] = createDevice(deviceType.GuideLock, elem, propConvert, showConfig);
|
||||
mapDevice[elem.stationCode].guideLockCode = elem.code; // 保证处理车站列表在处理引导总锁列表之前
|
||||
if (!elem.direction) {
|
||||
mapDevice[elem.stationCode].guideLockCode = elem.code; // 保证处理车站列表在处理引导总锁列表之前
|
||||
} else if (elem.direction === 'S') {
|
||||
mapDevice[elem.stationCode].sGuideLockCode = elem.code;
|
||||
} else if (elem.direction === 'X') {
|
||||
mapDevice[elem.stationCode].xGuideLockCode = elem.code;
|
||||
}
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.automaticRouteButtonList || [], elem => { // 自动进路列表
|
||||
|
@ -28,26 +28,20 @@ export default class EMouse extends Group {
|
||||
this.text.hide();
|
||||
}
|
||||
mouseover(e) {
|
||||
if (e &&
|
||||
e.target &&
|
||||
e.target._subType == 'Text') {
|
||||
if (e && e.target && e.target._subType == 'Text') {
|
||||
this.text.show();
|
||||
} else {
|
||||
// this.device.control.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor);
|
||||
// this.device.control.setTextColor(this.device.style.LcControl.mouseOverStyle.textColor);
|
||||
} else if (this.device.style.GuideLock.lightHigh && !this.device.__down) {
|
||||
this.device.control.setStyle({ fill: this.device.guideLock ? this.device.style.GuideLock.lamp.lightUpColor : this.device.style.GuideLock.lamp.lightHighColor });
|
||||
this.device.text.setStyle({ textFill: this.device.style.GuideLock.text.lightHighColor, textBackgroundColor: '#fff' });
|
||||
}
|
||||
}
|
||||
|
||||
mouseout(e) {
|
||||
if (!this.device.__down) {
|
||||
if (e &&
|
||||
e.target &&
|
||||
e.target._subType == 'Text') {
|
||||
this.text.hide();
|
||||
} else {
|
||||
// this.device.control.setControlColor(this.device.style.LcControl.lamp.controlColor);
|
||||
// this.device.control.setTextColor('#FFFFFF');
|
||||
}
|
||||
if (e && e.target && e.target._subType == 'Text' && !this.device.__down) {
|
||||
this.text.hide();
|
||||
} else if (this.device.style.GuideLock.lightHigh && !this.device.__down) {
|
||||
this.device.control.setStyle({ fill: this.device.style.GuideLock.lamp.controlColor });
|
||||
this.device.text.setStyle({ textFill: '#FFFFFF', textBackgroundColor: '#000' });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ export default class GuideLock extends Group {
|
||||
}
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.guideLock = false;
|
||||
this.create();
|
||||
this.createMouseEvent();
|
||||
this.setState(model);
|
||||
@ -34,6 +35,7 @@ export default class GuideLock extends Group {
|
||||
_subType: 'Control',
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
cursor: 'crosshair',
|
||||
shape: {
|
||||
cx: this.computedPosition.x,
|
||||
cy: this.computedPosition.y,
|
||||
@ -87,10 +89,14 @@ export default class GuideLock extends Group {
|
||||
this.add(this.text);
|
||||
}
|
||||
recover() {
|
||||
this.control && this.control.stopAnimation(false);
|
||||
this.text && this.text.stopAnimation(false);
|
||||
this.control && this.control.show();
|
||||
this.text && this.text.show();
|
||||
this.subtitleText && this.subtitleText.show();
|
||||
this.control && this.control.setStyle({ fill: this.style.GuideLock.lamp.controlColor });
|
||||
this.text && this.text.setStyle({ textFill: '#fff', textBackgroundColor: '#000' });
|
||||
this.__down = false;
|
||||
}
|
||||
handleSignal() {
|
||||
this.control.setStyle({ fill: this.style.GuideLock.lamp.lightUpColor });
|
||||
@ -99,7 +105,24 @@ export default class GuideLock extends Group {
|
||||
setAshShow() {
|
||||
this.control && this.control.setStyle({fill:'#FFF'});
|
||||
}
|
||||
|
||||
handleSelect() {
|
||||
this.control && this.control.animateStyle(true)
|
||||
.when(500, { fill: this.style.GuideLock.lamp.flashColor })
|
||||
.when(1000, { fill: this.style.GuideLock.lamp.controlColor })
|
||||
.start();
|
||||
this.text && this.text.animateStyle(true)
|
||||
.when(500, { textFill: this.style.GuideLock.text.flashColor })
|
||||
.when(1000, { textFill: '#fff' })
|
||||
.start();
|
||||
this.__down = true;
|
||||
setTimeout(() => {
|
||||
this.control && this.control.stopAnimation(false);
|
||||
this.text && this.text.stopAnimation(false);
|
||||
this.control && this.control.setStyle({ fill: this.guideLock ? this.style.GuideLock.lamp.lightUpColor : this.style.GuideLock.lamp.controlColor });
|
||||
this.text && this.text.setStyle({ textFill: '#fff', textBackgroundColor: '#000' });
|
||||
this.__down = false;
|
||||
}, 15000);
|
||||
}
|
||||
// 设置状态
|
||||
setState(model) {
|
||||
// 只响应前端自定义类型的状态变化
|
||||
@ -113,13 +136,17 @@ export default class GuideLock extends Group {
|
||||
this.setAshShow();
|
||||
} else {
|
||||
model.totalGuideLock && this.handleSignal();
|
||||
model.hasSelected && this.handleSelect();
|
||||
this.handleGuideLock(this.guideLock);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
handleGuideLock(flag) {
|
||||
this.guideLock = flag;
|
||||
this.control && this.control.setStyle({ fill: flag ? this.style.GuideLock.lamp.lightUpColor : this.style.GuideLock.lamp.controlColor });
|
||||
}
|
||||
createMouseEvent() {
|
||||
if (this.style.LcControl.mouseOverStyle) {
|
||||
if (this.style.GuideLock.mouseOverStyle) {
|
||||
this.mouseEvent = new EMouse(this);
|
||||
this.add(this.mouseEvent);
|
||||
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
|
||||
|
@ -978,6 +978,7 @@ export default class Station extends Group {
|
||||
model.emergencyController != undefined && this.handleEmergencyChange(model.emergencyController);
|
||||
model.controlApplicant && this.handleControlApplicant(model);
|
||||
model.allowAutonomy && this.handleAllowAutonomy();
|
||||
this.handleGuideLock(model);
|
||||
if (this.style.Station.syncCentralizeStation && (model.controlMode || model.controller || model.emergencyController != undefined) && model.centralized) {
|
||||
model.chargeStationCodeList.forEach(item => {
|
||||
const device = store.getters['map/getDeviceByCode'](item);
|
||||
@ -1018,6 +1019,13 @@ export default class Station extends Group {
|
||||
|
||||
}
|
||||
}
|
||||
handleGuideLock(model) {
|
||||
const sGuideLock = store.getters['map/getDeviceByCode'](model.sGuideLockCode);
|
||||
const xGuideLock = store.getters['map/getDeviceByCode'](model.xGuideLockCode);
|
||||
console.log(model, model.sGuideMasterLock, model.xGuideMasterLock);
|
||||
sGuideLock && sGuideLock.instance && sGuideLock.instance.handleGuideLock(model.sguideMasterLock);
|
||||
xGuideLock && xGuideLock.instance && xGuideLock.instance.handleGuideLock(model.xguideMasterLock);
|
||||
}
|
||||
handlePreResetLamp() {
|
||||
this.controlPreReset && this.controlPreReset.setColor('#f00');
|
||||
}
|
||||
|
@ -24,7 +24,7 @@
|
||||
<center><b>按</b><b>钮</b></center>
|
||||
</span>
|
||||
</button>
|
||||
<button :id="Station.guideLock.button.domId" :disabled="true" class="button_box" @click="buttonDown(Station.guideLock.button.operation, ['Button'])">
|
||||
<button :id="Station.guideLock.button.domId" class="button_box" @click="buttonDown(Station.guideLock.button.operation, ['GuideLock'])">
|
||||
<span :style="{color: operation === Station.guideLock.button.operation?'#ccc':'#800000'}">
|
||||
<center><b>引</b><b>导</b></center>
|
||||
<center><b>总</b><b>锁</b></center>
|
||||
@ -345,6 +345,9 @@ export default {
|
||||
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (operate.operationPre === this.Station.guideLock.button.operation) {
|
||||
this.$refs.password.doShow({userOperationType: UserOperationType.LEFTCLICK, operation: operate.operation, operateNext: this.Command.close.password.operation });
|
||||
}
|
||||
}
|
||||
}).catch(e => {
|
||||
console.error(e);
|
||||
@ -371,38 +374,6 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
// S引导总锁按钮点击
|
||||
guideLockLeftButtonDown() {
|
||||
const operate = {
|
||||
userOperationType: UserOperationType.LEFTCLICK,
|
||||
operation: this.Switch.guideLock.leftButton.operation
|
||||
};
|
||||
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
operate.nextCmdType = CMD.Switch.CMD_SWITCH_MASTER_UNBLOCK;
|
||||
operate.param = {right: false};
|
||||
operate['operateNext'] = this.Command.close.password.operation;
|
||||
this.$refs.password.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// X引导总锁按钮点击
|
||||
guideLockRightButtonDown() {
|
||||
const operate = {
|
||||
userOperationType: UserOperationType.LEFTCLICK,
|
||||
operation: this.Switch.guideLock.rightButton.operation
|
||||
};
|
||||
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
operate.nextCmdType = CMD.Switch.CMD_SWITCH_MASTER_UNBLOCK;
|
||||
operate.param = {right: true};
|
||||
operate['operateNext'] = this.Command.close.password.operation;
|
||||
this.$refs.password.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
buttonDown(operation, commandTypeList) {
|
||||
const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode);
|
||||
if (!station || station.controlMode === 'Interlock') { return; }
|
||||
@ -420,7 +391,8 @@ export default {
|
||||
const operationList = [
|
||||
this.Signal.humanTrainRoute.button.operation,
|
||||
this.Section.fault.button.operation,
|
||||
this.Signal.guide.button.operation
|
||||
this.Signal.guide.button.operation,
|
||||
this.Station.guideLock.button.operation
|
||||
];
|
||||
if (operationList.includes(operation)) {
|
||||
operate['operateNext'] = this.Command.close.password.operation;
|
||||
@ -646,11 +618,19 @@ export default {
|
||||
handleGuideLock(model) {
|
||||
const operate = {
|
||||
code: model.code,
|
||||
operation: this.Signal.guide.button.operation,
|
||||
operation: this.Station.guideLock.button.operation,
|
||||
userOperationType: UserOperationType.LEFTCLICK,
|
||||
param: {signalCode: model.signalCode}
|
||||
param: {stationCode: model.stationCode, throat: model.direction}
|
||||
};
|
||||
this.$store.dispatch('trainingNew/next', operate);
|
||||
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('training/updateMapState', [{code: model.code, _type: model._type, hasSelected: 1}]);
|
||||
}
|
||||
}).catch(e => {
|
||||
console.error(e);
|
||||
this.$refs.noticeInfo.doShow();
|
||||
this.clearOperate();
|
||||
});
|
||||
},
|
||||
handleFaultSection(model) {
|
||||
if (model._type === 'Section') {
|
||||
@ -680,6 +660,7 @@ export default {
|
||||
return;
|
||||
}
|
||||
const buttonOperation = this.$store.state.menuOperation.buttonOperation;
|
||||
console.log(model._type, buttonOperation, this.commandTypeList.includes(model._type), this.commandTypeList);
|
||||
if (buttonOperation && this.commandTypeList.includes(model._type)) {
|
||||
if (buttonOperation === this.MixinCommand.totalCancel.button.operation) {
|
||||
this.handleTotalCancel(model);
|
||||
@ -705,6 +686,8 @@ export default {
|
||||
this.arrangementRouteOperation(model);
|
||||
} else if (buttonOperation === this.Signal.guide.button.operation ) {
|
||||
this.handleGuideSignal(model);
|
||||
} else if (buttonOperation === this.Station.guideLock.button.operation ) {
|
||||
this.handleGuideLock(model);
|
||||
} else if (buttonOperation === this.MixinCommand.functionButton.button.operation) {
|
||||
const signalButtonList = ['ASSIST', 'CHANGE_DIRECTION', 'PICK_ASSIST', 'DEPART_ASSIST', 'OCCLUSION', 'RECOVERY', 'ACCIDENT'];
|
||||
if (model._type === 'SignalButton' && signalButtonList.includes(model.type)) {
|
||||
@ -789,14 +772,19 @@ export default {
|
||||
operate.userOperationType = UserOperationType.LEFTCLICK;
|
||||
operate.over = true;
|
||||
operate.cmdType = CMD.Switch.CMD_SWITCH_BLOCK;
|
||||
} else if (this.operation === OperationEvent.Station.guideLock.button.operation) {
|
||||
operate.userOperationType = UserOperationType.LEFTCLICK;
|
||||
operate.over = true;
|
||||
operate.cmdType = CMD.Station.CMD_STATION_MASTER_LOCK;
|
||||
}
|
||||
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
|
||||
if (valid) {
|
||||
this.clearOperate();
|
||||
}
|
||||
}).catch(e => {
|
||||
console.error(e);
|
||||
this.$refs.noticeInfo.doShow();
|
||||
}).finally(() => {
|
||||
if (this.operation === OperationEvent.Station.guideLock.button.operation) {
|
||||
this.$store.dispatch('training/updateMapState', [{code: this.selected.code, _type: this.selected._type, hasSelected: 0}]);
|
||||
}
|
||||
this.clearOperate();
|
||||
});
|
||||
}
|
||||
|
@ -114,6 +114,10 @@ export default {
|
||||
{ name: '全线临时限速', value: 'LimitControl' },
|
||||
{ name: '站后折返', value: 'StationTurnBack' }
|
||||
],
|
||||
directionList: [
|
||||
{ name: 'X方向', value: 'X' },
|
||||
{ name: 'S方向', value: 'S' }
|
||||
],
|
||||
cardMode: 'generate',
|
||||
addBackModel: {
|
||||
id: '',
|
||||
@ -133,6 +137,7 @@ export default {
|
||||
automaticRouteCode: '', // 关联自动进路code
|
||||
cycleCode: '', // 自动折返关联code
|
||||
stationCode: '', // 所属设备集中站
|
||||
direction: '',
|
||||
position: {
|
||||
x: 0,
|
||||
y: 0
|
||||
@ -146,6 +151,7 @@ export default {
|
||||
automaticRouteCode: '', // 关联自动进路code
|
||||
cycleCode: '', // 自动折返关联code
|
||||
stationCode: '', // 所属设备集中站
|
||||
direction: '',
|
||||
position: {
|
||||
x: 0,
|
||||
y: 0
|
||||
@ -218,9 +224,10 @@ export default {
|
||||
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
|
||||
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
|
||||
] },
|
||||
{ prop: 'direction', label: '方向:', type: 'select', optionLabel: 'name', optionValue: 'value', options: this.directionList },
|
||||
{ prop:'automaticRouteCode', label: this.$t('map.automaticRouteCode'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenAutomaticRoute, deviceChange: this.changeEditStation },
|
||||
{ prop:'cycleCode', label: this.$t('map.cycleCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenMapCycleButtonVO, deviceChange: this.changeEditStation },
|
||||
{ prop:'stationCode', label: '所属车站', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, disabled: this.isDisabledStation, isHidden: !this.isHiddenStation }
|
||||
{ prop:'stationCode', label: '所属车站:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, disabled: this.isDisabledStation, isHidden: !this.isHiddenStation }
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -324,6 +331,7 @@ export default {
|
||||
automaticRouteCode: '', // 关联自动进路code
|
||||
cycleCode: '', // 自动折返关联code
|
||||
stationCode: '', // 所属设备集中站
|
||||
direction: '',
|
||||
position: {
|
||||
x: 0,
|
||||
y: 0
|
||||
@ -450,6 +458,7 @@ export default {
|
||||
y: this.addModel.position.y
|
||||
},
|
||||
optionList: [],
|
||||
direction: this.addModel.direction,
|
||||
automaticRouteCode: this.addModel.automaticRouteCode, // 关联自动进路code
|
||||
cycleCode: this.addModel.cycleCode, // 自动折返关联code
|
||||
stationCode: this.addModel.stationCode // 所属设备集中站
|
||||
|
Loading…
Reference in New Issue
Block a user