This commit is contained in:
sunzhenyu 2020-03-12 18:40:17 +08:00
commit 7e6ea076f8
56 changed files with 1066 additions and 479 deletions

View File

@ -605,5 +605,9 @@ export default {
whetherAutoRoute: 'Whether auto route',
hostileData: 'Hostile data',
routeContinuesToProtectSectorData: 'Route continues to protect sector data',
physicalSectionID: 'Physical section id'
physicalSectionID: 'Physical section ID',
physicalSectionName: 'Physical section name',
routePhysicalSectionData: 'Route physical section data',
routeSideDefenseSwitch: 'Route side defense switch',
switchID: 'Switch ID'
};

View File

@ -598,5 +598,11 @@ export default {
whetherAutoRoute: '是否自定进路',
hostileData: '敌对数据',
routeContinuesToProtectSectorData: '进路延续保护区段数据',
physicalSectionID: '物理区段ID'
physicalSectionID: '物理区段ID',
physicalSectionName: '物理区段名称',
routePhysicalSectionData: '进路物理区段数据',
routeSideDefenseSwitch: '进路侧防道岔',
switchID: '道岔ID',
normalPosition: '定位',
reversePosition: '反位'
};

View File

@ -7,234 +7,234 @@ import store from '@/store';
/** 车身*/
export default class TrainBody extends Group {
constructor(model) {
super();
this.model = model;
this.deviceModel = model.model;
this.nameFormat = model.nameFormat;
this.create();
this.createMouse(); // 鼠标事件
}
constructor(model) {
super();
this.model = model;
this.deviceModel = model.model;
this.nameFormat = model.nameFormat;
this.create();
this.createMouse(); // 鼠标事件
}
createMouse() {
this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent);
if (this.deviceModel.down) {
store.dispatch('map/setTrainDetails', this.deviceModel);
this.mouseEvent.mouseover();
}
createMouse() {
this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent);
if (this.deviceModel.down) {
store.dispatch('map/setTrainDetails', this.deviceModel);
this.mouseEvent.mouseover();
}
this.on('mouseover', () => {
store.dispatch('map/setTrainDetails', this.deviceModel);
this.mouseEvent.mouseover();
});
this.on('mouseout', () => {
store.dispatch('map/setTrainDetails', null);
this.mouseEvent.mouseout();
});
}
this.on('mouseover', () => {
store.dispatch('map/setTrainDetails', this.deviceModel);
this.mouseEvent.mouseover();
});
this.on('mouseout', () => {
store.dispatch('map/setTrainDetails', null);
this.mouseEvent.mouseout();
});
}
create() {
const model = this.model;
const style = this.model.style;
this.trainBodyBox = new TrainBodyBox({
zlevel: model.zlevel,
z: model.z,
point: model.point,
style: style
});
create() {
const model = this.model;
const style = this.model.style;
this.trainBodyBox = new TrainBodyBox({
zlevel: model.zlevel,
z: model.z,
point: model.point,
style: style
});
const beginX = (model.point.x + style.Train.trainBody.lrPadding);
const beginY = (model.point.y - style.Train.hsda.trainHSDATextFontSize - style.Train.hsda.upPaddingHSDA);
const margin = (style.Train.common.trainWidth - style.Train.hsda.lrPaddingHSDA * 2) / 4;
const beginX = (model.point.x + style.Train.trainBody.lrPadding);
const beginY = (model.point.y - style.Train.hsda.trainHSDATextFontSize - style.Train.hsda.upPaddingHSDA);
const margin = (style.Train.common.trainWidth - style.Train.hsda.lrPaddingHSDA * 2) / 4;
this.textH = style.Train.common.haveTextHSDA ? new ETextName({
zlevel: model.zlevel,
z: model.z,
x: parseInt(beginX + margin * 0),
y: parseInt(beginY),
text: style.Train.hsda.textHContent,
textFill: style.trainYellowColor,
fontSize: style.Train.hsda.trainHSDATextFontSize,
fontFamily: style.Train.common.fontFamily,
textAlign: 'middle',
textVerticalAlign: 'top'
}) : '';
this.textS = style.Train.common.haveTextHSDA ? new ETextName({
zlevel: model.zlevel,
z: model.z,
x: parseInt(beginX + margin * 1),
y: parseInt(beginY),
text: style.Train.hsda.textSContent,
textFill: style.trainBlueColor,
fontSize: style.Train.hsda.trainHSDATextFontSize,
fontFamily: style.Train.common.fontFamily,
textAlign: 'middle',
textVerticalAlign: 'top'
}) : '';
this.textD = style.Train.common.haveTextHSDA ? new ETextName({
zlevel: model.zlevel,
z: model.z,
x: parseInt(beginX + margin * 2),
y: parseInt(beginY),
text: style.Train.hsda.textDContent,
textFill: style.trainGreenColor,
fontSize: style.Train.hsda.trainHSDATextFontSize,
fontFamily: style.Train.common.fontFamily,
textAlign: 'middle',
textVerticalAlign: 'top'
}) : '';
this.textA = style.Train.common.haveTextHSDA ? new ETextName({
zlevel: model.zlevel,
z: model.z,
x: parseInt(beginX + margin * 3),
y: parseInt(beginY),
text: style.Train.hsda.textAContent,
textFill: style.trainRedColor,
fontSize: style.Train.hsda.trainHSDATextFontSize,
fontFamily: style.Train.common.fontFamily,
textAlign: 'middle',
textVerticalAlign: 'top'
}) : '';
const serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.serviceNumber || style.Train.trainServer.defaultServiceNumber) + '';// 服务号(表号)
const tripNumber = style.Train.trainTarget.tripNumberPrefix + (style.Train.trainTarget.defaultDirectionCode
?(model.directionCode||style.Train.trainTarget.defaultDirectionCode) + (model.tripNumber || style.Train.trainTarget.defaultTripNumber)
:model.tripNumber || style.Train.trainTarget.defaultTripNumber) + ''; // 车次号
const targetCode = style.Train.trainNumber.targetCodePrefix + (model.targetCode || style.Train.trainNumber.defaultTargetCode) + ''; // 目的地码
const groupNumber = style.Train.trainTargetNumber.groupNumberPrefix + (model.groupNumber || style.Train.trainTargetNumber.defaultGroupNumber) + ''; // 车组号
this.textTrainServer = new ETextName({
zlevel: model.zlevel,
z: model.z+1,
x: parseInt(model.point.x + style.Train.trainServer.trainServerOffset.x),
y: parseInt(model.point.y + style.Train.trainServer.trainServerOffset.y),
text: serviceNumber.substring(serviceNumber.length - style.Train.trainServer.serviceNumberPrefix.length),
textFill: style.trainTextColor,
fontSize: model.fontSize,
fontFamily: style.Train.common.fontFamily,
textAlign: 'left',
textVerticalAlign: 'top'
});
this.textTrainTarget = new ETextName({
zlevel: this.model.zlevel,
z: this.model.z+1,
x: parseInt(model.point.x + model.style.Train.trainTarget.trainTargetOffset.x),
y: parseInt(model.point.y + model.style.Train.trainTarget.trainTargetOffset.y),
text: tripNumber.substring(tripNumber.length - style.Train.trainTarget.tripNumberPrefix.length),
textFill: style.trainTextColor,
fontSize: model.fontSize,
fontFamily: style.Train.common.fontFamily,
textAlign: style.Train.trainTarget.trainTargetTextAlign,
textVerticalAlign: 'top'
});
this.textTrainNumber = new ETextName({
zlevel: model.zlevel,
z: model.z+1,
x: parseInt(model.point.x + style.Train.trainNumber.trainNumberOffset.x),
y: parseInt(model.point.y + style.Train.trainNumber.trainNumberOffset.y),
text: targetCode.substring(targetCode.length - 3),
textFill: style.trainTextColor,
textStroke: style.trainTextColor,
fontWeight: 400,
textStrokeWidth: 0,
fontSize: model.fontSize,
fontFamily: style.Train.common.fontFamily,
textAlign: 'left',
textVerticalAlign: 'top'
});
this.textTrainTargetNumber = new ETextName({
zlevel: model.zlevel,
z: model.z+1,
x: parseInt(model.point.x - style.Train.trainBody.lrPadding),
y: parseInt(model.point.y + style.Train.trainBody.upPadding),
text: groupNumber.substring(groupNumber.length - 3),
textFill: style.trainTextColor,
textStroke: style.trainTextColor,
textStrokeWidth: 0,
fontSize: model.fontSize,
fontFamily: style.Train.common.fontFamily,
textAlign: 'left',
textVerticalAlign: 'top'
});
this.formatChangePosition(model, style);
this.add(this.trainBodyBox);
if (style.Train.common.haveTextHSDA) {
this.add(this.textH);
this.add(this.textS);
this.add(this.textD);
this.add(this.textA);
}
}
this.textH = style.Train.common.haveTextHSDA ? new ETextName({
zlevel: model.zlevel,
z: model.z,
x: parseInt(beginX + margin * 0),
y: parseInt(beginY),
text: style.Train.hsda.textHContent,
textFill: style.trainYellowColor,
fontSize: style.Train.hsda.trainHSDATextFontSize,
fontFamily: style.Train.common.fontFamily,
textAlign: 'middle',
textVerticalAlign: 'top'
}) : '';
this.textS = style.Train.common.haveTextHSDA ? new ETextName({
zlevel: model.zlevel,
z: model.z,
x: parseInt(beginX + margin * 1),
y: parseInt(beginY),
text: style.Train.hsda.textSContent,
textFill: style.trainBlueColor,
fontSize: style.Train.hsda.trainHSDATextFontSize,
fontFamily: style.Train.common.fontFamily,
textAlign: 'middle',
textVerticalAlign: 'top'
}) : '';
this.textD = style.Train.common.haveTextHSDA ? new ETextName({
zlevel: model.zlevel,
z: model.z,
x: parseInt(beginX + margin * 2),
y: parseInt(beginY),
text: style.Train.hsda.textDContent,
textFill: style.trainGreenColor,
fontSize: style.Train.hsda.trainHSDATextFontSize,
fontFamily: style.Train.common.fontFamily,
textAlign: 'middle',
textVerticalAlign: 'top'
}) : '';
this.textA = style.Train.common.haveTextHSDA ? new ETextName({
zlevel: model.zlevel,
z: model.z,
x: parseInt(beginX + margin * 3),
y: parseInt(beginY),
text: style.Train.hsda.textAContent,
textFill: style.trainRedColor,
fontSize: style.Train.hsda.trainHSDATextFontSize,
fontFamily: style.Train.common.fontFamily,
textAlign: 'middle',
textVerticalAlign: 'top'
}) : '';
const serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.serviceNumber || style.Train.trainServer.defaultServiceNumber) + '';// 服务号(表号)
const tripNumber = style.Train.trainTarget.tripNumberPrefix + (style.Train.trainTarget.defaultDirectionCode
? (model.directionCode || style.Train.trainTarget.defaultDirectionCode) + (model.tripNumber || style.Train.trainTarget.defaultTripNumber)
: model.tripNumber || style.Train.trainTarget.defaultTripNumber) + ''; // 车次号
const targetCode = style.Train.trainNumber.targetCodePrefix + (model.destinationCode || style.Train.trainNumber.defaultTargetCode) + ''; // 目的地码
const groupNumber = style.Train.trainTargetNumber.groupNumberPrefix + (model.groupNumber || style.Train.trainTargetNumber.defaultGroupNumber) + ''; // 车组号
this.textTrainServer = new ETextName({
zlevel: model.zlevel,
z: model.z + 1,
x: parseInt(model.point.x + style.Train.trainServer.trainServerOffset.x),
y: parseInt(model.point.y + style.Train.trainServer.trainServerOffset.y),
text: serviceNumber.substring(serviceNumber.length - style.Train.trainServer.serviceNumberPrefix.length),
textFill: style.trainTextColor,
fontSize: model.fontSize,
fontFamily: style.Train.common.fontFamily,
textAlign: 'left',
textVerticalAlign: 'top'
});
this.textTrainTarget = new ETextName({
zlevel: this.model.zlevel,
z: this.model.z + 1,
x: parseInt(model.point.x + model.style.Train.trainTarget.trainTargetOffset.x),
y: parseInt(model.point.y + model.style.Train.trainTarget.trainTargetOffset.y),
text: tripNumber.substring(tripNumber.length - style.Train.trainTarget.tripNumberPrefix.length),
textFill: style.trainTextColor,
fontSize: model.fontSize,
fontFamily: style.Train.common.fontFamily,
textAlign: style.Train.trainTarget.trainTargetTextAlign,
textVerticalAlign: 'top'
});
this.textTrainNumber = new ETextName({
zlevel: model.zlevel,
z: model.z + 1,
x: parseInt(model.point.x + style.Train.trainNumber.trainNumberOffset.x),
y: parseInt(model.point.y + style.Train.trainNumber.trainNumberOffset.y),
text: targetCode.substring(targetCode.length - 3),
textFill: style.trainTextColor,
textStroke: style.trainTextColor,
fontWeight: 400,
textStrokeWidth: 0,
fontSize: model.fontSize,
fontFamily: style.Train.common.fontFamily,
textAlign: 'left',
textVerticalAlign: 'top'
});
this.textTrainTargetNumber = new ETextName({
zlevel: model.zlevel,
z: model.z + 1,
x: parseInt(model.point.x - style.Train.trainBody.lrPadding),
y: parseInt(model.point.y + style.Train.trainBody.upPadding),
text: groupNumber.substring(groupNumber.length - 3),
textFill: style.trainTextColor,
textStroke: style.trainTextColor,
textStrokeWidth: 0,
fontSize: model.fontSize,
fontFamily: style.Train.common.fontFamily,
textAlign: 'left',
textVerticalAlign: 'top'
});
this.formatChangePosition(model, style);
this.add(this.trainBodyBox);
if (style.Train.common.haveTextHSDA) {
this.add(this.textH);
this.add(this.textS);
this.add(this.textD);
this.add(this.textA);
}
}
removeTrainDetail() {
this.mouseEvent.mouseout();
store.dispatch('map/setTrainDetails', null);
this.deviceModel.down = false;
}
setTrainColor(color) {
this.trainBodyBox && this.trainBodyBox.setStyle('fill', color);
}
setTextTrainServerColor(color) {
this.textTrainServer&&this.textTrainServer.setStyle('textFill', color);
this.textTrainServer&&this.textTrainServer.setStyle('textStroke', color);
}
setTextTrainTargetColor(color) {
this.textTrainTarget&&this.textTrainTarget.setStyle('textFill', color);
this.textTrainTarget&&this.textTrainTarget.setStyle('textStroke', color);
}
setTextTrainNumberColor(color) {
this.textTrainNumber&&this.textTrainNumber.setStyle('textFill', color);
this.textTrainNumber&&this.textTrainNumber.setStyle('textStroke', color);
}
setTextTrainTargetNumberColor(color) {
this.textTrainTargetNumber&&this.textTrainTargetNumber.setStyle('textFill', color);
this.textTrainTargetNumber&&this.textTrainTargetNumber.setStyle('textStroke', color);
}
setHShow(isShow) {
if (this.textH) {
isShow ? this.textH.show() : this.textH.hide();
}
}
setSShow(isShow) {
if (this.textS) {
isShow ? this.textS.show() : this.textS.hide();
}
}
setDShow(isShow) {
if (this.textD) {
isShow ? this.textD.show() : this.textD.hide();
}
}
setAShow(isShow) {
if (this.textA) {
isShow ? this.textA.show() : this.textA.hide();
}
}
setBodyBoxShape(key, color) {
this.trainBodyBox && this.trainBodyBox.setColor(key, color);
}
formatChangePosition(model, style) {
if (this.nameFormat) {
const arr = this.nameFormat.split(':');
let widthText = 0;
arr.forEach(ele => {
if (ele == 'targetCode') {
this.textTrainNumber.setStyle('x', parseInt(model.point.x + widthText + style.Train.common.textOffset) );
widthText += this.textTrainNumber.getBoundingRect().width;
this.add(this.textTrainNumber);
} else if (ele == 'serviceNumber') {
this.textTrainServer.setStyle('x', parseInt(model.point.x + widthText + style.Train.common.textOffset));
widthText += this.textTrainServer.getBoundingRect().width;
this.add(this.textTrainServer);
} else if (ele == 'tripNumber') {
this.textTrainTarget.setStyle('x', parseInt(model.point.x + widthText + style.Train.common.textOffset));
widthText += this.textTrainTarget.getBoundingRect().width;
this.add(this.textTrainTarget);
} else if (ele == 'groupNumber') {
this.textTrainTargetNumber.setStyle('x', parseInt(model.point.x + widthText + style.Train.common.textOffset));
widthText += this.textTrainTargetNumber.getBoundingRect().width;
this.add(this.textTrainTargetNumber);
}
});
}
}
removeTrainDetail() {
this.mouseEvent.mouseout();
store.dispatch('map/setTrainDetails', null);
this.deviceModel.down = false;
}
setTrainColor(color) {
this.trainBodyBox && this.trainBodyBox.setStyle('fill', color);
}
setTextTrainServerColor(color) {
this.textTrainServer && this.textTrainServer.setStyle('textFill', color);
this.textTrainServer && this.textTrainServer.setStyle('textStroke', color);
}
setTextTrainTargetColor(color) {
this.textTrainTarget && this.textTrainTarget.setStyle('textFill', color);
this.textTrainTarget && this.textTrainTarget.setStyle('textStroke', color);
}
setTextTrainNumberColor(color) {
this.textTrainNumber && this.textTrainNumber.setStyle('textFill', color);
this.textTrainNumber && this.textTrainNumber.setStyle('textStroke', color);
}
setTextTrainTargetNumberColor(color) {
this.textTrainTargetNumber && this.textTrainTargetNumber.setStyle('textFill', color);
this.textTrainTargetNumber && this.textTrainTargetNumber.setStyle('textStroke', color);
}
setHShow(isShow) {
if (this.textH) {
isShow ? this.textH.show() : this.textH.hide();
}
}
setSShow(isShow) {
if (this.textS) {
isShow ? this.textS.show() : this.textS.hide();
}
}
setDShow(isShow) {
if (this.textD) {
isShow ? this.textD.show() : this.textD.hide();
}
}
setAShow(isShow) {
if (this.textA) {
isShow ? this.textA.show() : this.textA.hide();
}
}
setBodyBoxShape(key, color) {
this.trainBodyBox && this.trainBodyBox.setColor(key, color);
}
formatChangePosition(model, style) {
if (this.nameFormat) {
const arr = this.nameFormat.split(':');
let widthText = 0;
arr.forEach(ele => {
if (ele == 'targetCode') {
this.textTrainNumber.setStyle('x', parseInt(model.point.x + widthText + style.Train.common.textOffset) );
widthText += this.textTrainNumber.getBoundingRect().width;
this.add(this.textTrainNumber);
} else if (ele == 'serviceNumber') {
this.textTrainServer.setStyle('x', parseInt(model.point.x + widthText + style.Train.common.textOffset));
widthText += this.textTrainServer.getBoundingRect().width;
this.add(this.textTrainServer);
} else if (ele == 'tripNumber') {
this.textTrainTarget.setStyle('x', parseInt(model.point.x + widthText + style.Train.common.textOffset));
widthText += this.textTrainTarget.getBoundingRect().width;
this.add(this.textTrainTarget);
} else if (ele == 'groupNumber') {
this.textTrainTargetNumber.setStyle('x', parseInt(model.point.x + widthText + style.Train.common.textOffset));
widthText += this.textTrainTargetNumber.getBoundingRect().width;
this.add(this.textTrainTargetNumber);
}
});
}
}
}

