This commit is contained in:
joylink_cuiweidong 2022-07-29 17:10:43 +08:00
commit 028ded01e3
11 changed files with 448 additions and 361 deletions

View File

@ -257,9 +257,33 @@ class SkinCode extends defaultStyle {
}; };
this[deviceType.SignalButton] = { this[deviceType.SignalButton] = {
shape: 'roundWithDock' shape: 'roundWithDock',
fillColor: '#808080',
showName: true
} }
this[deviceType.SwitchFault] = {
displayCondition: '01', // 显示条件 01所有模式下显示 02 行调显示 03现地显示
text: {
fontSize: 14, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: -50 // 灯跟文字距离
},
lamp: {
square: true, // 方形
radiusR: 20,
switchState: true, // 是否用颜色表示道岔状态
controlColor: '#00ff00', // 定位颜色
reverseColor: '#ffff00', // 反位颜色
switchingColor: '#999999', // 转换中颜色
faultColor: '#ff0000', // 挤岔颜色
blockColor: '#0000ff', // 单封颜色
lockColor: '#ff0000', // 单锁颜色
lineWidth: 2,
strokeColor: '#FFFFFF' // 控制灯描边样式
}
};
// 供电线路 // 供电线路
this[deviceType.Power] = { this[deviceType.Power] = {
noElectricStrokeColor:'#808080', // 无电颜色 noElectricStrokeColor:'#808080', // 无电颜色

View File

@ -541,6 +541,7 @@ class SkinCode extends defaultStyle {
distance: 5 // 灯跟文字距离 distance: 5 // 灯跟文字距离
}, },
lamp: { lamp: {
square: false, // 方形
radiusR: 6, // 控制灯大小 radiusR: 6, // 控制灯大小
controlColor: '#000000', // 控制灯颜色 controlColor: '#000000', // 控制灯颜色
offColor: '#ff0000', offColor: '#ff0000',

View File

@ -45,12 +45,13 @@ export default class SaidLamp extends Group {
this.control = new EControl({ this.control = new EControl({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
arc: { control: {
shape: { shape: {
cx: this.computedPosition.x, cx: this.computedPosition.x,
cy: this.computedPosition.y, cy: this.computedPosition.y,
r: this.deviceStyle.lamp.radiusR r: this.deviceStyle.lamp.radiusR
}, },
isSquare: this.deviceStyle.lamp.square,
subType: 'Control', subType: 'Control',
lineWidth: this.deviceStyle.lamp.lineWidth || 0, lineWidth: this.deviceStyle.lamp.lineWidth || 0,
fill: this.deviceStyle.lamp.controlColor, fill: this.deviceStyle.lamp.controlColor,
@ -282,7 +283,6 @@ export default class SaidLamp extends Group {
} }
} }
} }
} }
} }
} }

View File

