# Conflicts:
#	src/jmapNew/utils/parser.js
This commit is contained in:
zyy 2020-03-06 10:23:14 +08:00
commit 6d0849f5b3
29 changed files with 861 additions and 37 deletions

View File

@ -257,6 +257,15 @@ class SkinCode extends defaultStyle {
mouseOverStyle: {
borderLineColor: '#FFFFFF',
borderLineDash: [3, 3]
},
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 控制灯大小
lampColor: '#5A5D5A' // 功能按钮颜色
}
};

View File

@ -258,6 +258,15 @@ class SkinCode extends defaultStyle {
position: 1, // 运行等级方向
offset: {x: -8, y: 30}, // 运行等级偏移量
textColor: '#FFF000' // 停站等级字体颜色
},
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 控制灯大小
lampColor: '#5A5D5A' // 功能按钮颜色
}
};

View File

@ -263,6 +263,15 @@ class SkinCode extends defaultStyle {
position: 1, // 运行等级方向
offset: {x: -8, y: 15}, // 运行等级偏移量
textColor: '#FFF000' // 停站等级字体颜色
},
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 控制灯大小
lampColor: '#5A5D5A' // 功能按钮颜色
}
};
@ -295,7 +304,8 @@ class SkinCode extends defaultStyle {
},
lamp: {
radiusR: 6, // 控制灯大小
controlColor: '#FFFF00' // 控制灯颜色
controlColor: '#FFFF00', // 控制灯颜色
guideColor: '#5A5D5A' // 引导总锁灯颜色
},
turnBack: { // 按图折返
lamp: 1, // 灯数量
@ -413,7 +423,43 @@ class SkinCode extends defaultStyle {
this[deviceType.Line] = {
lineColor: '#FFFFFF' // 线条颜色
};
this[deviceType.Automactic] = {
// 是否显示
visible: true,
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
subtitleText: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 17 // 等于副标题距离
},
lamp: {
lineDash: null, // 灯的包围框
stroke: '#FFFFFF', // 框的颜色
fill: 'rgba(0,0,0,0)', // 填充色
radiusR: 6, // 控制灯大小
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
}
};
this[deviceType.AutomaticRoute] = {
// 是否显示
visible: true,
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
lineDash: null, // 灯的包围框
stroke: '#FFFFFF', // 框的颜色
fill: 'rgba(0,0,0,0)', // 填充色
radiusR: 6, // 控制灯大小
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
}
};
this[deviceType.TrainWindow] = {
lineColor: '#4DD43F', // 车次窗颜色
lineDash: null, // 车次窗虚线间隔

View File

@ -241,6 +241,15 @@ class SkinCode extends defaultStyle {
position: 1, // 运行等级方向
offset: {x: -8, y: 6}, // 运行等级偏移量
textColor: '#FFFFFF' // 停站等级字体颜色
},
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 控制灯大小
lampColor: '#5A5D5A' // 功能按钮颜色
}
};

View File

@ -246,6 +246,15 @@ class SkinCode extends defaultStyle {
position: 1, // 运行等级方向
offset: { x: -8, y: 6 }, // 运行等级偏移量
textColor: '#FFFFFF' // 停站等级字体颜色
},
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 控制灯大小
lampColor: '#5A5D5A' // 功能按钮颜色
}
};

View File

@ -284,6 +284,15 @@ class SkinCode extends defaultStyle {
position: -1, // 运行等级方向
offset: { x: -8, y: 4 }, // 运行等级偏移量
textColor: '#FFF000' // 停站等级字体颜色
},
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 控制灯大小
lampColor: '#5A5D5A' // 功能按钮颜色
}
};

View File

@ -128,4 +128,10 @@ deviceRender[deviceType.OutFrame] = {
zlevel: 1
};
/** AutomacticRoute渲染配置 自动进路*/
deviceRender[deviceType.AutomaticRoute] = {
_type: deviceType.AutomaticRoute,
zlevel: 1
};
export default deviceRender;

View File

@ -19,7 +19,8 @@ const deviceType = {
TrainWindow: 'TrainWindow',
Line: 'Line',
Text: 'Text',
CheckBox: 'CheckBox'
CheckBox: 'CheckBox',
AutomaticRoute:'AutomaticRoute'
};
export default deviceType;

View File

