This commit is contained in:
sunzhenyu 2021-03-11 17:11:03 +08:00
commit 1de6eda1a6
225 changed files with 6939 additions and 9350 deletions

View File

@ -429,3 +429,11 @@ export function getLogList(group, params) {
params:params
});
}
/* 宁波三排列进路到 获取路径列表 */
export function getPathListByStandCodeOrSignalCode( group, params ) {
return request({
url: `/simulation/${group}/querySectionPaths`,
method: 'get',
params
});
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -10,6 +10,7 @@ export default {
const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
dialogHeaderEl.onmousedown = (e) => {
e.stopPropagation();
/** 鼠标按下,计算当前元素距离可视区的距离*/
const disX = e.clientX - dialogHeaderEl.offsetLeft;
const disY = e.clientY - dialogHeaderEl.offsetTop;
@ -30,6 +31,7 @@ export default {
}
document.onmousemove = function (e) {
e.stopPropagation();
/** 通过事件委托,计算移动的距离*/
const l = e.clientX - disX;
const t = e.clientY - disY;
@ -46,6 +48,7 @@ export default {
};
document.onmouseup = function () {
e.stopPropagation();
document.onmousemove = null;
document.onmouseup = null;
};

View File

@ -41,7 +41,7 @@ export default {
blueButton: 'Blue button',
yellowButton: 'Yellow button',
greenButton: 'Green button',
grayButton: 'Gray button',
grayButton: 'White button',
digitalClockCode: 'Digital clock code',
digitalClockWidth: 'Digital clock width',
escalatorCode: 'Escalator code',

View File

@ -46,7 +46,7 @@ export default {
blueButton: '蓝色按钮',
yellowButton: '黄色按钮',
greenButton: '绿色按钮',
grayButton: '灰色按钮',
grayButton: '白色按钮',
digitalClockCode: '数字时钟编号',
digitalClockWidth: '数字时钟宽度',
escalatorCode: '扶梯编号',

View File

@ -5,12 +5,12 @@ export default {
level3: '等级三:',
level4: '等级四:',
level5: '等级五:',
updateData: '更新数据',
pleaseInputLevel1: '请输入等级一',
pleaseInputLevel2: '请输入等级二',
pleaseInputLevel3: '请输入等级三',
pleaseInputLevel4: '请输入等级四',
pleaseInputLevel5: '请输入等级五',
// updateData: '更新数据',
// pleaseInputLevel1: '请输入等级一',
// pleaseInputLevel2: '请输入等级二',
// pleaseInputLevel3: '请输入等级三',
// pleaseInputLevel4: '请输入等级四',
// pleaseInputLevel5: '请输入等级五',
systemOutPut: '系统输出框',
selectPrintArea: '选择打印区域',
selectDeleteRoute: '选择删除交路',
@ -20,9 +20,9 @@ export default {
deletePlanCar: '删除计划车'
},
openRunPlan: {
selectRunplan: '选择运行图',
// selectRunplan: '选择运行图',
delete: '删除',
modify: '修改',
// modify: '修改',
runPlanList: '运行图列表',
getRunPlanListFail: '获取运行图列表失败',
confirmDeleteRunPlan: '您确认是否删除此运行图?',
@ -51,20 +51,20 @@ export default {
// endStationTitle 终到站
// endSection 终到区段
// description 描述
detail: '详情:',
station: '车站',
section: '区段',
stopTime: '停站时间',
runLevel: '运行等级',
arrivalTime: '到点',
departureTime: '发点',
// detail: '详情:',
// station: '车站',
// section: '区段',
// stopTime: '停站时间',
// runLevel: '运行等级',
// arrivalTime: '到点',
// departureTime: '发点',
showDefaultTime: '显示默认停站时间和运行等级',
automatic: '自动',
default: '默认',
modifyTask: '修改任务',
setMessageTip1: '请先设置开始区段',
setMessageTip2: '终到区段',
setMessageTip3: '的站间运行时间',
// setMessageTip1: '请先设置开始区段',
// setMessageTip2: '终到区段',
// setMessageTip3: '的站间运行时间',
modifyTaskSuccess: '修改任务成功!',
modifyTaskFailed: '修改任务失败',
@ -74,29 +74,29 @@ export default {
endSection: '终点区段',
direction: '方向',
distance: '距离',
operation: '操作',
edit: '编辑',
save: '保存',
cancelAndQuit: '取消&退出',
// operation: '操作',
// edit: '编辑',
// save: '保存',
// cancelAndQuit: '取消&退出',
modifySuccess: '修改成功!',
modifyFailed: '修改失败',
modifyRunLevel: '修改运行等级',
modifyStopTime:'修改停站时间',
startStationTips: '起始站发车时间不变',
endStationTips: '终到站到达时间不变',
startStationTitle: '起始站',
startedStation: '起始站台',
endStationTitle: '终到站',
endedStation: '终到站台',
description: '描述',
modifyTaskRoute: '修改任务交路',
time: '时间',
// startStationTips: '起始站发车时间不变',
// endStationTips: '终到站到达时间不变',
// startStationTitle: '起始站',
// startedStation: '起始站台',
endStationTitle: '终到站'
// endedStation: '终到站台',
// description: '描述',
// modifyTaskRoute: '修改任务交路',
// time: '时间',
modifyStartTime: '修改开始时间:',
modifyStartTimeTitle: '修改起始时间',
search: '查找',
modifyTwoStationTime: '修改两站之间的时间'
// modifyStartTime: '修改开始时间:',
// modifyStartTimeTitle: '修改起始时间',
// search: '查找',
// modifyTwoStationTime: '修改两站之间的时间'
},
editSmoothRun: {
trainProportion: '分车比例',

View File

@ -108,6 +108,11 @@ class SkinCode extends defaultStyle {
width: 2,
defaultColor: '#03FFF8'
},
runLineShow:{
lineWidth: 6,
lineStroke:'#F37117',
pathStroke: '#00f'
},
routeArrow: {
radius: 5,
lineWidth: 3,

View File

@ -415,54 +415,22 @@ class SkinCode extends defaultStyle {
text: {
distance: 2, // 灯和文字之间的距离
fontSize: 12, // 字体大小
offsetX: 30, // 偏移差值X
offsetY: 0, // 偏移差值Y
fontFormat: 'consolas', // 字体格式
centerControlColor: '#ffffff', // 中控字体颜色
stationControlColor: '#ff0', // 站控字体颜色
emergencyControlColor:'#f00', // 紧急站控字体颜色
automaticRouteColor: '#3CB960', // 自动进路
manualRouteColor: '#f00', // 人工进路
openCommunicationColor: '#3CB960', // 建立通信
closeCommunicationColor: '#f00', // 断开通信
testValidColor: '#3CB960', // 验证生效
testInvalidColor: '#f00', // 验证无效
fontWeight: 'normal', // 字体粗细
textAlign: 'middle', // 字体水平对齐
textVerticalAlign: 'top' // 字体垂直对齐
}
// lamp: {
// count: 4, // 控制模式的个数
// offset: {x: 20, y: 0}, // 偏移量
// emergencyOffset: {x: 0, y: 0},
// radiusR: 4, // 控制模式灯的半径
// distance: 46, // 控制模式之间灯之间的距离
// grayColor: '#C0C0C0', // 控制模式灰色
// greenColor: 'green', // 控制模式绿色
// redColor: 'red', // 控制模式红色
// yellowColor: 'yellow' // 控制模式黄色
// },
// emergencyControl: { // 紧急站控
// show: true,
// offset: { x: 0, y: 0 },
// text: '紧急',
// arrowShow: false,
// grayColor: '#7F7F7F'
// },
// centerControl: { // 中控
// show: true,
// offset: { x: 0, y: 0 },
// text: '中控',
// buttonShow: false,
// arrowShow: false,
// grayColor: '#7F7F7F'
// },
// substationControl: { // 站控按钮
// show: true,
// offset: { x: 0, y: 0 },
// text: '站控',
// arrowShow: false,
// grayColor: '#7F7F7F'
// },
// interconnectedControl: { // 联锁控
// show: false,
// offset: { x: 0, y: 0 },
// text: '联锁控',
// arrowShow: false,
// grayColor: '#7F7F7F'
// }
}
};
@ -748,7 +716,8 @@ class SkinCode extends defaultStyle {
upPadding: 4, // 上边距离
trainBodyFillColor: '#2AA32A', // 列车车身填充颜色
trainSidelineColor: '#2AA32A',
trainNameFormat: 'serviceNumber:targetCode'// 列车显示格式
trainNameFormat: 'serviceNumber:targetCode', // 列车显示格式
trainBodyFaultFlashColor:'#f00' // 列车故障闪烁颜色
},
directionArrow: {
},

View File

@ -45,6 +45,7 @@ class Jlmap {
// 显示集中站
this.stationCode = '';
this.isUpdateShowTrainList = false;
this.isUpdateRunLineTrain = false;
}
// 初始化属性有鼠标事件 缩放等
@ -400,18 +401,18 @@ class Jlmap {
});
this.$painter.$transformHandle.revisibleAll();
}
updatePrdType(list = [], showMode = '03', val = '') {
this.showConfig.prdType = val;
this.showConfig.showMode = showMode;
list.forEach(item => {
const code = item.code;
const type = item._type;
const oDevice = this.mapDevice[code] || deviceFactory(type, item, this.showConfig);
this.hookHandle(oDevice, this.showConfig);
this.$painter.update(oDevice);
this.$painter.updateShowMode(oDevice);
});
}
// updatePrdType(list = [], showMode = '03', val = '') {
// this.showConfig.prdType = val;
// this.showConfig.showMode = showMode;
// list.forEach(item => {
// const code = item.code;
// const type = item._type;
// const oDevice = this.mapDevice[code] || deviceFactory(type, item, this.showConfig);
// this.hookHandle(oDevice, this.showConfig);
// this.$painter.update(oDevice);
// this.$painter.updateShowMode(oDevice);
// });
// }
update(list = [], fetch = true) {
this.setUpdateMapDevice(list, fetch); // 增加一个 前数据 处理 为了在区段中 获取全部的 道岔信息
@ -480,6 +481,7 @@ class Jlmap {
} else {
if (elem.deviceType === 'TRAIN') {
this.isUpdateShowTrainList = true;
if (elem.destinationCode) { this.isUpdateRunLineTrain = true; }
store.commit('map/updateActiveTrainList', elem);
} else if (elem.deviceType === 'STAND') {
store.dispatch('map/updateStationStand', elem);
@ -527,6 +529,7 @@ class Jlmap {
}
const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
if (elem.dispose) {
this.$painter.delete(oDevice);
} else {
@ -545,6 +548,10 @@ class Jlmap {
store.dispatch('map/setActiveTrainList');
this.isUpdateShowTrainList = false;
}
if (this.isUpdateRunLineTrain) {
store.dispatch('map/setRunLineTrain');
this.isUpdateRunLineTrain = false;
}
if (selected && codeList.includes(selected.code)) {
store.commit('menuOperation/setSelected', {device: {...selected}});

View File

@ -80,9 +80,6 @@ class MouseController extends Eventful {
}
mousedown(e) {
// if (eventTool.notLeftMouse(e)) {
// return;
// }
this.$zr.dom.focus();
if (e.which == 1 || e.which == 3) {
var x = e.offsetX;
@ -100,13 +97,7 @@ class MouseController extends Eventful {
}
mousemove(e) {
// if (eventTool.notLeftMouse(e) ||
// !this._moveOnMouseMove ||
// !this._dragging
// ) {
// return;
// }
if (this._dragging) {
const oldX = this._x;
const oldY = this._y;
@ -118,12 +109,12 @@ class MouseController extends Eventful {
if (e.which == 1) {
this._preventDefaultMouseMove && eventTool.stop(e.event);
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
} else if (e.which === 3 && this._zoomOnMouseWheel && this._previewOrMapDraw) {
this.handleMouseMoveRight({x: e.offsetX, y: e.offsetY});
}
}
}
mouseup(e) {
if (!eventTool.notLeftMouse(e)) {

View File

@ -268,6 +268,28 @@ export default class ELines extends Group {
this.bottomWithSection.hide();
}
if (style.Section.runLineShow && !isCurve) {
// 运行线
const points = [];
for (let i = 0; i < modelPoints.length; i++) {
points.push([modelPoints[i].x, modelPoints[i].y]);
}
this.runLine = new Polyline({
zlevel: this.zlevel,
// progressive: model.progressive,
z: Z + 2,
shape: {
points: points
},
style: {
lineWidth: style.Section.runLineShow.lineWidth,
stroke: style.Section.runLineShow.lineStroke
}
});
this.add(this.runLine);
this.runLine.hide();
}
if (style.Section.routeArrow && !isCurve) {
const cPointLeft = {x: 0, y:0};
const cPointRight = {x: 0, y:0};
@ -402,6 +424,21 @@ export default class ELines extends Group {
this.section && this.section.attr('z', lev);
}
setRunLineDefault() {
this.runLine && this.runLine.hide();
this.runLine && this.runLine.dirty();
}
runLineShow(type) {
if (type === 'runPath') {
this.runLine && this.runLine.setStyle({ stroke: this.model.style.Section.runLineShow.lineStroke });
} else if (type === 'path') {
this.runLine && this.runLine.setStyle({ stroke: this.model.style.Section.runLineShow.pathStroke });
}
this.runLine && this.runLine.show();
this.runLine && this.runLine.dirty();
}
hide() {
this.eachChild((child) => {
child.hide();
@ -535,6 +572,14 @@ export default class ELines extends Group {
}
}
addHover(style) {
this.__zr && this.__zr.addHover(this.section, style);
}
removeHover() {
this.__zr && this.__zr.removeHover(this.section);
}
recover() {
}

View File

@ -100,6 +100,7 @@ export default class Section extends Group {
}
this.line.setCrossSpeedUpperLimit('');
this.line.setCrossDefault();
// this.line.setRunLineDefault();
}
this.name && this.name.recover();
this.speedLimit && this.speedLimit.hide();
@ -150,6 +151,10 @@ export default class Section extends Group {
stroke: this.style.Section.line.communicationOccupiedColor,
fill:this.style.Section.line.communicationOccupiedColor
});
if (this.model.parentCode && this.model.type == '01') {
this.line.setCrossRouteLock();
}
}
/** 非通信车占用状态 03*/
@ -171,6 +176,10 @@ export default class Section extends Group {
if (this.name && this.style.Section.name.occupyColor) {
this.name.setStyle({ textFill: this.style.Section.name.occupyColor });
}
if (this.model.parentCode && this.model.type == '01') {
this.line.setCrossRouteLock();
}
}
/** ARB故障 */
invalid() {
@ -253,6 +262,13 @@ export default class Section extends Group {
}
}
showRunLine(type) {
this.line && this.line.runLineShow(type);
}
setRunLineDefault() {
this.line && this.line.setRunLineDefault();
}
/** 保护区段锁闭 09*/
protectiveLock(lockRight) {
if (this.line) {
@ -298,8 +314,8 @@ export default class Section extends Group {
/** 计轴预复位 */
preReset(blockade) {
if (this.style.Section.sectionMiddle && this.style.Section.sectionMiddle.preResetColor && !blockade) { // 南京二号线
this.sectionMiddle.setStyle({stroke: this.style.Section.sectionMiddle.preResetColor});
this.sectionMiddle.show();
this.sectionMiddle && this.sectionMiddle.setStyle({stroke: this.style.Section.sectionMiddle.preResetColor});
this.sectionMiddle && this.sectionMiddle.show();
}
}
// 延时解锁
@ -368,12 +384,14 @@ export default class Section extends Group {
// 只响应前端自定义类型的状态变化
if (model._free) {
// 先初始化为灰色
this.setAshShow()
this.setAshShow();
model.preGreen && this.line.setStyle({stroke: '#00FF00'});
model.preBlue && this.line.setStyle({stroke: '#4A76B7'});
} else {
this.handleSwitchSection(model, flag);
// 顺序代表优先级
/** 宁波三号线 运行线显示状态 (前端自定义状态)*/
// model.isRunLineShow && this.showRunLine();
/** 道岔保护区段锁闭 */
model.overlapLock && this.protectiveLock(model.lockRight);
/** 空闲锁闭或者叫进路锁闭 */
@ -475,15 +493,18 @@ export default class Section extends Group {
this.line.setOrignalCross(false);
}
}
drawBatchSelected(selected, type) {
if (this.selectedType === type) {
return;
}
if (selected && type) {
this.line && this.line.setStyle({ stroke: drawSectionStyle[type] });
} else {
this.line && this.line.setStyle({ stroke: this.style.Section.line.spareColor });
}
this.selectedType = type;
}

View File

@ -155,7 +155,10 @@ export default class Station extends Group {
if (!this.style.Station.StationControl.disPlayNone) {
if (this.style.Station.StationControl.special) {
if (model.visible && model.createControlMode) { // model.createControlMode 控制模式
this.createSpecialControlMode();
this.createControlModeAU();
this.createControlModeCC();
this.createControlModeCL();
this.createControlModeVA();
}
} else {
if (model.visible && model.createControlMode) { // model.createControlMode 控制模式
@ -170,14 +173,34 @@ export default class Station extends Group {
this.setState(model);
}
createSpecialControlMode() {
createControlModeAU() { // 西安二
const model = this.model;
this.stationControlText = new Text({
this.stationControlAU = new Text({
zlevel: this.zlevel,
z: this.z,
style: {
x: model.controlModePoint.x,
y: model.controlModePoint.y,
x: model.controlModePoint.x + this.style.Station.StationControl.text.offsetX*-1,
y: model.controlModePoint.y + this.style.Station.StationControl.text.offsetY,
fontWeight: this.style.Station.StationControl.text.fontWeight,
fontSize: this.style.Station.StationControl.text.fontSize,
fontFamily: this.style.fontFamily,
text: 'AU',
textFill: this.style.Station.StationControl.text.automaticRouteColor,
textAlign: this.style.Station.StationControl.text.textAlign,
textVerticalAlign: this.style.Station.StationControl.text.textVerticalAlign
}
});
this.add(this.stationControlAU);
}
createControlModeCC() { // 西安二
const model = this.model;
this.stationControlCC = new Text({
zlevel: this.zlevel,
z: this.z,
style: {
x: model.controlModePoint.x + this.style.Station.StationControl.text.offsetX*0,
y: model.controlModePoint.y + this.style.Station.StationControl.text.offsetY,
fontWeight: this.style.Station.StationControl.text.fontWeight,
fontSize: this.style.Station.StationControl.text.fontSize,
fontFamily: this.style.fontFamily,
@ -187,7 +210,47 @@ export default class Station extends Group {
textVerticalAlign: this.style.Station.StationControl.text.textVerticalAlign
}
});
this.add(this.stationControlText);
this.add(this.stationControlCC);
}
createControlModeCL() { // 西安二
const model = this.model;
this.stationControlCL = new Text({
zlevel: this.zlevel,
z: this.z,
style: {
x: model.controlModePoint.x + this.style.Station.StationControl.text.offsetX*1,
y: model.controlModePoint.y + this.style.Station.StationControl.text.offsetY,
fontWeight: this.style.Station.StationControl.text.fontWeight,
fontSize: this.style.Station.StationControl.text.fontSize,
fontFamily: this.style.fontFamily,
text: 'CL',
textFill: this.style.Station.StationControl.text.openCommunicationColor,
textAlign: this.style.Station.StationControl.text.textAlign,
textVerticalAlign: this.style.Station.StationControl.text.textVerticalAlign
}
});
this.add(this.stationControlCL);
}
createControlModeVA() { // 西安二
const model = this.model;
this.stationControlVA = new Text({
zlevel: this.zlevel,
z: this.z,
style: {
x: model.controlModePoint.x + this.style.Station.StationControl.text.offsetX*2,
y: model.controlModePoint.y + this.style.Station.StationControl.text.offsetY,
fontWeight: this.style.Station.StationControl.text.fontWeight,
fontSize: this.style.Station.StationControl.text.fontSize,
fontFamily: this.style.fontFamily,
text: 'VA',
textFill: this.style.Station.StationControl.text.testValidColor,
textAlign: this.style.Station.StationControl.text.textAlign,
textVerticalAlign: this.style.Station.StationControl.text.textVerticalAlign
}
});
this.add(this.stationControlVA);
}
createEmergencyControl() { // 紧急站控
@ -270,7 +333,7 @@ export default class Station extends Group {
_subType: 'button',
style: this.style,
zlevel: this.zlevel,
z: this.z,
z: this.z+1,
point: {
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.lamp.offset.x,
y: model.controlModePoint.y + this.style.Station.StationControl.lamp.offset.y
@ -298,7 +361,7 @@ export default class Station extends Group {
_subType: 'light',
style: this.style,
zlevel: this.zlevel,
z: this.z,
z: this.z+1,
point: {
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 9 / 2 + this.style.Station.StationControl.lamp.offset.x,
y: model.controlModePoint.y + this.style.Station.StationControl.lamp.offset.y
@ -326,7 +389,7 @@ export default class Station extends Group {
_subType: 'preReset',
style: this.style,
zlevel: this.zlevel,
z: this.z,
z: this.z+1,
point: {
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 + this.style.Station.StationControl.lamp.offset.x,
y: model.controlModePoint.y + this.style.Station.StationControl.lamp.offset.y
@ -418,7 +481,7 @@ export default class Station extends Group {
this.stationText.setColor('#1fdc1f');
}
this.stationControlText && this.stationControlText.setStyle({text:'CC', textFill:this.style.Station.StationControl.text.centerControlColor});
this.stationControlCC && this.stationControlCC.setStyle({text:'CC', textFill:this.style.Station.StationControl.text.centerControlColor});
//
//
// if (this.style.Station.StationControl.disPlayNone) {
@ -436,7 +499,7 @@ export default class Station extends Group {
this.substationControl && this.substationControl.setTextColor(this.style.Station.StationControl.lamp.yellowColor); // 文字颜色
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.substationArrowsControl && this.substationArrowsControl.setColor(this.style.Station.StationControl.lamp.greenColor);
this.stationControlText && this.stationControlText.setStyle({text:'LC', textFill:this.style.Station.StationControl.text.stationControlColor});
this.stationControlCC && this.stationControlCC.setStyle({text:'LC', textFill:this.style.Station.StationControl.text.stationControlColor});
// if (this.style.Station.StationControl.disPlayNone) {
// this.stationText && this.stationText.setStyle('textFill', '#fff');
// if (this.model.subheadDisplay) { // 副标题
@ -454,7 +517,7 @@ export default class Station extends Group {
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.emergencyArrowsControl && this.emergencyArrowsControl.setColor(this.style.Station.StationControl.lamp.greenColor);
this.stationControlText && this.stationControlText.setStyle({text:'EL', textFill:this.style.Station.StationControl.text.emergencyControlColor});
this.stationControlCC && this.stationControlCC.setStyle({text:'EL', textFill:this.style.Station.StationControl.text.emergencyControlColor});
// if (this.style.Station.StationControl.disPlayNone) {
// this.stationText && this.stationText.setStyle('textFill', '#fff');
// if (this.model.subheadDisplay) { // 副标题
@ -640,13 +703,19 @@ export default class Station extends Group {
case 'interconnected':
rect = this.interconnectedControl.getArcBoundingRect();
break;
case 'light':
rect = this.controlLight.getBoundingRect();
break;
case 'preReset':
rect = this.controlPreReset.getBoundingRect();
break;
default:
rect = this.stationText.getBoundingRect();
break;
}
return {
x: rect.x + rect.width,
x: rect.x + rect.width/2,
y: rect.y
};
}

View File

@ -534,4 +534,11 @@ export default class TrainBody extends Group {
this.textTrainGroup.dirty();
}
}
trainBodyFault() {
this.trainBodyBox && this.trainBodyBox.trainBodyFault();
}
untrainBodyFault() {
this.trainBodyBox && this.trainBodyBox.untrainBodyFault();
}
}

View File

@ -57,4 +57,23 @@ export default class TrainBodyBox extends Group {
this.trainBodyBox.stopAnimation(false);
}
}
// 西安二号线 列车停车状态 闪烁红色
trainBodyFault() {
if (this.trainBodyBox) {
this.trainBodyBox.setStyle('fill', this.model.style.Train.trainBody.trainBodyFaultFlashColor);
this.trainBodyBox.animateStyle(true)
.when(0, { opacity: 1 })
.when(1000, { opacity: 0 })
.when(2000, { opacity: 1 })
.start();
}
}
// 西安二号线 列车取消停车状态
untrainBodyFault() {
if (this.trainBodyBox) {
this.trainBodyBox.setStyle('fill', this.model.style.Train.trainBody.trainBodyFillColor);
this.trainBodyBox.stopAnimation(false);
}
}
}

View File

@ -374,6 +374,10 @@ export default class Train extends Group {
if (path.includes('/practiceDisplay')) {
this.handlePassagerColor(model.num);
}
if (style.Train.trainBody.trainBodyFaultFlashColor) {
// 西安二号线 列车停车状态 闪烁红色
this.updateTrainBodyFault(model.orderStop);
}
}
}
setTrainTypeColor(type) {
@ -386,6 +390,20 @@ export default class Train extends Group {
this.trainB && this.trainB.removeTrainDetail();
}
updateTrainBodyFault(orderStop) {
if (orderStop) {
// 西安二号线 列车停车状态 闪烁红色
if (this.trainB) {
this.trainB.trainBodyFault();
}
} else {
// 西安二号线 列车取消停车状态
if (this.trainB) {
this.trainB.untrainBodyFault();
}
}
}
handlePassagerColor(num) {
if (num) {
// && num > 0

View File

@ -200,7 +200,7 @@ export default {
{
maxDuration: 15,
minDuration: 8,
operateType: CMD.Signal.CMD_SIGNAL_CLOSE_GUIDE.value,
operateType: CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE.value,
skinCode: '04',
trainingName: '取消引导({3})',
trainingRemark: '取消引导进路功能(总取消)',

View File

@ -276,6 +276,7 @@ export default {
commitOperate(operate, {}, 2).then(({valid})=>{
this.loading = false;
if (valid) {
this.$emit('close');
this.doClose();
}
}).catch(() => {

View File

@ -36,10 +36,10 @@
<el-button :id="domIdCancel" @click="cancel">{{ $t('menu.cancel') }}</el-button>
</el-col>
</el-row>
<confirm-control ref="confirmControl" :pop-class="popClass" />
<confirm-control ref="confirmControl" :pop-class="popClass" @close="doClose" />
<ning-bo-confirm-tip ref="ningBoConfirmTip" @close="doClose" />
<password-box ref="password" :pop-class="popClass" @checkOver="passWordCommit" />
<notice-info ref="noticeInfo" :pop-class="popClass" />
<ning-bo-confirm-tip ref="ningBoConfirmTip" @close="doClose" />
</el-dialog>
</template>

View File

@ -330,7 +330,7 @@ export default {
this.$refs.noticeInfo.doShow();
});
} else {
commitOperate(menuOperate.Signal.humanControl, {routeCodeList:this.selection}, 2, val).then(({valid})=>{
commitOperate(menuOperate.Signal.humanControl, {routeCodeList:this.selection}, 2, { val }).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
@ -365,7 +365,7 @@ export default {
this.$refs.noticeInfo.doShow();
});
} else {
commitOperate(menuOperate.Signal.atsAutoControl, {routeCodeList:this.selection}, 2, val).then(({valid})=>{
commitOperate(menuOperate.Signal.atsAutoControl, {routeCodeList:this.selection}, 2, {val}).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();

View File

@ -1,29 +1,37 @@
<template>
<li :id="getDomId(item)" :class="item.type === 'separator'?'menu-separator':className?className:'nav-li'" @click.stop="hookClick(item)">
<span v-if="item.type !== 'separator'" :class="className?'label':'nav-li-text'">
<span v-if="item.type !== 'separator'" :class="className?isNextBtn?'triPad label':'label':'nav-li-text'">
{{ item.computedTitle?item.computedTitle(item): item.title }}
</span>
<!-- item.title -->
<ul v-if="item.children&&!className" class="nav-ul" :class="{'active' :id==classA}">
<span v-if="isNextBtn&&item.children" class="triangle" />
<ul v-if="item.children&&!className" class="nav-ul" :class="{'active' :id==index}">
<each-child-menu
v-for="(gridChild,j) in item.children"
:id="id+':'+j"
:id="j"
:key="j"
:index="active"
ref="eachChildMenu"
:item="gridChild"
class-name="menu-li-block"
:is-next-btn="isNextBtn"
@active="doActive"
@close="doClose"
/>
</ul>
<div v-if="item.children&&className" class="menu-ul-block-out">
<div class="menu-ul-block">
<ul class="menu-ul" :class="{'active' :id==classA}">
<ul class="menu-ul" :class="{'active' :id==index}">
<each-child-menu
v-for="(gridChild,j) in item.children"
:id="id+':'+j"
:id="j"
:key="j"
:index="active"
ref="eachChildMenu"
:item="gridChild"
class-name="menu-li-block"
:is-next-btn="isNextBtn"
@active="doActive"
@close="doClose"
/>
</ul>
</div>
@ -43,7 +51,13 @@ export default {
}
},
id:{
type:String,
type: Number,
default() {
return -1;
}
},
index: {
type: Number,
default() {
return -1;
}
@ -53,12 +67,17 @@ export default {
default() {
return '';
}
},
isNextBtn:{
type: Boolean,
default() {
return false;
}
}
},
data() {
return {
classA:'-1',
tempClassA: -1
active: -1
};
},
computed: {
@ -70,6 +89,13 @@ export default {
'mode'
])
},
watch: {
index(val) {
if (val == -1) {
this.active = -1;
}
}
},
methods:{
getDomId(item) {
if (item && item.operate) {
@ -79,43 +105,44 @@ export default {
},
hookClick(item, event) {
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
const idArray = this.id.split(':');
if (idArray.length <= 1) { this.$store.dispatch('menuOperation/changeMenuBar', ''); }
if (item && typeof item.click == 'function') {
if (item.children && item.children.length > 0) {
this.selectedClassA(item, this.id);
this.selectedClass(item, this.id);
} else {
item.click(item.operate);
this.doClose(-1);
this.$store.dispatch('menuOperation/changeMenuBar', '');
}
}
},
setClassA(index) {
this.classA = index;
},
selectedClassA(item, index) {
selectedClass(item, index) {
const order = this.order || 0;
if (this.mode !== TrainingMode.TEACH) { //
this.popupMenuA(item, index);
this.popupMenu(item, index);
} else if (this.steps[order] && this.steps[order].type == 'bar') { //
this.popupMenuA(item, index);
this.popupMenu(item, index);
}
},
//
popupMenuA(item, index) {
// this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
// this.clickEvent();
popupMenu(item, index) {
const operate = {
type: 'bar',
operation: item.operate.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.classA = index;
this.$emit('active', index);
this.$store.dispatch('menuOperation/changeMenuBar', index);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
doActive(index) {
this.active = index;
},
doClose() {
this.active = -1;
this.$emit('close');
}
}
};
@ -236,9 +263,23 @@ export default {
display: flex;
flex-direction: column;
padding:0;
max-height: 200px;
// max-height: 200px;
overflow: auto;
position: fixed;
border-left: 1px #CACACA solid;
}
.menu-li-block .triangle{
display: block;
width: 0;
height: 0;
border-top: 5px solid transparent;
border-left: 8px solid #49413e;
border-bottom: 5px solid transparent;
right: 10px;
position: absolute;
top: 10px;
}
.menu-li-block .label.triPad{
padding-right:35px;
}
</style>

View File

@ -1,13 +1,16 @@
<template>
<div id="menuBar">
<div id="menuBar" :style="{'z-index': zIndex}">
<div class="nav">
<each-child-menu v-for="(item,i) in menu" :id="''+i" :key="i" ref="eachChildMenu" :item="item" />
<each-child-menu v-for="(item,i) in menu" :id="i" :key="i" ref="eachChildMenu" :item="item" :is-next-btn="isNextBtn"
:index="index"
@active="doActie"
@close="doClose"
/>
</div>
</div>
</template>
<script>
import { TrainingMode } from '@/scripts/ConstDic';
// import { EventBus } from '@/scripts/event-bus';
import { State2SimulationMap } from '@/scripts/cmdPlugin/Config';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import EachChildMenu from './eachChildMenu';
@ -18,35 +21,33 @@ export default {
EachChildMenu
},
props: {
zIndex: {
type: Number,
default: 11
},
menuNormal:{
type: Object,
default() {
return null;
}
},
isNextBtn:{
type: Boolean,
default() {
return false;
}
}
},
data() {
return {
index: -1,
menu: []
};
},
watch: {
'$store.state.menuOperation.menuBarIndex': function (newval, oldval) {
if ((oldval !== '' && oldval !== null) && (newval === '' || newval === null)) {
const indexArray = oldval.split(':');
let current = this;
indexArray.forEach(element => {
current = current.$refs.eachChildMenu[element];
current.setClassA(-1);
});
}
},
'$store.state.training.operatemode': function (mode) {
this.initMenu();
},
'$store.state.training.started': function (val) {
this.closeMenu(true);
},
'$store.state.training.prdType': function () {
this.initMenu();
}
@ -64,17 +65,16 @@ export default {
initMenu(menu) {
const type = State2SimulationMap[this.$store.state.training.prdType];
this.menu = MenuContextHandler.menuBarConvert(this.menuNormal[type], this.$store.state.training.operatemode);
// this.clickEvent();
this.closeMenu(true);
this.clickEvent();
},
clickEvent() {
const self = this;
window.onclick = function (e) {
if (document.getElementById('menuBar')&&!self.$store.state.training.trainingStart) {
self.doClose(false);
}
};
},
// clickEvent() {
// const self = this;
// window.onclick = function (e) {
// if (document.getElementById('menuBar')) {
// self.closeMenu(false);
// }
// };
// },
noShowingChildren(children) {
if (!children || children.length <= 0) {
return true;
@ -87,15 +87,14 @@ export default {
}
return false;
},
closeMenu(flag) {
if (flag || (this.mode !== TrainingMode.EDIT && this.mode !== TrainingMode.TEACH)) {
this.$store.dispatch('menuOperation/changeMenuBar', '');
}
doActie(index) {
this.index = index;
},
doClose() {
// this.$nextTick(() => {
// EventBus.$emit('closeMenu');
// });
this.index = -1;
},
closeMenu() {
//
}
}
};
@ -109,7 +108,6 @@ export default {
$menuItemPadding: 5px;
#menuBar {
z-index: 36;
position: absolute;
width: inherit;
height: $height;

View File

@ -479,18 +479,19 @@ export const menuOperate = {
* @param {*} over 0为首次操作1为中间操作2为最后操作3为直接一次性操作
* @param {*} val 教学模式val 校验模式判断
*/
export function commitOperate(operate, paramList, over, val) {
export function commitOperate(operate, paramList, over, fillStep={}) {
const step = {
start: true,
operation: operate.operation,
param:{}
};
if (val) { step.val = val; }
step.param = paramList;
if (over == 0 || over == 3) {
const codeList = Object.values(paramList);
step.code = codeList[0];
}
if (over != 0 && over != 3) {
delete step.start;
}
@ -503,6 +504,7 @@ export function commitOperate(operate, paramList, over, val) {
step.code = codeList[0];
}
Object.assign(step, fillStep)
return new Promise(function(resolve, reject) {
store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {

View File

@ -252,7 +252,7 @@ export default {
//
humanControl() {
this.loading = true;
commitOperate(menuOperate.Signal.humanControl, {routeCodeList:this.selection}, 2, `${this.selection[0]}`).then(({valid})=>{
commitOperate(menuOperate.Signal.humanControl, {routeCodeList:this.selection}, 2, {val: `${this.selection[0]}`}).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
@ -266,7 +266,7 @@ export default {
//
atsAutoControl() {
this.loading = true;
commitOperate(menuOperate.Signal.atsAutoControl, {routeCodeList:this.selection}, 2, `${this.selection[0]}`).then(({valid})=>{
commitOperate(menuOperate.Signal.atsAutoControl, {routeCodeList:this.selection}, 2, {val: `${this.selection[0]}`}).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();

View File

@ -222,7 +222,7 @@ export default {
commit() {
if (this.row && this.row.canSetting) {
this.loading = true;
commitOperate(menuOperate.Signal.arrangementRoute, {routeCode: this.row.code}, 1, `${this.row.code}`).then(({valid, operate})=>{
commitOperate(menuOperate.Signal.arrangementRoute, {routeCode: this.row.code}, 1, {val: `${this.row.code}`}).then(({valid, operate})=>{
this.loading = false;
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });

View File

@ -144,7 +144,7 @@ export default {
},
sendCommand(operate, val) { //
this.loading = true;
commitOperate(operate, {}, 2, val).then(({valid})=>{
commitOperate(operate, {}, 2, { val }).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();

View File

@ -121,13 +121,3 @@ export default {
}
};
</script>
<style scoped>
.fuzhou-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -186,8 +186,6 @@ export default {
</script>
<style scoped>
.fuzhou-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;

View File

@ -191,8 +191,6 @@ export default {
</script>
<style scoped>
.fuzhou-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;

View File

@ -314,10 +314,8 @@ export default {
}
.fuzhou-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
background: rgb(240 240 240);
position: relative;
left: -15px;
top: -18px;
}
.fuzhou-01__systerm .el-dialog .el-form-item label {

View File

@ -155,13 +155,3 @@ export default {
}
};
</script>
<style scoped>
.fuzhou-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -10px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -126,13 +126,3 @@ export default {
}
};
</script>
<style scoped>
.fuzhou-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -10px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -172,13 +172,3 @@ export default {
}
};
</script>
<style scoped>
.fuzhou-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -10px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -125,8 +125,6 @@ export default {
</script>
<style scoped>
.fuzhou-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -10px;
padding: 0 5px;

View File

@ -294,10 +294,8 @@ export default {
</script>
<style scoped>
.fuzhou-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -10px;
left: 0px;
top: -20px;
padding: 0 5px;
background-color: #F0F0F0;
}

View File

@ -13,7 +13,7 @@
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules">
<div style="padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px;">
<span class="base-label">{{ $t('menu.menuDialog.addLocation') }}</span>
<div style="position: relative; top:-10px;">
<div style="position: relative; top:-25px;">
<el-form-item prop="stationStandCode">
<span slot="label">{{ $t('menu.menuDialog.terminalOne') }}</span>
<el-select v-model="addModel.stationStandCode" filterable :placeholder="$t('menu.menuDialog.pleaseSelect')">
@ -158,10 +158,8 @@ export default {
</script>
<style scoped>
.fuzhou-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
top: -25px;
padding: 0 5px;
background-color: #F0F0F0;
}

View File

@ -138,13 +138,3 @@ export default {
}
};
</script>
<style scoped>
.fuzhou-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -16,7 +16,7 @@
</el-form-item>
<div style="padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px;">
<span class="base-label">{{ $t('menu.menuDialog.purpose') }}</span>
<div style="position: relative; top:-10px;">
<div style="position: relative; top:-25px;">
<el-form-item prop="stationStandCode">
<span slot="label">{{ $t('menu.menuDialog.terminalTwo') }}</span>
<el-select v-model="addModel.stationStandCode" filterable :placeholder="$t('menu.menuDialog.pleaseSelect')">
@ -155,3 +155,11 @@ export default {
}
};
</script>
<style scoped>
.fuzhou-01__systerm .el-dialog .base-label {
left: -5px;
top: -25px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -205,4 +205,11 @@ export default {
.elrow{
margin-top:4px;
}
.fuzhou-01__systerm .el-dialog .base-label {
left: -10px;
top: -24px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -821,12 +821,12 @@ export default {
minDuration: 8,
operateType: 'Signal_Open_Auto_Setting',
skinCode: '02',
trainingName: '自排开({3})',
trainingRemark: '自排开',
trainingName: '进路交ATS自动控({3})',
trainingRemark: '进路交ATS自动控',
trainingType: 'Signal',
productTypes: ['02'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '315', tip: '鼠标右键菜单选择【自排开】' },
{ deviceType: '04', orderNum: 1, operateCode: '315', tip: '鼠标右键菜单选择【进路交ATS自动控】' },
{ deviceType: '04', orderNum: 2, operateCode: '3151', tip: '鼠标左键选择控制状态为"人工"的进路', val: '{4}' },
{ deviceType: '04', orderNum: 3, operateCode: '315', tip: '鼠标左键点击【确定】按钮', val: '{4}' }
]
@ -836,12 +836,12 @@ export default {
minDuration: 8,
operateType: 'Signal_Close_Auto_Setting',
skinCode: '02',
trainingName: '自排关({3})',
trainingRemark: '自排关',
trainingName: '进路交人工控({3})',
trainingRemark: '进路交人工控',
trainingType: 'Signal',
productTypes: ['02'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '314', tip: '鼠标右键菜单选择【自排关】' },
{ deviceType: '04', orderNum: 1, operateCode: '314', tip: '鼠标右键菜单选择【进路交人工控】' },
{ deviceType: '04', orderNum: 2, operateCode: '3141', tip: '鼠标左键选择进路({3})', val: '{4}' },
{ deviceType: '04', orderNum: 3, operateCode: '314', tip: '鼠标左键点击【确定】按钮', val: '{4}' }
]

View File

@ -384,7 +384,11 @@ export default {
if (valid) { this.handleDeviceMenu(); }
}).catch((error) => {
console.error(error);
if (error && error.code == '10017') {
EventBus.$emit('sendMsg', {message: error.message});
} else {
EventBus.$emit('sendMsg', {message: '命令执行失败!'});
}
});
if (val._type != 'Psd' && val._type != 'StationStand') {
this.dialogVisible = !this.isLocal;
@ -404,7 +408,11 @@ export default {
}
}).catch((error) => {
console.error(error);
if (error && error.code == '10017') {
EventBus.$emit('sendMsg', {message: error.message});
} else {
EventBus.$emit('sendMsg', {message: '命令执行失败!'});
}
});
}
@ -539,7 +547,7 @@ export default {
},
getStationControl(selected = {}) {
let control = null;
let model = this.$store.getters['map/getDeviceByCode'](selected.code)||{};
const model = this.$store.getters['map/getDeviceByCode'](selected.code) || {};
if (model._type == 'StationStand') {
control = this.$store.getters['map/getDeviceStationCodeByStationCode'](model.deviceStationCode);
} else if (model._type == 'Station') {
@ -552,7 +560,7 @@ export default {
control = this.$store.getters['map/getDeviceByCode'](el.code);
return;
}
})
});
}
} else if (model._type == 'Train') { //
control = model;
@ -741,7 +749,7 @@ export default {
let tip = '';
if (this.cmdType === CMD.Section.CMD_SECTION_SET_LIMIT_SPEED) {
tip = '轨道区段限速设定';
} else if (this.cmdType === CMD.SECTION.CMD_SWITCH_SET_LIMIT_SPEED) {
} else if (this.cmdType === CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED) {
tip = '道岔区段限速设定';
}
this.menuCmdList = new Array(15).fill({ name: '' });
@ -799,7 +807,11 @@ export default {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch((error) => {
if (error && error.code == '10017') {
EventBus.$emit('sendMsg', {message: error.message});
} else {
EventBus.$emit('sendMsg', {message: '命令执行失败!'});
}
});
}
},
@ -830,7 +842,11 @@ export default {
}).catch((error) => {
this.doClose();
this.handleClose();
if (error && error.code == '10017') {
EventBus.$emit('sendMsg', {message: error.message});
} else {
EventBus.$emit('sendMsg', {message: `${this.commandInfo.name}失败`});
}
});
},
clickCr1Confirm() {
@ -848,7 +864,11 @@ export default {
}, 10000);
}
}).catch((error) => {
if (error && error.code == '10017') {
EventBus.$emit('sendMsg', {message: error.message});
} else {
EventBus.$emit('sendMsg', {message: '命令执行失败!'});
}
this.doClose();
});
},
@ -871,7 +891,11 @@ export default {
this.doClose();
this.handleDeviceMenu();
this.handleClose();
if (error && error.code == '10017') {
EventBus.$emit('sendMsg', {message: error.message});
} else {
EventBus.$emit('sendMsg', {message: `${this.commandInfo.name}失败`});
}
});
},
handleRightClickClose() {
@ -964,7 +988,11 @@ export default {
}
}).catch((error) => {
console.error(error);
if (error && error.code == '10017') {
EventBus.$emit('sendMsg', {message: error.message});
} else {
EventBus.$emit('sendMsg', {message: '命令执行失败!'});
}
});
} else {
EventBus.$emit('sendMsg', {message: '请输入正确的车次号'});
@ -983,7 +1011,11 @@ export default {
}).catch((error) => {
console.error(error);
this.handleStationClose();
if (error && error.code == '10017') {
EventBus.$emit('sendMsg', {message: error.message});
} else {
EventBus.$emit('sendMsg', {message: '命令执行失败!'});
}
});
},
stationCommand(row) {
@ -1001,7 +1033,11 @@ export default {
}
}).catch((error) => {
console.error(error);
if (error && error.code == '10017') {
EventBus.$emit('sendMsg', {message: error.message});
} else {
EventBus.$emit('sendMsg', {message: '命令执行失败!'});
}
});
},
stationDetainTrain() {

View File

@ -26,7 +26,7 @@
</el-select>
</el-col>
<el-col :span="8">
<el-button :disabled="confirmIndex" @click="confirm1">确认</el-button>
<el-button :disabled="confirmIndex" :id="configmId1" @click="confirm1">确认</el-button>
</el-col>
</el-row>
</div>
@ -35,7 +35,7 @@
<div>按钮</div>
<el-row>
<el-col :span="16">
<el-select v-model="value2" size="mini">
<el-select :id="selectedId" v-model="value2" size="mini" @change="onChange">
<el-option
v-for="item in options"
:key="item.value"
@ -45,7 +45,7 @@
</el-select>
</el-col>
<el-col :span="8">
<el-button :disabled="!confirmIndex" @click="confirm2">确认</el-button>
<el-button :disabled="!confirmIndex" :id="confirmId2" @click="confirm2">确认</el-button>
</el-col>
</el-row>
</div>
@ -92,8 +92,14 @@ export default {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
confirmId() {
return this.operation.domId;
configmId1() {
return OperationEvent.Command.common.confirm1.domId;
},
confirmId2() {
return OperationEvent.Command.common.confirm2.domId;
},
selectedId(){
return OperationEvent.Command.common.select.domId;
}
},
mounted() {
@ -105,6 +111,7 @@ export default {
this.dialogShow = true;
this.confirmIndex = false;
this.operation = operate.operation;
this.value = '';
if (this.operation === OperationEvent.StationLight.SetOrCancelForceLight.confirm1.operation) {
this.value1 = '5';
}
@ -113,8 +120,16 @@ export default {
this.dialogShow = false;
if (this.timer) { clearInterval(this.timer); }
},
onChange(val) {
commitOperate({operation: OperationEvent.Command.common.select.operation}, {}, 1, {val}).then(({valid, operate})=>{
if (valid) {
}
});
},
confirm1() {
this.status = '发送First request消息成功请等待服务器';
commitOperate({operation: OperationEvent.Command.common.confirm1.operation}, {}, 1).then(({valid, operate})=>{
if (valid) {
setTimeout(() => {
this.confirmIndex = true;
this.time = 30;
@ -124,14 +139,18 @@ export default {
if (this.time < 0) { this.doClose(); }
}, 1000);
}, 1000);
}
});
},
confirm2() {
if (this.value1 !== this.value2) {
this.status = '确认操作失败!';
return;
}
if (this.operation === OperationEvent.StationLight.SetOrCancelForceLight.confirm1.operation) {
commitOperate({operate: this.operation, cmdType: CMD.Station.CMD_STATION_SET_OR_CANCEL_FORCE_PHYSICAL_SIGNAL}, {}, 2).then(({valid, operate})=>{
commitOperate({operation: OperationEvent.Command.common.confirm2.operation,
cmdType: CMD.Station.CMD_STATION_SET_OR_CANCEL_FORCE_PHYSICAL_SIGNAL}, {}, 2).then(({valid, operate})=>{
if (valid) {
this.status = '发送 Second Confirm消息成功请等待服务器';
setTimeout(() => {

View File

@ -73,8 +73,10 @@ export default {
const title = this.$store.state.map.mapName;
const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.map.showCentralizedStationCode);
if (station) {
this.title = title + '-' + station.name;
}
this.$nextTick(function () {
setTimeout(e => {
this.$store.dispatch('training/emitTipFresh');

View File

@ -9,57 +9,57 @@
</template>
<script>
import Vue from "vue";
import Jlmap from "@/jmapNew/map";
import { parser } from "@/jmapNew/utils/parser";
import { deepAssign } from "@/utils/index";
import deviceType from "@/jmapNew/constant/deviceType";
import Vue from 'vue';
import Jlmap from '@/jmapNew/map';
import { parser } from '@/jmapNew/utils/parser';
import { deepAssign } from '@/utils/index';
import deviceType from '@/jmapNew/constant/deviceType';
export default {
name: "JLocalmapVisual",
name: 'JLocalmapVisual',
props: {
width: {
type: Number,
default: 0,
default: 0
},
height: {
type: Number,
default: 0,
default: 0
},
mapData: {
type: Object,
defautl() {
return {};
},
},
}
}
},
data() {
return {
loading: true,
offset: {
x: 0,
y: 0,
y: 0
},
map: null,
mapDevice: {},
routeData: [],
autoReentryData: [],
autoReentryData: []
};
},
computed: {
canvasId() {
return ["map", Math.random().toFixed(5) * 100000].join("_");
},
},
watch: {
"$store.state.config.canvasSizeCount": function (val) {
this.resetSize();
},
"$store.state.training.prdType": function (val) {
if (val) {
this.changePrdType(val);
return ['map', Math.random().toFixed(5) * 100000].join('_');
}
},
watch: {
'$store.state.config.canvasSizeCount': function (val) {
this.resetSize();
}
// '$store.state.training.prdType': function (val) {
// if (val) {
// this.changePrdType(val);
// }
// }
},
mounted() {
this.init();
@ -78,33 +78,33 @@ export default {
const prdType = this.$store.state.training.prdType;
let showMode = "";
if (prdType == "01") {
showMode = "03";
} else if (prdType == "02") {
showMode = "02";
let showMode = '';
if (prdType == '01') {
showMode = '03';
} else if (prdType == '02') {
showMode = '02';
}
if (!this.map) {
this.map = new Jlmap({
dom: document.getElementById(this.canvasId),
config: {
renderer: "canvas",
renderer: 'canvas',
width: this.width,
height: this.height,
height: this.height
},
options: {
scaleRate: 1,
offsetX: 0,
offsetY: 0,
zoomOnMouseWheel: false,
zoomOnMouseWheel: false
},
showConfig: {
prdType: prdType,
previewOrMapDraw: true,
showMode: showMode,
showMode: showMode
},
methods: {},
methods: {}
});
}
@ -120,7 +120,7 @@ export default {
try {
this.setMap(this.mapData, this.mapDevice);
} catch (error) {
console.log("[ERROR] ", error);
console.log('[ERROR] ', error);
}
},
//
@ -130,7 +130,7 @@ export default {
this.autoReentryData = this.$store.state.map.autoReentryData;
this.map.setMap(data, mapDevice, {
routeData: this.routeData,
autoReentryData: this.autoReentryData,
autoReentryData: this.autoReentryData
});
this.setMapFree();
} else {
@ -179,25 +179,25 @@ export default {
return this.mapDevice[code];
},
//
changePrdType(val) {
const nameList = Object.keys(this.$store.state.map.map || {});
let list = [];
let showMode = "";
nameList.forEach((item) => {
if (item !== "skinVO") {
const data = this.$store.state.map.map[item];
if (data && data.constructor === Array) {
list = [...list, ...data];
}
}
});
if (val === "01") {
showMode = "03";
} else if (val === "02") {
showMode = "02";
}
this.map.updatePrdType(list, showMode, val);
},
// changePrdType(val) {
// const nameList = Object.keys(this.$store.state.map.map || {});
// let list = [];
// let showMode = '';
// nameList.forEach((item) => {
// if (item !== 'skinVO') {
// const data = this.$store.state.map.map[item];
// if (data && data.constructor === Array) {
// list = [...list, ...data];
// }
// }
// });
// if (val === '01') {
// showMode = '03';
// } else if (val === '02') {
// showMode = '02';
// }
// this.map.updatePrdType(list, showMode, val);
// },
setShowStation(stationCode, setCenter) {
const nameList = Object.keys(this.$store.state.map.map);
let list = [];
@ -206,7 +206,7 @@ export default {
this.$store.state.map.map[item] &&
this.$store.state.map.map[item].constructor === Array
) {
if (item === "trainList") {
if (item === 'trainList') {
this.$store.state.map.map[item].forEach((elem) => {
elem && list.push(elem);
});
@ -217,8 +217,8 @@ export default {
});
this.map.updateShowStation(list, stationCode);
!setCenter && this.setCenter(stationCode);
},
},
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -67,7 +67,7 @@ export default {
if ( this.password !== 'root' ) {
this.messageShow = true;
} else {
commitOperate({operation: OperationEvent.Command.close.password.operation}, {}, 1, this.password).then(({valid, operate}) => {
commitOperate({operation: OperationEvent.Command.close.password.operation}, {}, 1, {val: this.password}).then(({valid, operate}) => {
if (valid && this.operation === OperationEvent.StationLight.SetOrCancelForceLight.password.operation) {
this.show = false;
this.$emit('confirm');

View File

@ -4,7 +4,7 @@
<menu-axle-reset ref="menuAxleReset" :selected="selected" />
<menu-auto-trun-route ref="menuAutoTrunRoute" :selected="selected" />
<menu-station-stand ref="menuStationStand" :selected="selected" />
<menu-station-control ref="menuStationControl" />
<menu-station-control ref="menuStationControl" :selected="selected" />
<menu-station-turn-back ref="menuStationTurnBack" :selected="selected" />
<menu-switch ref="menuSwitch" :selected="selected" />
<menu-signal ref="menuSignal" :selected="selected" />
@ -15,7 +15,7 @@
<menu-station-light ref="menuStationLight" :selected="selected" />
<menu-station-pre-reset ref="menuStationPreReset" :selected="selected" />
<!--<passive-alarm ref="passiveAlarm" />-->
<passive-contorl ref="passiveControl" pop-class="ningbo-01__systerm" />
<passive-contorl ref="passiveControl" pop-class="ningbo-01__systerm" :selected="selected" />
<!--<passive-Timeout ref="passiveTimeout" />-->
</div>
</template>

View File

@ -50,7 +50,7 @@
<el-button style="width: 125px;margin-top: 10px;" :disabled="true" @click="distributionAll">全部强制分配</el-button>
<el-button style="width: 125px;margin-top: 10px;" :disabled="true" @click="cancelDistributionAll">取消全部强制分配</el-button>
<el-button style="width: 125px;margin-top: 10px;" @click="commit">应用</el-button>
<el-button style="width: 125px;margin-top: 10px;">退出</el-button>
<el-button style="width: 125px;margin-top: 10px;" @click="doClose">退出</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />

View File

@ -93,7 +93,7 @@ export default {
},
//
cancelSpeed() {
commitOperate(menuOperate.LimitControl.cancelSpeed, {}, 0).then(({valid, operate})=>{
commitOperate(menuOperate.LimitControl.cancelSpeed, {}, 0, {code: this.selected.code}).then(({valid, operate})=>{
if (valid) {
this.$refs.cancelAllLimit.doShow(operate, this.selected);
}

View File

@ -20,14 +20,14 @@ export default {
PopMenu,
StationControl
},
// props: {
// selected: {
// type: Object,
// default() {
// return null;
// }
// }
// },
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
menu: [],
@ -103,7 +103,6 @@ export default {
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
this.getCurrentStateObject();
},
doShow(point) {
this.clickEvent();
@ -117,9 +116,6 @@ export default {
this.$refs.popMenu.close();
}
},
getCurrentStateObject() {
this.selected = this.$store.getters['menuOperation/selected'];
},
setCenterControl() {
//
commitOperate(menuOperate.StationControl.requestCentralControl, {stationCode:this.selected.code}, 0).then(({valid, operate})=>{

View File

@ -27,6 +27,14 @@ export default {
OperateConfirm,
ButtonConfirm
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
menu: [],
@ -81,7 +89,6 @@ export default {
if (this.$store.state.training.mode === TrainingMode.NORMAL) {
const memberData = this.$store.state.training.memberData;
const userId = this.$store.state.user.id;
this.getCurrentStateObject();
if (!this.selected.controller || !memberData[this.selected.controller] || memberData[this.selected.controller].userId != userId) {
this.menu.forEach(item => {
item.disabled = true;
@ -105,12 +112,9 @@ export default {
this.$refs.popMenu.close();
}
},
getCurrentStateObject() {
this.selected = this.$store.getters['menuOperation/selected'];
},
setOrCancelForceLight() {
//
commitOperate(menuOperate.StationLight.setOrCancelForceLight, {stationCode:this.selected.code}, 0).then(({valid, operate})=>{
commitOperate(menuOperate.StationLight.setOrCancelForceLight.operation, {stationCode:this.selected.code}, 0, {code: this.selected.code, subType: 'light'}).then(({valid, operate})=>{
if (valid) {
const nextOperate = {
operation: OperationEvent.StationLight.SetOrCancelForceLight.password.operation

View File

@ -20,6 +20,14 @@ export default {
components: {
PopMenu,
ButtonDown
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
@ -82,7 +90,6 @@ export default {
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
this.getCurrentStateObject();
if (this.$store.state.training.mode === TrainingMode.NORMAL) {
const memberData = this.$store.state.training.memberData;
const userId = this.$store.state.user.id;
@ -109,9 +116,6 @@ export default {
this.$refs.popMenu.close();
}
},
getCurrentStateObject() {
this.selected = this.$store.getters['menuOperation/selected'];
},
setPreReset() {
//
commitOperate(menuOperate.Station.setPreReset, {stationCode:this.selected.code}, 0).then(({valid, operate})=>{
@ -125,7 +129,7 @@ export default {
},
cancelPreReset() {
//
commitOperate(menuOperate.Station.cancelPreReset, {stationCode:this.selected.code}, 0).then(({valid, operate})=>{
commitOperate(menuOperate.Station.cancelPreReset.operation, {stationCode:this.selected.code}, 0, {code: this.selected.code, subType: 'light'}).then(({valid, operate})=>{
if (valid) {
const nextOperate = {
operation: OperationEvent.Station.cancelPreReset.confirm.operation

View File

@ -722,7 +722,7 @@ export default {
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '308', tip: '鼠标右键菜单选择【引导】' },
{ deviceType: '04', orderNum: 2, operateCode: '0011', tip: '请输入密码"root",点击【确认】按钮', val: 'root' },
{ deviceType: '04', orderNum: 3, operateCode: '308', tip: '鼠标左键点击【确定】按钮' },
{ deviceType: '04', orderNum: 3, operateCode: '308', tip: '鼠标左键点击【确定】按钮' }
],
config: {onlySignalOP:true}
},
@ -913,12 +913,12 @@ export default {
trainingType: 'Station',
productTypes: ['01', '02'],
stepVOList: [
{ deviceType: '05', orderNum: 1, operateCode: '1100', tip: '鼠标右键菜单选择【设置/取消强制点灯】', codeType: 'BUTTON'},
{ deviceType: '05', orderNum: 2, operateCode: '11001', tip: '请输入密码"root",点击【确认】按钮', val: 'root' },
{ deviceType: '05', orderNum: 3, operateCode: '11004', tip: '鼠标左键点击【是】按钮' },
{ deviceType: '05', orderNum: 4, operateCode: '11002', tip: '鼠标左键点击【确定】按钮' },
{ deviceType: '05', orderNum: 5, operateCode: '11006', tip: '鼠标左键选择({8}{9})区段', val: '{19}' },
{ deviceType: '05', orderNum: 6, operateCode: '11003', tip: '鼠标左键点击【确定】按钮' }
{ deviceType: '05', orderNum: 1, operateCode: '1100', tip: '鼠标右键菜单选择【设置/取消强制点灯】', subType: 'light'},
{ deviceType: '05', orderNum: 2, operateCode: '0011', tip: '请输入密码"root",点击【确认】按钮', val: 'root' },
{ deviceType: '05', orderNum: 3, operateCode: '11002', tip: '鼠标左键点击【是】按钮' },
{ deviceType: '05', orderNum: 4, operateCode: 'com08', tip: '鼠标左键点击【确定】按钮' },
{ deviceType: '05', orderNum: 5, operateCode: 'com02', tip: '请选择【强制点灯】选项', val: '5' },
{ deviceType: '05', orderNum: 6, operateCode: 'com13', tip: '鼠标左键点击【确定】按钮' }
],
config:{tbStrategyBT:true}
},
@ -997,6 +997,7 @@ export default {
{ deviceType: '05', orderNum: 3, operateCode: '8003', tip: '鼠标左键点击【确定】按钮' },
{ deviceType: '05', orderNum: 4, operateCode: '8004', tip: '鼠标左键点击【确定】按钮' },
{ deviceType: '05', orderNum: 5, operateCode: '8005', tip: '鼠标左键点击【关闭】按钮' },
{ deviceType: '05', orderNum: 6, operateCode: '8006', tip: '鼠标左键点击【确定】按钮' }
]
},
{
@ -1012,7 +1013,7 @@ export default {
{ deviceType: 'bar', orderNum: 1, operateCode: '002c', tip: '鼠标左键点击菜单【批处理命令】', codeType: 'NULL'},
{ deviceType: 'bar', orderNum: 2, operateCode: '6062', tip: '鼠标左键点击菜单【{26}全站进路交自动控】' },
{ deviceType: '05', orderNum: 3, operateCode: '6063', tip: '鼠标左键点击【确定】按钮' }
],
]
},
{
maxDuration: 15,
@ -1027,7 +1028,7 @@ export default {
{ deviceType: 'bar', orderNum: 1, operateCode: '002c', tip: '鼠标左键点击菜单【批处理命令】', codeType: 'NULL'},
{ deviceType: 'bar', orderNum: 2, operateCode: '6141', tip: '鼠标左键点击菜单【设置{26}全站自动通过进路】' },
{ deviceType: '05', orderNum: 3, operateCode: '6142', tip: '鼠标左键点击【确定】按钮' }
],
]
},
{
maxDuration: 15,
@ -1042,7 +1043,7 @@ export default {
{ deviceType: 'mbm', orderNum: 1, operateCode: '002c', tip: '鼠标左键点击菜单【批处理命令】', codeType: 'NULL'},
{ deviceType: 'mbm', orderNum: 2, operateCode: '6151', tip: '鼠标左键点击菜单【取消{26}全站自动通过进路】' },
{ deviceType: '05', orderNum: 3, operateCode: '6152', tip: '鼠标左键点击【确定】按钮' }
],
]
},
// {
// maxDuration: 15,

View File

@ -1,5 +1,5 @@
<template>
<div class="menus" :style="{width: width + 'px'}">
<div class="menus __socpe" :style="{width: width + 'px'}">
<menu-bar v-show="isShowBar" ref="menuBar" :selected="selected" />
<menu-station-stand ref="menuStationStand" :selected="selected" />
<menu-switch ref="menuSwitch" :selected="selected" />
@ -9,7 +9,7 @@
<menu-station ref="menuStation" :selected="selected" />
<menu-limit ref="menuLimit" :selected="selected" />
<!--<passive-alarm ref="passiveAlarm" />-->
<passive-contorl ref="passiveControl" pop-class="ningbo-01__systerm" />
<passive-contorl ref="passiveControl" pop-class="ningbo-01__systerm" :selected="selected"/>
<!--<passive-Timeout ref="passiveTimeout" />-->
</div>
</template>
@ -373,3 +373,16 @@ export default {
margin-top: 10px;
}
</style>
<style lang="scss">
.__socpe {
.el-dialog,
.el-dialog__wrapper {
pointer-events: none !important;
}
.el-dialog__header,
.el-dialog__body {
pointer-events: all !important;
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -2,11 +2,21 @@
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="1000px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="10">
<el-table :data="tableData" height="397px" style="margin-top: 57px">
<el-table-column prop="groupNumber" label="列车" />
<el-table :data="tableData" height="397px" style="margin-top: 57px" highlight-current-row @current-change="handleTrainChange">
<el-table-column label="列车">
<template slot-scope="scope">
<span>{{ scope.row }}</span>
</template>
</el-table-column>
<el-table-column prop="groupNumber" label="班次" />
<el-table-column prop="groupNumber" label="运行线" />
<el-table-column prop="groupNumber" label="模式" />
<el-table-column label="运行线">
<template slot-scope="scope">
<span>{{ getTrainDestinationCode(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column prop="groupNumber" label="模式">
<span>自动</span>
</el-table-column>
</el-table>
</el-col>
<el-col :span="13" :offset="1">
@ -22,9 +32,13 @@
</div>
</el-col>
<el-col :span="12" :offset="1">
<el-table :data="tempData" height="340px">
<el-table :data="tempData" height="340px" highlight-current-row @current-change="handlePathChange">
<el-table-column prop="groupNumber" label="路径" />
<el-table-column prop="groupNumber" label="运行方向" />
<el-table-column prop="groupNumber" label="运行方向">
<template slot-scope="scope">
<span>{{ getRunDirection(scope.row) }}</span>
</template>
</el-table-column>
</el-table>
<el-checkbox v-model="displayCopyPath">显示复制路径</el-checkbox>
</el-col>
@ -33,15 +47,19 @@
<el-tab-pane label="信号机" name="second">
<el-row>
<el-col :span="11">
<el-table :data="signalList" height="380px">
<el-table :data="signalList" height="380px" highlight-current-row @current-change="handleSignalChange">
<el-table-column prop="name" label="信号机" />
<el-table-column prop="show" label="显示" />
</el-table>
</el-col>
<el-col :span="12" :offset="1">
<el-table :data="tempData" height="340px">
<el-table :data="tempData" height="340px" highlight-current-row @current-change="handlePathChange">
<el-table-column prop="groupNumber" label="路径" />
<el-table-column prop="groupNumber" label="运行方向" />
<el-table-column label="运行方向">
<template slot-scope="scope">
<span>{{ getRunDirection(scope.row) }}</span>
</template>
</el-table-column>
</el-table>
<el-checkbox v-model="displayCopyPath">显示复制路径</el-checkbox>
</el-col>
@ -74,6 +92,8 @@ import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
// import {mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus';
import { mapGetters } from 'vuex';
import { getPathListByStandCodeOrSignalCode } from '@/api/simulation';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'RouteSelection',
@ -83,13 +103,17 @@ export default {
data() {
return {
tempData: [],
tableData: [{}],
tableData: [],
activeName: 'first',
beforeSectionList: [],
dialogShow: false,
loading: false,
displayCopyPath: false,
selectStandCode: ''
selectStandCode: '',
selectTrainCode: '',
selectSignalCode: '',
oldSectionList: [],
routeCodeList: []
};
},
computed: {
@ -124,25 +148,101 @@ export default {
}
},
methods: {
selectStand(stationStand) {
this.selectStandCode = stationStand.code;
},
expandPath() {
console.log('展开进路预览');
},
doShow(operate) {
//
this.dialogShow = true;
this.selectTrainCode = '';
this.selectStandCode = '';
this.selectSignalCode = '';
this.tableData = this.$store.state.map.activeTrainList;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.handlePathChange([]);
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
getTrainDestinationCode(trainCode) {
const train = this.$store.getters['map/getDeviceByCode'](trainCode);
return train.destinationCode;
},
selectStand(stationStand) {
this.selectStandCode = stationStand.code;
if (this.selectTrainCode && this.selectStandCode) {
this.getPathList({ groupNumber: this.selectTrainCode, standCode: this.selectStandCode });
}
},
getRunDirection(routeCodeList) {
if (routeCodeList && routeCodeList.length) {
const route = this.$store.state.map.routeData[routeCodeList[0]];
const signal = this.$store.getters['map/getDeviceByCode'](route.startSignalCode);
return signal.right ? '0' : '1';
}
},
handlePathChange(routeCodeList) {
this.routeCodeList = routeCodeList;
if (this.oldSectionList && this.oldSectionList.length) {
this.oldSectionList.forEach(sectionCode => {
const section = this.$store.getters['map/getDeviceByCode'](sectionCode);
section && section.instance && section.instance.setRunLineDefault();
});
}
if (routeCodeList && routeCodeList.length) {
let nowSectionList = [];
routeCodeList.forEach((routeCode) => {
const route = this.$store.state.map.routeData[routeCode];
nowSectionList = [...nowSectionList, ...route.routeSectionList];
route && route.routeSectionList.forEach(sectionCode => {
const section = this.$store.getters['map/getDeviceByCode'](sectionCode);
section && section.instance && section.instance.showRunLine('path');
});
});
this.oldSectionList = nowSectionList;
}
},
handleTrainChange(val) {
this.selectTrainCode = val;
if (this.activeName === 'first' && this.selectTrainCode && this.selectStandCode) {
this.getPathList({ groupNumber: this.selectTrainCode, standCode: this.selectStandCode });
} else if (this.activeName === 'second' && this.selectTrainCode && this.selectSignalCode) {
this.getPathList({ groupNumber: this.selectTrainCode, signalCode: this.selectSignalCode });
}
},
handleSignalChange(signal) {
this.selectSignalCode = signal.code;
if (this.selectTrainCode && this.selectSignalCode) {
this.getPathList({ groupNumber: this.selectTrainCode, signalCode: this.selectSignalCode });
}
},
getPathList(params) {
getPathListByStandCodeOrSignalCode(this.$route.query.group, params).then(resp => {
this.tempData = resp.data;
}).catch(e => {
this.$message.error('获取路径列表失败!');
});
},
commit() {
const operate = {
over: true,
operation: OperationEvent.Train.trainSetRoute.confirm.operation,
cmdType: CMD.Train.CMD_TRAIN_SET_ROUTE,
param: { routes: this.routeCodeList }
};
this.$store.dispatch('training/nextNew', operate).then(({valid}) => {
if (valid) {
this.doClose();
}
}).catch(error => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleClick() {

View File

@ -0,0 +1,286 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="700px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="sure? 18: 24">
<el-table :id="domIdChoose" ref="table" :data="tempList" highlight-current-row height="300px" @current-change="handleChangeLine">
<el-table-column prop="name" width="90" label="闭塞区段" />
<el-table-column width="90" label="PMI">
<template slot-scope="scope">
<span>{{ getStationPIM(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column width="90" label="信号模式">
<template slot-scope="scope">
<span>{{ getSectionMode(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column width="120" label="过岔锁闭可取消">
<template slot-scope="scope">
<span>{{ getSectionCanStatus(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column width="120" label="过岔锁闭已取消">
<template slot-scope="scope">
<span>{{ getSectionHasStatus(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column width="160" label="锁闭过岔取消过程">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code) }}</span>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="5" :offset="1" v-if="sure">
<fieldset style="position: absolute;top: 40%;">
<legend class="card_title">命令</legend>
<el-radio-group v-model="command">
<el-radio :label="true" style="margin-bottom: 10px;">确认(F)</el-radio>
<el-radio :label="false">取消(N)</el-radio>
</el-radio-group>
</fieldset>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :disabled="!!disabled" :loading="loading" @click="commit(true)">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdApply" type="primary" :disabled="!!disabled" :loading="loading" @click="commit(false)">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button>帮助(H)</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mapGetters } from 'vuex';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
components: {
NoticeInfo
},
props: {
initCacheMap: {
type: Object,
default() {
return {}
}
},
initInfo: {
type: Object,
default() {
return {}
}
},
updateDone: {
type: Number,
default: 0
}
},
data() {
return {
title: '',
status: false,
standStatus: true,
allChecked: false,
dialogShow: false,
loading: false,
active: false,
activeName: 'first',
radio: '1',
operate: null,
command: true,
sure: false,
currentSelect: null,
noInit: true
};
},
computed: {
...mapGetters('map', [
'sectionList'
]),
cmdType() {
return ''
},
initSelect() {
return this.initInfo.initSelect||{};
},
disabled() {
return !this.currentSelect || this.currentSelect.blockade || this.noInit;
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
tempList() {
return this.sectionList.filter(el => ['01', '04'].includes(el.type) )
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Command.common.choose1.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.common.confirm1.domId : '';
},
domIdApply() {
return this.dialogShow ? OperationEvent.Command.common.apply1.domId : '';
},
domIdClose() {
return this.dialogShow ? OperationEvent.Command.common.close1.domId : '';
}
},
watch: {
'$store.state.map.keyboardEnterCount': function (val) {
if (this.show) {
this.commit();
}
},
updateDone() {
if (this.currentSelect) {
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code]||{}).done != 'one';
}
}
},
methods: {
getCacheMap() {
return this.initCacheMap[this.cmdType.value]||{};
},
doShow(operate, sure) {
this.operate = operate;
this.sure = sure;
this.title = `${sure? '确认/取消过岔锁闭取消': '初始化过岔锁闭取消'}`;
this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code);
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null);
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.sure && (this.currentSelect = null);
this.sure && this.$refs.table.setCurrentRow();
this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value,
Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done'))
)
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = true) {
if (this.currentSelect &&
this.currentSelect.code == this.initSelect.code) {
const cacheMap= this.getCacheMap();
const isOK = this.command&&(!this.sure || this.sure&&cacheMap[this.currentSelect.code])
const operate = {
cmdType: this.sure&&isOK? this.cmdType: null,
operation: isClose ? OperationEvent.Command.common.confirm1.operation : OperationEvent.Command.common.apply1.operation,
over: this.sure,
param: {sectionCode: this.currentSelect.code}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (isOK) {
this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, { done: this.sure? 'two': 'one'});
} else {
this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code);
}
this.$emit('updateDone')
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
}
}).catch(() => {
isClose && this.isClose();
this.$refs.noticeInfo.doShow();
});
} else {
this.$messageBox('两次选择不一致');
}
},
handleChangeLine(val) {
if (!val) { return; }
const step = {
code: val.code,
operation: OperationEvent.Command.common.choose1.operation,
val: val.code
};
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
this.$emit('updateDone')
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.sure || this.$emit('initSelect', this.currentSelect);
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
getProcess(code) {
const cacheMap = this.getCacheMap();
const cache = cacheMap[code];
if (cache) {
if (this.sure) {
return cache.done == 'two' ? '确认过岔锁闭取消完成' : '等待确认/取消';
} else {
return cache.done == 'one' ? '已初始化' : ''
}
}
return '';
},
getStationPIM(code) {
return '16-NSW';
},
getSectionMode(code) {
return '后备';
},
getSectionCanStatus(code) {
return '否'
},
getSectionHasStatus(code) {
return '否'
},
cancel() {
const operate = {
operation: OperationEvent.Command.common.close1.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.menu-li {
height: 30px;
line-height: 30px;
text-align: left;
list-style:none;
padding-left: 5px;
border-right: 2px solid #696969;
color: #000;
}
/deep/ {
.el-radio {
color: #000;
font-weight: bold;
}
.el-cascader-node>.el-radio, .el-radio:last-child{
margin-right: 20px;
}
}
</style>

View File

@ -0,0 +1,279 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="740px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="sure? 18: 24">
<el-table :id="domIdChoose" ref="table" :data="tempList" highlight-current-row height="300px" @current-change="handleChangeLine">
<el-table-column prop="name" width="90" label="闭塞区段" />
<el-table-column width="90" label="PMI">
<template slot-scope="scope">
<span>{{ getStationPIM(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column width="90" label="信号模式">
<template slot-scope="scope">
<span>{{ getSectionMode(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column width="90" label="转换锁闭">
<template slot-scope="scope">
<span>{{ getSectionLock(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column label="锁闭转换取消过程">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code) }}</span>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="5" :offset="1" v-if="sure">
<fieldset style="position: absolute;top: 40%;">
<legend class="card_title">命令</legend>
<el-radio-group v-model="command">
<el-radio :label="true" style="margin-bottom: 10px;">确认(F)</el-radio>
<el-radio :label="false">取消(N)</el-radio>
</el-radio-group>
</fieldset>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :disabled="!!disabled" :loading="loading" @click="commit(true)">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdApply" type="primary" :disabled="!!disabled" :loading="loading" @click="commit(false)">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button>帮助(H)</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mapGetters } from 'vuex';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
components: {
NoticeInfo
},
props: {
initCacheMap: {
type: Object,
default() {
return {}
}
},
initInfo: {
type: Object,
default() {
return {}
}
},
updateDone: {
type: Number,
default: 0
}
},
data() {
return {
title: '',
status: false,
standStatus: true,
allChecked: false,
dialogShow: false,
loading: false,
active: false,
activeName: 'first',
radio: '1',
operate: null,
command: true,
sure: false,
currentSelect: null,
noInit: true
};
},
computed: {
...mapGetters('map', [
'sectionList'
]),
cmdType() {
return ''
},
initSelect() {
return this.initInfo.initSelect||{};
},
disabled() {
return !this.currentSelect || this.currentSelect.blockade || this.noInit;
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
tempList() {
return this.sectionList.filter(el => ['01', '04'].includes(el.type) )
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Command.common.choose1.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.common.confirm1.domId : '';
},
domIdApply() {
return this.dialogShow ? OperationEvent.Command.common.apply1.domId : '';
},
domIdClose() {
return this.dialogShow ? OperationEvent.Command.common.close1.domId : '';
}
},
watch: {
'$store.state.map.keyboardEnterCount': function (val) {
if (this.show) {
this.commit();
}
},
updateDone() {
if (this.currentSelect) {
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code]||{}).done != 'one';
}
}
},
methods: {
getCacheMap() {
return this.initCacheMap[this.cmdType.value]||{};
},
doShow(operate, sure) {
this.operate = operate;
this.sure = sure;
this.title = `${sure? '确认/取消转换锁闭取消': '初始化转换锁闭取消'}`;
this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code);
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null);
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.sure && (this.currentSelect = null);
this.sure && this.$refs.table.setCurrentRow();
this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value,
Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done'))
)
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = true) {
if (this.currentSelect &&
this.currentSelect.code == this.initSelect.code) {
const cacheMap= this.getCacheMap();
const isOK = this.command&&(!this.sure || this.sure&&cacheMap[this.currentSelect.code])
const operate = {
cmdType: this.sure&&isOK? this.cmdType: null,
operation: isClose ? OperationEvent.Command.common.confirm1.operation : OperationEvent.Command.common.apply1.operation,
over: this.sure,
param: {sectionCode: this.currentSelect.code}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (isOK) {
this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, { done: this.sure? 'two': 'one'});
} else {
this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code);
}
this.$emit('updateDone')
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
}
}).catch(() => {
isClose && this.isClose();
this.$refs.noticeInfo.doShow();
});
} else {
this.$messageBox('两次选择不一致');
}
},
handleChangeLine(val) {
if (!val) { return; }
const step = {
code: val.code,
operation: OperationEvent.Command.common.choose1.operation,
val: val.code
};
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
this.$emit('updateDone')
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.sure || this.$emit('initSelect', this.currentSelect);
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
getProcess(code) {
const cacheMap = this.getCacheMap();
const cache = cacheMap[code];
if (cache) {
if (this.sure) {
return cache.done == 'two' ? '确认转换锁闭取消完成' : '等待确认/取消';
} else {
return cache.done == 'one' ? '已初始化' : ''
}
}
return '';
},
getStationPIM(code) {
return '16-NSW';
},
getSectionMode(code) {
return '后备';
},
getSectionLock(code) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
return elem.blockade ? '关闭' : '打开';
},
cancel() {
const operate = {
operation: OperationEvent.Command.common.close1.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.menu-li {
height: 30px;
line-height: 30px;
text-align: left;
list-style:none;
padding-left: 5px;
border-right: 2px solid #696969;
color: #000;
}
/deep/ {
.el-radio {
color: #000;
font-weight: bold;
}
.el-cascader-node>.el-radio, .el-radio:last-child{
margin-right: 20px;
}
}
</style>

View File

@ -3,11 +3,11 @@
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="600px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-table
:id="domIdChoose"
ref="table"
:data="signalList"
highlight-current-row
height="300px"
:id="domIdChoose"
@current-change="handleCurrentChange"
>
<el-table-column prop="name" label="信号机" />
@ -21,20 +21,20 @@
<span>{{ getCanGuide(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="unblockProcess" label="引导过程" width="120">
<!-- <el-table-column prop="unblockProcess" label="引导过程" width="120">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code) }}</span>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column prop="unblockProcess" width="150" label="区间信号引导过程" />
</el-table>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected || !selected.callOn" @click="commit(true)">确定(O)</el-button>
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="status " @click="commit(true)">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdApply" type="primary" :loading="loading" :disabled="!selected || !selected.callOn" @click="commit(false)">应用(A)</el-button>
<el-button :id="domIdApply" type="primary" :loading="loading" :disabled="status" @click="commit(false)">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
@ -45,7 +45,7 @@
</el-row>
</el-dialog>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
<signal-guide ref="signalGuide" @commandSuccess="commandSuccess" @cancelCommand="cancelCommand" />
<!-- <signal-guide ref="signalGuide" @commandSuccess="commandSuccess" @cancelCommand="cancelCommand" /> -->
</div>
</template>
@ -53,25 +53,26 @@
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import SignalGuide from './signalGuide';
// import SignalGuide from './signalGuide';
import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'StandDetain',
name: 'CancleSignalGuide',
components: {
SignalGuide,
// SignalGuide,
NoticeInfo
},
data() {
return {
status: false,
status: true,
standStatus: true,
allChecked: false,
dialogShow: false,
loading: false,
operate: '',
initEle: null,
commandEleCode: null
operate: ''
// initEle: null,
// commandEleCode: null
};
},
computed: {
@ -85,7 +86,7 @@ export default {
return this.$store.state.menuOperation.selected;
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Command.common.choose.domId : ''
return this.dialogShow ? OperationEvent.Command.common.choose.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.common.confirm.domId : '';
@ -97,7 +98,7 @@ export default {
return this.dialogShow ? OperationEvent.Command.common.apply.domId : '';
},
title() {
return '初始化引导';
return '清除引导';
}
},
watch: {
@ -105,12 +106,15 @@ export default {
if (this.show) {
this.commit();
}
},
'selected': function(val) {
this.status = !val || val.callOn;
}
},
methods: {
doShow(operate) {
this.initEle = null;
this.commandEleCode = null;
// this.initEle = null;
// this.commandEleCode = null;
this.operate = operate;
//
this.dialogShow = true;
@ -147,26 +151,32 @@ export default {
return '否';
}
},
getProcess(code) {
if (this.commandEleCode === code) {
return '完成';
} else if (this.initEle && this.initEle.code === code) {
return '等待确认/取消';
} else {
return '';
}
},
// getProcess(code) {
// if (this.commandEleCode === code) {
// return '';
// } else if (this.initEle && this.initEle.code === code) {
// return '/';
// } else {
// return '';
// }
// },
commit(isClose = false) {
this.loading = true;
const val = this.selected || {};
const step = {
operation: isClose
? OperationEvent.Command.common.confirm.operation
: OperationEvent.Command.common.apply.operation,
over: true,
param: {signalCode:[val.code]}
};
step.cmdType = CMD.Signal.CMD_SIGNAL_CLOSE_GUIDE;
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.signalGuide.doShow(step, this.selected);
this.initEle = this.selected;
this.loading = false;
isClose && this.doClose();
}
}).catch(() => {
@ -176,8 +186,6 @@ export default {
},
handleCurrentChange(val) {
if (!val) { return; }
this.initEle = null;
this.commandEleCode = null;
const step = {
code: `${val.code}`,
operation: OperationEvent.Command.common.choose.operation,
@ -195,12 +203,12 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
commandSuccess(code) {
this.commandEleCode = code;
},
cancelCommand() {
this.initEle = null;
},
// commandSuccess(code) {
// this.commandEleCode = code;
// },
// cancelCommand() {
// this.initEle = null;
// },
cancel() {
const operate = {
operation: OperationEvent.Command.common.close.operation

View File

@ -1,306 +0,0 @@
<template>
<div>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="1000px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="20">
<el-table :id="domIdChoose" ref="table1" :data="tempData" highlight-current-row height="300px" @current-change="handleChangeLine">
<el-table-column prop="name" width="100" label="轨道" />
<el-table-column prop="blockStatus" width="120" label="MAU">
<template slot-scope="scope">
<span>{{ getStationName(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column prop="blockProcess" width="80" label="临时限速">
<template slot-scope="scope">
<span>{{ getLimitSpeed(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="unblockProcess" label="PM临时限速" width="110">
<template slot-scope="scope">
<span>{{ getIsLimit(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="blockProcess" label="设置临时限速进程" width="140">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="unblockProcess" label="用户里程起点" width="110" />
<el-table-column prop="unblockProcess" label="用户里程终点" width="110" />
</el-table>
</el-col>
<el-col :span="4">
<el-table :id="domIdChoose1" ref="table2" :data="limitList" highlight-current-row height="300px" @current-change="handleChangeLine2">
<el-table-column prop="name" label="速度" />
</el-table>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected || speedLimitValue<0" @click="commit">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdApply" type="primary" :disabled="!selected || speedLimitValue<0" :loading="loading" @click="apply">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button>帮助(H)</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
</el-dialog>
<section-limit-speed ref="sectionLimitSpeed" @commandSuccess="commandSuccess" @cancelCommand="cancelCommand" />
</div>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mapGetters } from 'vuex';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import SectionLimitSpeed from './sectionLimitSpeed';
export default {
name: 'SwitchActive',
components: {
NoticeInfo,
SectionLimitSpeed
},
data() {
return {
status: false,
standStatus: true,
allChecked: false,
dialogShow: false,
loading: false,
active: false,
activeName: 'first',
tempData: [],
radio: '1',
limitList: [
{ name: '5', value: 5 },
{ name: '10', value: 10 },
{ name: '15', value: 15 },
{ name: '20', value: 20 },
{ name: '25', value: 25 },
{ name: '30', value: 30 },
{ name: '35', value: 35 },
{ name: '40', value: 40 },
{ name: '45', value: 45 },
{ name: '50', value: 50 },
{ name: '55', value: 55 },
{ name: '60', value: 60 },
{ name: '65', value: 65 },
{ name: '70', value: 70 },
{ name: '75', value: 75 },
{ name: '80', value: 80 }
],
initEle: null,
commandEleCode:null,
speedLimitValue: 0
};
},
computed: {
...mapGetters('map', [
'sectionList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
selected() {
return this.$store.state.menuOperation.selected;
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Command.common.choose.domId : '';
},
domIdChoose1() {
return this.dialogShow ? OperationEvent.Command.common.choose1.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.common.confirm.domId : '';
},
domIdApply() {
return this.dialogShow ? OperationEvent.Command.common.apply.domId : '';
},
domIdClose() {
return this.dialogShow ? OperationEvent.Command.common.close.domId : '';
},
title() {
return '初始化设置临时限速区域';
}
},
watch: {
'$store.state.map.keyboardEnterCount': function (val) {
if (this.show) {
this.commit();
}
}
},
methods: {
doShow(operate) {
this.tempData = [];
this.operate = operate;
this.sectionList.forEach(item => {
if (item.type === '01' || item.type === '04') {
this.tempData.push(item);
}
});
this.initEle = null;
this.commandEleCode = null;
this.speedLimitValue = 0;
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table1.setCurrentRow(null);
this.$refs.table2.setCurrentRow(null);
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.table1.setCurrentRow();
this.$refs.table2.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
},
handleChangeLine(val) {
if (!val) { return; }
this.initEle = null;
this.commandEleCode = null;
const step = {
code: val.code,
operation: OperationEvent.Command.common.choose.operation,
val: val.code
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$store.dispatch('menuOperation/setSelected', {device: val});
// const sectionEle = this.$store.getters['map/getDeviceByCode'](val.code);
// this.speedLimitValue = sectionEle.speedUpLimit;
// if (this.speedLimitValue > 0) {
// this.$refs.table2.setCurrentRow(this.limitList[this.speedLimitValue / 5 - 1]);
// } else {
// this.$refs.table2.setCurrentRow();
// }
this.$refs.table2.setCurrentRow()
this.speedLimitValue = 0;
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
handleChangeLine2(val) {
if (!val) { return; }
this.initEle = null;
this.commandEleCode = null;
const step = {
operation: OperationEvent.Command.common.choose1.operation,
val: val.value,
param: {speedLimitValue: val.value}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.speedLimitValue = val.value;
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
getStationName(val) {
const stationElm = this.$store.getters['map/getDeviceByCode'](val.stationCode);
return stationElm.name;
},
getIsLimit(code) {
if (this.commandEleCode === code) {
return this.speedLimitValue > 0 ? '开启' : '关闭';
}
const sectionEle = this.$store.getters['map/getDeviceByCode'](code);
return sectionEle.speedUpLimit > 0 ? '开启' : '关闭';
},
getLimitSpeed(code) {
if (this.commandEleCode === code) {
return this.speedLimitValue > 0 ? this.speedLimitValue : 0;
}
const sectionEle = this.$store.getters['map/getDeviceByCode'](code);
return sectionEle.speedUpLimit > 0 ? sectionEle.speedUpLimit : 0;
},
getProcess(code) {
if (this.commandEleCode && this.commandEleCode === code) {
return '完成';
} else if (this.initEle && this.initEle.code === code) {
return '已初始化';
} else {
return '';
}
},
commit(isClose = true) {
const step = {
operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation,
param: { sectionCode: this.selected.code }
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionLimitSpeed.doShow(step, this.selected, this.speedLimitValue);
this.initEle = this.selected;
isClose && this.doClose();
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
apply() {
this.commit(false);
},
commandSuccess(code, val) {
this.commandEleCode = code;
if (!val) {
this.speedLimitValue = 0;
this.$refs.table2.setCurrentRow();
}
},
cancelCommand() {
this.initEle = null;
},
handleClick() {
},
cancel() {
const operate = {
operation: OperationEvent.Command.common.close.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.menu-li {
height: 30px;
line-height: 30px;
text-align: left;
list-style:none;
padding-left: 5px;
border-right: 2px solid #696969;
color: #000;
}
/deep/ {
.el-radio {
color: #000;
font-weight: bold;
}
.el-cascader-node>.el-radio, .el-radio:last-child{
margin-right: 20px;
}
}
</style>

View File

@ -1,233 +0,0 @@
<template>
<div>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="700px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-table :id="domIdChoose" ref="table" :data="tempData" highlight-current-row height="300px" @current-change="handleChangeLine">
<el-table-column prop="name" label="轨道" />
<el-table-column prop="blockStatus" label="MAU">
<template slot-scope="scope">
<span>{{ getStationName(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column prop="blockProcess" label="状态">
<template slot-scope="scope">
<span>{{ getSectionStatus(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="unblockProcess" :label="isBlock?'关闭进程':'打开进程'">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code) }}</span>
</template>
</el-table-column>
</el-table>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected" @click="commit">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdApply" type="primary" :loading="loading" :disabled="!selected" @click="apply">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button>帮助(H)</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
</el-dialog>
<section-open ref="sectionOpen" @commandSuccess="commandSuccess" @cancelCommand="cancelCommand" />
</div>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mapGetters } from 'vuex';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import SectionOpen from './sectionOpen';
export default {
name: 'SwitchActive',
components: {
NoticeInfo,
SectionOpen
},
data() {
return {
status: false,
operate: {},
standStatus: true,
allChecked: false,
dialogShow: false,
loading: false,
active: false,
selectShow: false,
activeName: 'first',
tempData: [],
radio: '1',
initEle: null,
commandEleCode: null
};
},
computed: {
...mapGetters('map', [
'sectionList'
]),
isBlock() {
return !!this.operate && this.operate.operation === OperationEvent.Command.commandNingBo3.line_section_close.operation;
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
selected() {
return this.$store.state.menuOperation.selected;
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Command.common.choose.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.common.confirm.domId : '';
},
domIdApply() {
return this.dialogShow ? OperationEvent.Command.common.apply.domId : '';
},
domIdClose() {
return this.dialogShow ? OperationEvent.Command.common.close.domId : '';
},
title() {
return this.isBlock ? '初始化关闭轨道' : '初始化开放轨道';
}
},
watch: {
'$store.state.map.keyboardEnterCount': function (val) {
if (this.show) {
this.commit();
}
}
},
methods: {
doShow(operate) {
this.tempData = [];
this.sectionList.forEach(item => {
if (item.type === '01' || item.type === '04') {
this.tempData.push(item);
}
});
this.initEle = null;
this.commandEleCode = null;
this.operate = operate;
//
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
},
apply() {
this.commit(false);
},
handleChangeLine(val) {
if (!val) { return; }
this.initEle = null;
this.commandEleCode = null;
const step = {
code: val.code,
operation: OperationEvent.Command.common.choose.operation,
val: val.code
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$store.dispatch('menuOperation/setSelected', {device: val});
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
getProcess(code) {
if (this.commandEleCode && this.commandEleCode === code) {
return this.isBlock ? '已完成关闭' : '已完成打开';
} else if (this.initEle && this.initEle.code === code) {
return '已初始化';
} else {
return '';
}
},
getStationName(val) {
const stationElm = this.$store.getters['map/getDeviceByCode'](val.stationCode);
return stationElm.name;
},
getSectionStatus(code) {
const sectionElm = this.$store.getters['map/getDeviceByCode'](code);
if (this.commandEleCode && this.commandEleCode === code && this.isBlock) {
return '关闭双向:所有列车';
} else if (this.commandEleCode && this.commandEleCode === code && !this.isBlock) {
return '打开';
}
return sectionElm.blockade ? '关闭双向:所有列车' : '打开';
},
commit(isClose = true) {
const step = {
isBlock: this.isBlock,
operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation,
param: { sectionCode: this.selected.code }
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionOpen.doShow(step, this.selected);
this.initEle = this.selected;
isClose && this.doClose();
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
commandSuccess(code) {
this.commandEleCode = code;
},
cancelCommand() {
this.initEle = null;
},
cancel() {
const operate = {
operation: OperationEvent.Command.common.close.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.menu-li {
height: 30px;
line-height: 30px;
text-align: left;
list-style:none;
padding-left: 5px;
border-right: 2px solid #696969;
color: #000;
}
/deep/ {
.el-radio {
color: #000;
font-weight: bold;
}
.el-cascader-node>.el-radio, .el-radio:last-child{
margin-right: 20px;
}
}
</style>

View File

@ -1,233 +0,0 @@
<template>
<div>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="600px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-table
ref="table"
:data="filterSignalList"
highlight-current-row
height="350px"
:id="domIdChoose"
@current-change="handleCurrentChange"
>
<el-table-column prop="name" label="信号机" />
<el-table-column prop="status" label="信号机封锁状态">
<template slot-scope="scope">
<span>{{ getSignalStatus(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="blockProcess" label="设置封锁进程">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code, 'lock') }}</span>
</template>
</el-table-column>
<el-table-column prop="unblockProcess" label="解除封锁进程">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code, 'unlock') }}</span>
</template>
</el-table-column>
</el-table>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected || !!initEle" @click="commit(true)">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdApply" type="primary" :loading="loading" :disabled="!selected || !!initEle" @click="commit(false)">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button>帮助(H)</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
</el-dialog>
<signal-block ref="signalBlock" @commandSuccess="commandSuccess" @cancelCommand="cancelCommand" />
</div>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mapGetters } from 'vuex';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import SignalBlock from './signalBlock';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'InitSignalBlock',
components: {
NoticeInfo,
SignalBlock
},
data() {
return {
status: false,
signalModel: true,
allChecked: false,
dialogShow: false,
loading: false,
initEle: null,
commandEleCode: null
};
},
computed: {
...mapGetters('map', [
'signalList'
]),
filterSignalList() {
return this.signalList.map(el => {
return this.$store.getters['map/getDeviceByCode'](el.code);
})
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
selected() {
return this.$store.state.menuOperation.selected;
},
isBlock() {
return this.operate && this.operate.operation === OperationEvent.Command.commandNingBo3.line_signal_unblock.operation;
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Command.common.choose.domId : ''
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.common.confirm.domId : '';
},
domIdClose() {
return this.dialogShow ? OperationEvent.Command.common.close.domId : '';
},
domIdApply() {
return this.dialogShow ? OperationEvent.Command.common.apply.domId : '';
},
title() {
return this.operate && this.operation === OperationEvent.Signal.lock.menu.operation ? '初始化信号机封锁' : '初始化信号机解除封锁';
}
},
watch: {
'$store.state.map.keyboardEnterCount': function (val) {
if (this.show) {
this.commit();
}
}
},
methods: {
doShow(operate) {
this.initEle = null;
this.commandEleCode = null;
this.operate = operate;
//
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = false) {
const step = {
operation: isClose ? OperationEvent.Command.common.confirm.operation: OperationEvent.Command.common.apply.operation,
needBlock: !this.isBlock,
param: { signalCode: this.selected.code }
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.signalBlock.doShow(step, this.selected);
this.initEle = this.selected;
isClose && this.isClose();
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
handleCurrentChange(val) {
if (!val) { return; }
this.initEle = null;
this.commandEleCode = null;
const step = {
code: val.code,
operation: OperationEvent.Command.common.choose.operation,
val: val.code
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$store.dispatch('menuOperation/setSelected', {device: val});
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
getSignalStatus(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (signalEle.blockade) {
return '锁闭的';
} else {
return '未设锁闭';
}
},
commandSuccess(code) {
this.commandEleCode = code;
},
cancelCommand() {
this.initEle = null;
},
getProcess(code, type) {
if (this.commandEleCode && this.commandEleCode === code && ((type === 'lock' && this.isBlock) || (type === 'unlock' && !this.isBlock))) {
return this.isBlock ? '已完成解封' : '已完成封锁';
} else if (this.initEle && this.initEle.code === code && ((type === 'lock' && this.isBlock) || (type === 'unlock' && !this.isBlock))) {
return '已初始化';
} else {
return '';
}
},
cancel() {
const operate = {
operation: OperationEvent.Command.common.close.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.menu-li {
height: 30px;
line-height: 30px;
text-align: left;
list-style:none;
padding-left: 5px;
border-right: 2px solid #696969;
color: #000;
}
.set-status-box {
position: relative;
top: 100px;
border: 1px solid #AFAFAF;
padding-left: 10px;
padding-top: 8px;
}
.set-status-title{
position: relative;
top: 115px;
background: #F0F0F0;
width: 40px;
text-align: center;
z-index: 22;
left: 10px;
}
</style>

View File

@ -1,145 +0,0 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="600px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-table ref="table" :data="signalList" height="300px">
<el-table-column prop="code" label="ID" />
<el-table-column prop="mode" label="信号模式" />
<el-table-column v-if="isCbtc" prop="status" label="CBTC可命令" />
<el-table-column v-if="isCbtc" prop="status" label="CBTC模式进程" />
<el-table-column v-if="!isCbtc" prop="status" label="后备模式可命令" />
<el-table-column v-if="!isCbtc" prop="status" label="后备模式进程" />
</el-table>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit(true)">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :loading="loading" @click="commit(false)">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button>帮助(H)</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
export default {
name: 'InitCbtcMode',
components: {
NoticeInfo
},
data() {
return {
status: false,
signalModel: true,
allChecked: false,
dialogShow: false,
loading: false,
operate: {}
};
},
computed: {
...mapGetters('map', [
'signalList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
selected() {
return this.$store.state.menuOperation.selected;
},
isCbtc() {
return this.operate.operation === OperationEvent.Command.mBar.cbtcMode.operation;
},
domIdClose() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.choose.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
},
title() {
return this.isCbtc ? '初始化CBTC' : '初始化后备模式';
}
},
watch: {
'$store.state.map.keyboardEnterCount': function (val) {
if (this.show) {
this.commit();
}
}
},
methods: {
doShow(operate) {
this.operate = operate;
//
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = false) {
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.menu-li {
height: 30px;
line-height: 30px;
text-align: left;
list-style:none;
padding-left: 5px;
border-right: 2px solid #696969;
color: #000;
}
.set-status-box {
position: relative;
top: 100px;
border: 1px solid #AFAFAF;
padding-left: 10px;
padding-top: 8px;
}
.set-status-title{
position: relative;
top: 115px;
background: #F0F0F0;
width: 40px;
text-align: center;
z-index: 22;
left: 10px;
}
</style>

View File

@ -1,217 +0,0 @@
<template>
<div>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="700px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-table
ref="table"
:data="signalList"
highlight-current-row
height="300px"
@current-change="handleCurrentChange"
>
<el-table-column prop="name" label="信号机" />
<el-table-column prop="blockStatus" label="允许锁闭">
<template slot-scope="scope">
<span>{{ getSignalBlock(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="blockProcess" label="同意取消"></el-table-column>
<el-table-column prop="unblockProcess" label="取消进程">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code) }}</span>
</template>
</el-table-column>
</el-table>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected" @click="commit(true)">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected" @click="commit(false)">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button>帮助(H)</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
</el-dialog>
<signal-can-block ref="signalCanBlock" @commandSuccess="commandSuccess" @cancelCommand="cancelCommand" />
</div>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
import SignalCanBlock from './signalCanBlock';
export default {
name: 'StandDetain',
components: {
NoticeInfo,
SignalCanBlock
},
data() {
return {
status: false,
standStatus: true,
allChecked: false,
dialogShow: false,
loading: false,
operate: '',
initEle: null,
commandEleCode: null
};
},
computed: {
...mapGetters('map', [
'signalList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
selected() {
return this.$store.state.menuOperation.selected;
},
isBlock() {
return this.selected && this.selected.blockade;
},
domIdClose() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.choose.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
},
title() {
return '开始允许锁闭解除';
}
},
watch: {
'$store.state.map.keyboardEnterCount': function (val) {
if (this.show) {
this.commit();
}
}
},
methods: {
doShow(operate) {
this.initEle = null;
this.commandEleCode = null;
this.operate = operate;
//
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = false) {
const step = {
needBlock: this.isBlock,
code: `${this.selected.code}`,
operation: OperationEvent.Signal.lock.confirm.operation,
param: {}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.signalCanBlock.doShow(step, this.selected);
this.initEle = this.selected;
isClose && this.doClose();
}
}).catch(() => {
isClose && this.doClose();
this.$refs.noticeInfo.doShow();
});
},
getSignalBlock(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (signalEle.blockade) {
return '关闭';
} else {
return '开启';
}
},
getProcess(code) {
if (this.commandEleCode === code) {
return '完成';
} else if (this.initEle && this.initEle.code === code) {
return '已初始化';
} else {
return '';
}
},
commandSuccess(code) {
this.commandEleCode = code;
},
cancelCommand() {
this.initEle = null;
},
handleCurrentChange(val) {
if (!val) { return; }
this.initEle = null;
this.commandEleCode = null;
const step = {
code: `${val.code}`,
operation: OperationEvent.Signal.lock.choose.operation,
param: {}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$store.dispatch('menuOperation/setSelected', {device: val});
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.menu-li {
height: 30px;
line-height: 30px;
text-align: left;
list-style:none;
padding-left: 5px;
border-right: 2px solid #696969;
color: #000;
}
/deep/ {
.el-radio {
color: #000;
font-weight: bold;
}
.el-cascader-node>.el-radio, .el-radio:last-child{
margin-right: 20px;
}
}
</style>

View File

@ -1,225 +0,0 @@
<template>
<div>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="700px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-table
ref="table"
:data="switchList"
highlight-current-row
height="350px"
@current-change="handleCurrentChange"
>
<el-table-column prop="name" label="道岔" />
<el-table-column prop="blockStatus" label="道岔封锁状态">
<template slot-scope="scope">
<span>{{ getSwitchStatus(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="blockProcess" label="设置封锁进程">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code, 'block') }}</span>
</template>
</el-table-column>
<el-table-column prop="unblockProcess" label="解除封锁进程">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code, 'unblock') }}</span>
</template>
</el-table-column>
</el-table>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected || !!initEle" @click="commit(true)">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected || !!initEle" @click="commit(false)">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button>帮助(H)</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
</el-dialog>
<switch-block ref="switchBlock" @commandSuccess="commandSuccess" @cancelCommand="cancelCommand" />
</div>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mapGetters } from 'vuex';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import SwitchBlock from './switchBlock';
export default {
name: 'StandDetain',
components: {
NoticeInfo,
SwitchBlock
},
data() {
return {
status: false,
standStatus: true,
allChecked: false,
dialogShow: false,
loading: false,
mode: '',
position: '',
reserved: '',
operate: '',
initEle: null,
commandEleCode: null
};
},
computed: {
...mapGetters('map', [
'switchList'
]),
isBlock() {
return this.operate && this.operate.operation === OperationEvent.Switch.block.button.operation;
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
selected() {
return this.$store.state.menuOperation.selected;
},
domIdClose() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.choose.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
},
title() {
return this.isBlock ? '初始化道岔封锁' : '初始化道岔解除封锁';
}
},
watch: {
'$store.state.map.keyboardEnterCount': function (val) {
if (this.show) {
this.commit();
}
}
},
methods: {
doShow(operate) {
this.initEle = null;
this.commandEleCode = null;
this.operate = operate;
//
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = false) {
const step = {
code: `${this.selected.code}`,
operation: this.isBlock ? OperationEvent.Switch.block.confirm.operation : OperationEvent.Switch.unblock.confirm.operation,
param: {}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchBlock.doShow(step, this.selected);
this.initEle = this.selected;
isClose && this.doClose();
}
}).catch(() => {
isClose && this.doClose();
this.$refs.noticeInfo.doShow();
});
},
handleCurrentChange(val) {
if (!val) { return; }
this.initEle = null;
this.commandEleCode = null;
const step = {
code: val.code,
operation: this.isBlock ? OperationEvent.Switch.block.choose.operation : OperationEvent.Switch.unblock.choose.operation,
param: {}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$store.dispatch('menuOperation/setSelected', {device: val});
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
getSwitchStatus(code) {
const switchEle = this.$store.getters['map/getDeviceByCode'](code);
if (this.commandEleCode === code) {
return this.isBlock ? '锁闭的' : '未锁闭的';
}
if (switchEle.blockade) {
return '锁闭的';
} else {
return '未锁闭的';
}
},
getProcess(code, type) {
if (this.commandEleCode && this.commandEleCode === code && ((type === 'block' && this.isBlock) || (type === 'unblock' && !this.isBlock))) {
return this.isBlock ? '已完成封锁' : '已完成解封';
} else if (this.initEle && this.initEle.code === code && ((type === 'block' && this.isBlock) || (type === 'unblock' && !this.isBlock))) {
return '已初始化';
} else {
return '';
}
},
commandSuccess(code) {
this.commandEleCode = code;
this.$refs.table.setCurrentRow();
},
cancelCommand() {
this.initEle = null;
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.menu-li {
height: 30px;
line-height: 30px;
text-align: left;
list-style:none;
padding-left: 5px;
border-right: 2px solid #696969;
color: #000;
}
/deep/ {
.el-radio {
color: #000;
font-weight: bold;
}
.el-cascader-node>.el-radio, .el-radio:last-child{
margin-right: 20px;
}
}
</style>

View File

@ -0,0 +1,262 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="700px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="sure? 18: 24">
<el-table :id="domIdChoose" ref="table" :data="tempList" highlight-current-row height="300px" @current-change="handleChangeLine">
<el-table-column prop="name" label="ID" />
<el-table-column width="210" label="远程计轴预复位使能输出状态">
<template slot-scope="scope">
<span>{{ getSectionStatus(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column width="180" label="远程计轴预复位使能过程">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code) }}</span>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="5" :offset="1" v-if="sure">
<fieldset style="position: absolute;top: 40%;">
<legend class="card_title">命令</legend>
<el-radio-group v-model="command">
<el-radio :label="true" style="margin-bottom: 10px;">确认(F)</el-radio>
<el-radio :label="false">取消(N)</el-radio>
</el-radio-group>
</fieldset>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :disabled="!!disabled" :loading="loading" @click="commit(true)">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdApply" type="primary" :disabled="!!disabled" :loading="loading" @click="commit(false)">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button>帮助(H)</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mapGetters } from 'vuex';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
components: {
NoticeInfo
},
props: {
initCacheMap: {
type: Object,
default() {
return {}
}
},
initInfo: {
type: Object,
default() {
return {}
}
},
updateDone: {
type: Number,
default: 0
}
},
data() {
return {
title: '',
status: false,
standStatus: true,
allChecked: false,
dialogShow: false,
loading: false,
active: false,
activeName: 'first',
radio: '1',
operate: null,
command: true,
sure: false,
currentSelect: null,
noInit: true
};
},
computed: {
...mapGetters('map', [
'sectionList'
]),
cmdType() {
return CMD.Section.CMD_SECTION_UNBLOCK
},
initSelect() {
return this.initInfo.initSelect||{};
},
disabled() {
return !this.currentSelect || this.currentSelect.blockade || this.noInit;
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
tempList() {
return this.sectionList.filter(el => ['01', '04'].includes(el.type) )
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Command.common.choose1.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.common.confirm1.domId : '';
},
domIdApply() {
return this.dialogShow ? OperationEvent.Command.common.apply1.domId : '';
},
domIdClose() {
return this.dialogShow ? OperationEvent.Command.common.close1.domId : '';
}
},
watch: {
'$store.state.map.keyboardEnterCount': function (val) {
if (this.show) {
this.commit();
}
},
updateDone() {
if (this.currentSelect) {
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code]||{}).done != 'one';
}
}
},
methods: {
getCacheMap() {
return this.initCacheMap[this.cmdType.value]||{};
},
doShow(operate, sure) {
this.operate = operate;
this.sure = sure;
this.title = `${sure? '确认/取消远程预复位使能': '初始化远程预复位使能'}`;
this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code);
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null);
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.sure && (this.currentSelect = null);
this.sure && this.$refs.table.setCurrentRow();
this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value,
Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done'))
)
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = true) {
if (this.currentSelect &&
this.currentSelect.code == this.initSelect.code) {
const cacheMap= this.getCacheMap();
const isOK = this.command&&(!this.sure || this.sure&&cacheMap[this.currentSelect.code])
const operate = {
cmdType: this.sure&&isOK? this.cmdType: null,
operation: isClose ? OperationEvent.Command.common.confirm1.operation : OperationEvent.Command.common.apply1.operation,
over: this.sure,
param: {sectionCode: this.currentSelect.code}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (isOK) {
this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, { done: this.sure? 'two': 'one'});
} else {
this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code);
}
this.$emit('updateDone')
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
}
}).catch(() => {
isClose && this.isClose();
this.$refs.noticeInfo.doShow();
});
} else {
this.$messageBox('两次选择不一致');
}
},
handleChangeLine(val) {
if (!val) { return; }
const step = {
code: val.code,
operation: OperationEvent.Command.common.choose1.operation,
val: val.code
};
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
this.$emit('updateDone')
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.sure || this.$emit('initSelect', this.currentSelect);
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
getSectionStatus(code) {
return '关闭';
},
getProcess(code) {
const cacheMap = this.getCacheMap();
const cache = cacheMap[code];
if (cache) {
if (this.sure) {
return cache.done == 'two' ? '确认远程预复位使能完成': '等待确认/取消';
} else {
return cache.done == 'one' ? '已初始化' : ''
}
}
return '';
},
cancel() {
const operate = {
operation: OperationEvent.Command.common.close1.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.menu-li {
height: 30px;
line-height: 30px;
text-align: left;
list-style:none;
padding-left: 5px;
border-right: 2px solid #696969;
color: #000;
}
/deep/ {
.el-radio {
color: #000;
font-weight: bold;
}
.el-cascader-node>.el-radio, .el-radio:last-child{
margin-right: 20px;
}
}
</style>

View File

@ -478,8 +478,8 @@ export default {
},
getRouteDirection(route) {
const signalEle = this.$store.getters['map/getDeviceByCode'](route.startSignalCode);
if (signalEle.right) {
const elem = this.$store.getters['map/getDeviceByCode'](route.startSignalCode);
if (elem.right) {
return '0';
} else {
return '1';

View File

@ -1,8 +1,8 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="1000px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="900px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="18">
<el-table ref="singleTable1" :data="tempData" highlight-current-row height="300px" @current-change="selectLine1">
<el-col :span="(sure? 18: 21) + (isLimitSpeed? 0: 3)">
<el-table ref="singleTable1" :data="tempList" highlight-current-row height="300px" @current-change="selectLine1">
<el-table-column prop="name" label="轨道" />
<el-table-column prop="blockStatus" width="120" label="MAU">
<template slot-scope="scope">
@ -28,12 +28,12 @@
<el-table-column prop="unblockProcess" label="用户里程终点" width="110" />
</el-table>
</el-col>
<el-col :span="3">
<el-col :span="3" v-if="isLimitSpeed">
<el-table ref="singleTable2" :data="limitList" highlight-current-row height="300px" @current-change="selectLine2">
<el-table-column prop="name" label="速度" />
</el-table>
</el-col>
<el-col :span="3">
<el-col :span="3" v-if="sure">
<fieldset style="padding-left: 10px;">
<legend class="card_title">命令</legend>
<el-radio-group v-model="command">
@ -45,10 +45,10 @@
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit(true)">确定(O)</el-button>
<el-button :id="domIdConfirm" type="primary" :disabled="!!disabled" :loading="loading" @click="commit(true)">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit(false)">应用(A)</el-button>
<el-button :id="domIdConfirm" type="primary" :disabled="!!disabled" :loading="loading" @click="commit(false)">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
@ -68,23 +68,39 @@ import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SwitchActive',
props: {
initCacheMap: {
type: Object,
default() {
return {}
}
},
initInfo: {
type: Object,
default() {
return {}
}
},
updateDone: {
type: Number,
default: 0
}
},
components: {
NoticeInfo
},
data() {
return {
title: '',
status: false,
standStatus: true,
allChecked: false,
dialogShow: false,
loading: false,
active: false,
command: false,
command: true,
activeName: 'first',
tempData: [],
operate: null,
speedLimitValue: 0,
limitList: [
{ name: '5', value: 5 },
{ name: '10', value: 10 },
@ -102,7 +118,11 @@ export default {
{ name: '70', value: 70 },
{ name: '75', value: 75 },
{ name: '80', value: 80 }
]
],
sure: false,
speedLimitValue: 0,
currentSelect: null,
noInit: true
};
},
computed: {
@ -112,8 +132,23 @@ export default {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
selected() {
return this.$store.state.menuOperation.selected;
tempList() {
return this.sectionList.filter(el => ['01', '04'].includes(el.type) )
},
isLimitSpeed() {
return this.operate && this.operate.operation === OperationEvent.Command.commandNingBo3.line_section_limitSpeed.operation;
},
initSelect() {
return this.initInfo.initSelect||{};
},
initParams() {
return this.initInfo.initParams||{};
},
cmdType() {
return this.isLimitSpeed ? CMD.Section.CMD_SECTION_SET_LIMIT_SPEED : CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED;
},
disabled() {
return !this.currentSelect || (this.isLimitSpeed? !this.speedLimitValue: !this.currentSelect.speedUpLimit) || this.noInit;
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.common.confirm1.domId : '';
@ -123,9 +158,6 @@ export default {
},
domIdClose() {
return this.dialogShow ? OperationEvent.Command.common.close1.domId : '';
},
title() {
return '确认/取消设置临时限速区域';
}
},
watch: {
@ -133,74 +165,140 @@ export default {
if (this.show) {
this.commit();
}
},
updateDone() {
if (this.currentSelect) {
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code]||{}).done != 'one';
}
}
},
methods: {
doShow(operate, selected, value) {
this.tempData = [];
this.sectionList.forEach(item => {
if (item.type === '01' || item.type === '04') {
this.tempData.push(item);
}
});
this.command = true;
this.$store.dispatch('menuOperation/setSelected', {device: selected});
//
getCacheMap() {
return this.initCacheMap[this.cmdType.value]||{};
},
doShow(operate, sure) {
this.operate = operate;
this.speedLimitValue = value;
this.sure = sure;
if (this.isLimitSpeed) {
this.title = `${sure ? '确认/取消设置临时限速区域' : '初始化设置临时限速区域'}`;
} else {
this.title = `${sure ? '清除临时限速区域' : '初始化清除临时限速区域'}`;
}
this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code);
this.speedLimitValue = this.initParams.value||0;
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.singleTable1.setCurrentRow(selected);
this.$refs.singleTable2.setCurrentRow(this.limitList[value / 5 - 1]);
this.$refs.singleTable1.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null);
this.isLimitSpeed && this.$refs.singleTable2.setCurrentRow(this.limitList[this.initParams.value / 5 - 1]);
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.sure && (this.currentSelect = null);
this.sure && (this.speedLimitValue = 0);
this.sure && this.$refs.singleTable1.setCurrentRow();
this.sure && this.isLimitSpeed && this.$refs.singleTable2.setCurrentRow();
this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value,
Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done'))
)
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = true) {
if (this.currentSelect &&
this.currentSelect.code == this.initSelect.code &&
this.speedLimitValue == this.initParams.value) {
const cacheMap= this.getCacheMap();
const isOK = this.command&&(!this.sure || this.sure&&cacheMap[this.currentSelect.code])
const operate = {
cmdType: this.sure&&isOK? this.cmdType: null,
operation: isClose ? OperationEvent.Command.common.confirm1.operation : OperationEvent.Command.common.apply1.operation,
over: this.sure,
param: {sectionCode: this.currentSelect.code, speedLimitValue:this.speedLimitValue}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (isOK) {
this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, { done: this.sure? 'two': 'one'});
} else {
this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code);
}
this.$emit('updateDone')
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
} else {
this.$messageBox('两次选择不一致');
}
},
selectLine1(val) {
this.$refs.singleTable1.setCurrentRow(this.selected);
if (!val) { return; }
const step = {
code: val.code,
operation: OperationEvent.Command.common.choose.operation,
val: val.code
};
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
this.$emit('updateDone')
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.sure || this.$emit('initSelect', this.currentSelect, {value: this.speedLimitValue});
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
selectLine2(val) {
this.$refs.singleTable2.setCurrentRow(this.limitList[this.speedLimitValue / 5 - 1]);
if (!val) { return; }
const step = {
operation: OperationEvent.Command.common.choose1.operation,
val: val.value
};
this.speedLimitValue = val.value;
this.$emit('updateDone')
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.sure || this.$emit('initSelect', this.currentSelect, {value: this.speedLimitValue});
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
getStationName(val) {
const stationElm = this.$store.getters['map/getDeviceByCode'](val.stationCode);
return stationElm.name;
},
getIsLimit(code) {
const sectionEle = this.$store.getters['map/getDeviceByCode'](code);
return sectionEle.speedUpLimit > 0 ? '开启' : '关闭';
const elem = this.$store.getters['map/getDeviceByCode'](code);
return elem.speedUpLimit > 0 ? '开启' : '关闭';
},
getLimitSpeed(code) {
const sectionEle = this.$store.getters['map/getDeviceByCode'](code);
return sectionEle.speedUpLimit > 0 ? sectionEle.speedUpLimit : 0;
const elem = this.$store.getters['map/getDeviceByCode'](code);
return elem.speedUpLimit > 0 ? elem.speedUpLimit : 0;
},
getProcess(code) {
if (this.selected && this.selected.code === code) {
return '等待确认/取消';
const cacheMap = this.getCacheMap();
const cache = cacheMap[code];
if (cache) {
if (this.sure) {
return cache.done == 'two' ? this.isLimitSpeed? '确认设置限速完成': '确认清除限速完成' : '等待确认/取消';
} else {
return cache.done == 'one' ? '已初始化' : ''
}
}
return '';
}
},
commit(isClose = true) {
const operate = {
cmdType: this.speedLimitValue ? CMD.Section.CMD_SECTION_SET_LIMIT_SPEED : CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED,
// cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED,
operation: isClose ? OperationEvent.Command.common.confirm1.operation : OperationEvent.Command.common.apply1.operation,
over: true,
param: {sectionCode: this.selected.code, speedLimitValue:this.speedLimitValue}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
isClose && this.doClose();
this.$emit('commandSuccess', this.selected.code, this.speedLimitValue);
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
cancel() {
const operate = {

View File

@ -101,7 +101,6 @@ export default {
},
methods: {
doShow(operate) {
//
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
@ -120,7 +119,6 @@ export default {
commit() {
},
handleClick() {
},
cancel() {
const operate = {

View File

@ -1,8 +1,8 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="700px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="18">
<el-table :id="domIdChoose" ref="sectionable" :data="tempData" highlight-current-row height="300px" @current-change="handleChangeLine">
<el-col :span="sure? 18: 24">
<el-table :id="domIdChoose" ref="table" :data="tempList" highlight-current-row height="300px" @current-change="handleChangeLine">
<el-table-column prop="name" label="轨道" />
<el-table-column prop="blockStatus" label="MAU">
<template slot-scope="scope">
@ -21,8 +21,8 @@
</el-table-column>
</el-table>
</el-col>
<el-col :span="5" :offset="1">
<fieldset>
<el-col :span="5" :offset="1" v-if="sure">
<fieldset style="position: absolute;top: 40%;">
<legend class="card_title">命令</legend>
<el-radio-group v-model="command">
<el-radio :label="true" style="margin-bottom: 10px;">确认(F)</el-radio>
@ -33,10 +33,10 @@
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit(true)">确定(O)</el-button>
<el-button :id="domIdConfirm" type="primary" :disabled="!!disabled" :loading="loading" @click="commit(true)">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdApply" type="primary" :loading="loading" @click="commit(false)">应用(A)</el-button>
<el-button :id="domIdApply" type="primary" :disabled="!!disabled" :loading="loading" @click="commit(false)">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
@ -56,12 +56,30 @@ import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SwitchActive',
components: {
NoticeInfo
},
props: {
initCacheMap: {
type: Object,
default() {
return {}
}
},
initInfo: {
type: Object,
default() {
return {}
}
},
updateDone: {
type: Number,
default: 0
}
},
data() {
return {
title: '',
status: false,
standStatus: true,
allChecked: false,
@ -69,10 +87,12 @@ export default {
loading: false,
active: false,
activeName: 'first',
tempData: [],
radio: '1',
operate: null,
command: true
command: true,
sure: false,
currentSelect: null,
noInit: true
};
},
computed: {
@ -80,13 +100,22 @@ export default {
'sectionList'
]),
isBlock() {
return !!this.operate && this.operate.isBlock;
return this.operate && this.operate.operation.includes(OperationEvent.Command.commandNingBo3.line_section_close.operation);
},
cmdType() {
return this.isBlock ? CMD.Section.CMD_SECTION_BLOCK : CMD.Section.CMD_SECTION_UNBLOCK
},
initSelect() {
return this.initInfo.initSelect||{};
},
disabled() {
return !this.currentSelect || (this.isBlock? this.currentSelect.blockade: !this.currentSelect.blockade) || this.noInit;
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
selected() {
return this.$store.state.menuOperation.selected;
tempList() {
return this.sectionList.filter(el => ['01', '04'].includes(el.type) )
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Command.common.choose1.domId : '';
@ -99,9 +128,6 @@ export default {
},
domIdClose() {
return this.dialogShow ? OperationEvent.Command.common.close1.domId : '';
},
title() {
return this.isBlock ? '确认/取消关闭轨道' : '确认/取消开放轨道';
}
},
watch: {
@ -109,27 +135,75 @@ export default {
if (this.show) {
this.commit();
}
},
updateDone() {
if (this.currentSelect) {
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code]||{}).done != 'one';
}
}
},
methods: {
doShow(operate) {
this.tempData = [];
this.sectionList.forEach(item => {
if (item.type === '01' || item.type === '04') {
this.tempData.push(item);
}
});
getCacheMap() {
return this.initCacheMap[this.cmdType.value]||{};
},
doShow(operate, sure) {
this.operate = operate;
this.sure = sure;
if (sure) {
this.title = `${this.isBlock ? '确认/取消关闭轨道' : '确认/取消开放轨道'}`;
} else {
this.title = `${this.isBlock ? '初始化关闭轨道': '初始化开放轨道'}`;
}
this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code);
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.sectionable.setCurrentRow(this.selected);
this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null);
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.sure && (this.currentSelect = null);
this.sure && this.$refs.table.setCurrentRow();
this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value,
Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done'))
)
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = true) {
if (this.currentSelect &&
this.currentSelect.code == this.initSelect.code) {
const cacheMap= this.getCacheMap();
const isOK = this.command&&(!this.sure || this.sure&&cacheMap[this.currentSelect.code])
const operate = {
cmdType: this.sure&&isOK? this.cmdType: null,
operation: isClose ? OperationEvent.Command.common.confirm1.operation : OperationEvent.Command.common.apply1.operation,
over: this.sure,
param: {sectionCode: this.currentSelect.code}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (isOK) {
this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, { done: this.sure? 'two': 'one'});
} else {
this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code);
}
this.$emit('updateDone')
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
}
}).catch(() => {
isClose && this.isClose();
this.$refs.noticeInfo.doShow();
});
} else {
this.$messageBox('两次选择不一致');
}
},
handleChangeLine(val) {
if (!val) { return; }
@ -138,51 +212,37 @@ export default {
operation: OperationEvent.Command.common.choose1.operation,
val: val.code
};
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
this.$emit('updateDone')
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$store.dispatch('menuOperation/setSelected', {device: val});
this.$refs.sectionable.setCurrentRow(this.selected);
this.sure || this.$emit('initSelect', this.currentSelect);
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
getProcess(code) {
if (this.selected && this.selected.code === code) {
return '等待确认/取消';
const cacheMap = this.getCacheMap();
const cache = cacheMap[code];
if (cache) {
if (this.sure) {
return cache.done == 'two' ? this.isBlock ? '确认关闭轨道完成' : '确认开放轨道完成' : '等待确认/取消';
} else {
return '';
return cache.done == 'one' ? '已初始化' : ''
}
}
return '';
},
getStationName(val) {
const stationElm = this.$store.getters['map/getDeviceByCode'](val.stationCode);
return stationElm.name;
},
getSectionStatus(code) {
const sectionElm = this.$store.getters['map/getDeviceByCode'](code);
return sectionElm.blockade ? '关闭双向:所有列车' : '打开';
},
commit(isClose = true) {
if (this.command) {
const operate = {
cmdType: this.isBlock ? CMD.Section.CMD_SECTION_BLOCK : CMD.Section.CMD_SECTION_UNBLOCK,
operation: isClose ? OperationEvent.Command.common.confirm1.operation : OperationEvent.Command.common.apply1.operation,
over: true,
param: {sectionCode: this.selected.code}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
isClose && this.doClose();
this.$emit('commandSuccess', this.selected.code);
}
}).catch(() => {
isClose && this.isClose();
this.$refs.noticeInfo.doShow();
});
} else {
this.cancel();
}
const elem = this.$store.getters['map/getDeviceByCode'](code);
return elem.blockade ? '关闭双向:所有列车' : '打开';
},
cancel() {
const operate = {

View File

@ -2,7 +2,7 @@
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="700px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="24">
<el-table :data="tempData" highlight-current-row height="350px" @current-change="selectLine">
<el-table :data="tempList" highlight-current-row height="350px" @current-change="selectLine">
<el-table-column prop="name" width="100" label="轨道" />
<el-table-column prop="blockStatus" width="120" label="MAU">
<template slot-scope="scope">
@ -40,7 +40,7 @@
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="true">打印(P)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
<el-button :id="domIdClose" type="primary" @click="cancel">关闭(C)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :disabled="true">帮助(H)</el-button>
@ -71,7 +71,6 @@ export default {
active: false,
selectShow: false,
activeName: 'first',
tempData: [],
radio: '1'
};
},
@ -82,8 +81,8 @@ export default {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
selected() {
return this.$store.state.menuOperation.selected;
tempList() {
return this.sectionList.filter(el => ['01', '04'].includes(el.type) )
},
domIdClose() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
@ -107,13 +106,7 @@ export default {
},
methods: {
doShow(operate) {
this.tempData = [];
this.sectionList.forEach(item => {
if (item.type === '01' || item.type === '04') {
this.tempData.push(item);
}
});
//
this.operate = operate;
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
@ -135,16 +128,16 @@ export default {
return stationElm.name;
},
getLimitSpeed(code) {
const sectionEle = this.$store.getters['map/getDeviceByCode'](code);
return sectionEle.speedUpLimit > 0 ? sectionEle.speedUpLimit : 0;
const elem = this.$store.getters['map/getDeviceByCode'](code);
return elem.speedUpLimit > 0 ? elem.speedUpLimit : 0;
},
getSectionStatus(val) {
const sectionEle = this.$store.getters['map/getDeviceByCode'](val.code);
return sectionEle.blockade ? '关闭双向:所有列车' : '打开';
const elem = this.$store.getters['map/getDeviceByCode'](val.code);
return elem.blockade ? '关闭双向:所有列车' : '打开';
},
getIsLimit(code) {
const sectionEle = this.$store.getters['map/getDeviceByCode'](code);
return sectionEle.speedUpLimit > 0 ? '开启' : '关闭';
const elem = this.$store.getters['map/getDeviceByCode'](code);
return elem.speedUpLimit > 0 ? '开启' : '关闭';
},
cancel() {
const operate = {

View File

@ -1,10 +1,10 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="750px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="18">
<el-col :span="sure? 18: 24">
<el-table
ref="table"
:data="signalList"
:data="tempList"
highlight-current-row
height="350px"
@current-change="handleCurrentChange"
@ -27,7 +27,7 @@
</el-table-column>
</el-table>
</el-col>
<el-col :span="5" :offset="1">
<el-col :span="5" :offset="1" v-if="sure">
<div class="set-status-title">命令</div>
<div class="set-status-box">
<el-radio v-model="command" :label="true">确认</el-radio>
@ -38,10 +38,10 @@
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit(true)">确定(O)</el-button>
<el-button :id="domIdConfirm" type="primary" :disabled="!!disabled" :loading="loading" @click="commit(true)">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdApply" :loading="loading" @click="commit(false)">应用(A)</el-button>
<el-button :id="domIdApply" type="primary" :disabled="!!disabled" :loading="loading" @click="commit(false)">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
@ -61,33 +61,62 @@ import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SignalBlock',
props: {
initCacheMap: {
type: Object,
default() {
return {}
}
},
initInfo: {
type: Object,
default() {
return {}
}
},
updateDone: {
type: Number,
default: 0
}
},
components: {
NoticeInfo
},
data() {
return {
title: '',
status: false,
command: true,
allChecked: false,
dialogShow: false,
loading: false,
operate: {},
title: ''
sure: false,
currentSelect: null,
noInit: true
};
},
computed: {
...mapGetters('map', [
'signalList'
]),
needBlock() {
return this.operate && this.operate.needBlock;
isBlock() {
return this.operate && this.operate.operation.includes(OperationEvent.Command.commandNingBo3.line_signal_block.operation);
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
selected() {
return this.$store.state.menuOperation.selected;
tempList() {
return this.signalList;
},
initSelect() {
return this.initInfo.initSelect||{};
},
cmdType() {
return this.isBlock ? CMD.Signal.CMD_SIGNAL_BLOCK : CMD.Signal.CMD_SIGNAL_UNBLOCK
},
disabled() {
return !this.currentSelect || (this.isBlock? this.currentSelect.blockade: !this.currentSelect.blockade) || this.noInit;
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.common.confirm1.domId : '';
@ -104,62 +133,113 @@ export default {
if (this.show) {
this.commit();
}
},
updateDone() {
if (this.currentSelect) {
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code]||{}).done != 'one';
}
}
},
methods: {
doShow(operate) {
getCacheMap() {
return this.initCacheMap[this.cmdType.value]||{};
},
doShow(operate, sure) {
this.operate = operate;
//
this.title = this.needBlock ? '确认/取消信号机封锁' : '确认/取消信号机解除封锁';
this.sure = sure;
if (sure) {
this.title = `${this.isBlock ? '确认/取消信号机封锁' : '确认/取消信号机解除封锁'}`;
} else {
this.title = `${this.isBlock ? '初始化信号机封锁': '初始化信号机解除封锁'}`;
}
this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code);
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow(this.selected);
this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null);
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.sure && (this.currentSelect = null);
this.sure && this.$refs.table.setCurrentRow();
this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value,
Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done'))
)
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = false) {
if (this.command) {
if (this.currentSelect &&
this.currentSelect.code == this.initSelect.code) {
const cacheMap= this.getCacheMap();
const isOK = this.command&&(!this.sure || this.sure&&cacheMap[this.currentSelect.code])
const operate = {
cmdType: this.needBlock ? CMD.Signal.CMD_SIGNAL_BLOCK : CMD.Signal.CMD_SIGNAL_UNBLOCK,
cmdType: this.sure&&isOK? this.cmdType: null,
operation: isClose ? OperationEvent.Command.common.confirm1.operation : OperationEvent.Command.common.apply1.operation,
over: true,
param: {signalCode: this.selected.code}
over: this.sure,
param: {signalCode: this.currentSelect.code}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (isOK) {
this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, { done: this.sure? 'two': 'one'});
} else {
this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code);
}
this.$emit('updateDone')
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
this.$emit('commandSuccess', this.selected.code);
}
}).catch(() => {
isClose && this.doClose();
this.$refs.noticeInfo.doShow();
});
} else {
this.cancel();
this.$messageBox('两次选择不一致');
}
},
handleCurrentChange(val) {
this.$refs.table.setCurrentRow(this.selected);
if (!val) { return; }
const step = {
code: val.code,
operation: OperationEvent.Command.common.choose.operation,
val: val.code
};
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
this.$emit('updateDone')
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.sure || this.$emit('initSelect', this.currentSelect);
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
getSignalStatus(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (signalEle.blockade) {
return '锁闭的';
} else {
return '未设锁闭';
}
const elem = this.$store.getters['map/getDeviceByCode'](code);
return elem.blockade? '锁闭的': '未设锁闭';
},
getProcess(code, type) {
if (this.selected.code === code && ((type === 'lock' && this.needBlock) || (type === 'unlock' && !this.needBlock))) {
return '等待确认/取消';
const blockType = this.isBlock ? 'lock': 'unlock';
const cacheMap = this.getCacheMap();
const cache = cacheMap[code];
if (blockType==type) {
if (cache) {
if (this.sure) {
return cache.done == 'two' ? this.isBlock ? '确认封锁完成' : '确认解除封锁完成' : '等待确认/取消';
} else {
return '';
return cache.done == 'one' ? '已初始化' : ''
}
}
}
return '';
},
cancel() {
const operate = {
@ -196,7 +276,7 @@ export default {
}
.set-status-title{
position: relative;
top: 115px;
top: 108px;
background: #F0F0F0;
width: 40px;
text-align: center;

View File

@ -1,10 +1,10 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="700px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="18">
<el-col :span="sure? 18: 24">
<el-table
ref="table"
:data="signalList"
:data="tempList"
highlight-current-row
height="300px"
@current-change="handleCurrentChange"
@ -23,20 +23,20 @@
</el-table-column>
</el-table>
</el-col>
<el-col :span="6">
<el-col v-if="sure" :span="6">
<div class="radio-box-title">命令</div>
<div class="radio-box">
<el-radio v-model="needBlock" :label="true" style="display: block;margin-bottom: 10px;">确认</el-radio>
<el-radio v-model="needBlock" :label="false" style="display: block;">取消</el-radio>
<el-radio v-model="command" :label="true" style="display: block;margin-bottom: 10px;">确认</el-radio>
<el-radio v-model="command" :label="false" style="display: block;">取消</el-radio>
</div>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit(true)">确定(O)</el-button>
<el-button :id="domIdConfirm" type="primary" :disabled="!!disabled" :loading="loading" @click="commit(true)">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit(false)">应用(A)</el-button>
<el-button :id="domIdConfirm" type="primary" :disabled="!!disabled" :loading="loading" @click="commit(false)">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
@ -51,25 +51,45 @@
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SignalCanBlock',
components: {
NoticeInfo
},
props: {
initCacheMap: {
type: Object,
default() {
return {};
}
},
initInfo: {
type: Object,
default() {
return {};
}
},
updateDone: {
type: Number,
default: 0
}
},
data() {
return {
title: '',
status: false,
standStatus: true,
allChecked: false,
dialogShow: false,
loading: false,
operate: '',
needBlock: true
command: true,
sure: false,
currentSelect: null,
noInit: true
};
},
computed: {
@ -79,8 +99,17 @@ export default {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
selected() {
return this.$store.state.menuOperation.selected;
tempList() {
return this.signalList;
},
initSelect() {
return this.initInfo.initSelect || {};
},
cmdType() {
return CMD.Signal.CMD_SIGNAL_UNBLOCK;
},
disabled() {
return !this.currentSelect || this.currentSelect.blockade || this.noInit;
},
domIdClose() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
@ -90,9 +119,6 @@ export default {
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
},
title() {
return '确认/取消允许锁闭';
}
},
watch: {
@ -100,57 +126,105 @@ export default {
if (this.show) {
this.commit();
}
},
updateDone() {
if (this.currentSelect) {
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code] || {}).done != 'one';
}
}
},
methods: {
doShow(operate) {
getCacheMap() {
return this.initCacheMap[this.cmdType.value] || {};
},
doShow(operate, sure) {
this.operate = operate;
//
this.sure = sure;
this.title = `${sure ? '确认/取消允许锁闭' : '初始化允许锁闭'}`;
this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code);
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow(this.selected);
this.$refs.table.setCurrentRow(sure ? this.tempList.find(el => el.code == this.initSelect.code) : null);
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.sure && (this.currentSelect = null);
this.sure && this.$refs.table.setCurrentRow();
this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value,
Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done'))
);
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = false) {
if (this.currentSelect &&
this.currentSelect.code == this.initSelect.code) {
const cacheMap = this.getCacheMap();
const isOK = this.command && (!this.sure || this.sure && cacheMap[this.currentSelect.code]);
const operate = {
cmdType: this.needBlock ? CMD.Signal.CMD_SIGNAL_BLOCK : CMD.Signal.CMD_SIGNAL_UNBLOCK,
operation: this.needBlock ? OperationEvent.Signal.lock.confirm1.operation : OperationEvent.Signal.unlock.confirm1.operation,
over: true,
param: {signalCode: this.selected.code}
cmdType: this.sure && isOK ? this.cmdType : null,
operation: this.command ? OperationEvent.Signal.lock.confirm1.operation : OperationEvent.Signal.unlock.confirm1.operation,
over: this.sure,
param: {signalCode: this.currentSelect.code}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (isOK) {
this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, { done: this.sure ? 'two' : 'one'});
} else {
this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code);
}
this.$emit('updateDone');
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
this.$emit('commandSuccess', this.selected.code);
}
}).catch(() => {
isClose && this.doClose();
this.$refs.noticeInfo.doShow();
});
} else {
this.$messageBox('两次选择不一致');
}
},
handleCurrentChange(val) {
this.$refs.table.setCurrentRow(this.selected);
if (!val) { return; }
const step = {
code: val.code,
operation: OperationEvent.Command.common.choose.operation,
val: val.code
};
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
this.$emit('updateDone');
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.sure || this.$emit('initSelect', this.currentSelect);
}
}).catch(_ => {
this.$refs.noticeInfo.doShow();
});
},
getSignalBlock(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (signalEle.blockade) {
return '关闭';
} else {
return '开启';
}
const elem = this.$store.getters['map/getDeviceByCode'](code);
return elem.blockade ? '关闭' : '开启';
},
getProcess(code) {
if (this.selected && this.selected.code === code) {
return '等待确认/取消';
const cacheMap = this.getCacheMap();
const cache = cacheMap[code];
if (cache) {
if (this.sure) {
return cache.done == 'two' ? '确认允许锁闭完成' : '等待确认/取消';
} else {
return '';
return cache.done == 'one' ? '已初始化' : '';
}
}
return '';
},
cancel() {
const operate = {
@ -188,7 +262,7 @@ export default {
.radio-box-title {
position: relative;
left: 18px;
top: 115px;
top: 108px;
text-align: center;
color: #000;
width: 40px;

View File

@ -114,22 +114,22 @@ export default {
});
},
getSignalStatus(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (signalEle.blockade) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.blockade) {
return '锁闭的';
} else {
return '未设锁闭';
}
},
getSignalShow(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (signalEle.redOpen && !signalEle.yellowOpen && !signalEle.greenOpen) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.redOpen && !elem.yellowOpen && !elem.greenOpen) {
return '红';
} else if (!signalEle.redOpen && !signalEle.yellowOpen && signalEle.greenOpen) {
} else if (!elem.redOpen && !elem.yellowOpen && elem.greenOpen) {
return '绿';
} else if (!signalEle.redOpen && signalEle.yellowOpen && !signalEle.greenOpen) {
} else if (!elem.redOpen && elem.yellowOpen && !elem.greenOpen) {
return '黄';
} else if (signalEle.redOpen && signalEle.yellowOpen && !signalEle.greenOpen) {
} else if (elem.redOpen && elem.yellowOpen && !elem.greenOpen) {
return '引导';
} else {
return '';
@ -171,7 +171,7 @@ export default {
}
.set-status-title{
position: relative;
top: 115px;
top: 108px;
background: #F0F0F0;
width: 40px;
text-align: center;

View File

@ -1,10 +1,10 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="600px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="18">
<el-col :span="sure? 18: 24">
<el-table
ref="table"
:data="signalList"
:data="tempList"
highlight-current-row
height="300px"
@current-change="handleCurrentChange"
@ -28,7 +28,7 @@
<el-table-column prop="unblockProcess" width="150" label="区间信号引导过程" />
</el-table>
</el-col>
<el-col :span="6">
<el-col :span="6" v-if="sure">
<div class="radio-box-title">命令</div>
<div class="radio-box">
<el-radio v-model="command" :label="true" style="display: block;margin-bottom: 10px;">确认</el-radio>
@ -38,10 +38,10 @@
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit(true)">确定(O)</el-button>
<el-button :id="domIdConfirm" type="primary" :disabled="!!disabled" :loading="loading" @click="commit(true)">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdApply" type="primary" :loading="loading" @click="commit(false)">应用(A)</el-button>
<el-button :id="domIdApply" type="primary" :disabled="!!disabled" :loading="loading" @click="commit(false)">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
@ -56,25 +56,44 @@
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SignalGuide',
props: {
initCacheMap: {
type: Object,
default() {
return {}
}
},
initInfo: {
type: Object,
default() {
return {}
}
},
updateDone: {
type: Number,
default: 0
}
},
components: {
NoticeInfo
},
data() {
return {
title: '',
status: false,
standStatus: true,
allChecked: false,
dialogShow: false,
loading: false,
command: true,
operate: ''
sure: false,
currentSelect: null,
noInit: true
};
},
computed: {
@ -84,8 +103,17 @@ export default {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
selected() {
return this.$store.state.menuOperation.selected;
tempList() {
return this.signalList;
},
initSelect() {
return this.initInfo.initSelect||{};
},
cmdType() {
return CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
},
disabled() {
return !this.currentSelect || !this.currentSelect.callOn || this.noInit;
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Command.common.choose1.domId : ''
@ -98,9 +126,6 @@ export default {
},
domIdApply() {
return this.dialogShow ? OperationEvent.Command.common.apply1.domId : '';
},
title() {
return '确认/取消引导';
}
},
watch: {
@ -108,77 +133,121 @@ export default {
if (this.show) {
this.commit();
}
},
updateDone() {
if (this.currentSelect) {
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code]||{}).done != 'one';
}
}
},
methods: {
doShow(operate) {
getCacheMap() {
return this.initCacheMap[this.cmdType.value]||{};
},
doShow(operate, sure) {
this.operate = operate;
//
this.sure = sure;
this.title = `${sure? '确认/取消引导': '初始化引导'}`;
this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code);
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow(this.selected);
this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null);
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.table.setCurrentRow();
this.sure && (this.currentSelect = null);
this.sure && this.$refs.table.setCurrentRow();
this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value,
Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done'))
)
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = false) {
if (this.currentSelect &&
this.currentSelect.code == this.initSelect.code) {
const cacheMap= this.getCacheMap();
const isOK = this.command&&(!this.sure || this.sure&&cacheMap[this.currentSelect.code])
const operate = {
cmdType: this.command
? CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
: CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE,
cmdType: this.sure&&isOK? this.cmdType: null,
operation: this.command
? OperationEvent.Command.common.confirm1.operation
: OperationEvent.Command.common.apply1.operation,
over: true,
param: {signalCode: this.selected.code}
over: this.sure,
param: {signalCode: this.currentSelect.code}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (isOK) {
this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, { done: this.sure? 'two': 'one'});
} else {
this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code);
}
this.$emit('updateDone')
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
this.$emit('commandSuccess', this.selected.code);
}
}).catch(() => {
isClose && this.doClose();
this.$refs.noticeInfo.doShow();
});
},
getSignalShow(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (signalEle.redOpen && !signalEle.yellowOpen && !signalEle.greenOpen) {
return '红';
} else if (!signalEle.redOpen && !signalEle.yellowOpen && signalEle.greenOpen) {
return '绿';
} else if (!signalEle.redOpen && signalEle.yellowOpen && !signalEle.greenOpen) {
return '黄';
} else if (signalEle.redOpen && signalEle.yellowOpen && !signalEle.greenOpen) {
return '引导';
} else {
return '';
}
},
getCanGuide(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (signalEle.callOn) {
return '是';
} else {
return '否';
}
},
getProcess(code) {
if (this.selected && this.selected.code === code) {
return '等待确认/取消';
} else {
return '';
this.$messageBox('两次选择不一致');
}
},
handleCurrentChange(val) {
this.$refs.table.setCurrentRow(this.selected);
if (!val) { return; }
const step = {
code: val.code,
operation: OperationEvent.Command.common.choose.operation,
val: val.code
};
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
this.$emit('updateDone')
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.sure || this.$emit('initSelect', this.currentSelect);
}
}).catch(_ => {
this.$refs.noticeInfo.doShow();
});
},
getSignalShow(code) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.redOpen && !elem.yellowOpen && !elem.greenOpen) {
return '红';
} else if (!elem.redOpen && !elem.yellowOpen && elem.greenOpen) {
return '绿';
} else if (!elem.redOpen && elem.yellowOpen && !elem.greenOpen) {
return '黄';
} else if (elem.redOpen && elem.yellowOpen && !elem.greenOpen) {
return '引导';
}
return '';
},
getCanGuide(code) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
return elem.callOn ? '是': '否';
},
getProcess(code) {
const cacheMap = this.getCacheMap();
const cache = cacheMap[code];
if (cache) {
if (this.sure) {
return cache.done == 'two' ? '确认引导完成' : '等待确认/取消';
} else {
return cache.done == 'one' ? '已初始化' : ''
}
}
return '';
},
cancel() {
const operate = {
@ -186,7 +255,7 @@ export default {
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$emit('cancelCommand');
this.initEle = null;
this.doClose();
}
}).catch(() => {
@ -217,7 +286,7 @@ export default {
.radio-box-title {
position: relative;
left: 18px;
top: 115px;
top: 108px;
text-align: center;
color: #000;
width: 40px;

View File

@ -1,10 +1,10 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="750px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="18">
<el-col :span="sure? 18: 24">
<el-table
ref="table"
:data="signalList"
:data="tempList"
height="300px"
highlight-current-row
:dom-id-choose="domIdChoose"
@ -18,7 +18,7 @@
<el-table-column v-if="!isCbtc" prop="status" label="后备模式进程" />
</el-table>
</el-col>
<el-col :span="5" :offset="1">
<el-col :span="5" :offset="1" v-if="sure">
<div class="set-status-title">命令</div>
<div class="set-status-box">
<el-radio v-model="command" :label="true">确认</el-radio>
@ -29,10 +29,10 @@
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected" @click="commit(true)">确定(O)</el-button>
<el-button :id="domIdConfirm" type="primary" :disabled="!!disabled" :loading="loading" @click="commit(true)">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdConfirm" :loading="loading" :disabled="!selected" @click="commit(false)">应用(A)</el-button>
<el-button :id="domIdConfirm" type="primary" :disabled="!!disabled" :loading="loading" @click="commit(false)">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
@ -48,23 +48,43 @@
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { mapGetters } from 'vuex';
export default {
name: 'SignalBlock',
props: {
initCacheMap: {
type: Object,
default() {
return {}
}
},
initInfo: {
type: Object,
default() {
return {}
}
},
updateDone: {
type: Number,
default: 0
}
},
components: {
NoticeInfo
},
data() {
return {
title: '',
status: false,
command: true,
allChecked: false,
dialogShow: false,
loading: false,
operate: {}
operate: {},
sure: false,
currentSelect: null,
noInit: true
};
},
computed: {
@ -74,12 +94,21 @@ export default {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
selected() {
return this.$store.state.menuOperation.selected;
tempList() {
return this.signalList;
},
initSelect() {
return this.initInfo.initSelect||{};
},
isCbtc() {
return this.operate.operation === OperationEvent.Command.mBar.cbtcMode.operation;
},
cmdType() {
return this.isCbtc ? CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING : CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING;
},
disabled() {
return !this.currentSelect || this.noInit;
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Command.common.choose.domId : '';
},
@ -91,9 +120,6 @@ export default {
},
domIdApply() {
return this.dialogShow ? OperationEvent.Command.common.apply.domId : '';
},
title() {
return this.isCbtc ? '确认/取消CBTC模式' : '确认/取消后备模式';
}
},
watch: {
@ -101,9 +127,44 @@ export default {
if (this.show) {
this.commit();
}
},
updateDone() {
if (this.currentSelect) {
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code]||{}).done != 'one';
}
}
},
methods: {
getCacheMap() {
return this.initCacheMap[this.cmdType.value]||{};
},
doShow(operate, sure) {
this.operate = operate;
this.sure = sure;
if (sure) {
this.title = `${this.isCbtc ? '确认/取消CBTC模式' : '确认/取消后备模式'}`;
} else {
this.title = `${this.isCbtc ? '初始化CBTC模式' : '初始化后备模式'}`;
}
this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code);
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null);
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.sure && (this.currentSelect = null);
this.sure && this.$refs.table.setCurrentRow();
this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value,
Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done'))
)
this.$store.dispatch('training/emitTipFresh');
},
handleCurrentChange(val) {
if (!val) { return; }
const step = {
@ -111,48 +172,47 @@ export default {
operation: OperationEvent.Command.common.choose.operation,
val: val.code
};
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$store.dispatch('menuOperation/setSelected', {device: val});
this.$refs.table.setCurrentRow(this.selected);
this.sure || this.$emit('initSelect', this.currentSelect);
}
}).catch(() => {
}).catch(_ => {
this.$refs.noticeInfo.doShow();
});
},
doShow(operate) {
this.operate = operate;
//
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = false) {
if (this.currentSelect &&
this.currentSelect.code == this.initSelect.code) {
const cacheMap= this.getCacheMap();
const isOK = this.command&&(!this.sure || this.sure&&cacheMap[this.currentSelect.code])
const step = {
cmdType: this.isCbtc ? CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING : CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING,
cmdType: this.sure&&isOK? this.cmdType: null,
operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation,
over: true,
param: { signalCode: this.selected.code }
over: this.sure,
param: { signalCode: this.currentSelect.code }
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (isOK) {
this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, { done: this.sure? 'two': 'one'});
} else {
this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code);
}
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
}
}).catch(() => {
isClose && this.doClose();
this.$refs.noticeInfo.doShow();
});
} else {
this.$messageBox('两次选择不一致');
}
},
cancel() {
const operate = {
@ -188,7 +248,7 @@ export default {
}
.set-status-title{
position: relative;
top: 115px;
top: 108px;
background: #F0F0F0;
width: 40px;
text-align: center;

View File

@ -30,10 +30,10 @@
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected" @click="commit(true)">确定(O)</el-button>
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="disabled" @click="commit(true)">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdApply" :loading="loading" :disabled="!selected" @click="commit(false)">应用(A)</el-button>
<el-button :id="domIdApply" :loading="loading" :disabled="disabled" @click="commit(false)">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
@ -77,6 +77,9 @@ export default {
selected() {
return this.$store.state.menuOperation.selected;
},
disabled() {
return !this.selected
},
filterSignalList() {
return this.signalList.map(el => {
return this.$store.getters['map/getDeviceByCode'](el.code);
@ -137,7 +140,6 @@ export default {
},
doShow(operate) {
this.operate = operate;
//
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow();
@ -205,7 +207,7 @@ export default {
}
.set-status-title{
position: relative;
top: 115px;
top: 108px;
background: #F0F0F0;
width: 40px;
text-align: center;

View File

@ -104,7 +104,6 @@ export default {
commit() {
},
handleClick() {
},
getDetainStatus(code) {
const stand = this.$store.getters['map/getDeviceByCode'](code);

View File

@ -224,7 +224,7 @@ export default {
}
.radio-box-title {
position: relative;
top: 115px;
top: 108px;
left: 20px;
color: #000;
width: 60px;

View File

@ -253,7 +253,7 @@ export default {
}
.radio-box-title {
position: relative;
top: 115px;
top: 108px;
left: 20px;
color: #000;
width: 60px;

View File

@ -254,7 +254,7 @@ export default {
}
.radio-box-title {
position: relative;
top: 115px;
top: 108px;
left: 20px;
color: #000;
width: 60px;

View File

@ -254,7 +254,7 @@ export default {
}
.radio-box-title {
position: relative;
top: 115px;
top: 108px;
left: 20px;
color: #000;
width: 60px;

View File

@ -202,7 +202,7 @@ export default {
.radio-box-title {
position: relative;
left: 18px;
top: 115px;
top: 108px;
text-align: center;
color: #000;
width: 60px;

View File

@ -1,11 +1,11 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="700px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="18">
<el-col :span="sure? 18: 24">
<el-table
:id="domIdChoose"
ref="table"
:data="switchList"
:data="tempList"
highlight-current-row
height="350px"
@current-change="handleCurrentChange"
@ -28,7 +28,7 @@
</el-table-column>
</el-table>
</el-col>
<el-col :span="6">
<el-col :span="6" v-if="sure">
<div class="radio-box-title">命令</div>
<div class="radio-box">
<el-radio v-model="command" :label="true" style="display: block;margin-bottom: 10px;">确认</el-radio>
@ -38,10 +38,10 @@
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit(true)">确定(O)</el-button>
<el-button :id="domIdConfirm" type="primary" :disabled="!!disabled" :loading="loading" @click="commit(true)">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdApply" type="primary" :loading="loading" @click="commit(false)">应用(A)</el-button>
<el-button :id="domIdApply" type="primary" :disabled="!!disabled" :loading="loading" @click="commit(false)">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
@ -61,19 +61,40 @@ import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'StandDetain',
props: {
initCacheMap: {
type: Object,
default() {
return {}
}
},
initInfo: {
type: Object,
default() {
return {}
}
},
updateDone: {
type: Number,
default: 0
}
},
components: {
NoticeInfo
},
data() {
return {
title: '',
status: false,
standStatus: true,
allChecked: false,
dialogShow: false,
loading: false,
command: true,
title: ''
sure: false,
operate: {},
currentSelect: null,
noInit: true,
};
},
computed: {
@ -83,11 +104,20 @@ export default {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
selected() {
return this.$store.state.menuOperation.selected;
tempList() {
return this.switchList;
},
initSelect() {
return this.initInfo.initSelect||{};
},
isBlock() {
return this.operate && this.operate.operation === OperationEvent.Command.commandNingBo3.line_switch_block.operation;
return this.operate && this.operate.operation.includes(OperationEvent.Command.commandNingBo3.line_switch_block.operation);
},
cmdType() {
return this.isBlock ? CMD.Switch.CMD_SWITCH_BLOCK : CMD.Switch.CMD_SWITCH_UNBLOCK;
},
disabled() {
return !this.currentSelect || (this.isBlock? this.currentSelect.blockade: !this.currentSelect.blockade) || this.noInit;
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Command.common.choose.domId : '';
@ -107,52 +137,75 @@ export default {
if (this.show) {
this.commit();
}
},
updateDone() {
if (this.currentSelect) {
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code]||{}).done != 'one';
}
}
},
methods: {
doShow(operate) {
//
getCacheMap() {
return this.initCacheMap[this.cmdType.value]||{};
},
doShow(operate, sure) {
this.operate = operate;
this.title = this.isBlock ? '确认/取消道岔封锁' : '确认/取消道岔解除封锁';
this.sure = sure;
if (sure) {
this.title = `${this.isBlock ? '确认/取消道岔封锁' : '确认/取消道岔解除封锁'}`;
} else {
this.title = `${this.isBlock ? '初始化道岔封锁': '初始化解除封锁'}`;
}
this.currentSelect = sure? this.$store.getters['map/getDeviceByCode'](this.initSelect.code): null
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.table.setCurrentRow();
this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null);
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.table.setCurrentRow();
this.sure && (this.currentSelect = null);
this.sure && this.$refs.table.setCurrentRow();
this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value,
Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done'))
)
this.$store.dispatch('training/emitTipFresh');
},
getSwitchStatus(code) {
const switchEle = this.$store.getters['map/getDeviceByCode'](code);
if (switchEle.blockade) {
return '锁闭的';
} else {
return '未锁闭的';
}
},
commit(isClose = false) {
if (this.command) {
if (this.currentSelect &&
this.currentSelect.code == this.initSelect.code) {
const cacheMap= this.getCacheMap()
const isOK = this.command&&(!this.sure || this.sure&&cacheMap[this.currentSelect.code])
const operate = {
cmdType: this.isBlock ? CMD.Switch.CMD_SWITCH_BLOCK : CMD.Switch.CMD_SWITCH_UNBLOCK,
cmdType: this.sure&&isOK ? this.cmdType : null,
operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation,
over: true,
param: { switchCode: this.selected.code }
over: this.sure,
param: { switchCode: this.currentSelect.code }
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
isClose && this.doClose();
this.$emit('commandSuccess', this.selected.code);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (isOK) {
this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, {done: this.sure? 'two': 'one'});
} else {
this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code);
}
}).catch(() => {
this.$emit('updateDone')
this.$store.dispatch('map/flushMapRef');
isClose && this.doClose();
}
}).catch(_ => {
isClose && this.doClose();
this.$refs.noticeInfo.doShow();
});
} else {
this.cancel();
this.$messageBox('两次选择不一致');
}
},
handleCurrentChange(val) {
@ -162,21 +215,36 @@ export default {
operation: OperationEvent.Command.common.choose.operation,
val: val.code
};
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
this.$emit('updateDone')
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$store.dispatch('menuOperation/setSelected', {device: val});
this.sure || this.$emit('initSelect', this.currentSelect);
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
getSwitchStatus(code) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
return elem.blockade? '锁闭的': '未锁闭的';
},
getProcess(code, type) {
if (this.selected && this.selected.code === code && ((type === 'block' && this.isBlock) || (type === 'unblock' && !this.isBlock))) {
return '等待确认/取消';
const blockType = this.isBlock ? 'block': 'unblock';
const cacheMap = this.getCacheMap();
const cache = cacheMap[code];
if (blockType==type) {
if (cache) {
if (this.sure) {
return cache.done == 'two' ? this.isBlock ? '确认锁闭完成' : '确认解锁完成' : '等待确认/取消';
} else {
return '';
return cache.done == 'one' ? '已初始化' : ''
}
}
}
return '';
},
cancel() {
const operate = {
@ -184,10 +252,9 @@ export default {
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$emit('cancelCommand');
this.doClose();
}
}).catch(() => {
}).catch(error => {
this.doClose();
});
}
@ -215,7 +282,7 @@ export default {
.radio-box-title {
position: relative;
left: 18px;
top: 115px;
top: 108px;
text-align: center;
color: #000;
width: 40px;

View File

@ -174,18 +174,18 @@ export default {
});
},
getSwitchPosition(code) {
const switchEle = this.$store.getters['map/getDeviceByCode'](code);
if (switchEle.normalPosition) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.normalPosition) {
return '定位';
} else if (switchEle.reversePosition) {
} else if (elem.reversePosition) {
return '反位';
} else {
return '';
}
},
getSwitchStatus(code) {
const switchEle = this.$store.getters['map/getDeviceByCode'](code);
if (switchEle.blockade) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.blockade) {
return '锁闭的';
} else {
return '未锁闭的';

View File

@ -100,18 +100,18 @@ export default {
this.$store.dispatch('training/emitTipFresh');
},
getSwitchPosition(code) {
const switchEle = this.$store.getters['map/getDeviceByCode'](code);
if (switchEle.normalPosition) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.normalPosition) {
return '定位';
} else if (switchEle.reversePosition) {
} else if (elem.reversePosition) {
return '反位';
} else {
return '';
}
},
getSwitchStatus(code) {
const switchEle = this.$store.getters['map/getDeviceByCode'](code);
if (switchEle.blockade) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.blockade) {
return '锁闭的';
} else {
return '未锁闭的';

View File

@ -2,20 +2,20 @@
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="1000px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="10">
<el-table :data="tableData" height="397px" style="margin-top: 57px">
<el-table-column prop="groupNumber" label="列车" />
<el-table-column prop="groupNumber" label="班次" />
<el-table-column prop="groupNumber" label="运行线" />
<el-table-column prop="length" label="长度" />
<el-table :id="domIdChoose" ref="trainTable" :data="tableData" height="397px" style="margin-top: 57px" :highlight-current-row="true" @current-change="handleChangeTrain">
<el-table-column prop="trainName" label="列车" />
<!-- <el-table-column prop="groupNumber" label="班次" /> -->
<el-table-column prop="runPathName" label="运行线" />
<!-- <el-table-column prop="length" label="长度" />
<el-table-column prop="mode" label="模式" />
<el-table-column prop="status" label="状态" />
<el-table-column prop="status" label="状态" /> -->
</el-table>
</el-col>
<el-col :span="13" :offset="1">
<el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
<el-tab-pane label="运行线" name="first">
<el-table :data="stationStandList" height="380px">
<el-table-column prop="name" label="站台" />
<el-table :id="domIdChoose1" ref="runLineTable" :data="runLineList" height="380px" :highlight-current-row="true" @current-change="handleChange">
<el-table-column prop="name" label="运行线" />
</el-table>
</el-tab-pane>
<el-tab-pane label="往返" name="second">
@ -57,10 +57,10 @@
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定(O)</el-button>
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="status" @click="commit(true)">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button>应用(A)</el-button>
<el-button :loading="loading" :disabled="status" @click="commit(false)">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
@ -78,6 +78,8 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
// import {mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { getSimulationDestinationList } from '@/api/jmap/mapdraft';
import { mapGetters } from 'vuex';
export default {
@ -87,12 +89,16 @@ export default {
},
data() {
return {
status:true,
tableData: [],
runLineList:[],
activeName: 'first',
dialogShow: false,
loading: false,
selectStandCode: '',
showPath: false
showPath: false,
selectedTrain:'',
selectedRunPath:''
};
},
computed: {
@ -103,14 +109,17 @@ export default {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
selected() {
return this.$store.state.menuOperation.selected;
},
// selected() {
// return this.$store.state.menuOperation.selected;
// },
domIdClose() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.choose.domId : '';
return this.dialogShow ? OperationEvent.Command.common.choose.domId : '';
},
domIdChoose1() {
return this.dialogShow ? OperationEvent.Command.common.choose1.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
@ -120,18 +129,33 @@ export default {
}
},
watch: {
'$store.state.map.keyboardEnterCount': function (val) {
if (this.show) {
this.commit();
'$store.state.map.runLineTrainUpdate': function (val) {
if (val) {
this.getTrainList();
this.status = true;
} else {
this.tableData = [];
}
}
// '$store.state.training.runPathList':function(val) {
// console.log(val);
// }
},
mounted() {
getSimulationDestinationList(this.$route.query.group).then(res=>{
res.data.forEach(element => {
this.runLineList.push({code:element.code, name:element.code + '(' + element.description + ')', runPath:element.runPath});
});
}).catch(()=>{
});
},
methods: {
expandPath() {
console.log('展开进路预览');
},
doShow(operate, activeName) {
this.$store.dispatch('menuOperation/setSelected', {device: selected});
this.getTrainList();
// this.$store.dispatch('menuOperation/setSelected', {device: selected});
this.activeName = activeName;
//
this.dialogShow = true;
@ -139,16 +163,155 @@ export default {
this.$store.dispatch('training/emitTipFresh');
});
},
getTrainList() {
this.tableData = [];
const activeTrainList = this.$store.state.map.activeTrainList;
activeTrainList.forEach((trainCode)=>{
const train = this.$store.getters['map/getDeviceByCode'](trainCode);
let destinationCode = train.destinationCode;
const trainName = 'DD' + train.serviceNumber + train.tripNumber;
if (train.destinationCode) {
const runPath = this.runLineList.find((path)=>{ return path.code == train.destinationCode; });
if (runPath) { destinationCode = runPath.name; }
}
this.tableData.push({code:train.groupNumber + ':' + train.serviceNumber, trainName:trainName, runPathName:destinationCode});
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.status = true;
this.selectedRunPath = '';
this.selectedTrain = '';
this.$store.dispatch('training/emitTipFresh');
// this.$store.dispatch('menuOperation/setSelected', {device: {}});
this.$refs.runLineTable.setCurrentRow();
this.$refs.trainTable.setCurrentRow();
// mouseCancelState(this.selected);
this.$store.dispatch('training/setRunPathSelected', []);
},
commit() {
commit(isClose = false) {
// this.selectedRunPath = '';
// this.selectedTrain = '';
this.loading = true;
const trainInfo = this.selectedTrain.split(':');
const params = {
groupNumber: trainInfo[0],
destinationCode: this.selectedRunPath,
serviceNumber: trainInfo[1]
};
const steps = {
operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation,
over: true,
param:params
};
steps.cmdType = CMD.TrainWindow.CMD_TRAIN_SET_HEAD;
this.$store.dispatch('training/nextNew', steps).then(({ valid }) => {
if (valid) {
this.loading = false;
if (isClose) {
this.doClose();
}
}
}).catch(() => {
isClose && this.doClose();
this.loading = false;
this.$refs.noticeInfo.doShow();
});
},
handleClick() {
},
judgeCanCommit() {
if (this.selectedTrain && this.selectedRunPath) {
this.status = false;
} else {
this.status = true;
}
},
handleChange(row) {
if (row) {
const runPath = row.runPath;
if (runPath && runPath.length > 0) {
const step = {
code: row.code,
operation: OperationEvent.Command.common.choose1.operation,
val: row.code
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
const oldRunPath = [...this.$store.state.training.runPathList];
// this.setRunPath(oldRunPath, false);
// // this.$nextTick(()=>{
// // this.setRunPath(runPath, true);
// // });
// setTimeout(()=>{
// this.setRunPath(runPath, true);
// }, 500);
// this.setRunPath(runPath, true);
runPath.forEach(path=>{
if (oldRunPath.includes(path)) {
const index = oldRunPath.indexOf(path);
oldRunPath.splice(index, 1);
} else {
const section = this.$store.getters['map/getDeviceByCode'](path);
if (section && section.instance) {
section.instance.showRunLine('runPath');
}
}
});
oldRunPath.forEach(each=>{
const section = this.$store.getters['map/getDeviceByCode'](each);
if (section && section.instance) {
section.instance.setRunLineDefault();
}
});
this.selectedRunPath = row.code;
this.judgeCanCommit();
this.$store.dispatch('training/setRunPathSelected', runPath);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
}
} else {
const runPath = this.$store.state.training.runPathList;
this.setRunPath(runPath, false);
}
},
handleChangeTrain(row) {
if (row) {
const step = {
code: row.code,
operation: OperationEvent.Command.common.choose.operation,
val: row.code
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// this.$store.dispatch('menuOperation/setSelected', {device: row});
this.selectedTrain = row.code;
this.judgeCanCommit();
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
}
},
setRunPath(runPath, isShow) {
// console.log(isShow, runPath);
runPath.forEach(sectionCode=>{
const section = this.$store.getters['map/getDeviceByCode'](sectionCode);
if (section && section.instance) {
if (isShow) { section.instance.showRunLine('runPath'); } else { section.instance.setRunLineDefault(); }
}
});
},
cancel() {
const operate = {

View File

@ -262,7 +262,7 @@ export default {
}
.set-status-title{
position: relative;
top: 95px;
top: 88px;
background: #F0F0F0;
width: 40px;
text-align: center;

View File

@ -225,7 +225,7 @@ export default {
commit() {
if (this.row && this.row.canSetting) {
this.loading = true;
commitOperate(menuOperate.Signal.arrangementRoute, {routeCode: this.row.code}, 2, `${this.row.code}`).then(({valid})=>{
commitOperate(menuOperate.Signal.arrangementRoute, {routeCode: this.row.code}, 2, {val: `${this.row.code}`}).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();

View File

@ -143,7 +143,7 @@ export default {
},
sendCommand(operate, val) { //
this.loading = true;
commitOperate(operate, {}, 2, val).then(({valid})=>{
commitOperate(operate, {}, 2, { val }).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();

View File

@ -186,8 +186,6 @@ export default {
</script>
<style scoped>
.xian-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;

View File

@ -191,8 +191,6 @@ export default {
</script>
<style scoped>
.xian-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;

View File

@ -335,10 +335,8 @@ export default {
}
.xian-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
background: rgb(240 240 240);
position: relative;
left: -15px;
top: -18px;
}
.xian-01__systerm .el-dialog .el-form-item label {

View File

@ -1,72 +1,6 @@
<template>
<div id="menuBar">
<div class="nav">
<template v-for="(item,i) in menu">
<template v-if="noShowingChildren(item.children)">
<li :id="item.operate.domId" :key="i" class="nav-li" @click="hookClick(item)">
<span class="nav-li-text">{{ item.title }}</span>
</li>
</template>
<template v-else>
<li :id="item.operate.domId" :key="i" class="nav-li" @click.stop="selectedClassA(item, i)">
<span class="nav-li-text">{{ item.title }}</span>
<ul class="nav-ul" :class="{'active' :i==classA}">
<template v-for="(child,j) in item.children">
<template v-if="child.children&&child.children.length>0&&hasShowingChildren(child.children)">
<li
:id="child.operate.domId"
:key="j"
class="menu-li"
@click.stop="selectedClassB(child, j)"
>
<div class="menu-li-block">
<span class="menu-li-text">
<span class="status">&ensp;</span>
<span class="label">{{ child.title }}</span>
</span>
</div>
<ul class="menu-ul" :class="{'active' :j==classB}">
<template v-for="(grandchild,k) in child.children">
<li
v-if="grandchild.show"
:id="grandchild.operate.domId"
:key="k"
class="menu-li"
@click.stop="hookClick(grandchild)"
>
<div class="menu-li-block">
<span class="menu-li-text">
<span class="status">&ensp;</span>
<span class="label">{{ grandchild.title }}</span>
</span>
</div>
</li>
</template>
</ul>
</li>
</template>
<template v-else>
<li
v-if="child.show"
:id="child.operate.domId"
:key="j"
class="menu-li"
@click.stop="hookClick(child)"
>
<div class="menu-li-block">
<span class="menu-li-text">
<span class="status">&ensp;</span>
<span class="label">{{ child.title }}</span>
</span>
</div>
</li>
</template>
</template>
</ul>
</li>
</template>
</template>
</div>
<div id="menuBarXian01">
<menu-bar ref="menuBar" :menu-normal="menuNormal" style="width:100%" />
<!--<div class="deviceStatus">-->
<!--<div class="holdTrainStatus">H</div>-->
<!--<div class="jumpStopStatus">S</div>-->
@ -76,7 +10,6 @@
<view-train-id ref="viewTrainId" />
<view-name ref="viewName" />
<view-device ref="viewDevice" />
<notice-info ref="noticeInfo" pop-class="xian-01__systerm" />
<train-add ref="trainAdd" />
<train-transtalet ref="trainTranstalet" />
<train-delete ref="trainDelete" />
@ -85,11 +18,8 @@
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { TrainingMode } from '@/scripts/ConstDic';
import MenuBar from '@/jmapNew/theme/components/menus/menuBar';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler.js';
import { State2SimulationMap } from '@/scripts/cmdPlugin/Config.js';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import StationControlConvert from './menuDialog/stationControlConvert';
import TrainAdd from './menuDialog/trainAdd';
import TrainTranstalet from './menuDialog/trainTranstalet';
@ -100,13 +30,12 @@ import ViewName from './menuDialog/viewName';
import ViewDevice from './menuDialog/viewDevice';
import ManageUser from './menuDialog/manageUser';
import HelpAbout from './menuDialog/helpAbout';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import { EventBus } from '@/scripts/event-bus';
export default {
name: 'MenuBar',
name: 'MenuBarXian01',
components: {
NoticeInfo,
MenuBar,
StationControlConvert,
PasswordBox,
ViewTrainId,
@ -128,12 +57,6 @@ export default {
},
data() {
return {
classA: -1,
classB: -1,
tempClassA: -1,
tempClassB: -1,
valid: true,
menu: [],
menuNormal: {
Local: [
{
@ -399,133 +322,7 @@ export default {
}
};
},
computed: {
...mapGetters('training', [
'mode',
'started',
'steps',
'order',
'mode'
]),
...mapGetters('map', [
'stationList'
])
},
watch: {
tempClassA() {
this.classA = this.$store.state.menuOperation.break ? -1 : this.tempClassA;
},
tempClassB() {
this.classB = this.$store.state.menuOperation.break ? -1 : this.tempClassB;
},
'$store.state.menuOperation.break': function (val) {
if (val) {
this.classA = this.classB = -1;
} else {
this.classA = this.tempClassA;
this.classB = this.tempClassB;
}
},
'$store.state.training.operatemode': function (mode) {
this.initMenu();
},
'$store.state.training.started': function (val) {
this.closeMenu(true);
},
'$store.state.training.prdType': function () {
this.initMenu();
}
},
mounted() {
this.initMenu();
},
methods: {
initMenu(menu) {
this.menu = MenuContextHandler.menuBarConvert(this.menuNormal[State2SimulationMap[this.$store.state.training.prdType]], this.$store.state.training.operatemode);
this.clickEvent();
this.closeMenu(true);
},
clickEvent() {
const self = this;
window.onclick = function (e) {
if (document.getElementById('menuBar')) {
self.closeMenu(false);
}
};
},
noShowingChildren(children) {
if (!children || children.length <= 0) {
return true;
}
return false;
},
hasShowingChildren(children) {
if (children && children.length > 0) {
return true;
}
return false;
},
closeMenu(flag) {
if (flag || (this.mode !== TrainingMode.EDIT && this.mode !== TrainingMode.TEACH)) {
this.classA = this.tempClassA = -1;
this.classB = this.tempClassB = -1;
}
},
hookClick(item, event) {
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
if (item && typeof item.click == 'function') {
item.click(item.operate);
}
},
selectedClassA(item, index) {
const order = this.order || 0;
if (this.mode !== TrainingMode.TEACH) { //
this.popupMenuA(item, index);
} else if (this.steps[order] && this.steps[order].type == 'bar') { //
this.popupMenuA(item, index);
}
},
//
popupMenuA(item, index) {
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
this.clickEvent();
const operate = {
operation: item.operate.operation
};
if (this.$route.query.trainingId) {
operate.code = this.$store.state.training.offsetStationCode;
}
this.tempClassA = index;
this.tempClassB = -1;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
selectedClassB(item, index) {
const order = this.order || 0;
if (this.mode !== TrainingMode.TEACH) { //
this.popupMenuB(item, index);
} else if (this.steps[order] && this.steps[order].type == 'bar') { //
this.popupMenuB(item, index);
}
},
popupMenuB(item, index) {
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
const operate = {
operation: item.operate.operation
};
if (this.$route.query.trainingId) {
operate.code = this.$store.state.training.offsetStationCode;
}
this.tempClassB = index;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
//
turnToStationControl(order) {
const operate = {
@ -533,7 +330,7 @@ export default {
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$refs.menuBar.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationControlConvert.doShow(operate);
}
@ -546,7 +343,7 @@ export default {
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$refs.menuBar.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.passwordBox.doShow(operate);
}
@ -559,7 +356,7 @@ export default {
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$refs.menuBar.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationControlConvert.doShow(operate);
}
@ -572,7 +369,7 @@ export default {
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$refs.menuBar.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.viewTrainId.doShow(operate);
}
@ -585,7 +382,7 @@ export default {
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$refs.menuBar.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.viewName.doShow(operate);
}
@ -598,7 +395,7 @@ export default {
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$refs.menuBar.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.viewDevice.doShow(operate);
}
@ -611,7 +408,7 @@ export default {
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$refs.menuBar.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainAdd.doShow(operate);
}
@ -624,7 +421,7 @@ export default {
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$refs.menuBar.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainTranstalet.doShow(operate);
}
@ -637,7 +434,7 @@ export default {
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$refs.menuBar.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainDelete.doShow(operate);
}
@ -650,7 +447,7 @@ export default {
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$refs.menuBar.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.manageUser.doShow(operate);
}
@ -663,7 +460,7 @@ export default {
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.closeMenu(true);
this.$refs.menuBar.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.helpAbout.doShow(operate);
}
@ -671,7 +468,7 @@ export default {
},
//
refresh() {
this.closeMenu(true);
this.$refs.menuBar.closeMenu(true);
EventBus.$emit('refresh');
},
getLoginResult(operate) {
@ -684,143 +481,18 @@ export default {
}
},
undeveloped() {
this.doClose();
this.$refs.menuBar.doClose();
this.$alert(this.$t('menu.menuBar.implemented'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
callback: action => {
}
});
},
doClose() {
this.$nextTick(() => {
EventBus.$emit('closeMenu');
});
}
}
};
</script>
<style scoped rel="stylesheet/scss" lang="scss">
@import "src/styles/mixin.scss";
$width: 30px;
$height:30px;
$menuPadding: 10px;
$menuItemHeight: 30px;
$menuItemWidth: 190px;
$menuItemPadding: 5px;
#menuBar {
z-index: 36;
position: absolute;
width: inherit;
height: $height;
line-height: $height;
}
.nav {
display: block;
cursor: pointer;
color: #0000;
background: -webkit-linear-gradient(#FDFDFE, #DEE3F3);
background: -o-linear-gradient(#FDFDFE, #DEE3F3);
background: -moz-linear-gradient(#FDFDFE, #DEE3F3);
background: linear-gradient(#FDFDFE, #DEE3F3);
border: 1px solid #B6BCCC !important;
border-bottom: 2px solid #B6BCCC !important;
list-style: none;
}
.nav-li {
position: relative;
display: inline-block;
padding-left: $menuPadding;
padding-right: $menuPadding;
}
.nav-li:active {
background: #C9D0E1;
border-radius: 4px;
}
.nav-li-text {
font-size: 13px;
color: #000;
text-align: center;
text-decoration: none;
}
.nav-ul {
display: none;
position: absolute;
list-style: none;
border: 1px solid gray !important;
line-height: $menuItemHeight;
width: $menuItemWidth;
padding: 0px;
margin: 0px;
}
.menu-ul {
display: none;
list-style: none;
background: #F0F0F0;
line-height: $menuItemHeight;
width: $menuItemWidth;
bottom: $menuItemHeight;
}
.active {
position: absolute;
display: block !important;
}
.menu-ul-text {
font-size: 14px;
color: #000;
letter-spacing: 0;
height: $menuItemHeight;
line-height: $menuItemHeight;
}
.menu-li {
text-align: left;
background: #F0F0F0;
height: $menuItemHeight;
line-height: $menuItemHeight;
}
.menu-li-block {
display: flex;
letter-spacing: 0;
height: $menuItemHeight;
line-height: $menuItemHeight;
}
.menu-li-text {
font-size: 14px;
color: #000;
}
.menu-li-text .status {
display: block;
float: left;
border-right: 1px inset #CACACA;
width: $width;
}
.menu-li-text .label {
display: block;
float: left;
}
.menu-li-block:hover {
background: #C9DEF7;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.deviceStatus{
display: inline-block;
font-size: 0;
@ -837,4 +509,11 @@ export default {
background: #ccc;
font-size:14px;
}
#menuBarXian01{
line-height:30px;
}
#menuBarXian01 #menuBar .menu-li-block .label{
padding: 0px 30px 0px 5px !important;
}
</style>

View File

@ -155,13 +155,3 @@ export default {
}
};
</script>
<style scoped>
.xian-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -10px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -126,13 +126,3 @@ export default {
}
};
</script>
<style scoped>
.xian-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -10px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -172,13 +172,3 @@ export default {
}
};
</script>
<style scoped>
.xian-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -10px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -123,13 +123,3 @@ export default {
}
};
</script>
<style scoped>
.xian-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -10px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -294,10 +294,8 @@ export default {
</script>
<style scoped>
.xian-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -10px;
left: 0px;
top: -20px;
padding: 0 5px;
background-color: #F0F0F0;
}

View File

@ -13,7 +13,7 @@
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules">
<div style="padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px;">
<span class="base-label">{{ $t('menu.menuDialog.addLocation') }}</span>
<div style="position: relative; top:-10px;">
<div style="position: relative; top:-25px;">
<el-form-item prop="stationStandCode">
<span slot="label">{{ $t('menu.menuDialog.terminalOne') }}</span>
<el-select v-model="addModel.stationStandCode" filterable :placeholder="$t('menu.menuDialog.pleaseSelect')">
@ -160,10 +160,8 @@ export default {
</script>
<style scoped>
.xian-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
top: -25px;
padding: 0 5px;
background-color: #F0F0F0;
}

Some files were not shown because too many files have changed in this diff Show More