View File

@ -125,5 +125,7 @@ export default class defaultStyle {
export const drawSectionStyle = {
routePhysicalSection: 'rgba(255,255,0,0.5)',
continueProtectSection: 'rgba(255,0,255,0.5)',
signalNearSection: 'rgba(255, 0, 0, 0.5)'
signalNearSectionCBTC: 'rgba(255, 0, 0, 0.5)',
signalNearSectionReserve: 'rgba(160, 32, 240, 0.5)',
signalNearSection: 'rgba(124, 252, 0, 0.5)'
};

View File

@ -212,7 +212,7 @@ class SkinCode extends defaultStyle {
this[deviceType.MapCycleButtonVO] = {
// 是否显示
visibleConditions: ['01'],
visibleConditions: '03',
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
@ -239,7 +239,7 @@ class SkinCode extends defaultStyle {
this[deviceType.StationStand] = {
common: { // 通用属性
textFontSize: 8, // 站台默认字体大小
functionButtonShow: ['01'] // 功能灯按钮显示条件prdType
functionButtonShow: '03' // 功能灯按钮显示条件01所有模式下显示 02 行调显示 03现地显示
},
safetyDoor: { // 屏蔽门
height: 1.6, // 站台屏蔽门高度
@ -320,7 +320,7 @@ class SkinCode extends defaultStyle {
// show: true // 公里标名称显示
// },
kmPostShow: true, // 公里标显示
functionButtonShow: ['01'], // 功能灯按钮引导总锁显示条件prdType
functionButtonShow: '03', // 功能灯按钮(引导总锁)显示条件 01全部模式下显示 02 行调显示 03 现地显示
kilometerPosition: 'down', // 公里标位置
fontWeight: 'bold', // 文字错细
text: {
@ -492,7 +492,7 @@ class SkinCode extends defaultStyle {
};
this[deviceType.AutomaticRoute] = {
// 是否显示
displayCondition: [], // 显示条件 prdType
displayCondition: '03', // 显示条件 prdType
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细

View File

@ -209,7 +209,7 @@ class SkinCode extends defaultStyle {
common: { // 通用属性
textFontSize: 10, // 站台默认字体大小
haveJumpShow: false, // 站台是否有列车停跳显示
functionButtonShow: [] // 功能灯按钮显示条件prdType
functionButtonShow: '03' // 功能灯按钮显示条件01所有模式下显示 02 行调显示 03现地显示
},
safetyDoor: { // 屏蔽门
height: 3, // 站台屏蔽门高度
@ -289,13 +289,37 @@ class SkinCode extends defaultStyle {
borderColor: '#FFFFFF' // 延迟解锁边框颜色
}
};
this[deviceType.MapCycleButtonVO] = {
// 是否显示
visibleConditions: '03',
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
subtitleText: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 17 // 等于副标题距离
},
lamp: {
lineDash: null, // 灯的包围框
borderShow: false, // 是否显示边框
stroke: '#FFFFFF', // 框的颜色
fill: 'rgba(0,0,0,0)', // 填充色
radiusR: 6, // 控制灯大小
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
},
OutFrame: {
}
};
this[deviceType.Station] = {
// text: {
// show: true // 公里标名称显示
// },
kmPostShow: false, // 公里标显示
functionButtonShow: ['01'], // 功能灯按钮引导总锁显示条件prdType
functionButtonShow: '03', // 功能灯按钮(引导总锁)显示条件 01全部模式下显示 02 行调显示 03 现地显示
kilometerPosition: 'up', // 公里标朝向
text: {
fontSize: 11, // 字体大小
@ -426,7 +450,7 @@ class SkinCode extends defaultStyle {
};
this[deviceType.AutomaticRoute] = {
// 是否显示
displayCondition: [], // 显示条件 prdType
displayCondition: '03', // 显示条件 prdType
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细

View File

@ -212,7 +212,7 @@ class SkinCode extends defaultStyle {
common: { // 通用属性
textFontSize: 10, // 站台默认字体大小
haveJumpShow: true, // 站台是否有列车停跳显示
functionButtonShow: ['01'] // 功能灯按钮显示条件prdType
functionButtonShow: '03' // 功能灯按钮显示条件prdType
},
safetyDoor: { // 屏蔽门
height: 3, // 站台屏蔽门高度
@ -300,7 +300,7 @@ class SkinCode extends defaultStyle {
// show: true // 公里标名称显示
// },
kmPostShow: false, // 公里标显示
functionButtonShow: ['01'], // 功能灯按钮引导总锁显示条件prdType
functionButtonShow: '03', // 功能灯按钮(引导总锁)显示条件 01全部模式下显示 02 行调显示 03 现地显示
kilometerPosition: 'up', // 公里标朝向
text: {
fontSize: 11, // 字体大小
@ -451,7 +451,7 @@ class SkinCode extends defaultStyle {
};
this[deviceType.AutomaticRoute] = {
// 是否显示
displayCondition: ['01'], // 显示条件prdType 为01
displayCondition: '03', // 显示条件prdType 为01
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
@ -465,7 +465,7 @@ class SkinCode extends defaultStyle {
};
this[deviceType.MapCycleButtonVO] = {
// 是否显示
visibleConditions: ['01'],
visibleConditions: '03',
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细

View File

@ -200,7 +200,7 @@ class SkinCode extends defaultStyle {
this[deviceType.StationStand] = {
common: { // 通用属性
textFontSize: 11, // 站台默认字体大小
functionButtonShow: [] // 功能灯按钮显示条件prdType
functionButtonShow: '03' // 功能灯按钮显示条件01所有模式下显示 02 行调显示 03现地显示
},
safetyDoor: { // 屏蔽门
height: 3, // 站台屏蔽门高度
@ -272,13 +272,37 @@ class SkinCode extends defaultStyle {
borderColor: '#FFFFFF' // 延迟解锁边框颜色
}
};
this[deviceType.MapCycleButtonVO] = {
// 是否显示
visibleConditions: '03',
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
subtitleText: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 17 // 等于副标题距离
},
lamp: {
lineDash: null, // 灯的包围框
borderShow: false, // 是否显示边框
stroke: '#FFFFFF', // 框的颜色
fill: 'rgba(0,0,0,0)', // 填充色
radiusR: 6, // 控制灯大小
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
},
OutFrame: {
}
};
this[deviceType.Station] = {
// text: {
// show: true // 公里标名称显示
// },
kmPostShow: true, // 公里标显示
functionButtonShow: ['01'], // 功能灯按钮引导总锁显示条件prdType
functionButtonShow: '03', // 功能灯按钮(引导总锁)显示条件 01全部模式下显示 02 行调显示 03 现地显示
kilometerPosition: 'up', // 公里标朝向
text: {
fontSize: 11, // 字体大小
@ -442,7 +466,7 @@ class SkinCode extends defaultStyle {
};
this[deviceType.AutomaticRoute] = {
// 是否显示
displayCondition: [], // 显示条件 prdType
displayCondition: '03', // 显示条件 prdType
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细

View File

@ -204,7 +204,7 @@ class SkinCode extends defaultStyle {
textFontSize: 11, // 站台默认字体大小
special: true, // 特殊站台
haveJumpShow: true, // 站台是否有列车停跳显示
functionButtonShow: [] // 功能灯按钮显示条件prdType
functionButtonShow: '03' // 功能灯按钮显示条件01所有模式下显示 02 行调显示 03现地显示
},
safetyDoor: { // 屏蔽门
height: 3, // 站台屏蔽门高度
@ -287,13 +287,37 @@ class SkinCode extends defaultStyle {
borderColor: '#FFFFFF' // 延迟解锁边框颜色
}
};
this[deviceType.MapCycleButtonVO] = {
// 是否显示
visibleConditions: '03',
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
subtitleText: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 17 // 等于副标题距离
},
lamp: {
lineDash: null, // 灯的包围框
borderShow: false, // 是否显示边框
stroke: '#FFFFFF', // 框的颜色
fill: 'rgba(0,0,0,0)', // 填充色
radiusR: 6, // 控制灯大小
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
},
OutFrame: {
}
};
this[deviceType.Station] = {
// text: {
// show: true // 公里标名称显示
// },
kmPostShow: true, // 公里标显示
functionButtonShow: ['01'], // 功能灯按钮引导总锁显示条件prdType
functionButtonShow: '03', // 功能灯按钮(引导总锁)显示条件
kilometerPosition: 'up', // 公里标朝向
text: {
borderShow: true, // 车站包围框显示
@ -464,7 +488,7 @@ class SkinCode extends defaultStyle {
};
this[deviceType.AutomaticRoute] = {
// 是否显示
displayCondition: ['01'],
displayCondition: '03',
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细

View File

@ -208,7 +208,7 @@ class SkinCode extends defaultStyle {
this[deviceType.MapCycleButtonVO] = {
// 是否显示
visibleConditions: ['01', '02'],
visibleConditions: '01',
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
@ -236,7 +236,7 @@ class SkinCode extends defaultStyle {
common: { // 通用属性
textFontSize: 10, // 站台默认字体大小
haveJumpShow: false, // 站台是否有列车停跳显示
functionButtonShow: [] // 功能灯按钮显示条件prdType
functionButtonShow: '03' // 功能灯按钮显示条件01所有模式下显示 02 行调显示 03现地显示
},
safetyDoor: { // 屏蔽门
height: 3, // 站台屏蔽门高度
@ -322,7 +322,7 @@ class SkinCode extends defaultStyle {
// show: true // 公里标名称显示
// },
kmPostShow: false, // 公里标显示
functionButtonShow: ['01'], // 功能灯按钮引导总锁显示条件prdType
functionButtonShow: '03', // 功能灯按钮(引导总锁)显示条件 01全部模式下显示 02 行调显示 03 现地显示
kilometerPosition: 'up', // 公里标朝向
text: {
fontSize: 11, // 字体大小
@ -458,7 +458,7 @@ class SkinCode extends defaultStyle {
};
this[deviceType.AutomaticRoute] = {
// 是否显示
displayCondition: [], // 显示条件 prdType
displayCondition: '03', // 显示条件 prdType
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细

View File

@ -4,16 +4,16 @@ const deviceState = {};
deviceState[deviceType.Section] = {
/** 区段状态*/
blockade: false, // 是否封锁
routeLock: false, // 是否进路锁闭
overlapLock: false, // 进路延续保护锁闭
ctOccupied: false, // 通信车占用
nctOccupied: false, // 非通信车占用
cutOff: false, // 是否切除
invalid: false, // 是否失效
blockade: 0, // 是否封锁
routeLock: 0, // 是否进路锁闭
overlapLock: 0, // 进路延续保护锁闭
ctOccupied: 0, // 通信车占用
nctOccupied: 0, // 非通信车占用
cutOff: 0, // 是否切除
invalid: 0, // 是否失效
speedUpLimit: 0, // 最高限速
/** 是否故障*/
fault: false /** 非故障*/
fault: 0 /** 非故障*/
};
deviceState[deviceType.Switch] = {
@ -50,7 +50,7 @@ deviceState[deviceType.Switch] = {
// State14: '14' /** 道岔状态类型 - 封锁*/
// },
/** 是否故障*/
fault: false /** 非故障*/
fault: 0 /** 非故障*/
// /** 是否切除*/
// cutOff: {
// Default: false /** 是否切除*/
@ -58,19 +58,19 @@ deviceState[deviceType.Switch] = {
};
deviceState[deviceType.Signal] = {
blockade: false, // 是否锁闭
logicLight: false, // 逻辑点灯
greenOpen: false, // 绿灯开放
yellowOpen: false, // 黄灯开放
redOpen: true, // 红灯开放(默认状态)
blockade: 0, // 是否锁闭
logicLight: 0, // 逻辑点灯
greenOpen: 0, // 绿灯开放
yellowOpen: 0, // 黄灯开放
redOpen: 1, // 红灯开放(默认状态)
delayTime: 0, // 信号机延迟解锁倒计时
atsControl: 1, // 0是人工1是自动
fault: false // 是否故障
fault: 0 // 是否故障
};
deviceState[deviceType.Station] = {
/** 是否故障*/
fault: false, /** 非故障*/
fault: 0, /** 非故障*/
controlMode: 'Center'
// controlMode: 'Local' // Center 中控 Local 站控 Emergency 紧急站控 Interlock 联锁控
};
@ -87,7 +87,7 @@ deviceState[deviceType.Psd] = {
// State03: '03' /** 切除 */
// },
/** 是否故障*/
fault: false /** 非故障*/
fault: 0 /** 非故障*/
};
deviceState[deviceType.StationDelayUnlock] = {
@ -99,7 +99,7 @@ deviceState[deviceType.StationDelayUnlock] = {
// },
/** 是否故障*/
fault: false /** 非故障*/
fault: 0 /** 非故障*/
};
deviceState[deviceType.StationStand] = {
@ -123,7 +123,7 @@ deviceState[deviceType.StationStand] = {
// State04: '04' /** 默认 */
// },
/** 是否故障*/
fault: false /** 非故障*/
fault: 0 /** 非故障*/
};
deviceState[deviceType.Train] = {
@ -207,7 +207,7 @@ deviceState[deviceType.Train] = {
// State02: '02' /** 有报警 */
// },
/** 车门是否关闭且锁闭 */
doorCloseLock: true,
doorCloseLock: 1,
/** 列车运行级别 */
runLevel: 'CBTC',
/** 驾驶模式 */
@ -219,7 +219,7 @@ deviceState[deviceType.Train] = {
/** 列车是否向右形式 */
right: 1,
/** 是否故障*/
fault: false /** 非故障*/
fault: 0 /** 非故障*/
};
export default deviceState;

View File

@ -43,6 +43,7 @@ class Jlmap {
const width = opts.dom.clientWidth;
const height = opts.dom.clientHeight;
this.zoomOnMouseWheel = opts.options.zoomOnMouseWheel;
this.previewOrMapDraw = opts.showConfig.previewOrMapDraw;
this.$zr = zrender.init(opts.dom, deepAssign({ renderer, devicePixelRatio, width, height }, opts.config));
@ -61,6 +62,7 @@ class Jlmap {
this.$keyboardController = new KeyboardController(this);
this.$keyboardController.enable();
this.showConfig = opts.showConfig;
}
loadStyle(lineCode) {
@ -136,6 +138,7 @@ class Jlmap {
this.$mouseController.disable();
} else {
opts['zoomOnMouseWheel'] = this.zoomOnMouseWheel;
opts['previewOrMapDraw'] = this.previewOrMapDraw;
this.$mouseController.enable(opts);
}
@ -159,7 +162,7 @@ class Jlmap {
(list || []).forEach(elem => {
const code = elem.code;
const type = elem._type;
const oDevice = this.mapDevice[code] || deviceFactory(type, elem);
const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
const nDevice = deepAssign(oDevice || {}, elem);
this.$painter.delete(oDevice);
delete this.mapDevice[code];
@ -246,9 +249,23 @@ class Jlmap {
const code = elem.code;
const type = elem._type;
const oDevice = this.mapDevice[code] || deviceFactory(type, elem);
this.hookHandle(oDevice, elem)
this.hookHandle(oDevice, elem);
});
}
updateShowMode(list, showMode) {
this.showConfig.showMode = showMode;
(list || []).forEach(elem => {
const code = elem.code;
const type = elem._type;
const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
oDevice.showMode = showMode;
this.$painter.updateShowMode(oDevice);
});
this.$painter.$transformHandle.revisibleAll();
}
getShowConfig() {
return this.showConfig;
}
update(list) {
this.setUpdateMapDevice(list || []); // 增加一个 前数据 处理 为了在区段中 获取全部的 道岔信息
(list || []).forEach(elem => {
@ -263,12 +280,12 @@ class Jlmap {
this.$painter.update(signalDevice);
}
} else {
const oDevice = this.mapDevice[code] || deviceFactory(type, elem);
const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
if (elem.dispose) {
this.$painter.delete(oDevice);
} else {
// if (this.hookHandle(oDevice, elem)) {
this.$painter.update(oDevice);
this.$painter.update(oDevice);
// }
}
}

View File

@ -54,6 +54,7 @@ class MouseController extends Eventful {
this._moveOnMouseMove = opts.moveOnMouseMove || true;
this._zoomOnMouseWheel = opts.zoomOnMouseWheel || false;
this._preventDefaultMouseMove = opts.preventDefaultMouseMove || true;
this._previewOrMapDraw = opts.previewOrMapDraw || false;
this.disable();
@ -121,7 +122,7 @@ class MouseController extends Eventful {
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) {
} else if (e.which === 3 && this._zoomOnMouseWheel && this._previewOrMapDraw) {
this.handleMouseMoveRight({x: e.offsetX, y: e.offsetY});
}
}

View File

@ -161,7 +161,14 @@ class Painter {
}
}
}
/**
* 更新显示模式
*/
updateShowMode(device) {
if (device && device.instance) {
device.instance.setShowMode();
}
}
/**
* 更新transform变化
* @param {*} opt

View File

@ -6,7 +6,7 @@ import Arc from 'zrender/src/graphic/shape/Arc';
import Text from 'zrender/src/graphic/Text';
import Rect from 'zrender/src/graphic/shape/Rect';
import EMouse from './EMouse';
import {getPrdType} from '../utils/handlePath';
import {isShowThePrdType} from '../../utils/handlePath';
export default class Automactic extends Group {
constructor(model, style) {
@ -17,12 +17,14 @@ export default class Automactic extends Group {
this.zlevel = model.zlevel;
this.model = model;
this.style = style;
this.prdType = getPrdType();
if (!this.prdType || this.style.MapCycleButtonVO.visibleConditions.indexOf(this.prdType) !== -1) {
if (isShowThePrdType(model.prdType, style.MapCycleButtonVO.visibleConditions) || model.previewOrMapDraw) {
this.create();
this.createMouseEvent();
this.setState(model);
}
if (model.previewOrMapDraw) {
this.setShowMode();
}
}
create() {
@ -136,4 +138,19 @@ export default class Automactic extends Group {
}
return null;
}
setShowMode() {
const showMode = this.model.showMode;
const showConditions = this.style.MapCycleButtonVO.visibleConditions;
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.control.show();
this.text.show();
this.subtitleText && this.subtitleText.show();
this.arcBorder && this.arcBorder.show();
} else {
this.control.hide();
this.text.hide();
this.subtitleText && this.subtitleText.hide();
this.arcBorder && this.arcBorder.hide();
}
}
}

View File

@ -5,7 +5,7 @@ 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';
import {getPrdType} from '../utils/handlePath';
import {isShowThePrdType} from '../../utils/handlePath';
export default class LcControl extends Group {
constructor(model, style) {
@ -16,12 +16,14 @@ export default class LcControl extends Group {
this.zlevel = model.zlevel;
this.model = model;
this.style = style;
this.prdType = getPrdType();
if (!this.prdType || this.style.AutomaticRoute.displayCondition.indexOf(this.prdType) !== -1) {
if (isShowThePrdType(model.prdType, style.AutomaticRoute.displayCondition) || model.previewOrMapDraw) {
this.create();
this.createMouseEvent();
this.setState(model);
}
if (model.previewOrMapDraw) {
this.setShowMode();
}
}
create() {
@ -106,4 +108,17 @@ export default class LcControl extends Group {
}
return null;
}
setShowMode() {
const showMode = this.model.showMode;
const showConditions = this.style.AutomaticRoute.displayCondition;
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.control.show();
this.text.show();
this.subtitleText && this.subtitleText.show();
} else {
this.control.hide();
this.text.hide();
this.subtitleText && this.subtitleText.hide();
}
}
}

View File

@ -76,4 +76,5 @@ export default class LcControl extends Group {
}
return null;
}
setShowMode() {}
}

View File

@ -80,4 +80,5 @@ export default class LimitControl extends Group {
}
return null;
}
setShowMode() {}
}

View File

@ -1,6 +1,6 @@
import Line from 'zrender/src/graphic/shape/Line';
import Group from 'zrender/src/container/Group';
import {getPrdType, isShowThePrdType} from '../utils/handlePath';
import {isShowThePrdType} from '../../utils/handlePath';
export default class Line2 extends Group {
constructor(model, style) {
@ -11,11 +11,13 @@ export default class Line2 extends Group {
this.z = 0;
this.model = model;
this.style = style;
this.prdType = getPrdType();
if (isShowThePrdType(this.prdType, model.showConditions)) {
if (isShowThePrdType(model.prdType, model.showConditions) || model.previewOrMapDraw) {
this.create();
this.setState(model);
}
if (model.previewOrMapDraw) {
this.setShowMode();
}
}
create() {
@ -55,4 +57,18 @@ export default class Line2 extends Group {
setState(model) {
this.setLineType(model.type);
}
// 设置显示模式
setShowMode() {
const showMode = this.model.showMode;
const showConditions = this.model.showConditions;
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.eachChild((child) => {
child.show();
});
} else {
this.eachChild((child) => {
child.hide();
});
}
}
}

View File

@ -1,6 +1,6 @@
import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect';
import {getPrdType, isShowThePrdType} from '../utils/handlePath';
import {isShowThePrdType} from '../../utils/handlePath';
export default class OutFrame extends Group {
constructor(model, style) {
@ -11,11 +11,13 @@ export default class OutFrame extends Group {
this.style = style;
this.zlevel = model.zlevel;
this.z = 0;
this.prdType = getPrdType();
if (isShowThePrdType(this.prdType, model.showConditions)) {
if (isShowThePrdType(model.prdType, model.showConditions) || model.previewOrMapDraw) {
this.create();
this.setState(model);
}
if (model.previewOrMapDraw) {
this.setShowMode();
}
}
create() {
@ -42,4 +44,14 @@ export default class OutFrame extends Group {
// 设置状态
setState(model) {
}
// 设置显示模式
setShowMode() {
const showMode = this.model.showMode;
const showConditions = this.model.showConditions;
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.box && this.box.show();
} else {
this.box && this.box.hide();
}
}
}

View File

@ -96,4 +96,6 @@ export default class Line2 extends Group {
this.on('mouseover', () => { this.highlight.mouseover(); });
}
}
setShowMode() {}
}

View File

@ -66,4 +66,5 @@ export default class Resource extends Group {
}
return null;
}
setShowMode() {}
}

View File

@ -251,7 +251,7 @@ export default class Section extends Group {
/** 区段名称 (逻辑区段名称 或 物理区段名称 是否显示)*/
let tempx = x;
let tempy = y;
if (model.type == '01') {
if (model.type == '01') { // 物理区段名称
if (style.Section.text.show) {
const opposite = style.Section.text.opposite ? -1 : 1;
tempx += traingle.getSin(style.Section.text.distance);
@ -274,7 +274,7 @@ export default class Section extends Group {
});
this.add(this.name);
}
} else if (model.type == '02') {
} else if (model.type == '02') { // 逻辑区段
if (style.Section.logicText.show) {
const opposite = style.Section.logicText.opposite ? -1 : 1;
tempx += traingle.getSin(style.Section.logicText.distance);
@ -297,7 +297,7 @@ export default class Section extends Group {
});
this.add(this.name);
}
} else if (model.type == '03') {
} else if (model.type == '03') { // 道岔区段
if (style.Section.switchText.show) {
this.name = new ETextName({
zlevel: this.zlevel,
@ -317,7 +317,7 @@ export default class Section extends Group {
});
this.add(this.name);
}
} else if (model.type == '04') {
} else if (model.type == '04') { // 道岔计轴区段名称
if (router.currentRoute.path.startsWith('/design/usermap/map/draw') && router.currentRoute.path.endsWith('/draft')) {
this.name = new ETextName({
zlevel: this.zlevel,
@ -863,7 +863,7 @@ export default class Section extends Group {
if (this.selectedType === type) {
return;
}
if (selected && !this.selectedType) {
if (selected && type) {
this.section && this.section.setStyle({ stroke: drawSectionStyle[type] });
} else {
this.section && this.section.setStyle({ stroke: this.style.Section.line.spareColor });
@ -886,5 +886,5 @@ export default class Section extends Group {
mouseover() {
this.section && this.section.setStyle({ stroke: 'rgba(255,255,255,0.8)' });
}
setShowMode() {}
}

View File

@ -588,6 +588,7 @@ class Signal extends Group {
});
}
}
setShowMode() {}
}
export default Signal;

View File

@ -10,7 +10,7 @@ import EArrow from './EArrow';
import { arrow } from '../utils/ShapePoints';
import Rect from 'zrender/src/graphic/shape/Rect';
import BoundingRect from 'zrender/src/core/BoundingRect';
import {getPrdType} from '../utils/handlePath';
import {isShowThePrdType} from '../../utils/handlePath';
export default class Station extends Group {
constructor(model, style) {
@ -24,10 +24,12 @@ export default class Station extends Group {
this.create();
this.createTurnBack(); // 创建按图折返
this.prdType = getPrdType();
if ((!this.prdType || this.style.StationStand.common.functionButtonShow.indexOf(this.prdType) !== -1) && model.guideTotalLockPoint) {
if (isShowThePrdType(model.prdType, style.Station.functionButtonShow) || model.previewOrMapDraw) {
this.createGuideTotalLock(); // 创建引导总锁
}
if (model.previewOrMapDraw) {
this.setShowMode();
}
this.createControlMode();
this.setState(model);
this.checkIsDrawMap();
@ -366,4 +368,14 @@ export default class Station extends Group {
this.on('mouseover', () => { this.EMouse.mouseover(); });
}
}
// 设置显示模式
setShowMode() {
const showMode = this.model.showMode;
const showConditions = this.style.Station.functionButtonShow;
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.guideLamp && this.guideLamp.show();
} else {
this.guideLamp && this.guideLamp.hide();
}
}
}

View File

@ -178,4 +178,5 @@ export default class StationControl extends Group {
}
return null;
}
setShowMode() {}
}

View File

@ -86,5 +86,6 @@ export default class StationCounter extends Group {
getShapeTipPoint() {
return null;
}
setShowMode() {}
}

View File

@ -104,4 +104,5 @@ export default class StationDelayUnlock extends Group {
getShapeTipPoint() {
return null;
}
setShowMode() {}
}

View File

@ -12,7 +12,7 @@ import EHighlight from '../element/EHighlight';
import ETrainStop from './ETrainStop';
import ETrainDepart from './ETrainDepart';
import EControl from '../element/EControl';
import {getPrdType} from '../utils/handlePath';
import {isShowThePrdType} from '../../utils/handlePath';
class StationStand extends Group {
constructor(model, style) {
@ -24,12 +24,14 @@ class StationStand extends Group {
this.zlevel = model.zlevel;
this.z = 1;
this.doors = new Group();
this.prdType = getPrdType();
this.create();
this.createMouseEvent();
if (!this.prdType || this.style.StationStand.common.functionButtonShow.indexOf(this.prdType) !== -1) {
if (isShowThePrdType(model.prdType, style.StationStand.common.functionButtonShow) || model.previewOrMapDraw) {
this.createFunctionButton();
}
if (model.previewOrMapDraw) {
this.setShowMode();
}
this.setVisible(model.visible);
this.setState(model);
this.checkIsDrawMap();
@ -563,5 +565,21 @@ class StationStand extends Group {
this.on('mouseover', () => { this.highlight.mouseover(); });
}
}
// 设置显示模式
setShowMode() {
const showMode = this.model.showMode;
const showConditions = this.style.StationStand.common.functionButtonShow;
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.stopJumpLampButton && this.stopJumpLampButton.show();
this.cancelStopJumpLampButton && this.cancelStopJumpLampButton.show();
this.upDetainLamp && this.upDetainLamp.show();
this.downDetainLamp && this.downDetainLamp.show();
} else {
this.stopJumpLampButton && this.stopJumpLampButton.hide();
this.cancelStopJumpLampButton && this.cancelStopJumpLampButton.hide();
this.upDetainLamp && this.upDetainLamp.hide();
this.downDetainLamp && this.downDetainLamp.hide();
}
}
}
export default StationStand;

View File

@ -201,7 +201,7 @@ export default class Switch extends Group {
stroke: this.style.Switch.monolock.rectBorderColor,
fill: this.style.transparentColor
});
this.lockArc = new ELockArc({ // 锁定矩形
zlevel: this.zlevel,
z: this.z + 6,
@ -264,7 +264,7 @@ export default class Switch extends Group {
/** 恢复状态*/
recover() {
this.lockRect.hide(); // 矩形包围框
this.lockArc.hide(); // 圆形单锁框
this.lockArc.hide(); // 圆形单锁框
this.setSwitchCoreColor(this.style.backgroundColor);
this.name.getNameText().stopAnimation(false);
this.swCore.stopAnimation(false);
@ -482,4 +482,5 @@ export default class Switch extends Group {
this.on('mouseover', () => { this.highlight.mouseover(); });
}
}
setShowMode() {}
}

View File

@ -1,6 +1,6 @@
import Text from 'zrender/src/graphic/Text';
import Group from 'zrender/src/container/Group';
import {getPrdType, isShowThePrdType} from '../utils/handlePath';
import {isShowThePrdType} from '../../utils/handlePath';
export default class Text2 extends Group {
constructor(model, style) {
@ -12,11 +12,13 @@ export default class Text2 extends Group {
this.model = model;
this.style = style;
this.z = 6;
this.prdType = getPrdType();
if (isShowThePrdType(this.prdType, model.showConditions)) {
if (isShowThePrdType(model.prdType, model.showConditions) || model.previewOrMapDraw) {
this.create();
this.setState(model);
}
if (model.previewOrMapDraw) {
this.setShowMode();
}
}
create() {
@ -45,4 +47,14 @@ export default class Text2 extends Group {
setState(model) {
}
// 设置显示模式
setShowMode() {
const showMode = this.model.showMode;
const showConditions = this.model.showConditions;
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.text && this.text.show();
} else {
this.text && this.text.hide();
}
}
}

View File

@ -27,9 +27,9 @@ class EMouse extends Group {
}
let text = '';
if (LangStorage.getLang() == 'en') {
text = ` The planned train: ${trainType} \n Table No.: ${this.device.model.serviceNumber} \n Train Trip No.: ${this.device.model.tripNumber}\n Destination: ${this.device.model.targetCode ? this.device.model.targetCode : ''}\n Train No.: ${this.device.model.groupNumber}\n Early or late: ${destinationText}\n Direction: ${this.device.model.directionType == '02' ? 'up' : 'down'}\n Crew No.: \n Start Station: \n Terminal Station: \n Occupied Track: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n Current Station: \n Train-ground communication: normal \n Operation Speed level: 4 \n Detained: ${!this.device.model.hold ? 'Normal' : 'Detained'}\n \n 跳停状态: ${!this.device.model.jump ? 'Normal' : 'Skip to continue moving'}Stationary: ${!this.device.model.stop ? 'No' : 'Yes'}\n Blocked: No \n Speed: ${this.device.model.speed || 0} km/h \n Authorized Distance: ${this.device.model.maLen || 0} m`;
text = ` The planned train: ${trainType} \n Table No.: ${this.device.model.serviceNumber} \n Train Trip No.: ${this.device.model.tripNumber}\n Destination: ${this.device.model.destinationCode ? this.device.model.destinationCode : ''}\n Train No.: ${this.device.model.groupNumber}\n Early or late: ${destinationText}\n Direction: ${this.device.model.directionType == '02' ? 'up' : 'down'}\n Crew No.: \n Start Station: \n Terminal Station: \n Occupied Track: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n Current Station: \n Train-ground communication: normal \n Operation Speed level: 4 \n Detained: ${!this.device.model.hold ? 'Normal' : 'Detained'}\n \n 跳停状态: ${!this.device.model.jump ? 'Normal' : 'Skip to continue moving'}Stationary: ${!this.device.model.stop ? 'No' : 'Yes'}\n Blocked: No \n Speed: ${this.device.model.speed || 0} km/h \n Authorized Distance: ${this.device.model.maLen || 0} m`;
} else {
text = `列车类型: ${trainType} \n\0\0\0\0号: ${this.device.model.serviceNumber}\n\0\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.targetCode ? this.device.model.targetCode : ''}\n\0\0号: ${this.device.model.groupNumber}\n\0\0点: ${destinationText}\n运行方向: ${this.device.model.directionType == '02' ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${ !this.device.model.hold ? '正常' : '扣车'}\n 跳停状态: ${!this.device.model.jump ? '正常' : '跳停'} \n停稳状态: ${!this.device.model.stop ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${this.device.model.speed || 0} km/h\n列车移动授权距离: ${this.device.model.maLen || 0} m`;
text = `列车类型: ${trainType} \n\0\0\0\0号: ${this.device.model.serviceNumber}\n\0\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.destinationCode ? this.device.model.destinationCode : ''}\n\0\0号: ${this.device.model.groupNumber}\n\0\0点: ${destinationText}\n运行方向: ${this.device.model.directionType == '02' ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${ !this.device.model.hold ? '正常' : '扣车'}\n 跳停状态: ${!this.device.model.jump ? '正常' : '跳停'} \n停稳状态: ${!this.device.model.stop ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${this.device.model.speed || 0} km/h\n列车移动授权距离: ${this.device.model.maLen || 0} m`;
}
// 文字描述
this.arrowText = new Text({

View File

@ -21,9 +21,9 @@ export default class ETriangle extends Group {
points:[[model.point.x + 10 * right, model.point.y], [model.point.x, model.point.y - 6], [model.point.x, model.point.y + 6]]
},
style: {
stroke:'#FFFF00',
stroke:'#00FF00',
lineWidth: 0.5,
fill: '#FFFF00'
fill: '#00FF00'
}
});
this.add(this.angle);

View File

@ -102,7 +102,7 @@ export default class TrainBody extends Group {
const tripNumber = style.Train.trainTarget.tripNumberPrefix + (style.Train.trainTarget.defaultDirectionCode
? (model.directionCode || style.Train.trainTarget.defaultDirectionCode) + (model.tripNumber || style.Train.trainTarget.defaultTripNumber)
: model.tripNumber || style.Train.trainTarget.defaultTripNumber) + ''; // 车次号
const targetCode = style.Train.trainNumber.targetCodePrefix + (model.targetCode || style.Train.trainNumber.defaultTargetCode) + ''; // 目的地码
const targetCode = style.Train.trainNumber.targetCodePrefix + (model.destinationCode || style.Train.trainNumber.defaultTargetCode) + ''; // 目的地码
const groupNumber = style.Train.trainTargetNumber.groupNumberPrefix + (model.groupNumber || style.Train.trainTargetNumber.defaultGroupNumber) + ''; // 车组号
this.textTrainServer = new ETextName({
zlevel: model.zlevel,

View File

@ -18,6 +18,8 @@ export default class Train extends Group {
this.z = 40;
this.size = 0;
this.section = null;
this.nextPointIndex = 1;
this.currentAdd = 0;
this.fontSize = style.Train.common.useSelfText ? style.Train.common.nameFontSize || style.Train.common.trainTextFontSize : model.nameFontSize || style.Train.common.nameFontSize || style.Train.common.trainTextFontSize;
this.newScale = this.fontSize / style.Train.common.trainTextFontSize;
this.nameFormat = style.Train.common.useSelfFormat ? style.Train.trainBody.trainNameFormat : model.nameFormat || style.Train.trainBody.trainNameFormat;
@ -68,7 +70,7 @@ export default class Train extends Group {
destinationStatus: model.destinationStatus,
serviceNumber: model.serviceNumber,
tripNumber: model.tripNumber,
targetCode: model.targetCode,
destinationCode: model.destinationCode,
groupNumber: model.groupNumber,
directionType: model.directionType,
directionCode: model.directionCode,
@ -105,21 +107,37 @@ export default class Train extends Group {
scale: this.newScale
});
const data = this.model.physicalCode;
const oldmodel = store.getters['map/getDeviceByCode'](data);
const leftPoint = oldmodel.points[0];
const rightPoint = oldmodel.points[oldmodel.points.length - 1];
const right = this.model.right == 1 ? 1 : 0;
this.startX = leftPoint.x + (1 - right) * (rightPoint.x - leftPoint.x);
this.startY = leftPoint.y + (1 - right) * (rightPoint.y - leftPoint.y);
this.triangle = new ETriangle({
style: this.style,
zlevel: this.zlevel,
z:10,
right: this.model.right,
point:{x:this.startX, y:this.startY}
});
this.add(this.triangle);
if (style.Section.trainPosition.display) {
const data = this.model.physicalCode;
const oldmodel = store.getters['map/getDeviceByCode'](data);
const leftPoint = oldmodel.points[0];
const rightPoint = oldmodel.points[oldmodel.points.length - 1];
const right = this.model.right == 1 ? 1 : 0;
this.startX = leftPoint.x + (1 - right) * (rightPoint.x - leftPoint.x);
this.startY = leftPoint.y + (1 - right) * (rightPoint.y - leftPoint.y);
// 算出折线的长度
this.lineLength = 0;
let oldPoint = null;
oldmodel.points.forEach((point)=>{
if (oldPoint) {
const temp = Math.sqrt(
Math.pow(point.x - oldPoint.x, 2) +
Math.pow(point.y - oldPoint.y, 2),
);
this.lineLength += temp;
}
oldPoint = point;
});
// this.animatePoint = {x:this.startX, y:this.startY};
this.triangle = new ETriangle({
style: this.style,
zlevel: this.zlevel,
z:10,
right: this.model.right,
point:{x:this.startX, y:this.startY}
});
this.add(this.triangle);
}
this.add(this.trainB);
this.add(this.trainL);
@ -136,20 +154,66 @@ export default class Train extends Group {
updateSection() {
const train = this.model;
if (train.physicalCode && train.offsetp) {
if (train.physicalCode && train.offsetp && this.triangle) {
const data = train.physicalCode;
const oldmodel = store.getters['map/getDeviceByCode'](data);
const leftPoint = oldmodel.points[0];
const rightPoint = oldmodel.points[oldmodel.points.length - 1];
if (this.triangle) {
// 待处理(多个点的问题)
// const points = train.right == 1 ? oldmodel.points : oldmodel.points.reverse();
const points = oldmodel.points;
// 目标距离
let targetDistance = Math.sqrt(
Math.pow(points[this.nextPointIndex - 1].x - points[this.nextPointIndex].x, 2) +
Math.pow(points[this.nextPointIndex - 1].y - points[this.nextPointIndex].y, 2),
);
// // 当前距离
// const currentDistance = Math.sqrt(
// Math.pow(points[this.nextPointIndex - 1].x - this.animatePoint.x, 2) +
// Math.pow(points[this.nextPointIndex - 1].y - this.animatePoint.y, 2),
// );
const currentDistance = this.lineLength * train.offsetp - this.currentAdd;
// let cureent this.lineLength * train.offsetp
// 利用运动距离与目标距离, 判断运动的点是否超过下一个目标点, 超过了就重置下一个点
if (currentDistance >= targetDistance) {
// this.animatePoint = {
// x: points[this.nextPointIndex].x,
// y: points[this.nextPointIndex].y
// };
this.nextPointIndex++;
this.currentAdd += targetDistance;
targetDistance = Math.sqrt(
Math.pow(points[this.nextPointIndex - 1].x - points[this.nextPointIndex].x, 2) +
Math.pow(points[this.nextPointIndex - 1].y - points[this.nextPointIndex].y, 2),
);
}
if (this.nextPointIndex > points.length - 1) {
const leftPoint = oldmodel.points[0];
const rightPoint = oldmodel.points[oldmodel.points.length - 1];
this.startX = leftPoint.x + (rightPoint.x - leftPoint.x) * train.offsetp;
this.startY = leftPoint.y + (rightPoint.y - leftPoint.y) * train.offsetp;
const point = {x:this.startX, y:this.startY};
this.triangle.point = point;
this.triangle.updateTriangle(point, train.right);
this.triangle.dirty();
this.dirty();
} else {
// debugger;
// this.lineLength * train.offsetp
// if (this.currentLength > targetDistance) {
// this.currentLength = this.currentLength - targetDistance;
// this.nextPointIndex++;
// targetDistance = Math.sqrt(
// Math.pow(points[this.nextPointIndex - 1].x - points[this.nextPointIndex].x, 2) +
// Math.pow(points[this.nextPointIndex - 1].y - points[this.nextPointIndex].y, 2),
// );
// }
const rate = (this.lineLength * train.offsetp - this.currentAdd) / targetDistance;
this.startX = points[this.nextPointIndex - 1].x + (points[this.nextPointIndex].x - points[this.nextPointIndex - 1].x) * rate;
this.startY = points[this.nextPointIndex - 1].y + (points[this.nextPointIndex].y - points[this.nextPointIndex - 1].y) * rate;
// this.animatePoint.x = this.startX;
// this.animatePoint.y = this.startY;
}
const point = {x:this.startX, y:this.startY};
this.triangle.point = point;
this.triangle.updateTriangle(point, train.right);
this.triangle.dirty();
this.dirty();
}
}
@ -447,4 +511,5 @@ export default class Train extends Group {
this.add(this.trainBorder);
}
setShowMode() {}
}

View File

@ -39,7 +39,7 @@ class TrainWindow extends Group {
zlevel: this.zlevel,
z: this.z - 1,
shape: {
smooth: this.style.TrainWindow.trainWindowSmooth,
smooth: this.style.TrainWindow.trainWindowSmooth, // 圆滑程度
points: [
[point.x - model.width / 2, point.y],
[point.x + model.width / 2, point.y],
@ -78,6 +78,7 @@ class TrainWindow extends Group {
getInstanceByCode(code) {
return (store.getters['map/getDeviceByCode'](code) || {}).instance;
}
setShowMode() {}
}
export default TrainWindow;

View File

@ -80,4 +80,5 @@ export default class ZcControl extends Group {
}
return null;
}
setShowMode() {}
}

View File

@ -30,4 +30,5 @@ export default class checkBox extends Group {
});
this.add(this.box);
}
setShowMode() {}
}

View File

@ -102,4 +102,12 @@ export default class EControl extends Group {
this.text.setStyle('textFill', color);
}
}
hide() {
this.control.hide();
this.text.hide();
}
show() {
this.control.show();
this.text.show();
}
}

View File

@ -41,7 +41,7 @@ export default {
},
data() {
return {
unfold: false,
unfold: true,
tempData: [],
tableStyle: {
'border-bottom': 'none',
@ -105,7 +105,8 @@ export default {
const operate = {
over: true,
operation: eachCmd.operation.code,
cmdType: eachCmd.operation.cmdType
cmdType: eachCmd.operation.cmdType,
param: eachCmd.operation.param //
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;

View File

@ -49,13 +49,13 @@ export default {
},
{
label: '开放自动进路',
handler: this.atsAutoControl,
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
handler: this.singalPassModel,
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO
},
{
label: '关闭自动进路',
handler: this.humanControl,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING
handler: this.singalCancelPassModel,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO
},
{
label: '终端信号封锁',
@ -307,24 +307,45 @@ export default {
arrangementRoute() {
const step = {
start: true,
// over:true,
code: `${this.selected.code}`,
operation: OperationEvent.Signal.arrangementRoute.menu.operation,
param: {
signalCode: `${this.selected.code}`
},
// cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true});
this.$store.dispatch('menuOperation/pushRequestList', { device: this.selected, operation: { code: OperationEvent.Signal.arrangementRoute.menu.operation, name: '始端/终端选择', cmdType:CMD.Signal.CMD_SIGNAL_SET_ROUTE}});
const routes = [];
this.routeList.forEach(elem => {
if (elem.startSignalCode === this.selected.code) {
routes.push(elem);
}
});
const routeCode = this.checkRoutes(routes);
this.$store.dispatch('menuOperation/pushRequestList', {
device: this.selected,
operation: {
code: OperationEvent.Signal.arrangementRoute.menu.operation,
name: '始端/终端选择',
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE,
param: {
routeCode: routeCode
}
}
});
}
}).catch(() => {
this.$refs.noticeInfo.doShow(step);
});
},
checkRoutes(routes) {
const route = routes.filter(route => {
return route.greenOpen;
});
return route[0].code;
},
//
guide() {
const step = {
@ -334,13 +355,13 @@ export default {
operation: OperationEvent.Signal.guide.menu.operation,
param: {
signalCode: `${this.selected.code}`
},
}
// cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
};
this.$store.dispatch('training/nextNew', step).then(({ valid, response }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$store.dispatch('menuOperation/pushRequestList', {device: this.selected, operation: { code: OperationEvent.Signal.guide.menu.operation, name: '引导信号',cmdType:CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE}});
this.$store.dispatch('menuOperation/pushRequestList', {device: this.selected, operation: { code: OperationEvent.Signal.guide.menu.operation, name: '引导信号', cmdType:CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE}});
}
});
},
@ -353,14 +374,14 @@ export default {
operation: OperationEvent.Signal.cancelTrainRoute.menu.operation,
param: {
signalCode: `${this.selected.code}`
},
}
// cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$store.dispatch('menuOperation/pushRequestList', {device: this.selected, operation: { code: OperationEvent.Signal.cancelTrainRoute.menu.operation, name: '取消进路',cmdType:CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE}});
this.$store.dispatch('menuOperation/pushRequestList', {device: this.selected, operation: { code: OperationEvent.Signal.cancelTrainRoute.menu.operation, name: '取消进路', cmdType:CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE}});
}
});
},
@ -373,13 +394,13 @@ export default {
operation: OperationEvent.Signal.lock.menu.operation,
param: {
signalCode: `${this.selected.code}`
},
}
// cmdType: CMD.Signal.CMD_SIGNAL_BLOCK
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$store.dispatch('menuOperation/pushRequestList', { device: this.selected, operation: { code: OperationEvent.Signal.lock.menu.operation, name: '终端信号机封锁',cmdType:CMD.Signal.CMD_SIGNAL_BLOCK}});
this.$store.dispatch('menuOperation/pushRequestList', { device: this.selected, operation: { code: OperationEvent.Signal.lock.menu.operation, name: '终端信号机封锁', cmdType:CMD.Signal.CMD_SIGNAL_BLOCK}});
}
}).catch(() => {
this.$refs.noticeInfo.doShow(step);
@ -394,13 +415,13 @@ export default {
operation: OperationEvent.Signal.unlock.menu.operation,
param: {
signalCode: `${this.selected.code}`
},
}
// cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$store.dispatch('menuOperation/pushRequestList', { device: this.selected, operation: { code: OperationEvent.Signal.unlock.menu.operation, name: '终端信号机解封',cmdType:CMD.Signal.CMD_SIGNAL_UNBLOCK}});
this.$store.dispatch('menuOperation/pushRequestList', { device: this.selected, operation: { code: OperationEvent.Signal.unlock.menu.operation, name: '终端信号机解封', cmdType:CMD.Signal.CMD_SIGNAL_UNBLOCK}});
}
});
},

View File

@ -1,7 +1,7 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<train-init-plan ref="trainInitPlan"/>
<train-init-plan ref="trainInitPlan" />
<notice-info ref="noticeInfo" />
</div>
</template>

View File

@ -525,7 +525,7 @@ export default {
this.$refs.routerCommand.doShow(step, this.selected, '是否执行引导命令');
}
});
},
}
}
};
</script>

View File

@ -12,14 +12,14 @@ export function getPrdType() {
return prdType;
}
export function isShowThePrdType (prdType, showConditions) {
const path = window.location.href;
if (path.indexOf('map/draw') !== -1 ) {
if (showConditions === '01' || (showConditions === '02' && prdType === '02') || (showConditions === '03' && prdType === '01')) {
return true;
} else {
if (showConditions === '01' || (showConditions === '02' && prdType === '02') || (showConditions === '03' && prdType === '01')) {
return true;
} else if (!showConditions) {
return true; // 兼容老数据没有showConditions
}
} else if (!showConditions) {
return true; // 兼容老数据没有showConditions
}
}
export function isPreviewOrMapDraw() {
const path = window.location.href;
return path.indexOf('map/draw') !== -1 || path.indexOf('mapPreviewNew') !== -1;
}

View File

@ -30,105 +30,105 @@ export function calculateDCenter(viewRect, zrbound) {
return { dx: dx, dy: dy };
}
export function deviceFactory(type, elem) {
return {...deviceRender[type], ...elem};
export function deviceFactory(type, elem, showConfig) {
return {...deviceRender[type], ...elem, ...showConfig};
}
export function createDevice(type, elem, propConvert) {
const device = deviceFactory(type, Object.assign(elem, { _type: type } ));
export function createDevice(type, elem, propConvert, showConfig) {
const device = deviceFactory(type, Object.assign(elem, { _type: type } ), showConfig);
return propConvert ? propConvert.initPrivateProps(device) : device;
}
export function parser(data, skinCode) {
export function parser(data, skinCode, showConfig) {
var mapDevice = {};
var propConvert = skinCode ? Vue.prototype.$theme.loadPropConvert(skinCode) : null;
if (data) {
zrUtil.each(data.sectionList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Section, elem, propConvert);
mapDevice[elem.code] = createDevice(deviceType.Section, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.signalList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Signal, elem, propConvert);
mapDevice[elem.code] = createDevice(deviceType.Signal, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.stationList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Station, elem, propConvert);
mapDevice[elem.code] = createDevice(deviceType.Station, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.stationStandList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.StationStand, elem, propConvert);
mapDevice[elem.code] = createDevice(deviceType.StationStand, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.stationControlList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.StationControl, elem, propConvert);
mapDevice[elem.code] = createDevice(deviceType.StationControl, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.counterList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.StationCounter, elem, propConvert);
mapDevice[elem.code] = createDevice(deviceType.StationCounter, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.delayShowList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.StationDelayUnlock, elem, propConvert);
mapDevice[elem.code] = createDevice(deviceType.StationDelayUnlock, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.lineList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Line, elem, propConvert);
mapDevice[elem.code] = createDevice(deviceType.Line, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.espList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Esp, elem, propConvert);
mapDevice[elem.code] = createDevice(deviceType.Esp, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.psdList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Psd, elem, propConvert);
mapDevice[elem.code] = createDevice(deviceType.Psd, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.textList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Text, elem, propConvert);
mapDevice[elem.code] = createDevice(deviceType.Text, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.zcList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.ZcControl, elem, propConvert);
mapDevice[elem.code] = createDevice(deviceType.ZcControl, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.lcList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.LcControl, elem, propConvert);
mapDevice[elem.code] = createDevice(deviceType.LcControl, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.tempSpeedLimitList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.LimitControl, elem, propConvert);
mapDevice[elem.code] = createDevice(deviceType.LimitControl, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.resourceList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Resource, elem, propConvert);
mapDevice[elem.code] = createDevice(deviceType.Resource, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.trainList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Train, elem, propConvert);
mapDevice[elem.code] = createDevice(deviceType.Train, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.Line || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Line, elem, propConvert);
mapDevice[elem.code] = createDevice(deviceType.Line, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.Text || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Text, elem, propConvert);
mapDevice[elem.code] = createDevice(deviceType.Text, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.cycleButtonList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.MapCycleButtonVO, elem, propConvert);
mapDevice[elem.code] = createDevice(deviceType.MapCycleButtonVO, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.automaticRouteButtonList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.AutomaticRoute, elem, propConvert);
mapDevice[elem.code] = createDevice(deviceType.AutomaticRoute, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.outerFrameList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.OutFrame, elem, propConvert);
mapDevice[elem.code] = createDevice(deviceType.OutFrame, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.trainWindowList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.TrainWindow, elem, propConvert);
mapDevice[elem.code] = createDevice(deviceType.TrainWindow, elem, propConvert, showConfig);
if (elem.sectionCode) {
const section = mapDevice[elem.sectionCode];
if (section) {
@ -138,7 +138,7 @@ export function parser(data, skinCode) {
}, this);
zrUtil.each(data.switchList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Switch, elem, propConvert);
mapDevice[elem.code] = createDevice(deviceType.Switch, elem, propConvert, showConfig);
const cnodeSection = mapDevice[mapDevice[elem.code].sectionACode];
const lnodeSection = mapDevice[mapDevice[elem.code].sectionBCode];
const rnodeSection = mapDevice[mapDevice[elem.code].sectionCCode];

View File

@ -195,7 +195,7 @@ const map = {
mapDataLoadedCount: 0, // 地图数据加载完成标识
trainDetails: null, // 地图'列车详情'显示
deleteCount: 0, // 绘图快捷删除标识
updateCount: 0, // 绘图快捷修改标识
updateCount: 0, // 绘图快捷修改标识
mousemove: 0 // 实训战场图移动标识
},
@ -515,7 +515,11 @@ const map = {
setMapData: (state, map) => {
if (map && map.skinVO) {
state.map = map;
state.mapDevice = parser(map, map.skinVO.code);
let showConfig = {};
if (Vue.prototype.$jlmap && ( typeof(Vue.prototype.$jlmap.getShowConfig) === 'function')) {
showConfig = Vue.prototype.$jlmap.getShowConfig();
}
state.mapDevice = parser(map, map.skinVO.code, showConfig);
Vue.prototype.$jlmap && Vue.prototype.$jlmap.setMapDevice(state.mapDevice);
} else {
state.map = null;

View File

@ -4,6 +4,7 @@
<div :id="canvasId" style="background: #000;" class="display_canvas" />
<progress-bar ref="progressBar" />
<zoom-box v-if="!isScreen" :scale-rate="dataZoom.scaleRate" @setShrink="setShrink" @setMagnify="setMagnify" />
<show-mode v-if="isDesign" @setShowMode="setShowMode" />
<div v-if="show" class="zoom-view" :style="{ width: width +'px'}">
<el-form :model="dataZoom" label-width="80px" size="mini" inline>
<el-form-item :label="$t(`global.offset`)">
@ -33,7 +34,8 @@
import Vue from 'vue';
import localStore from 'storejs';
import Jlmap from '@/jmapNew/map';
import ZoomBox from './zoom/zoom';
import ZoomBox from './pendant/zoom';
import ShowMode from './pendant/showMode';
import ProgressBar from '@/views/components/progressBar/index';
import { mapGetters } from 'vuex';
import { TrainingMode } from '@/scripts/ConstDic';
@ -44,7 +46,8 @@ export default {
name: 'JlmapVisual',
components: {
ZoomBox,
ProgressBar
ProgressBar,
ShowMode
},
data() {
return {
@ -89,6 +92,9 @@ export default {
},
maskOpen() {
return this.$store.state.config.maskOpen;
},
isDesign() {
return this.$route.path.indexOf('mapPreviewNew') !== -1 || this.$route.path.indexOf('map/draw') !== -1;
}
},
watch: {
@ -152,11 +158,15 @@ export default {
};
//
const path = window.location.href;
let mouseWheelFlag = false;
if (path.includes('design/userlist/map/draw') || path.includes('design/usermap/map/draw')) {
mouseWheelFlag = true;
const mouseWheelFlag = true;
let previewOrMapDraw = false;
// if (path.includes('design/userlist/map/draw') || path.includes('design/usermap/map/draw')) {
// mouseWheelFlag = true;
// }
if (path.indexOf('map/draw') !== -1 || path.indexOf('mapPreviewNew') !== -1) {
previewOrMapDraw = true;
}
const prdType = this.$route.query.prdType;
Vue.prototype.$theme = new Theme();
Vue.prototype.$jlmap = new Jlmap({
dom: document.getElementById(this.canvasId),
@ -171,6 +181,11 @@ export default {
offsetY: 0,
zoomOnMouseWheel: mouseWheelFlag
},
showConfig: {
prdType: prdType,
previewOrMapDraw: previewOrMapDraw,
showMode: '03'
},
methods: {
dataLoaded: this.handleDataLoaded,
viewLoaded: this.handleViewLoaded,
@ -312,6 +327,13 @@ export default {
y: e.offsetY + Number(this.dataZoom.offsetY)
};
this.$store.dispatch('map/setMousemove');
},
//
setShowMode(showMode) {
const list = [...this.$store.state.map.map.automaticRouteButtonList, ...this.$store.state.map.map.cycleButtonList,
...this.$store.state.map.map.stationList, ...this.$store.state.map.map.stationStandList,
...this.$store.state.map.map.lineList, ...this.$store.state.map.map.textList, ...this.$store.state.map.map.outerFrameList];
this.$jlmap.updateShowMode(list, showMode);
}
}
};

View File

@ -0,0 +1,104 @@
<template>
<div class="zoom-box" :style="{top: offsetY+'px', right: offsetX+ 'px'}">
<el-select v-model="swch" size="small" :placeholder="$t('display.schema.selectProduct')" @change="switchMode">
<el-option v-for="item in swchList" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
</div>
</template>
<script>
export default {
name: 'ShowMode',
data() {
return {
offsetY: 15,
offsetX: 20,
swch: '03',
swchList: [
{ value: '03', name: '现地' },
{ value: '02', name: '行调' }
]
};
},
watch: {
'$store.state.config.menuBarLoadedCount': function (val) {
this.$nextTick(() => {
this.setPosition();
});
},
'$route' () {
this.setOffsetX();
}
},
mounted() {
this.setOffsetX();
},
methods: {
setPosition() {
this.$nextTick(() => {
let offsetY = 15;
const menuBar = document.getElementById('menuBar');
const menuTool = document.getElementById('menuTool');
if (menuBar) {
offsetY += (menuBar.offsetHeight || 0);
}
if (menuTool) {
offsetY += (menuTool.offsetHeight || 0);
}
if (this.offsetY != offsetY) {
this.offsetY = offsetY;
}
});
},
setOffsetX() {
if (this.$route.path.indexOf('mapPreviewNew') !== -1) {
this.offsetX = 20;
} else if (this.$route.path.indexOf('map/draw') !== -1) {
this.offsetX = 140;
}
},
switchMode(val) {
this.$emit('setShowMode', val);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.zoom-box {
z-index: 7;
position: absolute;
right: 20px;
width: 120px;
height: 32px;
background: rgb(224, 223, 223);
border-radius: 4px;
overflow: hidden;
.zoom {
width: 50%;
float: right;
height: 100%;
margin: 0;
padding: 0;
border-radius: 0;
display: flex;
justify-content: center;
align-items: center;
border: none;
outline: none;
color: #333;
i {
color: #000;
font-size: 18px;
font-weight: 900;
}
}
.shrink {
border-right: 1px solid #333;
}
}
</style>

View File

@ -10,54 +10,54 @@
</template>
<script>
export default {
name: 'ZoomBox',
props: {
scaleRate: {
type: String,
default() {
return '1';
}
}
},
data() {
return {
offset: 15
};
},
watch: {
'$store.state.config.menuBarLoadedCount': function (val) {
this.$nextTick(() => {
this.setPosition();
});
}
},
methods: {
setPosition() {
this.$nextTick(() => {
let offset = 15;
const menuBar = document.getElementById('menuBar');
const menuTool = document.getElementById('menuTool');
name: 'ZoomBox',
props: {
scaleRate: {
type: String,
default() {
return '1';
}
}
},
data() {
return {
offset: 15
};
},
watch: {
'$store.state.config.menuBarLoadedCount': function (val) {
this.$nextTick(() => {
this.setPosition();
});
}
},
methods: {
setPosition() {
this.$nextTick(() => {
let offset = 15;
const menuBar = document.getElementById('menuBar');
const menuTool = document.getElementById('menuTool');
if (menuBar) {
offset += (menuBar.offsetHeight || 0);
}
if (menuBar) {
offset += (menuBar.offsetHeight || 0);
}
if (menuTool) {
offset += (menuTool.offsetHeight || 0);
}
if (menuTool) {
offset += (menuTool.offsetHeight || 0);
}
if (this.offset != offset) {
this.offset = offset;
}
});
},
setShrinkCanvas() {
this.$emit('setShrink');
},
setMagnifyCanvas() {
this.$emit('setMagnify');
}
}
if (this.offset != offset) {
this.offset = offset;
}
});
},
setShrinkCanvas() {
this.$emit('setShrink');
},
setMagnifyCanvas() {
this.$emit('setMagnify');
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -306,8 +306,8 @@ export default {
name: row.name,
model: {
items: [
{ prop: 'sectionCode', label: '物理区段ID', type: 'text' },
{ prop: 'sectionCode', label: '物理区段名称', type: 'select', options: sectionDict }
{ prop: 'sectionCode', label: this.$t('map.physicalSectionID'), type: 'text' },
{ prop: 'sectionCode', label: this.$t('map.physicalSectionName'), type: 'select', options: sectionDict }
]
}
};
@ -322,12 +322,12 @@ export default {
const fieldList = {
id: row.id,
mapId: this.$route.params.mapId,
title: '进路物理区段数据',
title: this.$t('map.routePhysicalSectionData'),
name: row.name,
model: {
items: [
{ prop: 'sectionCode', label: '物理区段ID', type: 'text' },
{ prop: 'sectionCode', label: '物理区段名称', type: 'select', options: sectionDict }
{ prop: 'sectionCode', label: this.$t('map.physicalSectionID'), type: 'text' },
{ prop: 'sectionCode', label: this.$t('map.physicalSectionName'), type: 'select', options: sectionDict }
]
}
};
@ -355,18 +355,18 @@ export default {
const fieldList = {
id: row.id,
mapId: this.$route.params.mapId,
title: '进路侧防道',
title: this.$t('map.routeSideDefenseSwitch'),
name: row.name,
model: {
items: [
{ prop: 'switchCode', label: '道岔ID', type: 'text' },
{ prop: 'switchCode', label: '道岔名称', type: 'select', options: switchDict },
{ prop: 'switchType', label: '道岔类型', type: 'text'}
{ prop: 'switchCode', label: this.$t('map.switchID'), type: 'text' },
{ prop: 'switchCode', label: this.$t('map.switchName'), type: 'select', options: switchDict },
{ prop: 'switchType', label: this.$t('map.switchType'), type: 'text'}
]
}
};
row.routeFlankProtectionList.forEach( item => {
item.switchType = item.normal ? '定位' : '反位';
item.switchType = item.normal ? this.$t('map.normalPosition') : this.$t('map.reversePosition');
});
this.$refs.previewField.doShow(fieldList, row.routeFlankProtectionList);
}
@ -378,19 +378,19 @@ export default {
const fieldList = {
id: row.id,
mapId: this.$route.params.mapId,
title: '进路道岔数据',
title: this.$t('map.entryTurnout'),
name: row.name,
model: {
field: 'routeSwitchList',
items: [
{ prop: 'switchCode', label: '道岔ID', type: 'text' },
{ prop: 'switchCode', label: '道岔名称', type: 'select', options: switchDict },
{ prop: 'switchType', label: '道岔类型', type: 'text'}
{ prop: 'switchCode', label: this.$t('map.switchID'), type: 'text' },
{ prop: 'switchCode', label: this.$t('map.switchName'), type: 'select', options: switchDict },
{ prop: 'switchType', label: this.$t('map.switchType'), type: 'text'}
]
}
};
row.routeSwitchList.forEach( item => {
item.switchType = item.normal ? '定位' : '反位';
item.switchType = item.normal ? this.$t('map.normalPosition') : this.$t('map.reversePosition');
});
this.$refs.previewField.doShow(fieldList, row.routeSwitchList);
}
@ -398,7 +398,7 @@ export default {
//
saveRelated(row) {
putRouteNew(row).then(response => {
this.$message.success('更新成功');
this.$message.success(this.$t('tip.updateSuccessfully'));
}).catch(() => {
this.$messageBox('操作异常');
});

View File

@ -127,6 +127,9 @@ export default {
]),
newRouteSectionList() {
return JSON.stringify(this.addModel.routeSectionList);
},
newBlockSectionList() {
return JSON.stringify(this.addModel.blockSectionList);
}
},
watch: {
@ -145,10 +148,23 @@ export default {
const obj = JSON.parse(val);
const objOld = JSON.parse(old);
if (objOld && objOld.length) {
this.changeSectionSelected(objOld, false, 'signalNearSection');
this.changeSectionSelected(objOld, true);
}
if (obj && obj.length) {
this.changeSectionSelected(obj, true, 'signalNearSection');
this.changeSectionSelected(obj, true);
}
},
deep: true
},
newBlockSectionList: {
handler: function(val, old) {
const obj = JSON.parse(val);
const objOld = JSON.parse(old);
if (objOld && objOld.length) {
this.changeSectionSelected(objOld, true);
}
if (obj && obj.length) {
this.changeSectionSelected(obj, true);
}
},
deep: true
@ -209,6 +225,8 @@ export default {
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'blockSectionList'.toUpperCase()) {
if ((selected.type === '01' || selected.type === '03') && this.addModel.blockSectionList.indexOf(selected.code) === -1) {
this.addModel.blockSectionList.push(selected.code);
} else if (selected.type === '02' && this.addModel.blockSectionList.indexOf(selected.parentCode) === -1) {
this.addModel.blockSectionList.push(selected.parentCode);
}
}
}
@ -262,25 +280,48 @@ export default {
}
},
batchSectionListFocus(flag) {
this.changeSectionSelected(this.addModel.routeSectionList, flag, 'signalNearSection');
this.changeSectionSelected(this.addModel.routeSectionList, flag);
this.changeSectionSelected(this.addModel.blockSectionList, flag);
this.changeSignalSelected(this.addModel.signalCode, flag, 'routeSignal');
},
changeSignalSelected(val, flag, type) {
const signal = this.$store.getters['map/getDeviceByCode'](val);
signal && signal.instance.drawBatchSelected(flag, flag ? type : '');
},
changeSectionSelected(list, flag, type) {
changeSectionSelected(list, cutOut) {
let flag = true;
let type = '';
list && list.forEach((item) => {
const section = this.$store.getters['map/getDeviceByCode'](item);
if (section && section.logicSectionCodeList && section.logicSectionCodeList.length) {
section.logicSectionCodeList.forEach( (logicSectionCode) => {
const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode);
logicSection && logicSection.instance.drawBatchSelected(flag, flag ? type : '');
});
} else {
section && section.instance.drawBatchSelected(flag, flag ? type : '');
if (!cutOut) {
this.setSectionSelectedType(section, cutOut, '');
return;
}
if (this.addModel.routeSectionList.indexOf(item) !== -1 && this.addModel.blockSectionList.indexOf(item) !== -1) {
type = 'signalNearSection';
flag = true;
} else if (this.addModel.routeSectionList.indexOf(item) !== -1) {
type = 'signalNearSectionCBTC';
flag = true;
} else if (this.addModel.blockSectionList.indexOf(item) !== -1) {
type = 'signalNearSectionReserve';
flag = true;
} else {
type = '';
flag = false;
}
this.setSectionSelectedType(section, flag, type);
});
},
setSectionSelectedType(section, flag, type) {
if (section && section.logicSectionCodeList && section.logicSectionCodeList.length) {
section.logicSectionCodeList.forEach( (logicSectionCode) => {
const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode);
logicSection && logicSection.instance.drawBatchSelected(flag, flag ? type : '');
});
} else {
section && section.instance.drawBatchSelected(flag, flag ? type : '');
}
}
}
};

View File

@ -217,6 +217,15 @@ export default {
},
setShowSecond(flag) {
this.showSecond = flag;
if (flag) {
this.rules.turnBackRoute2Name = [{ required: true, message: '请选择折返进路2', trigger: 'blur' }];
this.rules.basicRoute2Name = [{ required: true, message: '请选择基础进路2', trigger: 'blur'}];
this.rules.reentryTrack2Code = [{ required: true, message: '请选择折返区段2', trigger: 'change'}];
} else {
delete this.rules.turnBackRoute2Name;
delete this.rules.basicRoute2Name;
delete this.rules.reentryTrack2Code;
}
},
buildModel(code) {
const model = Object.assign({}, this.addModel);
@ -271,6 +280,7 @@ export default {
this.addModel.code = '';
this.$refs.form.resetFields();
this.isSave = true;
this.showSecond = false;
}
},
setRouteCode(data, type) {

View File

@ -386,7 +386,7 @@ export default {
.operation_box{
position: absolute;
right: 20px;
top: 20px;
top: 15px;
z-index: 9;
}

View File

@ -14,12 +14,50 @@
</el-button-group>
</el-form-item>
</el-form>
<el-form ref="formModel" :model="formModel" label-width="200px" size="mini" :rules="formRules">
<el-form-item label="区段编码:" prop="modelList">
<el-select v-model="formModel.modelList" filterable multiple>
<el-option
v-for="item in sectionList"
:key="item.code"
:label="item.name + '(' + item.code + ')'"
:value="item.code"
/>
</el-select>
<el-button
:type="field === 'sectionTypeCode' ? 'danger' : 'primary'"
size="small"
@click="hover('sectionTypeCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item label="区段名称位置:" prop="trainPosType">
<el-select
v-model="formModel.trainPosType"
placeholder="请选择"
:clearable="true"
>
<el-option
v-for="option in positionTypes"
:key="option.type"
:label="option.name"
:value="option.type"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button type="primary" size="big" @click="setPositionType">{{ $t('global.set') }}</el-button>
</el-button-group>
</el-form-item>
</el-form>
</el-scrollbar>
</div>
</template>
<script>
import { deepAssign } from '@/utils/index';
import { mapGetters } from 'vuex';
export default {
name: 'BatchSettings',
props: {
@ -28,6 +66,12 @@ export default {
default: function() {
return [];
}
},
field: {
type: Object,
default: function () {
return '';
}
}
},
data() {
@ -36,10 +80,34 @@ export default {
leftDistance: 0,
rightDistance: 0
},
tipInfoList: []
formModel: {
modelList: [],
trainPosType: ''
},
positionTypes: [
{ name: '上方', type: '01' },
{ name: '下方', type: '02' }
],
tipInfoList: [],
formRules: {
trainPosType: [
{ required: true, message: '请选择', trigger: 'change' }
],
modelList: [
{ required: true, message: '请选择', trigger: 'change' }
]
}
};
},
computed: {
...mapGetters('map', [
'sectionList'
])
},
methods:{
hover(filed) {
this.$emit('hover', filed);
},
batchSettings() {
this.tipInfoList = [];
const models = [];
@ -63,6 +131,20 @@ export default {
this.$message.success(this.$t('tip.stopPointOffsetTip'));
}
}
},
setPositionType() {
const models = [];
this.$refs['formModel'].validate((valid) => {
if (valid) {
this.formModel.modelList.forEach(sectionCode => {
const model = deepAssign({}, this.$store.getters['map/getDeviceByCode'](sectionCode) || {});
model.trainPosType = this.formModel.trainPosType;
models.push(model);
});
this.$emit('updateMapModel', models, 'five');
this.$refs.formModel.resetFields(); //
}
});
}
}
};

View File

@ -24,7 +24,7 @@
<logic-block ref="logicBlock" :edit-model="editModel" @updateMapModel="updateMapModel" />
</el-tab-pane>
<el-tab-pane class="view-control" :label="$t('map.batchSettings')" name="five">
<batch-settings ref="batchSettings" :section-list="sectionList" @updateMapModel="updateMapModel" @tipInfoHandle="tipInfoHandle" />
<batch-settings ref="batchSettings" :field="field" :section-list="sectionList" @hover="hover" @updateMapModel="updateMapModel" @tipInfoHandle="tipInfoHandle" />
</el-tab-pane>
<tip-info ref="tipInfo" :tip-info-list="tipInfoList" />
</el-tabs>
@ -453,6 +453,11 @@ export default {
this.activeName = 'second';
this.field = '';
this.$emit('fieldSelect', '');
} else if (this.field.toUpperCase() === 'sectionTypeCode'.toUpperCase()) {
this.$refs.batchSettings.formModel.modelList.push(selected.code);
this.activeName = 'five';
// this.field = '';
// this.$emit('fieldSelect', '');
}
}
},

View File

@ -90,7 +90,7 @@ export default {
stationCode: '', //
position: { x: 0, y: 0 },
visible: true, //
inside: false, //
inside: false, //
right: true,
standTrackCode: '',
small: false,
@ -129,7 +129,7 @@ export default {
},
allModel: {
width: '',
height: '',
height: ''
}
};
},
@ -447,7 +447,7 @@ export default {
standCode: Standuid
});
}
section.standTrack = true;
section.standTrack = !this.addModel.small;
models.push(section);
this.$emit('updateMapModel', models);
}
@ -512,7 +512,7 @@ export default {
},
//
batchSettings() {
let models = [];
const models = [];
this.stationStandList.forEach(stationStand => {
if (!stationStand.small) {
const model = deepAssign({}, stationStand);
@ -520,7 +520,7 @@ export default {
model.height = this.allModel.height;
models.push(model);
}
})
});
this.$emit('updateMapModel', models);
}
}