JD1A风格改造
This commit is contained in:
parent
1c07eeef75
commit
10eba07da8
@ -270,9 +270,14 @@ class SkinCode extends defaultStyle {
|
||||
},
|
||||
lamp: {
|
||||
square: true, // 方形
|
||||
radiusR: 20, // 控制灯大小
|
||||
controlColor: '#00d900', // 控制灯颜色
|
||||
offColor: '#ff0000',
|
||||
radiusR: 20,
|
||||
switchState: true, // 是否用颜色表示道岔状态
|
||||
controlColor: '#00ff00', // 定位颜色
|
||||
reverseColor: '#ffff00', // 反位颜色
|
||||
switchingColor: '#999999', // 转换中颜色
|
||||
faultColor: '#ff0000', // 挤岔颜色
|
||||
blockColor: '#0000ff', // 单封颜色
|
||||
lockColor: '#ff0000', // 单锁颜色
|
||||
lineWidth: 2,
|
||||
strokeColor: '#FFFFFF' // 控制灯描边样式
|
||||
}
|
||||
|
@ -283,7 +283,6 @@ export default class SaidLamp extends Group {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +52,6 @@ export default class SignalButton extends Group {
|
||||
})
|
||||
const ctcArcList = ['OCCLUSION', 'RECOVERY', 'CHANGE_DIRECTION', 'ACCIDENT', 'DEPART_ASSIST', 'PICK_ASSIST', 'ASSIST']
|
||||
|
||||
// if (model.code === 'BTN31730') debugger
|
||||
if (queryCtc && ctcArcList.includes(model.type)) {
|
||||
this.arcShape = new Arc({
|
||||
zlevel: this.zlevel,
|
||||
|
@ -26,8 +26,6 @@ class ESwDot extends Group {
|
||||
this.add(this.dot)
|
||||
}
|
||||
setColor(color) {
|
||||
console.log(this.dot)
|
||||
console.log(color)
|
||||
this.dot.setStyle({ fill: color })
|
||||
}
|
||||
}
|
||||
|
@ -481,15 +481,27 @@ export default class Switch extends Group {
|
||||
.start();
|
||||
}
|
||||
// N-定位 R-反位 NO-无(失表) EX-挤叉
|
||||
setSwitchFault(fault) {
|
||||
setSwitchFault(model) {
|
||||
const { pos, fault, /* 单锁 */singleLock, /* 封锁 */blockade } = model
|
||||
const faultList = ['SPLIT', 'SQUEEZE', 'NORMAL_SPLIT', 'REVERSE_SPLIT', 'SPLIT_1'];
|
||||
// (fault === 'SPLIT' || fault === 'SQUEEZE' || (fault === 'NORMAL_SPLIT' && !reversePosition) || (fault === 'REVERSE_SPLIT' && !normalPosition))
|
||||
if (this.model.switchFaultCode && fault && faultList.includes(fault) ) {
|
||||
if (this.model.switchFaultCode) {
|
||||
const switchFault = this.mapDevice[this.model.switchFaultCode];
|
||||
switchFault.instance.setControlColor('#F00', true);
|
||||
} else if (this.model.switchFaultCode) {
|
||||
const switchFault = this.mapDevice[this.model.switchFaultCode];
|
||||
switchFault.instance.setControlColor(this.style.backgroundColor, false);
|
||||
if (this.style.SwitchFault.lamp.switchState) {
|
||||
console.log(fault)
|
||||
console.log(pos)
|
||||
if (pos === 'N') switchFault.instance.setControlColor(this.style.SwitchFault.lamp.controlColor)
|
||||
else if (pos === 'R') switchFault.instance.setControlColor(this.style.SwitchFault.lamp.reverseColor)
|
||||
else if (pos === 'NO') switchFault.instance.setControlColor(this.style.SwitchFault.lamp.switchingColor)
|
||||
else if (pos === 'EX') switchFault.instance.setControlColor(this.style.SwitchFault.lamp.faultColor)
|
||||
if (singleLock) switchFault.instance.setControlColor(this.style.SwitchFault.lamp.lockColor)
|
||||
if (blockade === 'EX') switchFault.instance.setControlColor(this.style.SwitchFault.lamp.blockColor)
|
||||
} else {
|
||||
if ( fault && faultList.includes(fault) ) {
|
||||
switchFault.instance.setControlColor('#F00', true);
|
||||
} else {
|
||||
switchFault.instance.setControlColor(this.style.backgroundColor, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
// stopAnimation
|
||||
this.shapeModelB.stopAnimation(false);
|
||||
@ -803,7 +815,8 @@ export default class Switch extends Group {
|
||||
this.setAshShow();
|
||||
}
|
||||
} else {
|
||||
this.setSwitchFault(model.fault);
|
||||
this.setSwitchFault(model);
|
||||
console.log(model)
|
||||
|
||||
// model.pos == 'NO' || model.pos == 'EX';
|
||||
// N-定位 R-反位 NO-无(失表) EX-挤叉
|
||||
|
@ -723,12 +723,17 @@ export default {
|
||||
}
|
||||
},
|
||||
handelSwitchOperate(model) {
|
||||
let code = ''
|
||||
if (model._type === 'Switch') code = model.code
|
||||
else if (model._type === 'SwitchFault') {
|
||||
code = this.$store.getters['map/getDeviceByCode'](model.switchCode).code
|
||||
}
|
||||
const operate = {
|
||||
over: true,
|
||||
code: model.code,
|
||||
operation: this.$store.state.menuOperation.buttonOperation,
|
||||
cmdType: this.cmdType,
|
||||
param: { switchCode: model.code }
|
||||
param: { switchCode: code }
|
||||
}
|
||||
this.sendCommand(operate)
|
||||
},
|
||||
@ -837,6 +842,15 @@ export default {
|
||||
this.Switch.block.button.operation,
|
||||
this.Switch.unblock.button.operation
|
||||
]
|
||||
const signalButtonOperation = [
|
||||
'LOCATE', //总定
|
||||
'REVERSE', //总反
|
||||
'MONOLOCK', //单锁
|
||||
'UNLOCK', //解锁
|
||||
'BLOCK', //单封
|
||||
'UNBLOCK', //解封,
|
||||
'SECTION_FAULT_UNLOCK' //区故解
|
||||
]
|
||||
if ((this.guideLockLeftFlag || this.guideLockRightFlag) && model._type === 'SignalButton' && model.type === 'GUIDE') {
|
||||
this.handleGuideLock(model)
|
||||
} else if (buttonOperation && this.commandTypeList.includes(model._type)) {
|
||||
@ -862,6 +876,30 @@ export default {
|
||||
} else if (model._type === 'SignalButton' && signalButtonList.includes(model.type)) {
|
||||
// 改方操作 总辅助操作 接辅助操作 发辅助操作
|
||||
this.assistOperateOrChange(model)
|
||||
} else if (model._type === 'SignalButton' && model.type === 'GUIDELOCK') {
|
||||
// 引导总锁
|
||||
if (model.labelEnum === 'S') {
|
||||
this.guideLockLeftButtonDown()
|
||||
} else if (model.labelEnum === 'X') {
|
||||
this.guideLockRightButtonDown()
|
||||
}
|
||||
} else if (model._type === 'SignalButton' && signalButtonOperation.includes(model.type)) {
|
||||
//总定总反单锁解锁单封解封
|
||||
if (model.type === 'LOCATE') {
|
||||
this.buttonDown(this.Switch.locate.button.operation, ['Switch', 'SwitchFault'])
|
||||
} else if (model.type === 'REVERSE') {
|
||||
this.buttonDown(this.Switch.reverse.button.operation, ['Switch', 'SwitchFault'])
|
||||
} else if (model.type === 'MONOLOCK') {
|
||||
this.buttonDown(this.Switch.lock.button.operation, ['Switch', 'SwitchFault'])
|
||||
} else if (model.type === 'UNLOCK') {
|
||||
this.buttonDown(this.Switch.unlock.button.operation, ['Switch', 'SwitchFault'])
|
||||
} else if (model.type === 'BLOCK') {
|
||||
this.buttonDown(this.Switch.block.button.operation, ['Switch', 'SwitchFault'])
|
||||
} else if (model.type === 'UNBLOCK') {
|
||||
this.buttonDown(this.Switch.unblock.button.operation, ['Switch', 'SwitchFault'])
|
||||
} else if (model.type === 'SECTION_FAULT_UNLOCK') {
|
||||
this.buttonDown(this.Section.fault.button.operation, ['Section'])
|
||||
}
|
||||
} else if (
|
||||
(model._type === 'SignalButton' && !this.checkSignalBlock(model.signalCode)) ||
|
||||
(model._type === 'Signal' && !model.blockade)
|
||||
|
@ -325,7 +325,7 @@ export default {
|
||||
return this.editModel.type === 'FLEXIBLE'
|
||||
},
|
||||
isLinkDirection() {
|
||||
return ['ASSIST', 'PICK_ASSIST', 'DEPART_ASSIST', 'ACCIDENT', 'CHANGE_DIRECTION', 'RECOVERY', 'OCCLUSION'].includes(
|
||||
return ['ASSIST', 'PICK_ASSIST', 'DEPART_ASSIST', 'ACCIDENT', 'CHANGE_DIRECTION', 'RECOVERY', 'OCCLUSION', 'GUIDELOCK'].includes(
|
||||
this.editModel.type
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user