@ -1,338 +1,312 @@
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group'
import Rect from 'zrender/src/graphic/shape/Rect'; import Rect from 'zrender/src/graphic/shape/Rect'
import Line from 'zrender/src/graphic/shape/Line'; import Line from 'zrender/src/graphic/shape/Line'
import Text from 'zrender/src/graphic/Text'; import Text from 'zrender/src/graphic/Text'
import Arc from 'zrender/src/graphic/shape/Arc'; import Arc from 'zrender/src/graphic/shape/Arc'
import Circle from 'zrender/src/graphic/shape/Circle'; import Circle from 'zrender/src/graphic/shape/Circle'
import store from '@/store/index'; import store from '@/store/index'
const typeList = [
'PICK_ASSIST',
'DEPART_ASSIST',
'ASSIST',
'GUIDELOCK',
'SECTION_FAULT_UNLOCK',
'LOCATE',
'REVERSE',
'CANCEL',
'HUMAN_RELEASE_ROUTE',
'MONOLOCK',
'UNLOCK',
'BLOCK',
'UNBLOCK',
'CHANGE_DIRECTION'
]
export default class SignalButton extends Group { export default class SignalButton extends Group {
constructor(model, {style}) { constructor(model, { style }) {
super(); super()
this._code = model.code; this._code = model.code
this._type = model._type; this._type = model._type
this.zlevel = model.zlevel; this.zlevel = model.zlevel
const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code)
if (pictureDevice) { if (pictureDevice) {
this.computedPosition = pictureDevice.position; this.computedPosition = pictureDevice.position
} else { } else {
this.computedPosition = model.position; this.computedPosition = model.position
}
this.z = 0;
this.model = model;
this.style = style;
// Line
this.create();
this.setState(model);
} }
this.z = 0
this.model = model
this.style = style
// Line
this.create()
this.setState(model)
}
create() { create() {
const model = this.model; const model = this.model
const computedPosition = this.computedPosition; const computedPosition = this.computedPosition
const fillColor = this.getTypeColor(); const fillColor = this.getTypeColor()
// const queryList = window.location.search.substring(1).split('&'); if (this.style.SignalButton && this.style.SignalButton.shape === 'roundWithDock' && typeList.includes(model.type)) {
// const queryCtc = queryList.find(item => { const circle1 = new Circle({
// return item.includes('ctc'); zlevel: this.zlevel,
// }); z: this.z + 2,
// const ctcArcList = ['OCCLUSION', 'RECOVERY', 'CHANGE_DIRECTION', 'ACCIDENT', 'DEPART_ASSIST', 'PICK_ASSIST', 'ASSIST']; shape: {
const typeList = []; cx: computedPosition.x + 7,
// debugger; cy: computedPosition.y + 7,
// console.log(model.type); r: 7
// if (queryCtc && ctcArcList.includes(model.type)) { },
// // debugger; style: {
// this.arcShape = new Arc({ stroke: '#69666E',
// zlevel: this.zlevel, lineWidth: 1,
// z: this.z, fill: fillColor
// shape: { }
// cx: computedPosition.x + 7, })
// cy: computedPosition.y + 7, const circle2 = new Circle({
// r: 7 zlevel: this.zlevel,
// }, z: this.z + 1,
// style: { shape: {
// stroke: '#69666E', cx: computedPosition.x + 7,
// lineWidth: 1, cy: computedPosition.y + 9,
// fill: fillColor r: 8
// } },
// }); style: {
// this.add(this.arcShape); fill: '#000'
// } else }
if (this.style.SignalButton && })
this.style.SignalButton.shape === 'roundWithDock' && const circle3 = new Circle({
typeList.includes(model.type)) { zlevel: this.zlevel,
const circle1 = new Circle({ z: this.z,
zlevel: this.zlevel, shape: {
z: this.z + 2, cx: computedPosition.x + 7,
shape: { cy: computedPosition.y + 9,
cx: computedPosition.x + 7, r: 9
cy: computedPosition.y + 7, },
r: 7 style: {
}, fill: '#eee'
style: { }
stroke: '#69666E', })
lineWidth: 1, this.arcShape = circle1
fill: fillColor this.arcShapeDock1 = circle2
} this.arcShapeDock2 = circle3
}); this.add(circle1)
const circle2 = new Circle({ .add(circle2)
zlevel: this.zlevel, .add(circle3)
z: this.z + 1, } else {
shape: { this.rectButton = new Rect({
cx: computedPosition.x + 7, zlevel: this.zlevel,
cy: computedPosition.y + 9, z: this.z,
r: 8 shape: {
}, x: computedPosition.x,
style: { y: computedPosition.y,
fill: '#000' width: 14,
} height: 14
}); },
const circle3 = new Circle({ style: {
zlevel: this.zlevel, lineDash: null,
z: this.z, stroke: '#69666E',
shape: { lineWidth: 1,
cx: computedPosition.x + 7, fill: fillColor
cy: computedPosition.y + 9, }
r: 9 })
}, this.add(this.rectButton)
style: { }
fill: '#eee' this.leftLine = new Line({
} zlevel: this.zlevel,
}); z: this.z + 1,
this.arcShape = circle1; shape: {
this.add(circle1).add(circle2).add(circle3); x1: computedPosition.x + 1,
y1: computedPosition.y + 1,
x2: computedPosition.x + 13,
y2: computedPosition.y + 13
},
style: {
lineWidth: 2,
stroke: '#ff0000'
}
})
this.add(this.leftLine)
this.leftLine.hide()
this.rightLine = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: computedPosition.x + 13,
y1: computedPosition.y + 1,
x2: computedPosition.x + 1,
y2: computedPosition.y + 13
},
style: {
lineWidth: 2,
stroke: '#ff0000'
}
})
this.add(this.rightLine)
this.rightLine.hide()
this.leftBoard = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: computedPosition.x - 1,
y1: computedPosition.y - 1,
x2: computedPosition.x - 1,
y2: computedPosition.y + 15
},
style: {
lineWidth: 2,
stroke: '#FFFFFF'
}
})
this.add(this.leftBoard)
this.leftBoard.hide()
this.topBoard = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: computedPosition.x - 1,
y1: computedPosition.y - 1,
x2: computedPosition.x + 15,
y2: computedPosition.y - 1
},
style: {
lineWidth: 2,
stroke: '#FFFFFF'
}
})
this.add(this.topBoard)
this.topBoard.hide()
this.rightBoard = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: computedPosition.x + 15,
y1: computedPosition.y - 1,
x2: computedPosition.x + 15,
y2: computedPosition.y + 15
},
style: {
lineWidth: 2,
stroke: '#A0A0A0'
}
})
this.add(this.rightBoard)
this.rightBoard.hide()
this.bottomBoard = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: computedPosition.x - 1,
y1: computedPosition.y + 15,
x2: computedPosition.x + 15,
y2: computedPosition.y + 15
},
style: {
lineWidth: 2,
stroke: '#A0A0A0'
}
})
this.add(this.bottomBoard)
this.bottomBoard.hide()
const hasTextList = ['PASS', 'ASSIST', 'PICK_ASSIST', 'DEPART_ASSIST', 'ACCIDENT', 'CHANGE_DIRECTION', 'RECOVERY', 'OCCLUSION']
if (hasTextList.includes(model.type) || (this.style.SignalButton && this.style.SignalButton.showName)) {
this.buttonText = new Text({
zlevel: this.zlevel,
z: this.z,
style: {
x: computedPosition.x + model.nameOffset.x,
y: computedPosition.y + model.nameOffset.y,
fontWeight: '400',
fontSize: 10,
fontFamily: '',
text: model.name,
textFill: '#C0C0C0',
textAlign: 'middle',
textVerticalAlign: 'top'
}
})
this.add(this.buttonText)
}
}
startAnimate() {
this.rectButton &&
this.rectButton
.animateStyle(true)
.when(0, { fill: '#000' })
.when(1000, { fill: this.getTypeColor() })
.when(2000, { fill: '#000' })
.start()
}
stopAnimation() {
this.rectButton && this.rectButton.stopAnimation(true)
// this.arcFlash && this.arcFlash.stopAnimation(false);
}
getTypeColor() {
if (this.style.SignalButton && this.style.SignalButton.fillColor && typeList.includes(this.model.type)) {
return this.style.SignalButton.fillColor
}
let color = ''
const list = ['ASSIST', 'ACCIDENT', 'PICK_ASSIST', 'DEPART_ASSIST', 'CHANGE_DIRECTION', 'RECOVERY', 'OCCLUSION']
if (this.model.type === 'FLEXIBLE' || this.model.type === 'SHUNT_TERMINAL') {
color = '#808080'
} else if (this.model.type === 'GUIDE') {
color = '#5050E1'
} else if (list.includes(this.model.type)) {
color = '#ccc'
} else {
color = '#008000'
}
return color
} //
recover() {
this.stopAnimation()
this.rectButton && this.rectButton.setStyle({ fill: this.getTypeColor() })
this.arcShape && this.arcShape.setStyle({ fill: this.getTypeColor() })
this.rightLine && this.rightLine.hide()
this.leftLine && this.leftLine.hide()
this.rectButton && this.rectButton.show()
this.arcShape && this.arcShape.show()
this.arcShapeDock1 && this.arcShapeDock1.show()
this.arcShapeDock2 && this.arcShapeDock2.show()
this.buttonText && this.buttonText.show()
this.leftBoard && this.leftBoard.hide()
this.rightBoard && this.rightBoard.hide()
this.topBoard && this.topBoard.hide()
this.bottomBoard && this.bottomBoard.hide()
}
blockShow() {
this.rightLine && this.rightLine.show()
this.leftLine && this.leftLine.show()
}
setState(model) {
this.recover()
// { value: 'ASSIST', label: '总辅助按钮' },
// { value: 'PICK_ASSIST', label: '接辅助按钮' },
// { value: 'DEPART_ASSIST', label: '发辅助按钮' },
const list = ['ASSIST', 'PICK_ASSIST', 'DEPART_ASSIST', 'CHANGE_DIRECTION', 'ACCIDENT', 'RECOVERY', 'OCCLUSION']
if (list.includes(model.type)) {
if (this.rectButton) {
if (model.pressDown) {
this.rectButton.setStyle({ fill: '#FFFF00' })
} else { } else {
this.rectButton = new Rect({ this.rectButton.setStyle({ fill: this.getTypeColor() })
zlevel: this.zlevel,
z: this.z,
shape: {
x: computedPosition.x,
y: computedPosition.y,
width: 14,
height: 14
},
style: {
lineDash: null,
stroke: '#69666E',
lineWidth:1,
fill: fillColor
}
});
this.add(this.rectButton);
} }
this.leftLine = new Line({ }
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: computedPosition.x + 1,
y1: computedPosition.y + 1,
x2: computedPosition.x + 13,
y2: computedPosition.y + 13
},
style: {
lineWidth: 2,
stroke: '#ff0000'
}
});
this.add(this.leftLine);
this.leftLine.hide();
this.rightLine = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: computedPosition.x + 13,
y1: computedPosition.y + 1,
x2: computedPosition.x + 1,
y2: computedPosition.y + 13
},
style: {
lineWidth: 2,
stroke: '#ff0000'
}
});
this.add(this.rightLine);
this.rightLine.hide();
this.leftBoard = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: computedPosition.x - 1,
y1: computedPosition.y - 1,
x2: computedPosition.x - 1,
y2: computedPosition.y + 15
},
style: {
lineWidth: 2,
stroke: '#FFFFFF'
}
});
this.add(this.leftBoard);
this.leftBoard.hide();
this.topBoard = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: computedPosition.x - 1,
y1: computedPosition.y - 1,
x2: computedPosition.x + 15,
y2: computedPosition.y - 1
},
style: {
lineWidth: 2,
stroke: '#FFFFFF'
}
});
this.add(this.topBoard);
this.topBoard.hide();
this.rightBoard = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: computedPosition.x + 15,
y1: computedPosition.y - 1,
x2: computedPosition.x + 15,
y2: computedPosition.y + 15
},
style: {
lineWidth: 2,
stroke: '#A0A0A0'
}
});
this.add(this.rightBoard);
this.rightBoard.hide();
this.bottomBoard = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: computedPosition.x - 1,
y1: computedPosition.y + 15,
x2: computedPosition.x + 15,
y2: computedPosition.y + 15
},
style: {
lineWidth: 2,
stroke: '#A0A0A0'
}
});
this.add(this.bottomBoard);
this.bottomBoard.hide();
const hasTextList = ['PASS', 'ASSIST', 'PICK_ASSIST', 'DEPART_ASSIST', 'ACCIDENT', 'CHANGE_DIRECTION', 'RECOVERY', 'OCCLUSION'];
if (hasTextList.includes(model.type)) {
this.buttonText = new Text({
zlevel: this.zlevel,
z: this.z,
style: {
x: computedPosition.x + model.nameOffset.x,
y: computedPosition.y + model.nameOffset.y,
fontWeight: '400',
fontSize: 10,
fontFamily: '',
text: model.name,
textFill: '#C0C0C0',
textAlign: 'middle',
textVerticalAlign: 'top'
}
});
this.add(this.buttonText);
}
// if (model.type === 'CHANGE_DIRECTION') {
// this.arcFlash = new Arc({
// _subType: 'change_direction_flash',
// zlevel: this.zlevel,
// z: this.z,
// shape: {
// cx: model.position.x + 18 + 7,
// cy: model.position.y + 7,
// r: 6
// },
// style: {
// lineWidth: 0,
// fill: '#ffff00'
// }
// });
// this.add(this.arcFlash);
// }
} }
startAnimate() { // let
this.rectButton && this.rectButton.animateStyle(true) // { value: 'PICK', label: '接车按钮' },
.when(0, { fill: '#000' }) // { value: 'SHUNT_TERMINAL', label: '调车终端按钮' },
.when(1000, { fill: this.getTypeColor() }) if (!store.getters['map/checkDeviceShow'](this._code)) {
.when(2000, { fill: '#000' }) this.buttonText && this.buttonText.hide()
.start(); this.rectButton && this.rectButton.hide()
} this.leftLine && this.leftLine.hide()
stopAnimation() { this.rightLine && this.rightLine.hide()
this.rectButton && this.rectButton.stopAnimation(true); this.arcShape && this.arcShape.hide()
// this.arcFlash && this.arcFlash.stopAnimation(false); this.arcShapeDock1 && this.arcShapeDock1.hide()
} this.arcShapeDock2 && this.arcShapeDock2.hide()
getTypeColor() { } else {
let color = ''; if (model.hasSelected) {
const list = ['ASSIST', 'ACCIDENT', 'PICK_ASSIST', 'DEPART_ASSIST', 'CHANGE_DIRECTION', 'RECOVERY', 'OCCLUSION']; this.startAnimate()
if (this.model.type === 'FLEXIBLE' || this.model.type === 'SHUNT_TERMINAL') { }
color = '#808080';
} else if (this.model.type === 'GUIDE') {
color = '#5050E1';
} else if (list.includes(this.model.type)) {
color = '#ccc';
} else {
color = '#008000';
}
return color;
}//
recover() {
this.stopAnimation();
this.rectButton && this.rectButton.setStyle({ fill:this.getTypeColor() });
this.arcShape && this.arcShape.setStyle({ fill:this.getTypeColor() });
this.rightLine && this.rightLine.hide();
this.leftLine && this.leftLine.hide();
this.rectButton && this.rectButton.show();
this.arcShape && this.arcShape.show();
this.buttonText && this.buttonText.show();
this.leftBoard && this.leftBoard.hide();
this.rightBoard && this.rightBoard.hide();
this.topBoard && this.topBoard.hide();
this.bottomBoard && this.bottomBoard.hide();
}
blockShow() {
this.rightLine && this.rightLine.show();
this.leftLine && this.leftLine.show();
}
setState(model) {
this.recover();
// { value: 'ASSIST', label: '总辅助按钮' },
// { value: 'PICK_ASSIST', label: '接辅助按钮' },
// { value: 'DEPART_ASSIST', label: '发辅助按钮' },
const list = ['ASSIST', 'PICK_ASSIST', 'DEPART_ASSIST', 'CHANGE_DIRECTION', 'ACCIDENT', 'RECOVERY', 'OCCLUSION'];
if (list.includes(model.type)) {
if (this.rectButton) {
if (model.pressDown) {
this.rectButton.setStyle({ fill:'#FFFF00' });
// this.arcFlash.show();
// const style = this.style;
// this.arcFlash.animateStyle(true)
// .when(0, { fill: style.backgroundColor })
// .when(500, { fill: '#FFFF00' })
// .when(1000, { fill: style.backgroundColor })
// .start();
} else {
this.rectButton.setStyle({ fill:this.getTypeColor() });
// this.arcFlash.stopAnimation(false);
// this.arcFlash.hide();
}
}
}
// let
// { value: 'PICK', label: '接车按钮' },
// { value: 'SHUNT_TERMINAL', label: '调车终端按钮' },
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.buttonText && this.buttonText.hide();
this.rectButton && this.rectButton.hide();
this.leftLine && this.leftLine.hide();
this.rightLine && this.rightLine.hide();
this.arcShape && this.arcShape.hide();
} else {
if (model.hasSelected) {
this.startAnimate();
}
}
}
getAnchorPoint() {
} }
}
getAnchorPoint() {}
} }

