This commit is contained in:
fan 2020-03-24 16:37:26 +08:00
commit 652aa43a2a
32 changed files with 704 additions and 1592 deletions

View File

@ -77,7 +77,7 @@ class SkinCode extends defaultStyle {
},
line: {
width: 5, // 区段宽度
beyondWidth: 1, // 区段宽超出宽度
beyondWidth: 0, // 区段宽超出宽度
invadeColor: '#EF0C08', // 区段侵入颜色
spareColor: '#3F3F3F', // 区段空闲颜色
communicationOccupiedColor: '#FF329A', // 区段通信车占用颜色
@ -144,7 +144,7 @@ class SkinCode extends defaultStyle {
},
lamp: {
bgShow: false, // 是否被选中
guidName: 'defult', // 默认引导类型
guidName: 'ningbo_01', // 默认引导类型
stopWidth: 2, // 禁止线宽度
borderWidth: 1, // 信号灯边框线宽度
borderColor: '#3149C3', // 信号灯边框线颜色
@ -158,19 +158,21 @@ class SkinCode extends defaultStyle {
blueColor: '#0070C0' // 信号灯蓝色
},
route: {
direction: false, // 自动进路方向
offset: { x: -4, y: 0 }, // 自动进路偏移量
routeColor: '#00FF00' // 自动进路
direction: false, // 自动通过方向
radiusR: 8, // 自动通过三角半径
offset: { x: 2, y: 0 }, // 自动通过偏移量
routeColor: '#00FF00' // 自动进路
},
auto: {
signalFrontTriangle: false, // 信号灯前三角展示
direction: false, // 自动通过方向
offset: { x: -4, y: 0}, // 自动通过偏移量
width: 5, // 自动宽度
autoRoute: '#00FF00', // 自动进路
autoTrigger: '#FFFF00', // 自动触发
manualControl: '#FFFF00', // 人工控制
outConflict: '#C00808' // 出车冲突
auto: { // 人工进路显示状态
signalFrontTriangle: true, // 信号灯前三角展示
fleetModeTriangle: false, // 自动进路显示三角形非箭头
direction: false, // 自动通过方向
offset: { x: -4, y: 0 }, // 自动通过偏移量
width: 5, // 自动宽度
manualControl: '#FFFF00', // 人工控制
autoRoute: '#00FF00', // 自动进路 (绿色)
autoTrigger: '#FFFF00', // 自动触发
outConflict: '#C00808' // 出车冲突
},
delay: {
direction: true, // 延时解锁方向
@ -193,6 +195,7 @@ class SkinCode extends defaultStyle {
this[deviceType.StationStand] = {
common: { // 通用属性
textFontSize: 11, // 站台默认字体大小
haveJumpShow: true, // 站台是否有列车停跳显示
functionButtonShow: '03' // 功能灯按钮显示条件01所有模式下显示 02 行调显示 03现地显示
},
safetyDoor: { // 屏蔽门
@ -207,11 +210,12 @@ class SkinCode extends defaultStyle {
spareColor: '#606060', // 站台空闲颜色
stopColor: '#FEFE00', // 站台列车停站颜色
jumpStopColor: '#9A99FF', // 站台跳停颜色
designatedJumpStopColor: 'lightSkyBlue' // 站台指定列车跳停颜色
designatedJumpStopColor: '#606060' // 站台指定列车跳停颜色
},
standEmergent: { // 紧急关闭
mergentR: 4, // 站台紧急关闭半径
offset: {x: 0, y: 40}, // 站台紧急关闭偏移量
position: -1,
offset: {x: -6, y: -15}, // 站台紧急关闭偏移量
closeColor: '#F61107' // 站台紧急关闭颜色
},
reentry: { // 站台折返策略
@ -223,20 +227,30 @@ class SkinCode extends defaultStyle {
detainCar: { // 扣车
text: 'H', // 扣车显示内容
position: -1, // 扣车方向
offset: {x: -8, y: -6}, // 扣车偏移量
offset: {x: -8, y: 13}, // 扣车偏移量
trainColor: '#E4EF50', // 车站扣车颜色
centerTrainColor: '#FFFFFF', // 中心扣车颜色
andCenterTrainColor: '#F61107', // 车站+中心扣车颜色
detainTrainTextColor: '#E4EF50' // 车站扣除文字颜色
},
stopTime: { // 停站时间
position: 1, // 运行时间方向
offset: {x: -8, y: 26}, // 运行时间偏移量
textColor: '#FFFFFF' // 停站时间字体颜色
stopTime: { // 停站时间
position: 1, // 运行时间方向
offset: {x: -8, y: -4}, // 运行时间偏移量
textColor: '#C0C0C0', // 停站时间字体颜色
textFontSize: 12
},
jump: {
text: 'S', // 停跳显示内容
position: -1, // 停跳方向
offset: {x: -8, y: 10},
textColor: '#5376B3', // 停跳文字颜色
arcColor: '#000000', // 停跳圆圈颜色
fillColor: 'rgba(0,0,0,0)', // 透明填充颜色
r: 8 // 圆半径大小
},
level: { // 运行等级
position: 1, // 运行等级方向
offset: {x: -8, y: 6}, // 运行等级偏移量
offset: {x: -8, y: -6}, // 运行等级偏移量
textColor: '#FFFFFF' // 停站等级字体颜色
},
text: {
@ -375,14 +389,14 @@ class SkinCode extends defaultStyle {
text: {
show: true, // 道岔名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
offset: {x: 0, y: 8}, // 道岔名称与区段距离
offset: { x: 5, y: -10 }, // 道岔名称与区段距离
fontSize: 11, // 字体大小
fontColor: '#C0C0C0', // 道岔名称颜色
fontWeight: 'bold', // 字体粗细
fontWeight: 'normal', // 字体粗细
borderColor: '#FE0000', // 道岔边框颜色
lossColor: '#FFFFFF', // 道岔失去颜色
locateColor: '#00FF00', // 道岔定位颜色
inversionColor: '#9C9D09', // 道岔反位颜色
inversionColor: '#FFFF00', // 道岔反位颜色
monolockColor: '#870E10' // 道岔单锁颜色
},
sectionAction: {
@ -393,13 +407,13 @@ class SkinCode extends defaultStyle {
length: 6 // 道岔单边长度
},
block: { // 道岔封锁配置
blockName: 'default', // 默认道岔封锁类型
blockName: 'foshan_01', // 默认道岔封锁类型
nameBorderShow: true, // 道岔名称是否有包围框 显示
contentRectShow: false // 道岔封锁显示
},
monolock: { // 道岔单锁配置
locationColor: '#ea282c', // 道岔单锁定位颜色 (红色)
inversionColor: '#ea282c', // 道岔单锁反位颜色 (红色)
locationColor: '#c00000', // 道岔单锁定位颜色 (红色)
inversionColor: '#c00000', // 道岔单锁反位颜色 (红色)
rectShow: false // 道岔单锁 矩形框是否显示
}
};

View File

@ -728,8 +728,8 @@ export default class Section extends Group {
}
const path = window.location.href;
if (path.includes('/map/draw')) {
this.on('mouseout', () => { !this.selectedType && !this.selected && this.section && this.section.setStyle({ stroke: this.style.Section.line.spareColor }); });
this.on('mouseover', () => { !this.selectedType && this.section && this.section.setStyle({ stroke: '#fbfbfb' }); });
this.on('mouseout', () => { !this.selectedType && !this.selected && this.section && this.section.setStyle({ stroke: this.style.Section.line.spareColor, lineWidth: this.style.Section.line.width }); });
this.on('mouseover', () => { !this.selectedType && this.section && this.section.setStyle({ stroke: '#fbfbfb', lineWidth: this.style.Section.line.width - 0.5 }); });
}
}

View File

@ -391,11 +391,11 @@ class Signal extends Group {
/** 信号机进路按钮显示 */
model.isRouteSignal && this.setLowButtonShow();
/** 信号机封锁 */
/** 信号机封锁 */ // 缺一个功能封锁
model.blockade && this.block();
/** 设置灯的颜色 */
// model.redOpen = 1;
// model.yellowOpen = 0;
// model.yellowOpen = 1;
// model.greenOpen = 0;
model.redOpen && model.yellowOpen && !model.greenOpen && this.guid(); // 引导信号显示
model.redOpen && !model.yellowOpen && !model.greenOpen && this.close(); // 信号关闭

View File

@ -26,7 +26,7 @@ class ELevel extends Group {
text: model.name,
textFill: style.StationStand.level.textColor,
textAlign: 'center',
textVerticalAlign: 'middle'
textVerticalAlign: 'middle'
}
});

View File

@ -61,7 +61,11 @@ class StationStand extends Group {
/** 站台紧急关闭*/
const emergentH = model.inside ? model.right ? 1 : -1 : model.right ? -1 : 1;
let emergentX = model.position.x + style.StationStand.standEmergent.offset.x;
let emergentWidth = 0;
if (style.StationStand.stopTime.position) {
emergentWidth = model.width / 2;
}
let emergentX = model.position.x + (style.StationStand.stopTime.position || emergentH) * style.StationStand.standEmergent.offset.x - emergentWidth;
let emergentY = model.position.y + emergentH * (model.height / 2 + style.StationStand.standEmergent.offset.y);
if (style.StationStand.common.special) {
emergentX = model.position.x;

View File

@ -38,6 +38,10 @@ class ERhomboid extends Group {
this.section.show();
}
setColor(color) {
this.section.setStyle({ fill: color });
}
stopAnimation(flag) {
this.section.stopAnimation(flag);
}

View File

@ -1,77 +0,0 @@
import Group from 'zrender/src/container/Group';
import Line from 'zrender/src/graphic/shape/Line';
class ESwCore extends Group {
constructor(model) {
super();
this.model = model;
this.create();
}
create() {
const model = this.model;
const style = this.model.style;
this.skewLine = new Line({
zlevel: model.zlevel,
z: model.z,
silent: true,
shape: {
x1: model.intersectionX,
y1: model.intersectionY,
x2: model.intersectionX + model.triangle.drictx * model.triangle.getCotRate() * model.coverLength,
y2: model.intersectionY + model.triangle.dricty * model.coverLength
},
style: {
lineWidth: model.lineWidth,
stroke: style.backgroundColor
}
});
this.line = new Line({
zlevel: model.zlevel,
z: model.z,
silent: true,
shape: {
x1: model.intersectionX - model.triangle.getCotRate() * model.coverLength,
y1: model.intersectionY,
x2: model.intersectionX + model.triangle.getCotRate() * model.coverLength,
y2: model.intersectionY
},
style: {
lineWidth: model.lineWidth,
stroke: style.backgroundColor
}
});
this.add(this.line);
this.add(this.skewLine);
}
hide() {
this.line.hide();
this.skewLine.hide();
}
show() {
this.line.show();
this.skewLine.show();
}
setColor(color) {
this.line.setStyle('stroke', color);
this.skewLine.setStyle('stroke', color);
}
stopAnimation(flag) {
this.line.stopAnimation(flag);
this.skewLine.stopAnimation(flag);
}
animateStyle(cb) {
this.eachChild((child) => {
cb(child);
});
}
}
export default ESwCore;

View File

@ -2,69 +2,58 @@ import Group from 'zrender/src/container/Group';
import Polygon from 'zrender/src/graphic/shape/Polygon';
class ESwLnversion extends Group {
constructor(model) {
super();
this.model = model;
this.create();
}
constructor(model) {
super();
this.model = model;
this.create();
}
create() {
const model = this.model;
const style = this.model.style;
this.relocShelter = new Polygon({ // 遮盖B区段范围
zlevel: model.zlevel,
z: model.z,
shape: {
points: model.shelterPoints
},
style: {
fill: style.backgroundColor
// fill: 'blue'
},
cursor: model.cursor,
onmouseover: model.onmouseover,
onmouseout: model.onmouseout
});
const rpx = Math.abs(model.triangle.getCos(model.halfWidth)) + 0.2;
this.relocShelter.position = [-model.triangle.drictx * rpx, -model.triangle.dricty * 0.2];
create() {
const model = this.model;
const style = this.model.style;
this.relocShelter = new Polygon({ // 遮盖B区段范围
zlevel: model.zlevel,
z: model.z,
shape: {
points: model.shelterPoints
},
style: {
fill: style.backgroundColor
// fill: 'yellow'
},
cursor: model.cursor,
onmouseover: model.onmouseover,
onmouseout: model.onmouseout
});
this.hide();
this.add(this.relocShelter);
}
// this.section = new Polygon({ // 平行四边形
// zlevel: model.zlevel,
// z: model.z + 1,
// shape: {
// points: model.sectionPoints
// },
// style: {
// // fill: style.Section.line.spareColor
// fill: 'blue'
// },
// cursor: model.cursor,
// onmouseover: model.onmouseover,
// onmouseout: model.onmouseout
// });
hide() {
this.relocShelter.hide();
}
this.hide();
this.add(this.relocShelter);
// this.add(this.section);
}
show() {
this.relocShelter.show();
}
hide() {
this.relocShelter.hide();
// this.section.hide();
}
setColor(color) {
this.relocShelter.setStyle({ fill: color });
}
show() {
this.relocShelter.show();
// this.section.show();
}
getSection() {
return this.section;
}
stopAnimation(flag) {
// this.section.stopAnimation(flag);
}
stopAnimation(flag) {
this.relocShelter.stopAnimation(flag);
}
getSection() {
return this.section;
}
animateStyle(cb) {
this.eachChild((child) => {
cb(child);
});
}
}

View File

@ -2,44 +2,54 @@ import Group from 'zrender/src/container/Group';
import Polygon from 'zrender/src/graphic/shape/Polygon';
class ESwLocal extends Group {
constructor(model) {
super();
this.model = model;
this.create();
}
constructor(model) {
super();
this.model = model;
this.create();
}
create() {
const model = this.model;
const style = this.model.style;
create() {
const model = this.model;
const style = this.model.style;
this.locShelter = new Polygon({
zlevel: model.zlevel,
z: model.z,
shape: {
points: model.shelterPoints
},
style: {
fill: style.backgroundColor
// fill: 'red'
},
cursor: model.cursor,
onmouseover: model.onmouseover,
onmouseout: model.onmouseout
});
this.locShelter = new Polygon({
zlevel: model.zlevel,
z: model.z,
shape: {
points: model.shelterPoints
},
style: {
fill: style.backgroundColor
// fill: 'red'
},
cursor: model.cursor,
onmouseover: model.onmouseover,
onmouseout: model.onmouseout
});
const lpx = Math.abs(model.triangle.getCos(1));
this.locShelter.position = [model.triangle.drictx * lpx, -model.triangle.dricty * 0.2];
this.locShelter.show();
this.add(this.locShelter);
}
const lpx = Math.abs(model.triangle.getCos(1));
this.locShelter.position = [model.triangle.drictx * lpx, -model.triangle.dricty * 0.2];
this.locShelter.show();
this.add(this.locShelter);
}
hide() {
this.locShelter.hide();
}
hide() {
this.locShelter.hide();
}
show() {
this.locShelter.show();
}
show() {
this.locShelter.show();
}
stopAnimation(flag) {
this.locShelter.stopAnimation(flag);
}
animateStyle(cb) {
this.eachChild((child) => {
cb(child);
});
}
}
export default ESwLocal;

View File

@ -40,6 +40,10 @@ class ETriangle extends Group {
this.section.show();
}
setColor(color) {
this.section.setStyle({ fill: color });
}
stopAnimation(flag) {
this.section.stopAnimation(flag);
}
@ -56,6 +60,12 @@ class ETriangle extends Group {
});
}
animateStyle(cb) {
this.eachChild((child) => {
cb(child);
});
}
}
export default ETriangle;

View File

@ -5,7 +5,6 @@ import Line from 'zrender/src/graphic/shape/Line';
import Group from 'zrender/src/container/Group';
import JTriangle from '../../utils/JTriangle';
import ESwName from './ESwName.js';
import ESwCore from './ESwCore.js';
import ESwLocal from './ESwLocal.js';
import ESwLnversion from './ESwLnversion';
import ELockRect from './ELockRect';
@ -49,31 +48,20 @@ export default class Switch extends Group {
const model = this.model;
const style = this.style;
let halfWidth = style.Section.line.width / 2;
const switchWidth = style.Section.line.width + style.Section.line.beyondWidth * 2 + 0.6;
const halfWidthX = style.Section.line.width / 2 - 0.7;
const halfWidthY = style.Section.line.width / 2 + 0.12;
const switchWidth = style.Section.line.width + style.Section.line.beyondWidth * 2; // 超出宽度多少
const swPadding = style.Switch.core.length;
const directx = this.triangle.drictx;
const directy = this.triangle.dricty;
const direct = -this.triangle.drictx * this.triangle.dricty;
const coverLength = switchWidth * 1.5;
this.swCore = new ESwCore({ // 道岔两个斜线 盖住所有
zlevel: this.zlevel,
z: this.z,
style: style,
intersectionX: model.intersection.x,
intersectionY: model.intersection.y,
coverLength: coverLength,
lineWidth: switchWidth,
triangle: this.triangle
});
halfWidth += 0.1;
const point1 = [model.intersection.x - directx * halfWidth, model.intersection.y + directy * halfWidth];
const point2 = [point1[0] + directx * switchWidth / this.triangle.getSinRate(), point1[1]];
const point1 = [model.intersection.x - directx * halfWidthX, model.intersection.y + directy * halfWidthY];
const point2 = [model.intersection.x - directx * halfWidthX + directx * switchWidth / this.triangle.getSinRate(), point1[1]];
const point3 = [point2[0] + directx * this.triangle.getCotRate() * swPadding, point2[1] + directy * swPadding];
const point4 = [point3[0] + direct * this.triangle.getSin(switchWidth), point3[1] - direct * this.triangle.getCos(switchWidth)];
this.locShelter = new ESwLocal({ // 定位
this.locShelter = new ESwLocal({ // 定位 覆盖形状
zlevel: this.zlevel,
z: this.z,
style: style,
@ -84,44 +72,35 @@ export default class Switch extends Group {
onmouseout: () => { this.name.getArrowText().hide(); }
});
const slen = switchWidth / this.triangle.getSinRate();
const rpoint1 = [model.intersection.x + directx * halfWidth, model.intersection.y - directy * halfWidth];
const rpoint2 = [rpoint1[0] + directx * (swPadding + switchWidth * this.triangle.getCotRate()), rpoint1[1]];
const rpoint3 = [rpoint2[0], rpoint2[1] + directy * switchWidth];
const rpoint4 = [rpoint1[0] + this.triangle.getCos(slen), rpoint1[1] + this.triangle.getSin(slen)];
const switchWidth1 = style.Section.line.width / 2;
const width1 = switchWidth1 * this.triangle.getSinRate();
const height1 = switchWidth1 * this.triangle.getCosRate();
const width2 = (height1 + switchWidth1) / this.triangle.getTanRate();
const width3 = (style.Section.line.width / this.triangle.getSinRate()) - width2 - width1;
const rpoint1 = [model.intersection.x + directx * width3, model.intersection.y - directy * switchWidth1];
const rpoint2 = [rpoint1[0] + directx * (width2 + width1) - directx * width3, model.intersection.y + directy * switchWidth1];
const rpoint3 = [rpoint2[0] + directx * 10, rpoint2[1]];
const rpoint4 = [rpoint2[0] + directx * 10, rpoint1[1]];
this.relocShelter = new ESwLnversion({ // 反位覆盖形状
zlevel: this.zlevel,
z: this.z,
style: style,
shelterPoints: [rpoint1, rpoint2, rpoint3, rpoint4],
cursor: 'pointer',
halfWidth: halfWidth,
triangle: this.triangle,
onmouseover: () => { this.name.getArrowText().show(); },
onmouseout: () => { this.name.getArrowText().hide(); }
});
const switchWidth1 = style.Section.line.width / 2 + 0.1;
const width1 = switchWidth1 * this.triangle.getSinRate();
const height1 = switchWidth1 * this.triangle.getCosRate();
const width2 = (height1 + switchWidth1) / this.triangle.getTanRate();
const width3 = (style.Section.line.width / this.triangle.getSinRate()) - width2 - width1;
const spoint1 = [model.intersection.x + directx * width3, model.intersection.y - directy * switchWidth1];
const spoint2 = [spoint1[0] - directx * (width2 + width1) - directx * width3, spoint1[1]];
const spoint3 = [model.intersection.x - directx * width3, model.intersection.y + directy * switchWidth1];
// if (this.style.Switch.block.blockName == 'ningbo_01') {
// spoint2 = [model.intersection.x - directx * 13, spoint1[1]];
// spoint3 = [model.intersection.x - directx * 13, model.intersection.y + directy * switchWidth1];
// }
const spoint4 = [spoint1[0] + directx * (width2 + width1) - directx * width3, spoint3[1]];
this.rhomboid = new ERhomboid({ // 平行四边形覆盖范围 (尝试使用本图形做宁波特有的挤岔图形动作 放弃使用下一个的图形)
this.rhomboid = new ERhomboid({ // 岔芯 平行四边形
zlevel: this.zlevel,
z: this.z,
style: style,
sectionPoints: [spoint1, spoint2, spoint3, spoint4],
cursor: 'pointer',
halfWidth: halfWidth,
triangle: this.triangle,
onmouseover: () => { this.name.getArrowText().show(); },
onmouseout: () => { this.name.getArrowText().hide(); }
});
@ -135,19 +114,17 @@ export default class Switch extends Group {
const Tspoint3 = [Tspoint1[0] - directx * spointLength1, model.intersection.y - directy * switchWidth1];
const Tspoint4 = [model.intersection.x + directx * width3, Tspoint3[1]];
const Tspoint5 = [Tspoint1[0], Tspoint1[1]];
this.sheltertriangle = new ETriangle({ // 平行四边形覆盖范围 内侧三角形覆盖物 (用于宁波线路'挤岔' 专用)其他线路不能使用
this.sheltertriangle = new ETriangle({ // 岔芯 直角梯形 (用于'挤岔')
zlevel: this.zlevel,
z: this.z,
style: style,
sectionPoints: [Tspoint1, Tspoint2, Tspoint3, Tspoint4, Tspoint5],
cursor: 'pointer',
halfWidth: halfWidth,
triangle: this.triangle,
onmouseover: () => { this.name.getArrowText().show(); },
onmouseout: () => { this.name.getArrowText().hide(); }
});
this.releaseBackground = new Line({ // 区段上遮盖段
this.releaseBackground = new Line({
zlevel: this.zlevel,
z: this.z,
shape: {
@ -181,7 +158,6 @@ export default class Switch extends Group {
triangle: this.triangle
});
this.add(this.swCore); // 岔芯link
this.add(this.locShelter);
this.add(this.relocShelter);
this.add(this.rhomboid);
@ -233,20 +209,6 @@ export default class Switch extends Group {
.start();
}
/** 设置岔芯是否隐藏*/
setSwitchCoreInvisible(invisible) {
if (invisible) {
this.swCore.hide();
} else {
this.swCore.show();
}
}
/** 设置岔芯颜色*/
setSwitchCoreColor(color) {
this.swCore && this.swCore.setColor(color);
}
/** 设置道岔文字颜色*/
setTextColor(color) {
this.name.getNameText().setStyle({ textFill: color });
@ -266,9 +228,7 @@ export default class Switch extends Group {
recover() {
this.lockRect.hide(); // 矩形包围框
this.lockArc.hide(); // 圆形单锁框
this.setSwitchCoreColor(this.style.backgroundColor);
this.name.getNameText().stopAnimation(false);
this.swCore.stopAnimation(false);
this.sheltertriangle.hide();
this.rhomboid.stopAnimation(false);
this.releaseBackground.hide();
@ -278,7 +238,6 @@ export default class Switch extends Group {
/** 定位*/
setLocationAction() {
this.recover();
this.setSwitchCoreInvisible(true);
if (this.style.Switch.core.splice) {
this.locShelter.hide();
} else {
@ -292,7 +251,6 @@ export default class Switch extends Group {
/** 反位*/
setInversionAction() {
this.recover();
this.setSwitchCoreInvisible(true);
this.setTextColor(this.style.Switch.text.inversionColor);
if (this.style.Switch.core.splice) {
this.relocShelter.hide();
@ -300,35 +258,53 @@ export default class Switch extends Group {
this.relocShelter.show(); // 反位
}
this.locShelter.hide(); // 定位
this.rhomboid.show();
this.setSectionState(this.relocShelter.getSection(), 'fill', this.model);
// this.setSectionState(this.relocShelter.getSection(), 'fill', this.model);
this.rhomboid.show(); // 平行四边形
this.setSectionState(this.rhomboid.getSection(), 'fill', this.model);
}
/** 失去*/
setLossAction(nameFlicker) {
this.recover();
this.locShelter.hide();
this.relocShelter.hide();
this.locShelter.show();
this.relocShelter.show();
this.rhomboid.hide();
this.setSwitchCoreInvisible(false);
this.sheltertriangle.show();
this.sheltertriangle.setColor(this.style.backgroundColor);
this.setTextColor(this.style.Switch.text.lossColor);
nameFlicker && this.nameTextAnimation();
}
/** 挤叉*/
setForkAction() {
this.setLossAction(true);
if (this.style.Switch.block.blockName == 'ningbo_01') {
this.rhomboid.hide(); // 平行四边形
if (this.style.Switch.block.blockName == 'ningbo_01' || this.style.Switch.block.blockName == 'foshan_01') {
this.recover();
this.relocShelter.show();
this.relocShelter.animateStyle(item => {
item.animateStyle(true)
.when(0, { fill: this.style.backgroundColor })
.when(1000, { fill: 'red' })
.when(2000, { fill: this.style.backgroundColor })
.start();
});
this.sheltertriangle.show(); // 宁波线路挤叉特殊显示
this.sheltertriangle.animateStyle(item => {
item.animateStyle(true)
.when(0, { fill: this.style.backgroundColor })
.when(1000, { fill: 'red' })
.when(2000, { fill: this.style.backgroundColor })
.start();
});
this.locShelter.show();
this.locShelter.animateStyle(item => {
item.animateStyle(true)
.when(0, { fill: this.style.backgroundColor })
.when(1000, { fill: 'red' })
.when(2000, { fill: this.style.backgroundColor })
.start();
});
}
this.swCore.animateStyle(item => {
item.animateStyle(true)
.when(0, { stroke: this.style.backgroundColor })
.when(1000, { stroke: 'red' })
.when(2000, { stroke: this.style.backgroundColor })
.start();
});
}
/** 单锁*/
@ -364,13 +340,11 @@ export default class Switch extends Group {
/** 延时释放*/
timeRelease() {
this.setSwitchCoreInvisible(true);
this.releaseBackground.show();
}
/** 设置道岔切除*/
setSwitchCutOff() {
this.setSwitchCoreInvisible(true);
if (this.model.normalPosition) {
this.releaseBackground.hide(); /** 定位*/
} else if (this.model.reversePosition) {
@ -435,6 +409,7 @@ export default class Switch extends Group {
/** 道岔封锁 */
model.blockade && this.block();
/** 区段切除*/
// this.setForkAction(); // 道岔挤岔完成
model.cutOff && this.setSwitchCutOff();
if (this.style.Switch.sectionAction.flag) { // 哈尔滨线路处理道岔相关区段颜色
const switchModel = Vue.prototype.$jlmap.mapDevice[model.code];

View File

@ -42,7 +42,6 @@ import { mouseCancelState } from '../utils/menuItemStatus';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import {menuOperate, commitOperate} from '../utils/menuOperate';
// import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'RouteControl',

View File

@ -22,7 +22,7 @@
style="width: 100%;"
@change="handleChooseChangeStation"
>
<el-option v-for="item in stationList" :key="item.code" :label="item.name" :value="item" />
<el-option v-for="item in concertrateStationList" :key="item.code" :label="item.name" :value="item" />
</el-select>
</el-row>
<el-radio-group :id="domIdChooseControl" v-model="stationType">
@ -31,6 +31,7 @@
{{ controlProps[item] }}</el-radio>
</el-row>
</el-radio-group>
<div class="message" style="color:#ff0000;font-size:14px;margin-left:10px">{{ message }}</div>
<el-row type="flex" justify="center" class="button-group">
<el-button :id="domIdCommit" :disabled="disabledCommit" @click="handleCommit">设置</el-button>
<el-button :id="domIdCancel" :disabled="disabledClose" style="margin-left: 200px" @click="cancel">退出
@ -61,6 +62,7 @@ export default {
station:{},
stationCode: '',
stationName: '',
message:'',
controlProps: {
'03': '紧急站控',
'02': '站控',
@ -98,6 +100,11 @@ export default {
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
concertrateStationList() {
return this.stationList.filter(station=>{
return station.centralized;
});
}
},
mounted() {
@ -107,6 +114,7 @@ export default {
},
methods: {
doShow(operate) {
this.message = '';
if (!this.dialogShow) {
this.operate = operate || {};
this.operation = operate.operation;
@ -131,6 +139,7 @@ export default {
});
},
handleChooseChangeStation(data) {
this.message = '';
this.stationCode = data.code;
this.stationName = data.name;
const operate = {
@ -171,15 +180,21 @@ export default {
},
//
handleCommit() {
if (this.stationType == '01') {
if (this.stationCode == '' || this.stationCode == null) {
this.message = '请选择车站';
return false;
} else {
this.message = '';
if (this.stationType == '01') {
//
this.conterCommit();
} else if (this.stationType == '02') {
this.conterCommit();
} else if (this.stationType == '02') {
//
this.requestCommit();
} else if (this.stationType == '03') {
this.requestCommit();
} else if (this.stationType == '03') {
//
this.emergencyCommit();
this.emergencyCommit();
}
}
},
//

View File

@ -42,11 +42,6 @@ export default {
menu: [],
menuNormal: {
Local: [
{
label: '区段故障解锁',
handler: this.fault,
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK
},
{
label: '区段激活',
handler: this.active,
@ -56,6 +51,11 @@ export default {
label: '区段切除',
handler: this.split,
cmdType: CMD.Section.CMD_SECTION_CUT_OFF
},
{
label: '区段故障解锁',
handler: this.fault,
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK
}
],
Center: [

View File

@ -1,27 +1,37 @@
<template>
<el-dialog class="ningbo-01__systerm confirm-control" :title="title" :visible.sync="show" width="360px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag>
<div class="context">
<template v-for="(message, index) in messages">
<span :key="index">{{message}}</span>
</template>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo"></notice-info>
</el-dialog>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm confirm-control"
:title="title"
:visible.sync="show"
width="360px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<div class="context">
<template v-for="(message, index) in messages">
<span :key="index">{{ message }}</span>
</template>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/ConstDic';
import NoticeInfo from './childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {menuOperate, commitOperate} from '../../utils/menuOperate';
export default {
name: 'ConfirmControl',
@ -42,18 +52,8 @@ export default {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
title() {
if (this.operation === OperationEvent.Signal.arrangementRoute.menu.operation) {
return '进路设置';
} else if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
return '信号关灯';
} else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) {
return '信号重开';
} else if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) {
return '取消进路';
} else if (this.operation === OperationEvent.Signal.humanControl.menu.operation) {
return '进路交人工控';
} else if (this.operation === OperationEvent.Signal.atsAutoControl.menu.operation) {
return '进路交ATS自动控';
} else if (this.operation === OperationEvent.StationStand.setRunLevel.menu.operation) {
return '设置运行等级';
} else if (this.operation === OperationEvent.StationStand.setStopTime.menu.operation) {
@ -67,24 +67,9 @@ export default {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
if (this.operation === OperationEvent.Signal.arrangementRoute.menu.operation) {
/** 进路设置*/
return OperationEvent.Signal.arrangementRoute.confirm.domId;
} else if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
/** 信号关灯*/
return OperationEvent.Signal.signalClose.confirm.domId;
} else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) {
/** 信号重开*/
return OperationEvent.Signal.reopenSignal.confirm.domId;
} else if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) {
/** 取消进路*/
return OperationEvent.Signal.cancelTrainRoute.confirm.domId;
} else if (this.operation === OperationEvent.Signal.humanControl.menu.operation) {
/** 进路交人工控*/
return OperationEvent.Signal.humanControl.confirm.domId;
} else if (this.operation === OperationEvent.Signal.atsAutoControl.menu.operation) {
/** 进路交ATS自动控*/
return OperationEvent.Signal.atsAutoControl.confirm.domId;
} else if (this.operation === OperationEvent.StationStand.setRunLevel.menu.operation) {
/** 设置运行等级*/
return OperationEvent.StationStand.setRunLevel.confirm.domId;
@ -123,24 +108,9 @@ export default {
this.$store.dispatch('training/emitTipFresh');
},
commit() {
if (this.operation === OperationEvent.Signal.arrangementRoute.menu.operation) {
/** 进路设置*/
this.routeSetting();
} else if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
/** 信号关灯*/
this.signalClose();
} else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) {
/** 信号重开*/
this.reopenSignal();
} else if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) {
/** 取消进路*/
this.cancelTrainRoute();
} else if (this.operation === OperationEvent.Signal.humanControl.menu.operation) {
/** 进路交人工控*/
this.humanControl();
} else if (this.operation === OperationEvent.Signal.atsAutoControl.menu.operation) {
/** 进路交ATS自动控*/
this.atsAutoControl();
} else if (this.operation === OperationEvent.StationStand.setRunLevel.menu.operation) {
/** 设置运行等级*/
this.setRunLevel();
@ -152,95 +122,21 @@ export default {
this.setBackStrategy();
}
},
//
routeSetting() {
const operate = {
send: true,
operation: OperationEvent.Signal.arrangementRoute.confirm.operation,
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
};
this.sendCommand(operate);
},
//
signalClose() {
const operate = {
send: true,
operation: OperationEvent.Signal.signalClose.confirm.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL
};
this.sendCommand(operate);
},
//
reopenSignal() {
const operate = {
send: true,
operation: OperationEvent.Signal.reopenSignal.confirm.operation,
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
};
this.sendCommand(operate);
},
//
cancelTrainRoute() {
const operate = {
send: true,
operation: OperationEvent.Signal.cancelTrainRoute.confirm.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
};
this.sendCommand(operate);
},
//
humanControl() {
const operate = {
send: true,
operation: OperationEvent.Signal.humanControl.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING
};
this.sendCommand(operate);
},
// ATS
atsAutoControl() {
const operate = {
send: true,
operation: OperationEvent.Signal.atsAutoControl.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
};
this.sendCommand(operate);
this.sendCommand(menuOperate.Signal.signalClose);
},
//
setRunLevel() {
const operate = {
send: true,
operation: OperationEvent.StationStand.setRunLevel.confirm.operation,
cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME
};
this.sendCommand(operate);
this.sendCommand(menuOperate.StationStand.setRunLevel);
},
//
setStopTime() {
const operate = {
send: true,
operation: OperationEvent.StationStand.setStopTime.confirm.operation,
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME
};
this.sendCommand(operate);
this.sendCommand(menuOperate.StationStand.setStopTime);
},
//
setBackStrategy() {
const operate = {
send: true,
operation: OperationEvent.StationStand.setBackStrategy.confirm.operation,
cmdType: CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY
};
this.sendCommand(operate);
this.sendCommand(menuOperate.StationStand.setBackStrategy);
},
cancel() {
const operate = {
@ -258,15 +154,13 @@ export default {
},
sendCommand(operate) {
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
commitOperate(operate, {}, 2).then((data)=>{
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow({}, error.message);
});
}
}

View File

@ -44,7 +44,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {menuOperate, commitOperate} from '../utils/menuOperate';
export default {
name: 'RouteControl',
@ -150,75 +150,40 @@ export default {
},
//
cancelTrainRoute() {
const operate = {
over: true,
operation: OperationEvent.Signal.cancelTrainRoute.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
};
this.sendCommand(operate);
this.sendCommand(menuOperate.Signal.cancelTrainRoute);
},
//
signalClose() {
const operate = {
operation: OperationEvent.Signal.signalClose.menu.operation,
messages: [`信号关灯: ${this.signalName}`],
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
commitOperate(menuOperate.Signal.signalClose, {}, 1).then((data)=>{
this.doClose();
this.$refs.confirmControl.doShow(data.operate);
}).catch(() => {
this.loading = false;
if (valid) {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmControl.doShow(operate);
}
}).catch((error) => {
this.loading = false;
this.$refs.noticeInfo.doShow(operate, error.message);
this.doClose();
});
},
//
reopenSignal() {
const operate = {
over: true,
operation: OperationEvent.Signal.reopenSignal.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
};
this.sendCommand(operate);
this.sendCommand(menuOperate.Signal.reopenSignal);
},
//
singalPassModel() {
const operate = {
over: true,
operation: OperationEvent.Signal.setAutoInterlock.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO
};
this.sendCommand(operate);
this.sendCommand(menuOperate.Signal.setAutoInterlock);
},
//
singalCancelPassModel() {
const operate = {
over: true,
operation: OperationEvent.Signal.cancelAutoInterlock.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO
};
this.sendCommand(operate);
this.sendCommand(menuOperate.Signal.cancelAutoInterlock);
},
sendCommand(operate) {
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
commitOperate(operate, {}, 2).then((data)=>{
this.loading = false;
if (valid) {
this.doClose();
}
this.doClose();
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
this.$refs.noticeInfo.doShow({}, error.message);
});
},
//

View File

@ -81,8 +81,7 @@ import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import Vue from 'vue';
import {menuOperate, commitOperate} from '../utils/menuOperate';
export default {
name: 'RouteHandControl',
@ -286,41 +285,21 @@ export default {
},
//
humanControl() {
const operate = {
over: true,
operation: OperationEvent.Signal.humanControl.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING,
param:{
routeCodeList: this.selection
}
};
this.sendCommand(operate);
this.sendCommand(menuOperate.Signal.humanControl);
},
//
atsAutoControl() {
const operate = {
over: true,
operation: OperationEvent.Signal.atsAutoControl.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING,
param:{
routeCodeList: this.selection
}
};
this.sendCommand(operate);
this.sendCommand(menuOperate.Signal.atsAutoControl);
},
sendCommand(operate) {
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
commitOperate(operate, {}, 2).then((data)=>{
this.loading = false;
if (valid) {
this.doClose();
}
this.doClose();
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
this.$refs.noticeInfo.doShow({}, error.message);
});
},
cancel() {

View File

@ -36,7 +36,7 @@
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {menuOperate, commitOperate} from '../utils/menuOperate';
import { deepAssign } from '@/utils/index';
export default {
@ -179,25 +179,13 @@ export default {
},
commit() {
if (this.row && this.row.canSetting) {
const operate = {
over: true,
operation: OperationEvent.Signal.arrangementRoute.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE,
param: {
routeCode: this.row.code
}
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
commitOperate(menuOperate.Signal.arrangementRoute, {routeCode:this.row.code}, 2).then((data)=>{
this.doClose();
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
this.$refs.noticeInfo.doShow({}, error.message);
});
}
},

View File

@ -31,7 +31,7 @@
import { mapGetters } from 'vuex';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {menuOperate, commitOperate} from '../utils/menuOperate';
export default {
name: 'RouteLock',
@ -99,35 +99,21 @@ export default {
},
// /
cancelGuide() {
const operate = {
over: true,
operation: this.operate,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE
};
this.sendCommand(operate);
this.sendCommand(menuOperate.Signal.cancelGuide);
},
//
guide() {
const operate = {
over: true,
operation: this.operate,
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
};
this.sendCommand(operate);
this.sendCommand(menuOperate.Signal.guide);
},
sendCommand(operate) {
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
commitOperate(operate, {}, 2).then((data)=>{
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow({}, error.message);
});
},
cancel() {

View File

@ -48,7 +48,7 @@
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {menuOperate, commitOperate} from '../utils/menuOperate';
export default {
name: 'SectionControl',
@ -148,52 +148,31 @@ export default {
},
//
lock() {
const operate = {
over: true,
operation: this.operation,
cmdType: CMD.Section.CMD_SECTION_BLOCK
};
this.sendCommand(operate);
this.sendCommand(menuOperate.Section.lock);
},
//
split() {
const operate = {
over: true,
operation: this.operation,
cmdType: CMD.Section.CMD_SECTION_CUT_OFF
};
this.sendCommand(operate);
this.sendCommand(menuOperate.Section.split);
},
//
active() {
const operate = {
over: true,
operation: this.operation,
cmdType: CMD.Section.CMD_SECTION_ACTIVE
};
this.sendCommand(operate);
this.sendCommand(menuOperate.Section.active);
},
sendCommand(operate) {
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
commitOperate(operate, {}, 2).then((data)=>{
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow({}, error.message);
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();

View File

@ -48,7 +48,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {menuOperate, commitOperate} from '../utils/menuOperate';
export default {
name: 'RouteControl',
@ -101,7 +101,6 @@ export default {
}
}
this.operation = operate.operation;
if (this.operation == OperationEvent.AutoTurnBack.SetAutoTurnBackButton.menu.operation) {
this.passRadio = '1';
} else if (this.operation == OperationEvent.AutoTurnBack.CancelAutoTurnBackButton.menu.operation) {
@ -128,35 +127,21 @@ export default {
},
//
singalPassModel() {
const operate = {
over: true,
operation: this.operation,
cmdType: CMD.Signal.CMD_SIGNAL_SET_AUTO_TURN_BACK
};
this.sendCommand(operate);
this.sendCommand(menuOperate.Signal.setAutoTurnBack);
},
//
singalCancelPassModel() {
const operate = {
over: true,
operation: this.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK
};
this.sendCommand(operate);
this.sendCommand(menuOperate.Signal.cancelAutoTurnBack);
},
sendCommand(operate) {
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
commitOperate(operate, {}, 2).then((data)=>{
this.loading = false;
if (valid) {
this.doClose();
}
this.doClose();
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
this.$refs.noticeInfo.doShow({}, error.message);
});
},
//

View File

@ -3,7 +3,6 @@
<menu-cancel ref="menuCancel" />
<template v-show="isShowAll">
<menu-bar v-show="isShowBar" ref="menuBar" :selected="selected" />
<!-- <menu-button ref="menuButton" /> -->
<menu-axle-reset ref="menuAxleReset" :selected="selected" />
<menu-auto-trun-route ref="menuAutoTrunRoute" :selected="selected" />
<menu-station-stand ref="menuStationStand" :selected="selected" />
@ -25,7 +24,6 @@
import { mapGetters } from 'vuex';
import MenuCancel from './menuCancel';
import MenuSignal from './menuSignal';
// import MenuButton from './menuButton';
import MenuAxleReset from './menuAxleReset';
import MenuAutoTrunRoute from './menuAutoTrunRoute';
import MenuStationStand from './menuStationStand';
@ -44,7 +42,6 @@ export default {
name: 'Menus',
components: {
MenuBar,
// MenuButton,
MenuAxleReset,
MenuAutoTrunRoute,
MenuCancel,

View File

@ -9,9 +9,8 @@
import PopMenu from '@/components/PopMenu';
import TurnBackControl from './dialog/turnBackControl';
import { mapGetters } from 'vuex';
import {menuOperate, commitOperate} from './utils/menuOperate';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
@ -107,36 +106,14 @@ export default {
},
//
handlerTurnBack() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.AutoTurnBack.SetAutoTurnBackButton.menu.operation,
param: {
autoTurnBackCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.turnBackControl.doShow(operate, this.selected);
}
commitOperate(menuOperate.Signal.setAutoTurnBack, {cycleCode:this.selected.cycleCode}, 0).then((data)=>{
this.$refs.turnBackControl.doShow(data.operate, this.selected);
});
},
//
cancelTurnBack() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.AutoTurnBack.CancelAutoTurnBackButton.menu.operation,
param: {
autoTurnBackCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.turnBackControl.doShow(operate, this.selected);
}
commitOperate(menuOperate.Signal.cancelAutoTurnBack, {cycleCode:this.selected.cycleCode, cancelRoute:false}, 0).then((data)=>{
this.$refs.turnBackControl.doShow(data.operate, this.selected);
});
}
}

View File

@ -763,7 +763,7 @@ export default {
};
this.tempClassA = index;
this.tempClassB = -1;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
@ -784,7 +784,7 @@ export default {
operation: item.operate.operation
};
this.tempClassB = index;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
@ -804,7 +804,7 @@ export default {
operation: order.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
@ -818,7 +818,7 @@ export default {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
@ -833,7 +833,7 @@ export default {
operation: order.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
@ -848,7 +848,7 @@ export default {
operation: order.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
@ -863,7 +863,7 @@ export default {
operation: order.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
@ -877,7 +877,7 @@ export default {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
@ -891,7 +891,7 @@ export default {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
@ -905,7 +905,7 @@ export default {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
@ -919,7 +919,7 @@ export default {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
@ -933,7 +933,7 @@ export default {
type: 'bar',
operation: order.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });

View File

@ -1,389 +0,0 @@
<template>
<div v-if="isShowBtn" class="menu" style="height: 45px;" :style="{left: point.x+'px', top: point.y+'px' }">
<button
:id="Signal.arrangementRoute.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Signal.arrangementRoute.button.operation)"
>
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
:id="Signal.cancelTrainRoute.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Signal.cancelTrainRoute.button.operation)"
>
<span style="color: black">
<center>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
:id="Signal.humanTrainRoute.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Signal.humanTrainRoute.button.operation)"
>
<span style="color: red">
<center>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
:id="Signal.reopenSignal.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Signal.reopenSignal.button.operation)"
>
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
:id="Signal.guide.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Signal.guide.button.operation)"
>
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
id="mbm_06"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown('mbm_06')"
>
<span style="color: red">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
:id="Switch.locate.button.domId"
:style="{display: 'block', float: 'left', width: width+'px',backgroundColor:buttonUpColor}"
@click="buttonDown(Switch.locate.button.operation)"
>
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
:id="Switch.reverse.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Switch.reverse.button.operation)"
>
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
:id="Switch.lock.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Switch.lock.button.operation)"
>
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
:id="Switch.unlock.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Switch.unlock.button.operation)"
>
<span style="color: red">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
:id="Signal.setAutoInterlock.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Signal.setAutoInterlock.button.operation)"
>
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
:id="Section.fault.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Section.fault.button.operation)"
>
<span style="color: black">
<center>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
:id="Section.axlePreReset.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Section.axlePreReset.button.operation)"
>
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
id="mbm_11"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown('mbm_11')"
>
<span style="color: black">
<center>
<b style="color:deepskyblue"></b>
<b style="color:burlywood"></b>
</center>
<center>
<b style="color: red"></b>
<b style="color:forestgreen"></b>
</center>
</span>
</button>
<button
id="mbm_12"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown('mbm_12')"
>
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
</div>
</template>
<script>
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
import OperateHandler from '@/scripts/plugin/OperateHandler';
export default {
name: 'MapButtonMenu',
data() {
return {
point: {
x: -1000,
y: -1000
},
operation: '0',
buttonName: '',
buttonDownColor: '#A8A8A8',
buttonUpColor: '#DCDCDC',
width: 58,
tempData: null,
offset: {}
};
},
computed: {
Switch() {
return OperationEvent.Switch;
},
Section() {
return OperationEvent.Section;
},
Signal() {
return OperationEvent.Signal;
},
isShowBtn() {
return this.$store.state.training.prdType == '01';
}
},
watch: {
'$store.state.config.canvasOffsetCount': function (val) {
this.resetPosition();
},
'$store.state.menuOperation.buttonOperation': function (val, old) {
this.updateButtonShow(val, old);
},
'$store.state.menuOperation.selectedCount': function (val) {
this.selectedChange();
}
},
mounted() {
this.resetPosition();
},
methods: {
resetPosition() {
this.$nextTick(() => {
const canvasOffset = this.$store.state.config.canvasOffset;
this.point = {
x: canvasOffset.x + 20,
y: canvasOffset.y + this.$store.state.config.height - 65
};
this.$store.dispatch('training/tipReload');
});
},
updateButtonShow(val, old) {
if (old) {
//
const domId = getDomIdByOperation(old);
const dom = document.getElementById(domId);
if (dom) {
dom.disabled = false;
dom.style.backgroundColor = this.buttonUpColor;
}
}
if (val) {
//
const domId = getDomIdByOperation(val);
const dom = document.getElementById(domId);
if (dom) {
dom.disabled = true;
dom.style.backgroundColor = this.buttonDownColor;
}
}
},
buttonDown(operation) {
const operate = {
type: 'mbm',
operation: operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/setButtonOperation', operation); //
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$store.dispatch('training/emitTipFresh');
}
});
},
selectedChange() {
//
if (this.$store.state.menuOperation.buttonOperation) {
const model = this.$store.state.menuOperation.selected;
if (model) {
const deviceType = MapDeviceType[model._type];
const operate = {
send: true,
model: model,
code: model.code,
type: deviceType.type,
operation: this.$store.state.menuOperation.buttonOperation,
tempData: this.tempData
};
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
if (valid) {
if (response) {
this.tempData = response.data;
}
}
});
} else {
OperateHandler.cleanOperates();
this.$store.dispatch('menuOperation/setButtonOperation', null);
}
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
$bg: #fff;
$hoverBg: #f5f7fa;
.menu {
background-color: $bg;
position: fixed;
border: 1px solid gray;
z-index: 10;
display: block;
.dsp-block {
display: block;
text-align: center;
border-radius: unset;
width: 100%;
}
.dsp-block:hover {
background-color: $hoverBg;
}
}
</style>

View File

@ -1,120 +1,133 @@
<template>
<el-dialog class="ningbo-01__systerm two-confirmation" title="二次确认" :visible.sync="show" width="360px"
:before-close="doClose" :showClose="false" :zIndex="2000" :modal="false" :close-on-click-modal="false"
append-to-body v-dialogDrag>
<div class="context">
<template v-for="(message, index) in messages">
<span :key="index">{{message}}</span>
</template>
</div>
<el-row class="button-group">
<el-col :span="10" :offset="3">
<el-button :id="show? domIdConfirm: ''" :loading="loading" @click="commit">确认</el-button>
</el-col>
<el-col :span="6" :offset="4">
<el-button :id="domIdCancel" @click="cancel">关闭</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo"></notice-info>
</el-dialog>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm two-confirmation"
title="二次确认"
:visible.sync="show"
width="360px"
:before-close="doClose"
:show-close="false"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<div class="context">
<template v-for="(message, index) in messages">
<span :key="index">{{ message }}</span>
</template>
</div>
<el-row class="button-group">
<el-col :span="10" :offset="3">
<el-button :id="show? domIdConfirm: ''" :loading="loading" @click="commit">确认</el-button>
</el-col>
<el-col :span="6" :offset="4">
<el-button :id="domIdCancel" @click="cancel">关闭</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { MapDeviceType, OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
import NoticeInfo from '../../dialog/childDialog/childDialog/noticeInfo'
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '../../dialog/childDialog/childDialog/noticeInfo';
export default {
name: 'TwoConfirmation',
data() {
return {
dialogShow: false,
loading: false,
operation: '',
operate: '',
timer: null
export default {
name: 'TwoConfirmation',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
operation: '',
operate: '',
timer: null
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdConfirm() {
if (this.operation == OperationEvent.StationControl.emergencyStationControl.menu.operation) {
return OperationEvent.StationControl.emergencyStationControl.confirm.domId;
} else if (this.operation == OperationEvent.StationControl.requestStationControl.menu.operation) {
return OperationEvent.StationControl.requestStationControl.confirm.domId;
} else if (this.operation == OperationEvent.StationControl.requestCentralControl.menu.operation) {
return OperationEvent.StationControl.requestCentralControl.confirm.domId;
} else {
return '';
}
},
components: {
NoticeInfo
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdConfirm() {
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.emergencyStationControl)) {
return OperationEvent.StationControl.emergencyStationControl.confirm.domId;
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
return OperationEvent.StationControl.requestStationControl.confirm.domId;
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
return OperationEvent.StationControl.requestCentralControl.confirm.domId;
}
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
},
messages() {
if (this.operate) {
return this.operate.messages;
}
return []
messages() {
if (this.operate) {
return this.operate.messages;
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
doShow(operate) {
this.operate = operate || {};
this.operation = this.operate.operation;
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
return [];
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, message) {
this.operate = operate || {};
this.operate.messages = [];
this.operate.messages.push(message);
this.operation = this.operate.operation;
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
},
cancel() {
let operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.confirm.operation,
}
});
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
cancel() {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.confirm.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
}
})
},
commit() {
let operate = {
send: true,
type: this.operate.type,
val: this.operate.val,
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
}
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
operate.operation = OperationEvent.StationControl.requestCentralControl.confirm.operation;
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
operate.operation = OperationEvent.StationControl.requestStationControl.confirm.operation;
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.emergencyStationControl)) {
operate.operation = OperationEvent.StationControl.emergencyStationControl.confirm.operation;
}
this.doClose();
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}, 1000).catch((error) => {
this.$refs.noticeInfo.doShow(operate);
});
});
},
commit() {
const operate = {
over: true,
operation:this.operation
};
if (this.operation == OperationEvent.StationControl.requestCentralControl.menu.operation) {
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL;
} else if (this.operation == OperationEvent.StationControl.requestStationControl.menu.operation) {
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL;
} else if (this.operation == OperationEvent.StationControl.emergencyStationControl.menu.operation) {
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL;
}
this.doClose();
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}, 1000).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
}
}
</script>
};
</script>

View File

@ -1,231 +1,234 @@
<template>
<el-dialog class="ningbo-01__systerm station-control" title="控制模式转换" :visible.sync="show" width="400px"
:before-close="doClose" :showClose="true" :zIndex="2000" :modal="false" :close-on-click-modal="false"
v-dialogDrag>
<el-row> 集中站 </el-row>
<el-row style="margin-bottom: 20px">
<el-select v-model="stationCode" filterable placeholder="请选择" style="width: 100%;" :id="domIdChooseStation"
@change="handleChooseChangeStation">
<el-option v-for="item in stationList" :key="item.code" :label="item.name" :value="item.code">
</el-option>
</el-select>
</el-row>
<el-radio-group v-model="stationType" :id="domIdChooseControl">
<el-row style="padding-bottom: 10px" v-for="item in Object.keys(controlProps)" :key="item">
<el-radio :label="item" @change="handleChooseChangeControl">
{{controlProps[item]}}</el-radio>
</el-row>
</el-radio-group>
<el-row type="flex" justify="center" class="button-group">
<el-button :id="domIdCommit" :disabled="disabledCommit" @click="handleCommit">设置</el-button>
<el-button :id="domIdCancel" :disabled="disabledClose" @click="cancel" style="margin-left: 200px">退出
</el-button>
</el-row>
<two-confirmation ref="twoConfirmation"></two-confirmation>
</el-dialog>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm station-control"
title="控制模式转换"
:visible.sync="show"
width="400px"
:before-close="doClose"
:show-close="true"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row> 集中站 </el-row>
<el-row style="margin-bottom: 20px">
<el-select
:id="domIdChooseStation"
v-model="station"
value-key="code"
filterable
placeholder="请选择"
style="width: 100%;"
@change="handleChooseChangeStation"
>
<el-option v-for="item in concertrateStationList" :key="item.code" :label="item.name" :value="item" />
</el-select>
</el-row>
<el-radio-group :id="domIdChooseControl" v-model="stationType">
<el-row v-for="item in Object.keys(controlProps)" :key="item" style="padding-bottom: 10px">
<el-radio :label="item" @change="handleChooseChangeControl">
{{ controlProps[item] }}</el-radio>
</el-row>
</el-radio-group>
<div class="message" style="color:#ff0000;font-size:14px;margin-left:10px">{{ message }}</div>
<el-row type="flex" justify="center" class="button-group">
<el-button :id="domIdCommit" :disabled="disabledCommit" @click="handleCommit">设置</el-button>
<el-button :id="domIdCancel" :disabled="disabledClose" style="margin-left: 200px" @click="cancel">退出
</el-button>
</el-row>
<two-confirmation ref="twoConfirmation" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, TrainingMode, OperationEvent, getDomIdByOperation, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
import TwoConfirmation from './childDialog/twoConfirmation';
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import TwoConfirmation from './childDialog/twoConfirmation';
import {menuOperate, commitOperate} from '../utils/menuOperate';
export default {
name: 'StationControl',
data() {
return {
operate: null,
dialogShow: false,
disabledClose: false,
disabledCommit: false,
stationType: '01',
stationCode: '',
controlProps: {
'03': '紧急站控',
'02': '站控',
'01': '遥控',
},
export default {
name: 'StationControl',
components: {
TwoConfirmation
},
data() {
return {
operate: null,
dialogShow: false,
disabledClose: false,
disabledCommit: false,
stationType: '01',
station:{},
stationCode: '',
stationName:'',
message:'',
controlProps: {
'03': '紧急站控',
'02': '站控',
'01': '遥控'
}
};
},
computed: {
...mapGetters('map', [
'stationList'
]),
...mapGetters('training', [
'mode',
'started'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
components: {
TwoConfirmation
domIdChooseControl() {
return this.dialogShow ? OperationEvent.Command.order.choose.domId : '';
},
computed: {
...mapGetters('map', [
'stationList'
]),
...mapGetters('training', [
'mode',
'started'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdChooseControl() {
return this.dialogShow ? OperationEvent.Command.order.choose.domId : '';
},
domIdChooseStation() {
return this.dialogShow ? OperationEvent.Command.order.choose1.domId : '';
},
domIdCommit() {
if (this.dialogShow) {
if (this.stationType == '01') {
return OperationEvent.StationControl.requestCentralControl.menu.domId;
} else if (this.stationType == '02') {
return OperationEvent.StationControl.requestStationControl.menu.domId;
} else if (this.stationType == '03') {
return OperationEvent.StationControl.emergencyStationControl.menu.domId;
}
}
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}
domIdChooseStation() {
return this.dialogShow ? OperationEvent.Command.order.choose1.domId : '';
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
doShow(operate) {
if (!this.dialogShow) {
this.operate = operate || {};
this.operation = operate.operation;
}
this.dialogShow = true;
this.$store.dispatch('training/emitTipFresh');
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
cancel() {
let operate = {
type: 'bar',
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
})
},
handleChooseChangeStation() {
let operate = {
type: MapDeviceType.StationControl.type,
operation: OperationEvent.Command.order.choose1.operation,
val: this.stationCode,
}
// if (this.stationType == '01') {
// operate.operation = OperationEvent.StationControl.requestCentralControl.choose1.operation
// } else if (this.stationType == '02') {
// operate.operation = OperationEvent.StationControl.requestStationControl.choose1.operation
// } else if (this.stationType == '03') {
// operate.operation = OperationEvent.StationControl.emergencyStationControl.choose1.operation
// }
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
})
},
handleChooseChangeControl() {
let operate = {
type: MapDeviceType.StationControl.type,
operation: OperationEvent.Command.order.choose.operation,
val: this.stationCode,
}
// if (this.stationType == '01') {
// operate.operation = OperationEvent.StationControl.requestCentralControl.choose.operation
// } else if (this.stationType == '02') {
// operate.operation = OperationEvent.StationControl.requestStationControl.choose.operation
// } else if (this.stationType == '03') {
// operate.operation = OperationEvent.StationControl.emergencyStationControl.choose.operation
// }
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
})
},
//
handleCommit() {
domIdCommit() {
if (this.dialogShow) {
if (this.stationType == '01') {
//
return OperationEvent.StationControl.requestCentralControl.menu.domId;
} else if (this.stationType == '02') {
return OperationEvent.StationControl.requestStationControl.menu.domId;
} else if (this.stationType == '03') {
return OperationEvent.StationControl.emergencyStationControl.menu.domId;
} else {
return '';
}
} else {
return '';
}
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
concertrateStationList() {
return this.stationList.filter(station=>{
return station.centralized;
});
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate) {
this.message = '';
if (!this.dialogShow) {
this.operate = operate || {};
this.operation = operate.operation;
}
this.dialogShow = true;
this.$store.dispatch('training/emitTipFresh');
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
cancel() {
const operate = {
type: 'bar',
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
});
},
handleChooseChangeStation(data) {
this.stationCode = data.code;
this.stationName = data.name;
this.message = '';
const operate = {
operation: OperationEvent.Command.order.choose1.operation,
val: this.stationCode
};
// if (this.stationType == '01') {
// operate.operation = OperationEvent.StationControl.requestCentralControl.choose1.operation
// } else if (this.stationType == '02') {
// operate.operation = OperationEvent.StationControl.requestStationControl.choose1.operation
// } else if (this.stationType == '03') {
// operate.operation = OperationEvent.StationControl.emergencyStationControl.choose1.operation
// }
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
handleChooseChangeControl() {
const operate = {
operation: OperationEvent.Command.order.choose.operation,
val: this.stationCode
};
// if (this.stationType == '01') {
// operate.operation = OperationEvent.StationControl.requestCentralControl.choose.operation
// } else if (this.stationType == '02') {
// operate.operation = OperationEvent.StationControl.requestStationControl.choose.operation
// } else if (this.stationType == '03') {
// operate.operation = OperationEvent.StationControl.emergencyStationControl.choose.operation
// }
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
//
handleCommit() {
if (this.stationCode == '' || this.stationCode == null) {
this.message = '请选择车站';
return false;
} else {
this.message = '';
if (this.stationType == '01') {
//
this.conterCommit();
} else if (this.stationType == '02') {
//
//
this.requestCommit();
} else if (this.stationType == '03') {
//
//
this.emergencyCommit();
}
},
//
conterCommit() {
let operate = {
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.requestCentralControl.menu.operation,
messages: ['确认将如下操作区域的控制模式由站控转为中控:'],
val: `${this.stationCode}::`,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.twoConfirmation.doShow(operate);
} else {
this.disabledSure = false;
}
}).catch(() => {
})
},
//
requestCommit() {
let operate = {
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.requestStationControl.menu.operation,
messages: ['确认将如下操作区域的控制模式由中控转为站控:'],
val: `${this.stationCode}::`,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.twoConfirmation.doShow(operate);
} else {
this.disabledSure = false;
}
}).catch((error) => {
})
},
//
emergencyCommit() {
let operate = {
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.emergencyStationControl.menu.operation,
messages: ['确认将如下操作区域的控制模式由中控转为站控:'],
val: `${this.stationCode}::`,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.twoConfirmation.doShow(operate);
} else {
this.disabledSure = false;
}
}).catch(() => {
})
}
},
//
conterCommit() {
commitOperate(menuOperate.StationControl.requestCentralControl, {stationCodes:[this.stationCode]}, 0).then((data)=>{
this.doClose();
this.$refs.twoConfirmation.doShow(data.operate, '确认将如下操作区域的控制模式由站控转为遥控:\n' + this.stationName);
});
},
//
requestCommit() {
commitOperate(menuOperate.StationControl.requestStationControl, {stationCodes:[this.stationCode]}, 0).then((data)=>{
this.doClose();
this.$refs.twoConfirmation.doShow(data.operate, '确认将如下操作区域的控制模式由中控转为站控:\n' + this.stationName);
});
},
//
emergencyCommit() {
commitOperate(menuOperate.StationControl.emergencyStationControl, {stationCodes:[this.stationCode]}, 0).then((data)=>{
this.doClose();
this.$refs.twoConfirmation.doShow(data.operate, '确认将如下操作区域的控制模式由中控转为站控:\n' + this.stationName);
});
}
}
};
</script>
<style scoped rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
@ -234,4 +237,4 @@
color: #000;
font-weight: bold;
}
</style>
</style>

View File

@ -302,7 +302,7 @@ export default {
this.$refs.routeLock.doShow(data.operate, this.selected);
});
},
//
//
unlock() {
commitOperate(menuOperate.Signal.unlock, {signalCode:this.selected.code}, 0).then((data)=>{
this.$refs.routeUnLock.doShow(data.operate, this.selected);

View File

@ -9,8 +9,7 @@
import PopMenu from '@/components/PopMenu';
import StationControl from './dialog/stationControl';
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from './utils/menuOperate';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
@ -112,29 +111,15 @@ export default {
this.selected = this.$store.getters['menuOperation/selected'];
},
setCenterControl() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.StationControl.requestCentralControl.menu.operation
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationControl.doShow(step, this.selected);
}
//
commitOperate(menuOperate.StationControl.requestCentralControl, {}, 0).then((data)=>{
this.$refs.stationControl.doShow(data.operate, this.selected);
});
},
setStationControl() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.StationControl.requestStationControl.menu.operation
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationControl.doShow(step, this.selected);
}
//
commitOperate(menuOperate.StationControl.requestStationControl, {}, 0).then((data)=>{
this.$refs.stationControl.doShow(data.operate, this.selected);
});
}
}

View File

@ -1,202 +0,0 @@
<template>
<div id="menuTool">
<div class="nav">
<div v-for="(item,index) in tools" :key="index" class="tool">
<img :src="item.src" :alt="item.title">
</div>
<img class="logo" :src="logoImg">
<system-time v-if="isShowSystemTime" class="time" :time="time" :zoom="2" :width="180" :height="48" :fine="2" :top="6" />
</div>
</div>
</template>
<script>
import { prefixIntrger } from '@/utils/date';
import SystemTime from '@/views/components/systemTime/index';
import logo_ from '@/assets/logo_.png';
export default {
name: 'MenuTool',
components: {
SystemTime
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
logoImg: logo_,
time: '00:0000',
tools: [
{
title: '服务器1',
operate: '',
src: logo_,
click: this.undeveloped
},
{
title: '服务器2',
operate: '',
src: '',
click: this.undeveloped
},
{
title: '前置机1',
operate: '',
src: '',
click: this.undeveloped
},
{
title: '前置机2',
operate: '',
src: '',
click: this.undeveloped
},
{
title: '主调',
operate: '',
src: '',
click: this.undeveloped
},
{
title: '调度台1',
operate: '',
src: '',
click: this.undeveloped
},
{
title: '调度台2',
operate: '',
src: '',
click: this.undeveloped
},
{
title: '调度台3',
operate: '',
src: '',
click: this.undeveloped
},
{
title: '大屏',
operate: '',
src: '',
click: this.undeveloped
},
{
title: '维护工作站',
operate: '',
src: '',
click: this.undeveloped
},
{
title: '运行图显示人工站',
operate: '',
src: '',
click: this.undeveloped
},
{
title: '跳停',
operate: '',
src: '',
click: this.undeveloped
},
{
title: '扣车',
operate: '',
src: '',
click: this.undeveloped
},
{
title: '列车报警',
operate: '',
src: logo_,
click: this.undeveloped
}
]
};
},
computed: {
isShowSystemTime() {
return this.$route.params.mode == 'demon' || this.$route.params.mode === 'dp' || !this.$route.params.mode;
}
},
watch: {
'$store.state.training.initTime': function (initTime) {
const date = new Date(initTime);
this.time = `${prefixIntrger(date.getHours(), 2)}:${prefixIntrger(date.getMinutes(), 2)}${prefixIntrger(date.getSeconds(), 2)}`;
}
},
mounted() {
this.initTools();
},
methods: {
initTools() {
this.tools = [];
}
}
};
</script>
<style scoped rel="stylesheet/scss" lang="scss">
@import "src/styles/mixin.scss";
$top: 30px;
$width: 50px;
$height: 50px;
#menuTool {
z-index: 5;
position: absolute;
top: $top;
width: 100%;
}
.nav {
display: block;
height: $height;
line-height: $height;
color: #0000;
background: #ECE9D8;
border: 1px solid #B6BCCC !important;
border-bottom: 2px solid #B6BCCC !important;
list-style: none;
}
.tool {
background: #808080;
display: flex;
justify-content: center;
cursor: pointer;
position: relative;
float: left;
height: $height - 2;
width: $width + 15;
margin: 1px;
img {
display: block;
text-align: center;
padding-top: 4px;
height: $height - 10;
width: $width - 10;
}
}
.time {
position: relative;
float: right;
text-align: center;
}
.logo {
position: relative;
float: right;
text-align: center;
margin: 1px 10px;
height: $height - 4;
width: $width - 4;
}
</style>

View File

@ -111,6 +111,16 @@ export const menuOperate = {
// 人工解锁进路(信号机取消引导)
operation: OperationEvent.Signal.cancelGuide.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE
},
setAutoTurnBack:{
// 设置自动折返
operation: OperationEvent.AutoTurnBack.SetAutoTurnBackButton.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_SET_AUTO_TURN_BACK
},
cancelAutoTurnBack:{
// 取消自动折返
operation: OperationEvent.AutoTurnBack.CancelAutoTurnBackButton.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK
}
},
Switch:{
@ -230,25 +240,24 @@ export const menuOperate = {
// 查询站台状态
operation: OperationEvent.StationStand.detail.menu.operation
}
},
StationControl:{
requestCentralControl:{
// 请求中控(遥控)
operation: OperationEvent.StationControl.requestCentralControl.menu.operation,
cmdType: CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL
},
requestStationControl:{
// 请求站控
operation: OperationEvent.StationControl.requestStationControl.menu.operation,
cmdType:CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL
},
emergencyStationControl:{
// 紧急站控
operation: OperationEvent.StationControl.emergencyStationControl.menu.operation,
cmdType:CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL
}
}
// StationControl:{
// requestCentralControl:{
// // 请求中控(遥控)
// operation: OperationEvent.StationControl.requestCentralControl.menu.operation,
// cmdType: CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL
// },
// requestStationControl:{
// // 请求站控
// operation: OperationEvent.StationControl.requestStationControl.menu.operation,
// cmdType:CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL
// },
// emergencyStationControl:{
// // 紧急站控
// operation: OperationEvent.StationControl.emergencyStationControl.menu.operation,
// cmdType:CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL
// }
// }
};
export function commitOperate(operate, paramList, over) {

View File

@ -907,7 +907,7 @@ export const OperationEvent = {
operation: '3181',
domId: '_Tips-Signal-cancelGuide-Confirm'
}
},
}
},
// 物理区段操作
@ -1951,11 +1951,11 @@ export const OperationEvent = {
},
CancelAutoTurnBackButton: {
menu: {
operation: '900',
operation: '901',
domId: '_Tips-Turn-Back-Menu'
},
confirm: {
operation: '9001',
operation: '9011',
domId: '_Tips-Turn-Back-confirm-Menu'
}
}