@ -0,0 +1,53 @@
import Group from 'zrender/src/container/Group';
import Text from 'zrender/src/graphic/Text';
export default class EMouse extends Group {
constructor(device) {
super();
this.device = device;
this.create();
}
create() {
this.text = new Text({
zlevel: this.device.zlevel,
z: this.device.z+1,
position: [0, 0],
style: {
x: this.device.model.position.x,
y: this.device.model.position.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance-30,
fontWeight: 'normal',
fontSize: this.device.style.LcControl.mouseOverStyle.fontSize,
fontFamily: this.device.style.LcControl.mouseOverStyle.fontFamily,
text: this.device.model.name,
textFill: this.device.style.LcControl.mouseOverStyle.fontColor,
textAlign: this.device.style.LcControl.mouseOverStyle.textAlign,
textVerticalAlign: this.device.style.LcControl.mouseOverStyle.textVerticalAlign
}
});
this.add(this.text);
this.text.hide();
}
mouseover(e) {
if (e.target && e.target._subType == 'Text') {
this.text.show();
} else {
this.device.control.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor);
this.device.control.setTextColor(this.device.style.LcControl.mouseOverStyle.textColor);
this.device.control.setTextBorder(true);
this.device.control.setArcBorder(true);
}
}
mouseout(e) {
if (!this.device.model.down) {
if (e.target && e.target._subType == 'Text') {
this.text.hide();
} else {
this.device.control.setControlColor(this.device.style.LcControl.lamp.controlColor);
this.device.control.setTextColor('#FFFFFF');
this.device.control.setTextBorder(false);
this.device.control.setArcBorder(false);
}
}
}
}

View File

@ -0,0 +1,105 @@
/*
* 自动折返 控制器
*/
import Group from 'zrender/src/container/Group';
import Arc from 'zrender/src/graphic/shape/Arc';
import Text from 'zrender/src/graphic/Text';
import EMouse from './EMouse';
export default class LcControl extends Group {
constructor(model, style) {
super();
this.z = 20;
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
this.model = model;
this.style = style;
this.create();
this.createMouseEvent();
this.setState(model);
}
create() {
const model = this.model;
this.control = new Arc({
_subType: 'Control',
zlevel: this.zlevel,
z: this.z,
shape: {
cx: model.position.x,
cy: model.position.y,
r: this.style.AutomaticRoute.lamp.radiusR
},
style: {
lineWidth: 0,
fill: this.style.AutomaticRoute.lamp.controlColor
}
});
this.text = new Text({
_subType: 'Text',
zlevel: this.zlevel,
z: this.z,
position: [0, 0],
style: {
x: model.position.x,
y: model.position.y + this.style.AutomaticRoute.lamp.radiusR + this.style.AutomaticRoute.text.distance,
fontWeight: this.style.AutomaticRoute.text.fontWeight,
fontSize: this.style.AutomaticRoute.text.fontSize,
fontFamily: this.style.fontFamily,
text: model.name,
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
}
});
if (this.model.subtitleName) {
this.subtitleText = new Text({
_subType: 'Text',
zlevel: this.zlevel,
z: this.z,
position: [0, 0],
style: {
x: model.position.x,
y: model.position.y + this.style.AutomaticRoute.lamp.radiusR + this.style.AutomaticRoute.subtitleText.distance,
fontWeight: this.style.AutomaticRoute.subtitleText.fontWeight,
fontSize: this.style.AutomaticRoute.subtitleText.fontSize,
fontFamily: this.style.fontFamily,
text: model.subtitleName,
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
}
});
this.add(this.subtitleText);
}
this.add(this.control);
this.add(this.text);
}
// 设置状态
setState(model) {
}
createMouseEvent() {
if (this.style.LcControl.mouseOverStyle) {
this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent);
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
}
}
getShapeTipPoint() {
if (this.control) {
var distance = 2;
var rect = this.control.getBoundingRect();
return {
x: rect.x + rect.width / 2,
y: rect.y - distance
};
}
return null;
}
}

View File