View File

@ -26,8 +26,6 @@ class ESwDot extends Group {
this.add(this.dot) this.add(this.dot)
} }
setColor(color) { setColor(color) {
console.log(this.dot)
console.log(color)
this.dot.setStyle({ fill: color }) this.dot.setStyle({ fill: color })
} }
} }

View File

@ -481,15 +481,27 @@ export default class Switch extends Group {
.start(); .start();
} }
// N-定位 R-反位 NO-无(失表) EX-挤叉 // N-定位 R-反位 NO-无(失表) EX-挤叉
setSwitchFault(fault) { setSwitchFault(model) {
const { pos, fault, /* 单锁 */singleLock, /* 封锁 */blockade } = model
const faultList = ['SPLIT', 'SQUEEZE', 'NORMAL_SPLIT', 'REVERSE_SPLIT', 'SPLIT_1']; 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) {
if (this.model.switchFaultCode && fault && faultList.includes(fault) ) {
const switchFault = this.mapDevice[this.model.switchFaultCode]; const switchFault = this.mapDevice[this.model.switchFaultCode];
switchFault.instance.setControlColor('#F00', true); if (this.style.SwitchFault.lamp.switchState) {
} else if (this.model.switchFaultCode) { console.log(fault)
const switchFault = this.mapDevice[this.model.switchFaultCode]; console.log(pos)
switchFault.instance.setControlColor(this.style.backgroundColor, false); 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 // stopAnimation
this.shapeModelB.stopAnimation(false); this.shapeModelB.stopAnimation(false);
@ -803,7 +815,8 @@ export default class Switch extends Group {
this.setAshShow(); this.setAshShow();
} }
} else { } else {
this.setSwitchFault(model.fault); this.setSwitchFault(model);
console.log(model)
// model.pos == 'NO' || model.pos == 'EX'; // model.pos == 'NO' || model.pos == 'EX';
// N-定位 R-反位 NO-无(失表) EX-挤叉 // N-定位 R-反位 NO-无(失表) EX-挤叉

View File

@ -13,23 +13,40 @@ export default class EControl extends Group {
this.z = model.z; this.z = model.z;
this.style = model.style; this.style = model.style;
this.textStyle = model.text; this.textStyle = model.text;
this.arcStyle = model.arc; this.controlStyle = model.control;
this.create(); this.create();
} }
create() { create() {
this.control = new Arc({ this.control = this.controlStyle.isSquare ? new Rect({
_subType: this.arcStyle.subType, _subType: this.controlStyle.subType,
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
shape: this.arcStyle.shape, shape: {
style: { width: this.controlStyle.shape.r,
lineWidth: this.arcStyle.lineWidth, height: this.controlStyle.shape.r,
fill: this.arcStyle.fill, x: this.controlStyle.shape.cx - this.controlStyle.shape.r / 2,
stroke: this.arcStyle.stroke y: this.controlStyle.shape.cy - this.controlStyle.shape.r / 2,
}, },
onmouseover: this.arcStyle.mouseover, style: {
onmouseout: this.arcStyle.mouseout lineWidth: this.controlStyle.lineWidth,
fill: this.controlStyle.fill,
stroke: this.controlStyle.stroke
},
onmouseover: this.controlStyle.mouseover,
onmouseout: this.controlStyle.mouseout
}) : new Arc({
_subType: this.controlStyle.subType,
zlevel: this.zlevel,
z: this.z,
shape: this.controlStyle.shape,
style: {
lineWidth: this.controlStyle.lineWidth,
fill: this.controlStyle.fill,
stroke: this.controlStyle.stroke
},
onmouseover: this.controlStyle.mouseover,
onmouseout: this.controlStyle.mouseout
}); });
this.text = new Text({ this.text = new Text({
_subType: 'Text', _subType: 'Text',
@ -63,7 +80,7 @@ export default class EControl extends Group {
height: arcRect.height + 4 height: arcRect.height + 4
}, },
style: { style: {
lineDash: this.arcStyle.lineDash || this.style.arcBorderStyle.lineDash, lineDash: this.controlStyle.lineDash || this.style.arcBorderStyle.lineDash,
stroke: this.style.arcBorderStyle.stroke, stroke: this.style.arcBorderStyle.stroke,
fill: this.style.arcBorderStyle.fill fill: this.style.arcBorderStyle.fill
} }
@ -106,15 +123,15 @@ export default class EControl extends Group {
setControlFlashing(color) { setControlFlashing(color) {
if (color) { if (color) {
this.control.animateStyle(true) this.control.animateStyle(true)
.when(0, { fill: this.arcStyle.fill }) .when(0, { fill: this.controlStyle.fill })
.when(1000, { stroke: color }) .when(1000, { stroke: color })
.when(2000, { fill: this.arcStyle.fill }) .when(2000, { fill: this.controlStyle.fill })
.start(); .start();
} }
} }
recover() { recover() {
this.control.stopAnimation(false); this.control.stopAnimation(false);
this.control.setStyle('fill', this.arcStyle.fill); this.control.setStyle('fill', this.controlStyle.fill);
} }
setControlStroke(color, lineWidth) { setControlStroke(color, lineWidth) {
this.control.setStyle('lineWidth', lineWidth); this.control.setStyle('lineWidth', lineWidth);

View File

@ -723,12 +723,17 @@ export default {
} }
}, },
handelSwitchOperate(model) { 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 = { const operate = {
over: true, over: true,
code: model.code, code: model.code,
operation: this.$store.state.menuOperation.buttonOperation, operation: this.$store.state.menuOperation.buttonOperation,
cmdType: this.cmdType, cmdType: this.cmdType,
param: { switchCode: model.code } param: { switchCode: code }
} }
this.sendCommand(operate) this.sendCommand(operate)
}, },
@ -837,6 +842,15 @@ export default {
this.Switch.block.button.operation, this.Switch.block.button.operation,
this.Switch.unblock.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') { if ((this.guideLockLeftFlag || this.guideLockRightFlag) && model._type === 'SignalButton' && model.type === 'GUIDE') {
this.handleGuideLock(model) this.handleGuideLock(model)
} else if (buttonOperation && this.commandTypeList.includes(model._type)) { } else if (buttonOperation && this.commandTypeList.includes(model._type)) {
@ -862,6 +876,30 @@ export default {
} else if (model._type === 'SignalButton' && signalButtonList.includes(model.type)) { } else if (model._type === 'SignalButton' && signalButtonList.includes(model.type)) {
// //
this.assistOperateOrChange(model) 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 ( } else if (
(model._type === 'SignalButton' && !this.checkSignalBlock(model.signalCode)) || (model._type === 'SignalButton' && !this.checkSignalBlock(model.signalCode)) ||
(model._type === 'Signal' && !model.blockade) (model._type === 'Signal' && !model.blockade)

View File

@ -190,7 +190,8 @@ export default {
this.signedId = activeUser.memberId; this.signedId = activeUser.memberId;
} }
}, },
doShow() { async doShow() {
await this.searchCmd(); // cmdManage
this.getSenderName(); this.getSenderName();
this.getSignedData(); this.getSignedData();
this.dialogShow = true; this.dialogShow = true;
@ -245,6 +246,16 @@ export default {
}).catch(error => { }).catch(error => {
this.$messageBox('查询调度命令失败:' + error.message); this.$messageBox('查询调度命令失败:' + error.message);
}); });
},
searchCmd() {
return new Promise((resolve, reject) => {
sendCommandNew(this.group, 'CTC_QUERY_DISPATCH_COMMAND', {}).then((res) => {
console.log(res, '---res----');
resolve();
}).catch(error => {
reject(error.message);
});
});
} }
} }

View File

@ -636,7 +636,7 @@ function getCTCDevicename(operationType) {
deviceName = '车务终端 --> 调度命令'; deviceName = '车务终端 --> 调度命令';
} }
} else if (operationType == 'CTC_READ_DISPATCH_COMMAND') { } else if (operationType == 'CTC_READ_DISPATCH_COMMAND') {
deviceName = '调度命令'; deviceName = '车务终端 --> 调度命令';
} else if (operationType == 'CTC_SIGN_DISPATCH_COMMAND') { } else if (operationType == 'CTC_SIGN_DISPATCH_COMMAND') {
deviceName = '车务终端 --> 调度命令'; deviceName = '车务终端 --> 调度命令';
} else if (operationType == 'CTC_SEND_DISPATCH_COMMAND') { } else if (operationType == 'CTC_SEND_DISPATCH_COMMAND') {

View File

@ -87,7 +87,18 @@ export default {
{ value: 'ACCIDENT', label: '事故按钮' }, { value: 'ACCIDENT', label: '事故按钮' },
{ value: 'CHANGE_DIRECTION', label: '改方按钮' }, { value: 'CHANGE_DIRECTION', label: '改方按钮' },
{ value: 'RECOVERY', label: '复原按钮' }, { value: 'RECOVERY', label: '复原按钮' },
{ value: 'OCCLUSION', label: '闭塞按钮' } { value: 'OCCLUSION', label: '闭塞按钮' },
{ value: 'LOCATE', label: '总定位按钮' },
{ value: 'REVERSE', label: '总反位按钮' },
{ value: 'HUMAN_RELEASE_ROUTE', label: '总人解按钮' },
{ value: 'CANCEL', label: '总取消按钮' },
{ value: 'GUIDELOCK', label: '引导总锁按钮' },
{ value: 'SECTION_FAULT_UNLOCK', label: '区故解按钮' },
{ value: 'MONOLOCK', label: '单锁按钮' },
{ value: 'UNLOCK', label: '单解按钮' },
{ value: 'BLOCK', label: '单封按钮' },
{ value: 'UNBLOCK', label: '解封按钮' },
], ],
centralizedStationList: [], // centralizedStationList: [], //
directionList: [ directionList: [
@ -314,7 +325,7 @@ export default {
return this.editModel.type === 'FLEXIBLE' return this.editModel.type === 'FLEXIBLE'
}, },
isLinkDirection() { 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 this.editModel.type
) )
} }