This commit is contained in:
fan 2022-08-15 15:09:52 +08:00
commit 6b4b63fc40
4 changed files with 63 additions and 34 deletions

View File

@ -265,6 +265,8 @@ class SkinCode extends defaultStyle {
this[deviceType.SignalButton] = { this[deviceType.SignalButton] = {
width:12, width:12,
borderLine:1,
isShowBorder:true,
guideColor: 'rgb(80,80,255)', guideColor: 'rgb(80,80,255)',
trainColor:'rgb(0,128,0)', trainColor:'rgb(0,128,0)',
strokeColor:'rgb(128,128,128)' strokeColor:'rgb(128,128,128)'

View File

@ -119,14 +119,15 @@ export default class SignalButton extends Group {
} }
this.add(this.rectButton); this.add(this.rectButton);
} }
const width = this.style.SignalButton && this.style.SignalButton.width ? this.style.SignalButton.width : 14;
this.leftLine = new Line({ this.leftLine = new Line({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z + 1, z: this.z + 1,
shape: { shape: {
x1: computedPosition.x + 1, x1: computedPosition.x + 1,
y1: computedPosition.y + 1, y1: computedPosition.y + 1,
x2: computedPosition.x + 13, x2: computedPosition.x + width - 1,
y2: computedPosition.y + 13 y2: computedPosition.y + width - 1
}, },
style: { style: {
lineWidth: 2, lineWidth: 2,
@ -139,10 +140,10 @@ export default class SignalButton extends Group {
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z + 1, z: this.z + 1,
shape: { shape: {
x1: computedPosition.x + 13, x1: computedPosition.x + width - 1,
y1: computedPosition.y + 1, y1: computedPosition.y + 1,
x2: computedPosition.x + 1, x2: computedPosition.x + 1,
y2: computedPosition.y + 13 y2: computedPosition.y + width - 1
}, },
style: { style: {
lineWidth: 2, lineWidth: 2,
@ -151,70 +152,74 @@ export default class SignalButton extends Group {
}); });
this.add(this.rightLine); this.add(this.rightLine);
this.rightLine.hide(); this.rightLine.hide();
const borderLine = this.style.SignalButton && this.style.SignalButton.borderLine ? this.style.SignalButton.borderLine : 2;
const isShowBorder = this.style.SignalButton && this.style.SignalButton.isShowBorder;
// 接车按钮 通过按钮 引导按钮
const showBorderBtn = ['PICK', 'PASS', 'GUIDE'];
this.leftBoard = new Line({ this.leftBoard = new Line({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z + 1, z: this.z + 1,
shape: { shape: {
x1: computedPosition.x - 1, x1: computedPosition.x - (borderLine - 1),
y1: computedPosition.y - 1, y1: computedPosition.y - (borderLine - 1),
x2: computedPosition.x - 1, x2: computedPosition.x - (borderLine - 1),
y2: computedPosition.y + 15 y2: computedPosition.y + width + (borderLine - 1)
}, },
style: { style: {
lineWidth: 2, lineWidth: borderLine,
stroke: '#FFFFFF' stroke: '#FFFFFF'
} }
}); });
this.add(this.leftBoard); this.add(this.leftBoard);
this.leftBoard.hide(); if (!(isShowBorder && showBorderBtn.includes(model.type))) { this.leftBoard.hide(); }
this.topBoard = new Line({ this.topBoard = new Line({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z + 1, z: this.z + 1,
shape: { shape: {
x1: computedPosition.x - 1, x1: computedPosition.x - (borderLine - 1),
y1: computedPosition.y - 1, y1: computedPosition.y - (borderLine - 1),
x2: computedPosition.x + 15, x2: computedPosition.x + width + (borderLine - 1),
y2: computedPosition.y - 1 y2: computedPosition.y - (borderLine - 1)
}, },
style: { style: {
lineWidth: 2, lineWidth: borderLine,
stroke: '#FFFFFF' stroke: '#FFFFFF'
} }
}); });
this.add(this.topBoard); this.add(this.topBoard);
this.topBoard.hide(); if (!(isShowBorder && showBorderBtn.includes(model.type))) { this.topBoard.hide(); }
this.rightBoard = new Line({ this.rightBoard = new Line({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z + 1, z: this.z + 1,
shape: { shape: {
x1: computedPosition.x + 15, x1: computedPosition.x + width + (borderLine - 1),
y1: computedPosition.y - 1, y1: computedPosition.y - (borderLine - 1),
x2: computedPosition.x + 15, x2: computedPosition.x + width + (borderLine - 1),
y2: computedPosition.y + 15 y2: computedPosition.y + width + (borderLine - 1)
}, },
style: { style: {
lineWidth: 2, lineWidth: borderLine,
stroke: '#A0A0A0' stroke: '#A0A0A0'
} }
}); });
this.add(this.rightBoard); this.add(this.rightBoard);
this.rightBoard.hide(); if (!(isShowBorder && showBorderBtn.includes(model.type))) { this.rightBoard.hide(); }
this.bottomBoard = new Line({ this.bottomBoard = new Line({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z + 1, z: this.z + 1,
shape: { shape: {
x1: computedPosition.x - 1, x1: computedPosition.x - (borderLine - 1),
y1: computedPosition.y + 15, y1: computedPosition.y + width + (borderLine - 1),
x2: computedPosition.x + 15, x2: computedPosition.x + width + (borderLine - 1),
y2: computedPosition.y + 15 y2: computedPosition.y + width + (borderLine - 1)
}, },
style: { style: {
lineWidth: 2, lineWidth: borderLine,
stroke: '#A0A0A0' stroke: '#A0A0A0'
} }
}); });
this.add(this.bottomBoard); this.add(this.bottomBoard);
this.bottomBoard.hide(); if (!(isShowBorder && showBorderBtn.includes(model.type))) { this.bottomBoard.hide(); }
const hasTextList = ['PASS', 'ASSIST', 'PICK_ASSIST', 'DEPART_ASSIST', 'ACCIDENT', 'CHANGE_DIRECTION', 'RECOVERY', 'OCCLUSION', 'FAULT_NOTICE']; const hasTextList = ['PASS', 'ASSIST', 'PICK_ASSIST', 'DEPART_ASSIST', 'ACCIDENT', 'CHANGE_DIRECTION', 'RECOVERY', 'OCCLUSION', 'FAULT_NOTICE'];
if (hasTextList.includes(model.type) || (this.style.SignalButton && this.style.SignalButton.showName)) { if (hasTextList.includes(model.type) || (this.style.SignalButton && this.style.SignalButton.showName)) {
this.buttonText = new Text({ this.buttonText = new Text({
@ -307,10 +312,10 @@ export default class SignalButton extends Group {
this.arcShapeDock1 && this.arcShapeDock1.show(); this.arcShapeDock1 && this.arcShapeDock1.show();
this.arcShapeDock2 && this.arcShapeDock2.show(); this.arcShapeDock2 && this.arcShapeDock2.show();
this.buttonText && this.buttonText.show(); this.buttonText && this.buttonText.show();
this.leftBoard && this.leftBoard.hide(); // this.leftBoard && this.leftBoard.hide();
this.rightBoard && this.rightBoard.hide(); // this.rightBoard && this.rightBoard.hide();
this.topBoard && this.topBoard.hide(); // this.topBoard && this.topBoard.hide();
this.bottomBoard && this.bottomBoard.hide(); // this.bottomBoard && this.bottomBoard.hide();
} }
blockShow() { blockShow() {
this.rightLine && this.rightLine.show(); this.rightLine && this.rightLine.show();
@ -331,6 +336,25 @@ export default class SignalButton extends Group {
} }
} }
} }
const isShowBorder = this.style.SignalButton && this.style.SignalButton.isShowBorder;
// 接车按钮 通过按钮 引导按钮
const showBorderBtn = ['PICK', 'PASS', 'GUIDE'];
if (isShowBorder && showBorderBtn.includes(model.type)) {
if (this.rectButton) {
if (model.hasSelected) {
this.leftBoard && this.leftBoard.hide();
this.rightBoard && this.rightBoard.hide();
this.topBoard && this.topBoard.hide();
this.bottomBoard && this.bottomBoard.hide();
} else {
this.leftBoard && this.leftBoard.show();
this.rightBoard && this.rightBoard.show();
this.topBoard && this.topBoard.show();
this.bottomBoard && this.bottomBoard.show();
}
}
}
// { value: 'PICK', label: '接车按钮' }, // { value: 'PICK', label: '接车按钮' },
// { value: 'SHUNT_TERMINAL', label: '调车按钮' }, // { value: 'SHUNT_TERMINAL', label: '调车按钮' },
if (!store.getters['map/checkDeviceShow'](this._code)) { if (!store.getters['map/checkDeviceShow'](this._code)) {

View File

@ -191,7 +191,9 @@ class StationStand extends Group {
} }
if (this.style.Section.remainTime) { if (this.style.Section.remainTime) {
const section = this.mapDevice[model.standTrackCode]; const section = this.mapDevice[model.standTrackCode];
if (model.remainTime) { // model.trainParking = true;
// model.remainTime = 20;
if (model.trainParking && model.remainTime) {
section.instance && section.instance.showRemainTime(model.remainTime); section.instance && section.instance.showRemainTime(model.remainTime);
} else { } else {
section.instance && section.instance.hideRemainTime(); section.instance && section.instance.hideRemainTime();

View File

@ -295,13 +295,13 @@ export default {
} }
}); });
}, },
changeArriveRunPlan(event, row, index) { changeArriveRunPlan(event, row, index) {
this.modifyDispatcherLogerRpSection(row, row.arriveSectionCode, 'R'); this.modifyDispatcherLogerRpSection(row, row.arriveSectionCode, 'R');
}, },
changeDepartRunPlan(event, row, index) { changeDepartRunPlan(event, row, index) {
this.modifyDispatcherLogerRpSection(row, row.departSectionCode, 'D'); this.modifyDispatcherLogerRpSection(row, row.departSectionCode, 'D');
}, },
//
changeArrivePlanTime(event, row, index) { changeArrivePlanTime(event, row, index) {
this.modifyDispatcherLogerRpPlanTime(row, row.arrivePlanTime, 'R'); this.modifyDispatcherLogerRpPlanTime(row, row.arrivePlanTime, 'R');
@ -315,6 +315,7 @@ export default {
changeDepartDirectionCode(event, row, index) { changeDepartDirectionCode(event, row, index) {
this.modifyDispatcherLogerRpDirection(row, row.departDirectionCode, 'D'); this.modifyDispatcherLogerRpDirection(row, row.departDirectionCode, 'D');
}, },
// //
modifyDispatcherLogerRpDirection(row, directionCode, type) { modifyDispatcherLogerRpDirection(row, directionCode, type) {
const params = {stationCode:row.stationCode, runPlanCode:row.runPlanCode, directionCode:directionCode, model:type}; const params = {stationCode:row.stationCode, runPlanCode:row.runPlanCode, directionCode:directionCode, model:type};