@ -22,6 +22,7 @@ export default class Station extends Group {
this.style = style;
this.create();
this.createTurnBack(); // 创建按图折返
this.createGuideTotalLock(); // 创建引导总锁
this.createControlMode();
this.setState(model);
this.checkIsDrawMap();
@ -104,6 +105,39 @@ export default class Station extends Group {
}
}
}
createGuideTotalLock() { // 创建引导总锁
const model = this.model;
const style = this.style;
if (model.guideTotalLock) {
this.guideLamp = new EControl({
zlevel: this.zlevel,
z: this.z,
arc: {
shape: {
cx: model.guideTotalLockPoint.x,
cy: model.guideTotalLockPoint.y,
r: style.Station.lamp.radiusR
},
lineWidth: 0,
fill: style.Station.lamp.guideColor
},
text: {
position: [0, 0],
x: model.guideTotalLockPoint.x,
y: model.guideTotalLockPoint.y + style.Station.lamp.radiusR + style.Station.StationControl.text.distance,
fontWeight: style.Station.text.fontWeight,
fontSize: style.Station.text.fontSize,
fontFamily: style.fontFamily,
text: '引导总锁',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
},
style: this.style
});
this.add(this.guideLamp);
}
}
createTurnBack() { // 创建按图折返
const model = this.model;
const style = this.style;

View File

@ -11,6 +11,7 @@ import EJump from './EJump';
import EHighlight from '../element/EHighlight';
import ETrainStop from './ETrainStop';
import ETrainDepart from './ETrainDepart';
import EControl from '../element/EControl';
class StationStand extends Group {
constructor(model, style) {
@ -24,6 +25,7 @@ class StationStand extends Group {
this.doors = new Group();
this.create();
this.createMouseEvent();
this.createFunctionButton();
this.setVisible(model.visible);
this.setState(model);
this.checkIsDrawMap();
@ -205,7 +207,126 @@ class StationStand extends Group {
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
}
}
createFunctionButton() { //
const model = this.model;
const style = this.style;
if (model.stopJumpLamp) {
this.stopJumpLampButton = new EControl({
zlevel: this.zlevel,
z: this.z,
arc: {
shape: {
cx: model.stopJumpLampPoint.x,
cy: model.stopJumpLampPoint.y,
r: style.Station.lamp.radiusR
},
lineWidth: 0,
fill: style.StationStand.lamp.lampColor
},
text: {
position: [0, 0],
x: model.stopJumpLampPoint.x,
y: model.stopJumpLampPoint.y + style.StationStand.lamp.radiusR + style.StationStand.text.distance,
fontWeight: style.StationStand.text.fontWeight,
fontSize: style.StationStand.text.fontSize,
fontFamily: style.fontFamily,
text: '跳停',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
},
style: this.style
});
this.add(this.stopJumpLampButton);
}
if (model.cancelStopJumpLamp) {
this.cancelStopJumpLampButton = new EControl({
zlevel: this.zlevel,
z: this.z,
arc: {
shape: {
cx: model.cancelStopJumpLampPoint.x,
cy: model.cancelStopJumpLampPoint.y,
r: style.Station.lamp.radiusR
},
lineWidth: 0,
fill: style.StationStand.lamp.lampColor
},
text: {
position: [0, 0],
x: model.cancelStopJumpLampPoint.x,
y: model.cancelStopJumpLampPoint.y + style.StationStand.lamp.radiusR + style.StationStand.text.distance,
fontWeight: style.StationStand.text.fontWeight,
fontSize: style.StationStand.text.fontSize,
fontFamily: style.fontFamily,
text: '取消跳停',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
},
style: this.style
});
this.add(this.cancelStopJumpLampButton);
}
if (model.upDetainLamp) {
this.upDetainLampButton = new EControl({
zlevel: this.zlevel,
z: this.z,
arc: {
shape: {
cx: model.upDetainLampPoint.x,
cy: model.upDetainLampPoint.y,
r: style.Station.lamp.radiusR
},
lineWidth: 0,
fill: style.StationStand.lamp.lampColor
},
text: {
position: [0, 0],
x: model.upDetainLampPoint.x,
y: model.upDetainLampPoint.y + style.StationStand.lamp.radiusR + style.StationStand.text.distance,
fontWeight: style.StationStand.text.fontWeight,
fontSize: style.StationStand.text.fontSize,
fontFamily: style.fontFamily,
text: '上行扣车',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
},
style: this.style
});
this.add(this.upDetainLampButton);
}
if (model.downDetainLamp) {
this.downDetainLampButton = new EControl({
zlevel: this.zlevel,
z: this.z,
arc: {
shape: {
cx: model.downDetainLampPoint.x,
cy: model.downDetainLampPoint.y,
r: style.Station.lamp.radiusR
},
lineWidth: 0,
fill: style.StationStand.lamp.lampColor
},
text: {
position: [0, 0],
x: model.downDetainLampPoint.x,
y: model.downDetainLampPoint.y + style.StationStand.lamp.radiusR + style.StationStand.text.distance,
fontWeight: style.StationStand.text.fontWeight,
fontSize: style.StationStand.text.fontSize,
fontFamily: style.fontFamily,
text: '上行扣车',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
},
style: this.style
});
this.add(this.downDetainLampButton);
}
}
setVisible(visible) {
if (visible) {
this.eachChild(elem => { elem.show(); });

View File

@ -18,6 +18,7 @@ import Text2 from './Text/index.js';
import MapCycleButtonVO from './Automactic/index.js';
import OutFrame from './OutFrame/index.js';
import CheckBox from './checkBox/checkBox.js';
import AutomaticRoute from './AutomacticRoute/index.js';
/** 图库*/
const mapShape = {};
@ -40,6 +41,7 @@ mapShape[deviceType.Text] = Text2;
mapShape[deviceType.MapCycleButtonVO] = MapCycleButtonVO;
mapShape[deviceType.OutFrame] = OutFrame;
mapShape[deviceType.CheckBox] = CheckBox;
mapShape[deviceType.AutomaticRoute] = AutomaticRoute;
function shapefactory(device, jmap) {
const type = device._type;

View File

@ -195,21 +195,21 @@ export default {
// this.tempData.push({ item: '', status: opts.holdStatus == '02' || opts.holdStatus == '04' ? '' : '' });
// this.tempData.push({ item: '', status: opts.holdStatus == '03' || opts.holdStatus == '04' ? '' : '' });
//
this.treeData[1].children[0].value = opts.holdStatus == '03' || opts.holdStatus == '04' ? '已设置' : '未设置';
this.treeData[1].children[0].value = selected.centerHoldTrain ? '已设置' : '未设置';
//
this.treeData[1].children[1].value = opts.holdStatus == '02' || opts.holdStatus == '04' ? '已设置' : '未设置';
this.treeData[1].children[1].value = selected.stationHoldTrain ? '已设置' : '未设置';
// this.tempData.push({ item: '', status: opts.parkingTime != -1 ? opts.parkingTime : '' });
//
this.treeData[0].children[2].value = opts.parkingTime != -1 ? opts.parkingTime : '自动';
this.treeData[0].children[2].value = selected.parkingTime != -1 ? selected.parkingTime : '自动';
//
this.treeData[0].children[3].value = opts.jumpStopStatus != '01' ? '已设置' : '未设置';
this.treeData[0].children[3].value = selected.allSkip || selected.assignSkip ? '已设置' : '未设置';
if (!stationStand || !station) {
this.tempData.push({ item: '运行等级', status: `自动` });
} else {
this.tempData.push({ item: '运行等级', status: opts.intervalRunTime > 0 ? `${station.name}${stationStand.name}:人工` : `${station.name}${stationStand.name}:自动` });
this.tempData.push({ item: '运行等级', status: selected.runLevelTime > 0 ? `${station.name}${stationStand.name}:人工` : `${station.name}${stationStand.name}:自动` });
}
// this.tempData.push({ item: '', status: opts.jumpStopStatus != '01' ? '' : '' });
this.tempData.push({ item: '下行折返策略', status: this.strategyMap[opts.reentryStrategy] ? this.strategyMap[opts.reentryStrategy] : '默认' });
this.tempData.push({ item: '下行折返策略', status: this.strategyMap[selected.reentryStrategy] ? this.strategyMap[selected.reentryStrategy] : '默认' });
},
doShow(operate, selected, opts) {
this.selected = selected;

View File

@ -52,6 +52,20 @@ export default {
menu: [],
menuNormal: {
Local: [
{
label: '轨道切除',
handler: this.split,
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF
},
{
label: '轨道激活',
handler: this.active,
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE
}
// {
// label: '',
// handler: this.undeveloped
// }
],
Center: [
{

View File

@ -263,10 +263,10 @@ export default {
if (valid) {
this.doClose();
}
}).catch(() => {
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(operate, error.message);
});
}
}

View File

@ -135,7 +135,6 @@ export default {
const operate = {
over: true,
operation: OperationEvent.Signal.detail.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_DETAIL
};
this.loading = true;

View File

@ -230,6 +230,8 @@ export default {
if (!item.disabled) {
this.changeList.push(false);
this.selection.splice(this.selection.indexOf(item.code), 1);
} else {
this.changeList = [];
}
});
this.allSelect = false;
@ -287,7 +289,10 @@ export default {
const operate = {
over: true,
operation: OperationEvent.Signal.humanControl.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING,
param:{
routeCodeList: this.selection
}
};
this.sendCommand(operate);
@ -297,7 +302,10 @@ export default {
const operate = {
over: true,
operation: OperationEvent.Signal.atsAutoControl.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING,
param:{
routeCodeList: this.selection
}
};
this.sendCommand(operate);

View File

@ -155,11 +155,10 @@ export default {
},
cancel() {
const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}

View File

@ -160,7 +160,7 @@ export default {
operate.operation = OperationEvent.StationStand.earlyDeparture.downSelect.operation;
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}

View File

@ -193,21 +193,25 @@ export default {
// this.tempData.push({ item: '', status: opts.holdStatus == '02' || opts.holdStatus == '04' ? '' : '' });
// this.tempData.push({ item: '', status: opts.holdStatus == '03' || opts.holdStatus == '04' ? '' : '' });
//
this.treeData[1].children[0].value = opts.holdStatus == '03' || opts.holdStatus == '04' ? '已设置' : '未设置';
this.treeData[1].children[0].value = selected.centerHoldTrain ? '已设置' : '未设置';
//
this.treeData[1].children[1].value = opts.holdStatus == '02' || opts.holdStatus == '04' ? '已设置' : '未设置';
this.treeData[1].children[1].value = selected.stationHoldTrain ? '已设置' : '未设置';
// this.tempData.push({ item: '', status: opts.parkingTime != -1 ? opts.parkingTime : '' });
//
this.treeData[0].children[2].value = opts.parkingTime != -1 ? opts.parkingTime : '自动';
this.treeData[0].children[2].value = selected.parkingTime != -1 ? selected.parkingTime : '自动';
//
this.treeData[0].children[3].value = opts.jumpStopStatus != '01' ? '已设置' : '未设置';
if (!stationStand || !station) {
this.tempData.push({ item: '运行等级', status: `自动` });
} else {
this.tempData.push({ item: '运行等级', status: opts.intervalRunTime > 0 ? `${station.name}${stationStand.name}:人工` : `${station.name}${stationStand.name}:自动` });
}
this.treeData[0].children[3].value = selected.allSkip || selected.assignSkip ? '已设置' : '未设置';
// if (selected.direction == '01') {
//
// }
// if (!stationStand || !station) {
// this.tempData.push({ item: '', status: `` });
// } else {
// this.tempData.push({ item: '', status: selected.runLevelTime > 0 ? `${station.name}${stationStand.name}:` : `${station.name}${stationStand.name}:` });
// }
// this.tempData.push({ item: '', status: opts.jumpStopStatus != '01' ? '' : '' });
this.tempData.push({ item: '下行折返策略', status: this.strategyMap[opts.reentryStrategy] ? this.strategyMap[opts.reentryStrategy] : '默认' });
//
// this.tempData.push({ item: '', status: this.strategyMap[selected.reentryStrategy] ? this.strategyMap[selected.reentryStrategy] : '' });
},
doShow(operate, selected, opts) {
this.selected = selected;

View File

@ -119,6 +119,10 @@ export function parser(data, skinCode) {
mapDevice[elem.code] = createDevice(deviceType.MapCycleButtonVO, elem, propConvert);
}, this);
zrUtil.each(data.AutomaticRouteButtonList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.AutomaticRoute, elem, propConvert);
}, this);
zrUtil.each(data.outerFrameList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.OutFrame, elem, propConvert);
}, this);
@ -215,6 +219,7 @@ export function updateMapData(state, model) {
case deviceType.Esp: updateForList(model, state, 'espList'); break;
case deviceType.MapCycleButtonVO: updateForList(model, state, 'cycleButtonList'); break;
case deviceType.OutFrame: updateForList(model, state, 'outerFrameList'); break;
case deviceType.AutomaticRoute: updateForList(model, state, 'automaticRouteButtonList'); break;
}
}
}

View File

@ -330,6 +330,13 @@ const map = {
return [];
}
},
automaticRouteButtonList: (state) => {
if (state.map) {
return state.map.automaticRouteButtonList || [];
} else {
return [];
}
},
resourceList: (state) => {
if (state.map) {
return state.map.resourceList;

View File

@ -2,7 +2,7 @@ import store from '@/store';
import { Notification } from 'element-ui';
function handle(state, data) {
// console.log(data, 'socket订阅');
console.log(data, 'socket订阅');
const msg = data.body;
const path = window.location.href;
switch (data.type) {

View File

@ -38,6 +38,9 @@ export function loadMapDataById(mapId) {
export function loadNewMapDataByGroup(group) {
return new Promise((resolve, reject) => {
getNewMapDataByGroup(group).then(resp => {
// resp.data.graphDataNew && resp.data.graphDataNew.trainList && resp.data.graphDataNew.trainList.forEach(item => {
// item.code = item.groupNumber;
// });
const mapData = resp.data.graphDataNew;
store.dispatch('map/setMapData', mapData).then(() => {
store.dispatch('map/clearJlmapTrainView').then(() => {

View File

@ -0,0 +1,274 @@
<template>
<el-tabs v-model="activeName" class="card" @tab-click="handleClick">
<el-tab-pane class="view-control" :label="$t('map.property')" name="first">
<div style="height: calc(100% - 46px);">
<el-scrollbar wrap-class="scrollbar-wrapper">
<config-list ref="dataform" :form="form" :form-model="editModel" :rules="rules" />
</el-scrollbar>
</div>
<div class="button_box">
<el-button-group class="map-draft-group">
<el-button type="primary" size="small" @click="edit">{{ $t('map.updateObj') }}</el-button>
<el-button type="danger" size="small" @click="deleteObj">{{ $t('map.deleteObj') }}</el-button>
</el-button-group>
</div>
</el-tab-pane>
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second">
<div style="height: calc(100% - 46px);">
<el-scrollbar wrap-class="scrollbar-wrapper">
<config-data ref="make" :form="formMake" :form-model="addModel" :rules="createRules" />
</el-scrollbar>
</div>
<div class="button_box">
<el-button-group class="map-draft-group">
<el-button type="primary" size="small" @click="create">{{ $t('map.create') }}</el-button>
</el-button-group>
</div>
</el-tab-pane>
</el-tabs>
</template>
<script>
import { mapGetters } from 'vuex';
import { getUID } from '@/jmapNew/utils/Uid';
import ConfigList from './config/list';
import ConfigData from './config/data';
import { deepAssign } from '@/utils/index';
import { getRouteNewList} from '@/api/jmap/mapdraft';
export default {
name: 'AutoMaticRoute',
components: {
ConfigList,
ConfigData
},
props: {
selected: {
type: Object,
default: function () {
return null;
}
}
},
data() {
return {
activeName: 'first',
autoList: [],
editModel: {
code: '',
name: '',
automaticRouteCode: '', // code
position: {
x: 0,
y: 0
}
},
addModel: {
code: '',
name: '',
automaticRouteCode: '', // code
position: {
x: 0,
y: 0
}
},
rules: {
code: [
{ required: true, message: this.$t('rules.pleaseSelectEncoding'), trigger: 'change' }
],
name: [
{ required: true, message: this.$t('rules.pleaseEnterStatusSignal'), trigger: 'blur' }
],
automaticRouteCode:[
{ required: true, message: this.$t('rules.selectConcentrateStation'), trigger: 'change' }
],
'position.x': [
{ required: true, message: this.$t('rules.trainPositionX'), trigger: 'blur' }
],
'position.y': [
{ required: true, message: this.$t('rules.trainPositionY'), trigger: 'blur' }
]
}
};
},
computed: {
...mapGetters('map', [
'automaticRouteButtonList'
]),
form() {
const form = {
labelWidth: '150px',
items: {
code: {
name: '',
item: []
},
draw: {
name: this.$t('map.drawData'),
item: [
{ prop: 'code', label: `${this.$t('map.code')}`, type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.automaticRouteButtonList, change: true, deviceChange: this.deviceChange },
{ prop: 'name', label: '标题名称:', type: 'input' },
{ prop: 'position', label: '坐标:', type: 'coordinate', width: '140px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
] },
{ prop:'automaticRouteCode', label: '自动进路code:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.autoList },
]
}
}
};
return form;
},
formMake() {
const form = {
labelWidth: '150px',
items: [
{ prop:'automaticRouteCode', label: '自动进路:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.autoList },
{ prop: 'name', label: '自动进路名称:', type: 'input' },
{ prop: 'position', label: '坐标:', type: 'coordinate', width: '140px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] }
]
};
return form;
},
createRules: function () {
return {
automaticRouteCode: [
{ required: true, message: '请选择自动进路', trigger: 'change' }
],
name: [
{ required: true, message: '请输入名称', trigger: 'blur' }
],
'position.x': [
{ required: true, message: this.$t('rules.trainPositionX'), trigger: 'blur' }
],
'position.y': [
{ required: true, message: this.$t('rules.trainPositionY'), trigger: 'blur' }
]
};
}
},
watch: {
selected(val, oldVal) {
this.deviceSelect(val);
}
},
mounted() {
this.getAutoMaticList();
},
methods: {
deviceChange(code) {
this.$emit('setCenter', code);
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
handleClick() {
this.getAutoMaticList();
},
deviceSelect(selected) {
this.$refs.dataform.resetFields();
this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() === 'AutomaticRoute'.toUpperCase()) {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
}
},
async getAutoMaticList() {
const params = {
pageSize: 9999,
pageNum: 1
};
const resp = await getRouteNewList(this.$route.params.mapId, params);
this.autoList = [];
resp.data && resp.data.list && resp.data.list.forEach(elem => {
if (elem.flt) {
this.autoList.push(elem);
}
});
},
//
create() {
this.$refs.make.validate((valid) => {
console.log(valid, this.addModel, this.editModel);
if (valid) {
const uid = getUID('AutomaticRoute', this.automaticRouteButtonList);
let models = [];
const model = {
_type: 'AutomaticRoute',
code: uid,
name: this.addModel.name,
position: {
x: this.addModel.position.x,
y: this.addModel.position.y
},
automaticRouteCode:this.addModel.automaticRouteCode
};
models.push(model, '=-----');
this.$emit('updateMapModel', models);
this.$refs.make.resetForm();
}
});
},
//
edit() {
this.$refs['dataform'].validate((valid) => {
if (valid) {
const data = Object.assign({_type: 'AutomaticRoute'}, this.editModel);
let models = [data];
this.$emit('updateMapModel', models);
}
});
},
//
deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'AutomacticRoute'.toUpperCase()) {
const _that = this;
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
_that.$emit('updateMapModel', {...selected, _dispose: true});
_that.deviceSelect();
}).catch(() => {
_that.$message.info(this.$t('tip.cancelledDelete'));
});
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.view-control{
height: 100%;
}
.card {
height: 100%;
}
.coordinate {
overflow: hidden;
.title {
text-align: right;
font-size: 14px;
color: #606266;
line-height: 40px;
padding: 0 12px 0 0;
-webkit-box-sizing: border-box;
box-sizing: border-box;
line-height: 28px;
width: 160px;
font-weight: bold;
display: block;
float: left;
}
}
.map-draft-group {
color: #3E44BE;
}
</style>

View File

@ -100,6 +100,14 @@
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane label="自动进路" class="tab_pane_box" name="AutomacticRoute">
<automatic-route
ref="AutomacticRoute"
:selected="selected"
@updateMapModel="updateMapModel"
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane :label="$t('map.train')" class="tab_pane_box" name="Train">
<train-draft
ref="Train"
@ -185,6 +193,7 @@ import TrainWindowDraft from './trainwindow';
import ZcControlDraft from './zcControl';
import AutomaticControlDraft from './automaticControl';
import OutFrameDraft from './outFrameControl';
import AutomaticRoute from './automaticRoute';
import LimitControlDraft from './limitControl';
import LcControlDraft from './lcControl';
import ImageControlDraft from './ImageControl';
@ -214,7 +223,8 @@ export default {
LimitControlDraft,
LcControlDraft,
ImageControlDraft,
CheckboxDraft
CheckboxDraft,
AutomaticRoute
},
props: {
selected: {

View File

@ -125,6 +125,8 @@ export default {
// controlled:false,
createControlMode:false,
createTurnBack:false,
guideTotalLock: false,
guideTotalLockPoint: {x: 0, y: 0},
turnBackPoint: {x: 0, y: 0}, //
controlModePoint: { x: 0, y: 0 } //
},
@ -198,6 +200,11 @@ export default {
{ prop: 'turnBackPoint', label: '按图折返坐标:', type: 'coordinate', width: '120px', isHidden: !this.isPointsShow, children: [
{ prop: 'turnBackPoint.x', firstLevel: 'turnBackPoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'turnBackPoint.y', firstLevel: 'turnBackPoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] },
{ prop: 'guideTotalLock', label: '引导总锁:', type: 'checkbox'},
{ prop: 'guideTotalLockPoint', label: '引导总锁坐标:', type: 'coordinate', width: '120px', isHidden: !this.isGuidePointsShow, children: [
{ prop: 'guideTotalLockPoint.x', firstLevel: 'guideTotalLockPoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'guideTotalLockPoint.y', firstLevel: 'guideTotalLockPoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] }
]
},
@ -247,6 +254,9 @@ export default {
isPointsShow() {
return this.editModel.createTurnBack;
},
isGuidePointsShow() {
return this.editModel.guideTotalLock;
},
isZcCode() {
return this.editModel.centralized;
}
@ -394,6 +404,8 @@ export default {
// controlled: false,
chargeStationCodeList:[],
createControlMode: item.control,
guideTotalLock: false,
guideTotalLockPoint: {x: 0, y: 0},
createTurnBack: false,
turnBackPoint: {x: 0, y: 0} //
};

View File

@ -74,7 +74,15 @@ export default {
inside: false, //
right: true,
standTrackCode: '',
small: false
small: false,
stopJumpLamp: false, //
stopJumpLampPoint: {x: 0, y: 0}, //
cancelStopJumpLamp: false, //
cancelStopJumpLampPoint: {x: 0, y: 0}, //
upDetainLamp: false, //
upDetainLampPoint: {x: 0, y: 0}, //
downDetainLamp: false, //
downDetainLampPoint: {x: 0, y: 0} //
// direction: '' //
},
field: '',
@ -90,7 +98,15 @@ export default {
stationstandDirection: '02', //
right: true,
inside: false, //
small: false
small: false,
stopJumpLamp: false, //
stopJumpLampPoint: {x: 0, y: 0}, //
cancelStopJumpLamp: false, //
cancelStopJumpLampPoint: {x: 0, y: 0}, //
upDetainLamp: false, //
upDetainLampPoint: {x: 0, y: 0}, //
downDetainLamp: false, //
downDetainLampPoint: {x: 0, y: 0} //
}
};
},
@ -125,7 +141,27 @@ export default {
{ prop: 'standTrackCode', label: '站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'editSectionSelectCode', buttonShowType: this.isButtonTypeES },
{ prop: 'right', label: '行驶方向:', type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.isRightList },
{ prop: 'small', label: '是否小型站台:', type: 'checkbox', disabled: true },
{ prop: 'inside', label: '是否内站台:', type: 'checkbox' }
{ prop: 'inside', label: '是否内站台:', type: 'checkbox' },
{ prop: 'stopJumpLamp', label: '跳停按钮:', type: 'checkbox'},
{ prop: 'stopJumpLampPoint', label: '跳停按钮坐标:', type: 'coordinate', width: '120px', isHidden: !this.isStopJumpPointsShow, children: [
{ prop: 'stopJumpLampPoint.x', firstLevel: 'stopJumpLampPoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'stopJumpLampPoint.y', firstLevel: 'stopJumpLampPoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] },
{ prop: 'cancelStopJumpLamp', label: '取消跳停按钮:', type: 'checkbox'},
{ prop: 'cancelStopJumpLampPoint', label: '取消跳停按钮坐标:', type: 'coordinate', width: '120px', isHidden: !this.isCancelStopJumpPointsShow, children: [
{ prop: 'cancelStopJumpLampPoint.x', firstLevel: 'cancelStopJumpLampPoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'cancelStopJumpLampPoint.y', firstLevel: 'cancelStopJumpLampPoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] },
{ prop: 'upDetainLamp', label: '上行扣车按钮:', type: 'checkbox'},
{ prop: 'upDetainLampPoint', label: '上行扣车按钮坐标:', type: 'coordinate', width: '120px', isHidden: !this.isUpDetainPointsShow, children: [
{ prop: 'upDetainLampPoint.x', firstLevel: 'upDetainLampPoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'upDetainLampPoint.y', firstLevel: 'upDetainLampPoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] },
{ prop: 'downDetainLamp', label: '下行扣车按钮:', type: 'checkbox'},
{ prop: 'downDetainLampPoint', label: '下行扣车坐标:', type: 'coordinate', width: '120px', isHidden: !this.isDownDetainPointsShow, children: [
{ prop: 'downDetainLampPoint.x', firstLevel: 'downDetainLampPoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'downDetainLampPoint.y', firstLevel: 'downDetainLampPoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] }
]
},
map: {
@ -188,7 +224,27 @@ export default {
{ prop: 'standTrackCode', label: '站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'sectionSelectCode', buttonShowType: this.isButtonTypeS },
{ prop: 'right', label: '行驶方向:', type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.isRightList },
{ prop: 'small', label: '是否小型站台:', type: 'checkbox' },
{ prop: 'inside', label: '是否内站台:', type: 'checkbox' }
{ prop: 'inside', label: '是否内站台:', type: 'checkbox' },
{ prop: 'stopJumpLamp', label: '跳停按钮:', type: 'checkbox'},
{ prop: 'stopJumpLampPoint', label: '跳停按钮坐标:', type: 'coordinate', width: '120px', isHidden: !this.isStopJumpPointsShow, children: [
{ prop: 'stopJumpLampPoint.x', firstLevel: 'stopJumpLampPoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'stopJumpLampPoint.y', firstLevel: 'stopJumpLampPoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] },
{ prop: 'cancelStopJumpLamp', label: '取消跳停按钮:', type: 'checkbox'},
{ prop: 'cancelStopJumpLampPoint', label: '取消跳停按钮坐标:', type: 'coordinate', width: '120px', isHidden: !this.isCancelStopJumpPointsShow, children: [
{ prop: 'cancelStopJumpLampPoint.x', firstLevel: 'cancelStopJumpLampPoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'cancelStopJumpLampPoint.y', firstLevel: 'cancelStopJumpLampPoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] },
{ prop: 'upDetainLamp', label: '上行扣车按钮:', type: 'checkbox'},
{ prop: 'upDetainLampPoint', label: '上行扣车按钮坐标:', type: 'coordinate', width: '120px', isHidden: !this.isUpDetainPointsShow, children: [
{ prop: 'upDetainLampPoint.x', firstLevel: 'upDetainLampPoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'upDetainLampPoint.y', firstLevel: 'upDetainLampPoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] },
{ prop: 'downDetainLamp', label: '下行扣车按钮:', type: 'checkbox'},
{ prop: 'downDetainLampPoint', label: '下行扣车坐标:', type: 'coordinate', width: '120px', isHidden: !this.isDownDetainPointsShow, children: [
{ prop: 'downDetainLampPoint.x', firstLevel: 'downDetainLampPoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'downDetainLampPoint.y', firstLevel: 'downDetainLampPoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] }
]
},
door: {
@ -228,6 +284,18 @@ export default {
isButtonTypeES() {
return this.field === 'editSectionSelectCode';
},
isStopJumpPointsShow() {
return this.activeName === 'first' ? this.editModel.stopJumpLamp : this.addModel.stopJumpLamp;
},
isCancelStopJumpPointsShow() {
return this.activeName === 'first' ? this.editModel.cancelStopJumpLamp : this.addModel.cancelStopJumpLamp;
},
isUpDetainPointsShow() {
return this.activeName === 'first' ? this.editModel.upDetainLamp : this.addModel.upDetainLamp;
},
isDownDetainPointsShow() {
return this.activeName === 'first' ? this.editModel.downDetainLamp : this.addModel.downDetainLamp;
},
PhysicalSectionList() {
let list = [];
if (this.sectionList && this.sectionList.length) {
@ -309,7 +377,15 @@ export default {
standTrackCode: this.addModel.standTrackCode,
right: this.addModel.right,
small: this.addModel.small,
inside: this.addModel.inside
inside: this.addModel.inside,
stopJumpLamp: this.addModel.stopJumpLamp, //
stopJumpLampPoint: this.addModel.stopJumpLampPoint, //
cancelStopJumpLamp: this.addModel.cancelStopJumpLamp, //
cancelStopJumpLampPoint: this.addModel.cancelStopJumpLampPoint, //
upDetainLamp: this.addModel.upDetainLamp, //
upDetainLampPoint: this.addModel.upDetainLampPoint, //
downDetainLamp: this.addModel.downDetainLamp, //
downDetainLampPoint: this.addModel.downDetainLampPoint //
};
this.stationList.forEach(elem => {
if (elem.code == this.addModel.stationCode) {