Merge branch 'dev' of https://git.code.tencent.com/lian-cbtc/jl-client into dev
# Conflicts: # src/jmapNew/theme/chengdu_01/model.js # src/utils/baseUrl.js
This commit is contained in:
commit
19f64034fb
@ -133,9 +133,9 @@ class SkinCode extends defaultStyle {
|
||||
endColor: '#FFFFFF', // 尽头分隔符颜色
|
||||
color: '#FFFFFF' // 区段边界符颜色
|
||||
},
|
||||
shuttleBack: { // 折返进路 (存在此对象 显示折返箭头)
|
||||
distance: 5 // 限速线距离区段距离
|
||||
},
|
||||
// shuttleBack: { // 折返进路 (存在此对象 显示折返箭头)
|
||||
// distance: 5 // 限速线距离区段距离
|
||||
// },
|
||||
block: {
|
||||
special: false // 区段特殊显示
|
||||
},
|
||||
|
@ -36,6 +36,9 @@ class Jlmap {
|
||||
this.defaultStateDict = this.loadDefaultState();
|
||||
|
||||
this.initMapInstance(opts);
|
||||
|
||||
// 显示集中站
|
||||
this.stationCode = '';
|
||||
}
|
||||
|
||||
// 初始化属性有鼠标事件 缩放等
|
||||
@ -173,6 +176,8 @@ class Jlmap {
|
||||
});
|
||||
|
||||
if (this.methods.viewUpdate instanceof Function) { this.methods.viewUpdate(list); }
|
||||
this.updateShowMode(list, this.showConfig.showMode);
|
||||
this.updateShowStation(list, this.stationCode);
|
||||
}
|
||||
|
||||
// 中间处理
|
||||
@ -266,6 +271,57 @@ class Jlmap {
|
||||
getShowConfig() {
|
||||
return this.showConfig;
|
||||
}
|
||||
updateShowStation(list, stationCode) {
|
||||
this.stationCode = stationCode;
|
||||
(list || []).forEach(elem => {
|
||||
const code = elem.code;
|
||||
const type = elem._type;
|
||||
const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
|
||||
if (oDevice._type === deviceType.Station) {
|
||||
this.showStationHandleStation(oDevice, stationCode);
|
||||
} else if (oDevice._type === deviceType.Section) {
|
||||
this.$painter.updateShowStation(oDevice, stationCode);
|
||||
this.showStationHandleSection(oDevice, stationCode);
|
||||
} else if (oDevice._type === deviceType.TrainWindow) {
|
||||
} else if (oDevice._type === deviceType.Psd) {
|
||||
this.showStationHandlePsd(oDevice, stationCode);
|
||||
} else {
|
||||
this.$painter.updateShowStation(oDevice, stationCode);
|
||||
}
|
||||
});
|
||||
this.$painter.$transformHandle.revisibleAll();
|
||||
}
|
||||
showStationHandlePsd(oDevice, stationCode) {
|
||||
const standDevice = this.mapDevice[oDevice.standCode];
|
||||
if (standDevice.deviceStationCode === stationCode || !stationCode) {
|
||||
this.$painter.updateSpecialShowStation(oDevice, true);
|
||||
} else {
|
||||
this.$painter.updateSpecialShowStation(oDevice, false);
|
||||
}
|
||||
}
|
||||
showStationHandleSection(oDevice, stationCode) {
|
||||
const trainWinDevice = this.mapDevice[oDevice.trainWindowCode];
|
||||
if (oDevice.stationCode === stationCode || !stationCode) {
|
||||
this.$painter.updateSpecialShowStation(trainWinDevice, true);
|
||||
} else {
|
||||
this.$painter.updateSpecialShowStation(trainWinDevice, false);
|
||||
}
|
||||
}
|
||||
showStationHandleStation (oDevice, stationCode) {
|
||||
if ((oDevice.centralized && oDevice.code === stationCode) || !stationCode) {
|
||||
this.$painter.updateSpecialShowStation(oDevice, true);
|
||||
oDevice.chargeStationCodeList.forEach(staCode => {
|
||||
const staDevice = this.mapDevice[staCode];
|
||||
this.$painter.updateSpecialShowStation(staDevice, true);
|
||||
});
|
||||
} else if (oDevice.centralized && oDevice.code !== stationCode) {
|
||||
this.$painter.updateSpecialShowStation(oDevice, false);
|
||||
oDevice.chargeStationCodeList.forEach(staCode => {
|
||||
const staDevice = this.mapDevice[staCode];
|
||||
this.$painter.updateSpecialShowStation(staDevice, false);
|
||||
});
|
||||
}
|
||||
}
|
||||
update(list) {
|
||||
this.setUpdateMapDevice(list || []); // 增加一个 前数据 处理 为了在区段中 获取全部的 道岔信息
|
||||
(list || []).forEach(elem => {
|
||||
|
@ -169,6 +169,19 @@ class Painter {
|
||||
device.instance.setShowMode();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 更新现地显示单独集中站
|
||||
* */
|
||||
updateShowStation(device, stationCode) {
|
||||
if (device && device.instance) {
|
||||
device.instance.setShowStation(stationCode);
|
||||
}
|
||||
}
|
||||
updateSpecialShowStation(device, flag) {
|
||||
if (device && device.instance) {
|
||||
device.instance.setShowStation(flag);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 更新transform变化
|
||||
* @param {*} opt
|
||||
|
@ -17,6 +17,7 @@ export default class Automactic extends Group {
|
||||
this.zlevel = model.zlevel;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.isShowShape = true;
|
||||
if (isShowThePrdType(model.prdType, style.MapCycleButtonVO.visibleConditions) || model.previewOrMapDraw) {
|
||||
this.create();
|
||||
this.createMouseEvent();
|
||||
@ -104,6 +105,7 @@ export default class Automactic extends Group {
|
||||
|
||||
// 设置状态
|
||||
setState(model) {
|
||||
if (!this.isShowShape) return;
|
||||
}
|
||||
|
||||
createMouseEvent() {
|
||||
@ -114,7 +116,6 @@ export default class Automactic extends Group {
|
||||
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
|
||||
}
|
||||
}
|
||||
|
||||
getArcBoundingRect() {
|
||||
const rect = this.control.getBoundingRect().clone();
|
||||
const scale = this.control.scale[0];
|
||||
@ -142,15 +143,31 @@ export default class Automactic extends Group {
|
||||
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();
|
||||
this.show();
|
||||
} else {
|
||||
this.control.hide();
|
||||
this.text.hide();
|
||||
this.subtitleText && this.subtitleText.hide();
|
||||
this.arcBorder && this.arcBorder.hide();
|
||||
this.hide();
|
||||
}
|
||||
}
|
||||
setShowStation(stationCode) {
|
||||
if (!stationCode || this.model.stationCode === stationCode) {
|
||||
this.isShowShape = true;
|
||||
this.show();
|
||||
} else {
|
||||
this.isShowShape = false;
|
||||
this.hide();
|
||||
}
|
||||
}
|
||||
show() {
|
||||
this.control && this.control.show();
|
||||
this.text && this.text.show();
|
||||
this.subtitleText && this.subtitleText.show();
|
||||
this.arcBorder && this.arcBorder.show();
|
||||
this.setState(this.model);
|
||||
}
|
||||
hide() {
|
||||
this.control && this.control.hide();
|
||||
this.text && this.text.hide();
|
||||
this.subtitleText && this.subtitleText.hide();
|
||||
this.arcBorder && this.arcBorder.hide();
|
||||
}
|
||||
}
|
||||
|
@ -2,52 +2,52 @@ 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);
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import Text from 'zrender/src/graphic/Text';
|
||||
import EMouse from './EMouse';
|
||||
import {isShowThePrdType} from '../../utils/handlePath';
|
||||
|
||||
export default class LcControl extends Group {
|
||||
export default class AutomacticRoute extends Group {
|
||||
constructor(model, style) {
|
||||
super();
|
||||
this.z = 20;
|
||||
@ -16,6 +16,7 @@ export default class LcControl extends Group {
|
||||
this.zlevel = model.zlevel;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.isShowShape = true;
|
||||
if (isShowThePrdType(model.prdType, style.AutomaticRoute.displayCondition) || model.previewOrMapDraw) {
|
||||
this.create();
|
||||
this.createMouseEvent();
|
||||
@ -87,6 +88,7 @@ export default class LcControl extends Group {
|
||||
|
||||
// 设置状态
|
||||
setState(model) {
|
||||
if (!this.isShowShape) return;
|
||||
}
|
||||
|
||||
createMouseEvent() {
|
||||
@ -112,13 +114,29 @@ export default class LcControl extends Group {
|
||||
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();
|
||||
this.show();
|
||||
} else {
|
||||
this.control.hide();
|
||||
this.text.hide();
|
||||
this.subtitleText && this.subtitleText.hide();
|
||||
this.hide();
|
||||
}
|
||||
}
|
||||
setShowStation(stationCode) {
|
||||
if (!stationCode || this.model.stationCode === stationCode) {
|
||||
this.isShowShape = true;
|
||||
this.show();
|
||||
} else {
|
||||
this.isShowShape = false;
|
||||
this.hide();
|
||||
}
|
||||
}
|
||||
show() {
|
||||
this.control && this.control.show();
|
||||
this.text && this.text.show();
|
||||
this.subtitleText && this.subtitleText.show();
|
||||
this.setState(this.model);
|
||||
}
|
||||
hide() {
|
||||
this.control && this.control.hide();
|
||||
this.text && this.text.hide();
|
||||
this.subtitleText && this.subtitleText.hide();
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ export default class LcControl extends Group {
|
||||
this.zlevel = model.zlevel;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.isShowShape = true;
|
||||
this.create();
|
||||
this.createMouseEvent();
|
||||
this.setState(model);
|
||||
@ -54,6 +55,7 @@ export default class LcControl extends Group {
|
||||
|
||||
// 设置状态
|
||||
setState(model) {
|
||||
if (!this.isShowShape) return;
|
||||
}
|
||||
|
||||
createMouseEvent() {
|
||||
@ -64,7 +66,6 @@ export default class LcControl extends Group {
|
||||
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
|
||||
}
|
||||
}
|
||||
|
||||
getShapeTipPoint() {
|
||||
if (this.control) {
|
||||
var distance = 2;
|
||||
@ -77,4 +78,14 @@ export default class LcControl extends Group {
|
||||
return null;
|
||||
}
|
||||
setShowMode() {}
|
||||
setShowStation(stationCode) {
|
||||
if (!stationCode || this.model.stationCode === stationCode) {
|
||||
this.control.show();
|
||||
this.isShowShape = true;
|
||||
this.setState(this.model);
|
||||
} else {
|
||||
this.control.hide();
|
||||
this.isShowShape = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ export default class LimitControl extends Group {
|
||||
this.zlevel = model.zlevel;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.isShowShape = true;
|
||||
this.z = 20;
|
||||
this.create(model);
|
||||
this.createMouseEvent();
|
||||
@ -58,6 +59,7 @@ export default class LimitControl extends Group {
|
||||
|
||||
// 设置状态
|
||||
setState(model) {
|
||||
if (!this.isShowShape) return;
|
||||
}
|
||||
|
||||
createMouseEvent() {
|
||||
@ -81,4 +83,14 @@ export default class LimitControl extends Group {
|
||||
return null;
|
||||
}
|
||||
setShowMode() {}
|
||||
setShowStation(stationCode) {
|
||||
if (!stationCode || this.model.stationCode === stationCode) {
|
||||
this.control.show();
|
||||
this.isShowShape = true;
|
||||
this.setState(this.model);
|
||||
} else {
|
||||
this.control.hide();
|
||||
this.isShowShape = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ export default class Line2 extends Group {
|
||||
this.z = 0;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.isShowShape = true;
|
||||
if (isShowThePrdType(model.prdType, model.showConditions) || model.previewOrMapDraw) {
|
||||
this.create();
|
||||
this.setState(model);
|
||||
@ -55,6 +56,7 @@ export default class Line2 extends Group {
|
||||
}
|
||||
|
||||
setState(model) {
|
||||
if (!this.isShowShape) return;
|
||||
this.setLineType(model.type);
|
||||
}
|
||||
// 设置显示模式
|
||||
@ -71,4 +73,18 @@ export default class Line2 extends Group {
|
||||
});
|
||||
}
|
||||
}
|
||||
setShowStation(stationCode) {
|
||||
if (!stationCode || this.model.stationCode === stationCode) {
|
||||
this.eachChild((child) => {
|
||||
child.show();
|
||||
});
|
||||
this.isShowShape = true;
|
||||
this.setState(this.model);
|
||||
} else {
|
||||
this.eachChild((child) => {
|
||||
child.hide();
|
||||
});
|
||||
this.isShowShape = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ export default class OutFrame extends Group {
|
||||
this._code = model.code;
|
||||
this.style = style;
|
||||
this.zlevel = model.zlevel;
|
||||
this.isShowShape = true;
|
||||
this.z = 0;
|
||||
if (isShowThePrdType(model.prdType, model.showConditions) || model.previewOrMapDraw) {
|
||||
this.create();
|
||||
@ -43,6 +44,7 @@ export default class OutFrame extends Group {
|
||||
|
||||
// 设置状态
|
||||
setState(model) {
|
||||
if (!this.isShowShape) return;
|
||||
}
|
||||
// 设置显示模式
|
||||
setShowMode() {
|
||||
@ -50,8 +52,19 @@ export default class OutFrame extends Group {
|
||||
const showConditions = this.model.showConditions;
|
||||
if (!showConditions || showConditions === '01' || showMode === showConditions) {
|
||||
this.box && this.box.show();
|
||||
this.setState(this.model);
|
||||
} else {
|
||||
this.box && this.box.hide();
|
||||
}
|
||||
}
|
||||
setShowStation(stationCode) {
|
||||
if (!stationCode || this.model.stationCode === stationCode) {
|
||||
this.box && this.box.show();
|
||||
this.isShowShape = true;
|
||||
this.setState(this.model);
|
||||
} else {
|
||||
this.box && this.box.hide();
|
||||
this.isShowShape = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -119,6 +119,20 @@ class ESafeDoor extends Group {
|
||||
this.safeC && this.safeC.setStyle('fill', color);
|
||||
this.safeR && this.safeR.setStyle('fill', color);
|
||||
}
|
||||
hide() {
|
||||
this.stand1 && this.stand1.hide();
|
||||
this.stand2 && this.stand2.hide();
|
||||
this.safeL && this.safeL.hide();
|
||||
this.safeC && this.safeC.hide();
|
||||
this.safeR && this.safeR.hide();
|
||||
}
|
||||
show() {
|
||||
this.stand1 && this.stand1.show();
|
||||
this.stand2 && this.stand2.show();
|
||||
this.safeL && this.safeL.show();
|
||||
this.safeC && this.safeC.show();
|
||||
this.safeR && this.safeR.show();
|
||||
}
|
||||
}
|
||||
|
||||
export default ESafeDoor;
|
||||
|
@ -11,6 +11,7 @@ export default class Line2 extends Group {
|
||||
this.z = 1;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.isShowShape = true;
|
||||
this.create();
|
||||
this.setState(model);
|
||||
this.checkIsDrawMap();
|
||||
@ -64,6 +65,7 @@ export default class Line2 extends Group {
|
||||
}
|
||||
|
||||
setState(model) {
|
||||
if (!this.isShowShape) return;
|
||||
/** 设置屏蔽门开关*/
|
||||
// if (model.name == 'Psd44') {
|
||||
// console.log(model, model.screenDoorOpenStatus, '1 为关门 0 为开门');
|
||||
@ -96,6 +98,15 @@ export default class Line2 extends Group {
|
||||
this.on('mouseover', () => { this.highlight.mouseover(); });
|
||||
}
|
||||
}
|
||||
|
||||
setShowMode() {}
|
||||
setShowStation(flag) {
|
||||
if (flag) {
|
||||
this.safeDoor && this.safeDoor.show();
|
||||
this.isShowShape = true;
|
||||
this.setState(this.model);
|
||||
} else {
|
||||
this.safeDoor && this.safeDoor.hide();
|
||||
this.isShowShape = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ export default class Resource extends Group {
|
||||
this.zlevel = model.zlevel;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.isShowShape = true;
|
||||
this.z = model.zIndex || 1;
|
||||
this.create();
|
||||
}
|
||||
@ -42,6 +43,7 @@ export default class Resource extends Group {
|
||||
}
|
||||
|
||||
setState(model) {
|
||||
if (!this.isShowShape) return;
|
||||
}
|
||||
|
||||
// 整体图片
|
||||
@ -67,4 +69,14 @@ export default class Resource extends Group {
|
||||
return null;
|
||||
}
|
||||
setShowMode() {}
|
||||
setShowStation(stationCode) {
|
||||
if (!stationCode || this.model.stationCode === stationCode) {
|
||||
this.image && this.image.show();
|
||||
this.isShowShape = true;
|
||||
this.setState(this.model);
|
||||
} else {
|
||||
this.image && this.image.hide();
|
||||
this.isShowShape = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,31 +5,31 @@ import Path from 'zrender/src/graphic/Path';
|
||||
|
||||
// 计轴
|
||||
export const EAxle = Path.extend({
|
||||
type: 'EAxle',
|
||||
shape: {
|
||||
point: null
|
||||
},
|
||||
buildPath: function (ctx, model) {
|
||||
if (model && model.style && model.traingle) {
|
||||
const axleLength = 2 * model.style.Section.axle.radius;
|
||||
const positionx = model.point.x + model.drictx * (model.traingle.getCos(axleLength));
|
||||
const positiony = model.point.y + model.dricty * (model.traingle.getCos(axleLength));
|
||||
// 圆弧
|
||||
const arcX = positionx - model.dricty * model.traingle.getSin(axleLength);
|
||||
const arcY = positiony + model.drictx * model.traingle.getSin(axleLength);
|
||||
const arcR = model.style.Section.axle.radius;
|
||||
ctx.arc(arcX, arcY, arcR, 0, 2 * Math.PI, false);
|
||||
ctx.closePath();
|
||||
type: 'EAxle',
|
||||
shape: {
|
||||
point: null
|
||||
},
|
||||
buildPath: function (ctx, model) {
|
||||
if (model && model.style && model.traingle) {
|
||||
const axleLength = 2 * model.style.Section.axle.radius;
|
||||
const positionx = model.point.x + model.drictx * (model.traingle.getCos(axleLength));
|
||||
const positiony = model.point.y + model.dricty * (model.traingle.getCos(axleLength));
|
||||
// 圆弧
|
||||
const arcX = positionx - model.dricty * model.traingle.getSin(axleLength);
|
||||
const arcY = positiony + model.drictx * model.traingle.getSin(axleLength);
|
||||
const arcR = model.style.Section.axle.radius;
|
||||
ctx.arc(arcX, arcY, arcR, 0, 2 * Math.PI, false);
|
||||
ctx.closePath();
|
||||
|
||||
const x1 = positionx - model.traingle.getCos(axleLength) - model.dricty * model.traingle.getSin(axleLength);
|
||||
const y1 = positiony + model.drictx * model.traingle.getSin(axleLength) - model.traingle.getSin(axleLength);
|
||||
const x2 = positionx + model.traingle.getCos(axleLength) - model.dricty * model.traingle.getSin(axleLength);
|
||||
const y2 = positiony + model.drictx * model.traingle.getSin(axleLength) + model.traingle.getSin(axleLength);
|
||||
ctx.moveTo(x1, y1);
|
||||
ctx.lineTo(x2, y2);
|
||||
ctx.closePath();
|
||||
}
|
||||
}
|
||||
const x1 = positionx - model.traingle.getCos(axleLength) - model.dricty * model.traingle.getSin(axleLength);
|
||||
const y1 = positiony + model.drictx * model.traingle.getSin(axleLength) - model.traingle.getSin(axleLength);
|
||||
const x2 = positionx + model.traingle.getCos(axleLength) - model.dricty * model.traingle.getSin(axleLength);
|
||||
const y2 = positiony + model.drictx * model.traingle.getSin(axleLength) + model.traingle.getSin(axleLength);
|
||||
ctx.moveTo(x1, y1);
|
||||
ctx.lineTo(x2, y2);
|
||||
ctx.closePath();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// export default class EAxle extends Group {
|
||||
|
@ -2,41 +2,41 @@ import Path from 'zrender/src/graphic/Path';
|
||||
|
||||
// 成都三号线 折返进路
|
||||
export const EBackArrow = Path.extend({
|
||||
type: 'EBackArrow',
|
||||
shape: {
|
||||
points: null
|
||||
},
|
||||
buildPath: function (ctx, shape) {
|
||||
const points = shape.points;
|
||||
var r = shape.height;
|
||||
var x = points.x + shape.drict * shape.width / 2;
|
||||
var y = points.y;
|
||||
ctx.moveTo(points.x - shape.drict * shape.width, points.y + shape.height);
|
||||
ctx.lineTo(points.x + shape.drict * shape.width / 2, points.y + shape.height);
|
||||
if (shape.drict) {
|
||||
ctx.arc(x, y, r, Math.PI / 2, Math.PI * 3 / 2, true);
|
||||
} else {
|
||||
ctx.arc(x, y, r, Math.PI / 2, Math.PI * 3 / 2, false);
|
||||
}
|
||||
ctx.moveTo(points.x + shape.drict * shape.width / 2, points.y - shape.height);
|
||||
ctx.lineTo(points.x - shape.drict * (shape.width - 5), points.y - shape.height);
|
||||
}
|
||||
type: 'EBackArrow',
|
||||
shape: {
|
||||
points: null
|
||||
},
|
||||
buildPath: function (ctx, shape) {
|
||||
const points = shape.points;
|
||||
var r = shape.height;
|
||||
var x = points.x + shape.drict * shape.width / 2;
|
||||
var y = points.y;
|
||||
ctx.moveTo(points.x - shape.drict * shape.width, points.y + shape.height);
|
||||
ctx.lineTo(points.x + shape.drict * shape.width / 2, points.y + shape.height);
|
||||
if (shape.drict) {
|
||||
ctx.arc(x, y, r, Math.PI / 2, Math.PI * 3 / 2, true);
|
||||
} else {
|
||||
ctx.arc(x, y, r, Math.PI / 2, Math.PI * 3 / 2, false);
|
||||
}
|
||||
ctx.moveTo(points.x + shape.drict * shape.width / 2, points.y - shape.height);
|
||||
ctx.lineTo(points.x - shape.drict * (shape.width - 5), points.y - shape.height);
|
||||
}
|
||||
});
|
||||
|
||||
// 箭头
|
||||
export const EBackArrowTriangle = Path.extend({
|
||||
type: 'EBackArrowTriangle',
|
||||
shape: {
|
||||
points: null
|
||||
},
|
||||
buildPath: function (ctx, shape) {
|
||||
const points = shape.points;
|
||||
ctx.moveTo(points.x - shape.drict * (shape.width - 5), points.y - shape.height - 3);
|
||||
if (shape.drict) {
|
||||
ctx.lineTo(points.x - shape.drict * shape.width, points.y - shape.height);
|
||||
} else {
|
||||
ctx.lineTo(points.x - shape.drict * shape.width, points.y - shape.height);
|
||||
}
|
||||
ctx.lineTo(points.x - shape.drict * (shape.width - 5), points.y - shape.height + 3);
|
||||
}
|
||||
type: 'EBackArrowTriangle',
|
||||
shape: {
|
||||
points: null
|
||||
},
|
||||
buildPath: function (ctx, shape) {
|
||||
const points = shape.points;
|
||||
ctx.moveTo(points.x - shape.drict * (shape.width - 5), points.y - shape.height - 3);
|
||||
if (shape.drict) {
|
||||
ctx.lineTo(points.x - shape.drict * shape.width, points.y - shape.height);
|
||||
} else {
|
||||
ctx.lineTo(points.x - shape.drict * shape.width, points.y - shape.height);
|
||||
}
|
||||
ctx.lineTo(points.x - shape.drict * (shape.width - 5), points.y - shape.height + 3);
|
||||
}
|
||||
});
|
||||
|
@ -77,141 +77,141 @@ import Vue from 'vue';
|
||||
// });
|
||||
|
||||
export default class ELimitLines extends Group {
|
||||
constructor(model) {
|
||||
super();
|
||||
this.model = model;
|
||||
this.zlevel = model.zlevel;
|
||||
this.z = model.z;
|
||||
this.create(model);
|
||||
}
|
||||
constructor(model) {
|
||||
super();
|
||||
this.model = model;
|
||||
this.zlevel = model.zlevel;
|
||||
this.z = model.z;
|
||||
this.create(model);
|
||||
}
|
||||
|
||||
create(model) {
|
||||
/** 创建区段*/
|
||||
if (model && model.points.length > 1) {
|
||||
if (model.isCurve) {
|
||||
const shape = {};
|
||||
for (let i = 1; i < (model.points.length - 1); i++) {
|
||||
shape[`cpx${i}`] = model.points[i].x;
|
||||
shape[`cpy${i}`] = model.points[i].y;
|
||||
}
|
||||
create(model) {
|
||||
/** 创建区段*/
|
||||
if (model && model.points.length > 1) {
|
||||
if (model.isCurve) {
|
||||
const shape = {};
|
||||
for (let i = 1; i < (model.points.length - 1); i++) {
|
||||
shape[`cpx${i}`] = model.points[i].x;
|
||||
shape[`cpy${i}`] = model.points[i].y;
|
||||
}
|
||||
|
||||
shape[`x1`] = model.points[0].x;
|
||||
shape[`y1`] = model.points[0].y;
|
||||
shape[`x2`] = model.points[model.points.length - 1].x;
|
||||
shape[`y2`] = model.points[model.points.length - 1].y;
|
||||
shape[`x1`] = model.points[0].x;
|
||||
shape[`y1`] = model.points[0].y;
|
||||
shape[`x2`] = model.points[model.points.length - 1].x;
|
||||
shape[`y2`] = model.points[model.points.length - 1].y;
|
||||
|
||||
this.add(new BezierCurve({
|
||||
isLine: true,
|
||||
zlevel: this.zlevel,
|
||||
progressive: model.progressive,
|
||||
z: this.z,
|
||||
culling: true,
|
||||
shape: shape,
|
||||
position: model.position,
|
||||
style: {
|
||||
lineWidth: model.style.Section.speedLimit.width,
|
||||
stroke: model.style.Section.speedLimit.lineColor,
|
||||
fillOpacity: 0
|
||||
}
|
||||
}));
|
||||
} else {
|
||||
const swPadding = model.style.Switch.core.length; // 定位和反位时区段距离岔芯的距离
|
||||
var switchWidth = model.style.Section.line.width + model.style.Section.line.beyondWidth; // 道岔宽度
|
||||
const beg = Object.assign({}, model.points[0]);
|
||||
const end = Object.assign({}, model.points[model.points.length - 1]);
|
||||
if (model.isSwitchSection && beg.y !== end.y) {
|
||||
const swch = Vue.prototype.$jlmap.mapDevice[model.switch.code]; // 获取道岔model 及状态数据
|
||||
this.add(new BezierCurve({
|
||||
isLine: true,
|
||||
zlevel: this.zlevel,
|
||||
progressive: model.progressive,
|
||||
z: this.z,
|
||||
culling: true,
|
||||
shape: shape,
|
||||
position: model.position,
|
||||
style: {
|
||||
lineWidth: model.style.Section.speedLimit.width,
|
||||
stroke: model.style.Section.speedLimit.lineColor,
|
||||
fillOpacity: 0
|
||||
}
|
||||
}));
|
||||
} else {
|
||||
const swPadding = model.style.Switch.core.length; // 定位和反位时区段距离岔芯的距离
|
||||
var switchWidth = model.style.Section.line.width + model.style.Section.line.beyondWidth; // 道岔宽度
|
||||
const beg = Object.assign({}, model.points[0]);
|
||||
const end = Object.assign({}, model.points[model.points.length - 1]);
|
||||
if (model.isSwitchSection && beg.y !== end.y) {
|
||||
const swch = Vue.prototype.$jlmap.mapDevice[model.switch.code]; // 获取道岔model 及状态数据
|
||||
|
||||
if (swch && swch.instance) {
|
||||
const traingle = new JTriangle(swch.intersection, swch.skew);
|
||||
if ((swch.intersection.x === beg.x) && (swch.intersection.y === beg.y) && !swch.normalPosition && swch.sectionCCode == model.code) {
|
||||
beg.x = beg.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
|
||||
beg.y = beg.y + traingle.dricty * (swPadding + switchWidth);
|
||||
}
|
||||
if (swch && swch.instance) {
|
||||
const traingle = new JTriangle(swch.intersection, swch.skew);
|
||||
if ((swch.intersection.x === beg.x) && (swch.intersection.y === beg.y) && !swch.normalPosition && swch.sectionCCode == model.code) {
|
||||
beg.x = beg.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
|
||||
beg.y = beg.y + traingle.dricty * (swPadding + switchWidth);
|
||||
}
|
||||
|
||||
if ((swch.intersection.x === end.x) && (swch.intersection.y === end.y) && swch.normalPosition && swch.sectionCCode == model.code) {
|
||||
end.x = end.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
|
||||
end.y = end.y + traingle.dricty * (swPadding + switchWidth);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((swch.intersection.x === end.x) && (swch.intersection.y === end.y) && swch.normalPosition && swch.sectionCCode == model.code) {
|
||||
end.x = end.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
|
||||
end.y = end.y + traingle.dricty * (swPadding + switchWidth);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (model.points.length == 2) {
|
||||
this.add(new Line({
|
||||
isLine: true,
|
||||
zlevel: this.zlevel,
|
||||
progressive: model.progressive,
|
||||
z: this.z,
|
||||
position: model.position,
|
||||
shape: {
|
||||
x1: beg.x,
|
||||
y1: beg.y,
|
||||
x2: end.x,
|
||||
y2: end.y
|
||||
},
|
||||
style: {
|
||||
lineWidth: model.style.Section.speedLimit.width,
|
||||
stroke: model.style.Section.speedLimit.lineColor
|
||||
}
|
||||
}));
|
||||
} else {
|
||||
this.add(new Line({
|
||||
isLine: true,
|
||||
zlevel: this.zlevel,
|
||||
progressive: model.progressive,
|
||||
z: this.z,
|
||||
position: model.position,
|
||||
shape: {
|
||||
x1: beg.x,
|
||||
y1: beg.y,
|
||||
x2: model.points[1].x,
|
||||
y2: model.points[1].y
|
||||
},
|
||||
style: {
|
||||
lineWidth: model.style.Section.speedLimit.width,
|
||||
stroke: model.style.Section.speedLimit.lineColor
|
||||
}
|
||||
}));
|
||||
if (model.points.length == 2) {
|
||||
this.add(new Line({
|
||||
isLine: true,
|
||||
zlevel: this.zlevel,
|
||||
progressive: model.progressive,
|
||||
z: this.z,
|
||||
position: model.position,
|
||||
shape: {
|
||||
x1: beg.x,
|
||||
y1: beg.y,
|
||||
x2: end.x,
|
||||
y2: end.y
|
||||
},
|
||||
style: {
|
||||
lineWidth: model.style.Section.speedLimit.width,
|
||||
stroke: model.style.Section.speedLimit.lineColor
|
||||
}
|
||||
}));
|
||||
} else {
|
||||
this.add(new Line({
|
||||
isLine: true,
|
||||
zlevel: this.zlevel,
|
||||
progressive: model.progressive,
|
||||
z: this.z,
|
||||
position: model.position,
|
||||
shape: {
|
||||
x1: beg.x,
|
||||
y1: beg.y,
|
||||
x2: model.points[1].x,
|
||||
y2: model.points[1].y
|
||||
},
|
||||
style: {
|
||||
lineWidth: model.style.Section.speedLimit.width,
|
||||
stroke: model.style.Section.speedLimit.lineColor
|
||||
}
|
||||
}));
|
||||
|
||||
for (let i = 1; i < (model.points.length - 2); i++) {
|
||||
this.add(new Line({
|
||||
isLine: true,
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
progressive: model.progressive,
|
||||
position: model.position,
|
||||
shape: {
|
||||
x1: model.points[i].x,
|
||||
y1: model.points[i].y,
|
||||
x2: model.points[i + 1].x,
|
||||
y2: model.points[i + 1].y
|
||||
},
|
||||
style: {
|
||||
lineWidth: model.style.Section.speedLimit.width,
|
||||
stroke: model.style.Section.speedLimit.lineColor
|
||||
}
|
||||
}));
|
||||
}
|
||||
for (let i = 1; i < (model.points.length - 2); i++) {
|
||||
this.add(new Line({
|
||||
isLine: true,
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
progressive: model.progressive,
|
||||
position: model.position,
|
||||
shape: {
|
||||
x1: model.points[i].x,
|
||||
y1: model.points[i].y,
|
||||
x2: model.points[i + 1].x,
|
||||
y2: model.points[i + 1].y
|
||||
},
|
||||
style: {
|
||||
lineWidth: model.style.Section.speedLimit.width,
|
||||
stroke: model.style.Section.speedLimit.lineColor
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
this.add(new Line({
|
||||
isLine: true,
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
position: model.position,
|
||||
progressive: model.progressive,
|
||||
shape: {
|
||||
x1: model.points[model.points.length - 2].x,
|
||||
y1: model.points[model.points.length - 2].y,
|
||||
x2: end.x,
|
||||
y2: end.y
|
||||
},
|
||||
style: {
|
||||
lineWidth: model.style.Section.speedLimit.width,
|
||||
stroke: model.style.Section.speedLimit.lineColor
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.add(new Line({
|
||||
isLine: true,
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
position: model.position,
|
||||
progressive: model.progressive,
|
||||
shape: {
|
||||
x1: model.points[model.points.length - 2].x,
|
||||
y1: model.points[model.points.length - 2].y,
|
||||
x2: end.x,
|
||||
y2: end.y
|
||||
},
|
||||
style: {
|
||||
lineWidth: model.style.Section.speedLimit.width,
|
||||
stroke: model.style.Section.speedLimit.lineColor
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,70 +3,70 @@ import Line from 'zrender/src/graphic/shape/Line';
|
||||
|
||||
/** 延时释放*/
|
||||
export default class ERelease extends Group {
|
||||
constructor(model) {
|
||||
super();
|
||||
this.model = model;
|
||||
this.isNew = false;
|
||||
constructor(model) {
|
||||
super();
|
||||
this.model = model;
|
||||
this.isNew = false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
create() {
|
||||
if (!this.isNew) {
|
||||
const model = this.model;
|
||||
create() {
|
||||
if (!this.isNew) {
|
||||
const model = this.model;
|
||||
|
||||
this.isNew = true;
|
||||
this.lines = new Line({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: model.shape,
|
||||
progressive: model.progressive,
|
||||
style: {
|
||||
lineWidth: model.lineWidth,
|
||||
stroke: model.stroke
|
||||
}
|
||||
});
|
||||
this.add(this.lines);
|
||||
}
|
||||
}
|
||||
this.isNew = true;
|
||||
this.lines = new Line({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: model.shape,
|
||||
progressive: model.progressive,
|
||||
style: {
|
||||
lineWidth: model.lineWidth,
|
||||
stroke: model.stroke
|
||||
}
|
||||
});
|
||||
this.add(this.lines);
|
||||
}
|
||||
}
|
||||
|
||||
setStyle(model) {
|
||||
this.create();
|
||||
this.lines.setStyle(model);
|
||||
}
|
||||
setStyle(model) {
|
||||
this.create();
|
||||
this.lines.setStyle(model);
|
||||
}
|
||||
|
||||
hide() {
|
||||
this.create();
|
||||
this.lines.hide();
|
||||
}
|
||||
hide() {
|
||||
this.create();
|
||||
this.lines.hide();
|
||||
}
|
||||
|
||||
show() {
|
||||
this.create();
|
||||
this.lines.show();
|
||||
}
|
||||
show() {
|
||||
this.create();
|
||||
this.lines.show();
|
||||
}
|
||||
|
||||
// 开始动画
|
||||
animateStyle(loop, animates) {
|
||||
this.create();
|
||||
if (animates && animates.length) {
|
||||
this.eachChild((child) => {
|
||||
if (child.animateStyle) {
|
||||
let an = child.animateStyle(loop);
|
||||
animates.forEach(elem => {
|
||||
an = an.when(elem.time, elem.styles);
|
||||
});
|
||||
an.start();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// 开始动画
|
||||
animateStyle(loop, animates) {
|
||||
this.create();
|
||||
if (animates && animates.length) {
|
||||
this.eachChild((child) => {
|
||||
if (child.animateStyle) {
|
||||
let an = child.animateStyle(loop);
|
||||
animates.forEach(elem => {
|
||||
an = an.when(elem.time, elem.styles);
|
||||
});
|
||||
an.start();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 结束动画
|
||||
stopAnimation(flag) {
|
||||
this.create();
|
||||
this.eachChild((child) => {
|
||||
if (child.stopAnimation) {
|
||||
child.stopAnimation(flag);
|
||||
}
|
||||
});
|
||||
}
|
||||
// 结束动画
|
||||
stopAnimation(flag) {
|
||||
this.create();
|
||||
this.eachChild((child) => {
|
||||
if (child.stopAnimation) {
|
||||
child.stopAnimation(flag);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -4,111 +4,111 @@ import Circle from 'zrender/src/graphic/shape/Circle';
|
||||
|
||||
/** 分隔符*/
|
||||
export default class ESeparator extends Group {
|
||||
constructor(model) {
|
||||
super();
|
||||
this.model = model;
|
||||
this.zlevel = model.zlevel;
|
||||
this.z = model.style.Section.separator.z || 6;
|
||||
this.style = model.style;
|
||||
this.setType();
|
||||
}
|
||||
constructor(model) {
|
||||
super();
|
||||
this.model = model;
|
||||
this.zlevel = model.zlevel;
|
||||
this.z = model.style.Section.separator.z || 6;
|
||||
this.style = model.style;
|
||||
this.setType();
|
||||
}
|
||||
|
||||
createModel(points, lineWidth = null, stroke = null) {
|
||||
const model = this.model;
|
||||
this.partition = new Polyline({
|
||||
zlevel: this.zlevel,
|
||||
progressive: model.progressive,
|
||||
z: this.z,
|
||||
shape: {
|
||||
points: points
|
||||
},
|
||||
style: {
|
||||
lineWidth: lineWidth || this.style.Section.separator.width,
|
||||
stroke: stroke || this.style.Section.separator.color
|
||||
}
|
||||
});
|
||||
this.add(this.partition);
|
||||
}
|
||||
createModel(points, lineWidth = null, stroke = null) {
|
||||
const model = this.model;
|
||||
this.partition = new Polyline({
|
||||
zlevel: this.zlevel,
|
||||
progressive: model.progressive,
|
||||
z: this.z,
|
||||
shape: {
|
||||
points: points
|
||||
},
|
||||
style: {
|
||||
lineWidth: lineWidth || this.style.Section.separator.width,
|
||||
stroke: stroke || this.style.Section.separator.color
|
||||
}
|
||||
});
|
||||
this.add(this.partition);
|
||||
}
|
||||
|
||||
// 创建 侵限分隔符
|
||||
createCircle() {
|
||||
const model = this.model;
|
||||
this.circle = new Circle({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
progressive: model.progressive,
|
||||
shape: {
|
||||
cx: model.point.x,
|
||||
cy: model.point.y,
|
||||
r: this.style.Section.line.width
|
||||
},
|
||||
style: {
|
||||
stroke: this.style.Section.line.invadeColor,
|
||||
GBaseLineWidth: 0.5,
|
||||
fill: this.style.transparentColor
|
||||
}
|
||||
});
|
||||
this.add(this.circle);
|
||||
}
|
||||
// 创建 侵限分隔符
|
||||
createCircle() {
|
||||
const model = this.model;
|
||||
this.circle = new Circle({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
progressive: model.progressive,
|
||||
shape: {
|
||||
cx: model.point.x,
|
||||
cy: model.point.y,
|
||||
r: this.style.Section.line.width
|
||||
},
|
||||
style: {
|
||||
stroke: this.style.Section.line.invadeColor,
|
||||
GBaseLineWidth: 0.5,
|
||||
fill: this.style.transparentColor
|
||||
}
|
||||
});
|
||||
this.add(this.circle);
|
||||
}
|
||||
|
||||
createCircleArc() {
|
||||
const model = this.model;
|
||||
this.circleArc = new Circle({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
progressive: model.progressive,
|
||||
shape: {
|
||||
cx: model.point.x,
|
||||
cy: model.point.y,
|
||||
r: this.style.Section.line.width + 2
|
||||
},
|
||||
style: {
|
||||
stroke: 'red',
|
||||
GBaseLineWidth: 0.5,
|
||||
fill: this.style.transparentColor
|
||||
}
|
||||
});
|
||||
this.add(this.circleArc);
|
||||
}
|
||||
createCircleArc() {
|
||||
const model = this.model;
|
||||
this.circleArc = new Circle({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
progressive: model.progressive,
|
||||
shape: {
|
||||
cx: model.point.x,
|
||||
cy: model.point.y,
|
||||
r: this.style.Section.line.width + 2
|
||||
},
|
||||
style: {
|
||||
stroke: 'red',
|
||||
GBaseLineWidth: 0.5,
|
||||
fill: this.style.transparentColor
|
||||
}
|
||||
});
|
||||
this.add(this.circleArc);
|
||||
}
|
||||
|
||||
setType() {
|
||||
const type = this.model.sepType;
|
||||
const model = this.model;
|
||||
if (model && this.style && model.traingle) {
|
||||
if (type === '01') { // 普通分割
|
||||
const points = [
|
||||
[model.point.x, model.point.y - (this.style.Section.line.width)],
|
||||
[model.point.x, model.point.y + (this.style.Section.line.width)]
|
||||
];
|
||||
this.createModel(points);
|
||||
} else if (type === '02') { // 单侧分割符
|
||||
const points = [
|
||||
[model.point.x + model.drict * (this.style.Section.line.width), model.point.y - (this.style.Section.line.width * 1.5)],
|
||||
[model.point.x, model.point.y - (this.style.Section.line.width * 1.5)],
|
||||
[model.point.x, model.point.y + (this.style.Section.line.width * 1.5)]
|
||||
];
|
||||
this.createModel(points);
|
||||
} else if (type === '03') { // 尽头分隔符
|
||||
const points = [
|
||||
[model.point.x + model.drict * (this.style.Section.line.width) * 1.2, model.point.y - (this.style.Section.line.width * 1.2)],
|
||||
[model.point.x, model.point.y - (this.style.Section.line.width * 1.2)],
|
||||
[model.point.x, model.point.y + (this.style.Section.line.width * 1.2)],
|
||||
[model.point.x + model.drict * (this.style.Section.line.width) * 1.2, model.point.y + (this.style.Section.line.width * 1.2)]
|
||||
];
|
||||
const lineWidth = this.style.Section.separator.endWidth;
|
||||
const stroke = this.style.Section.separator.endColor;
|
||||
this.createModel(points, lineWidth, stroke);
|
||||
} else if (type === '04') { // 侵限分隔符
|
||||
this.createCircle();
|
||||
} else if (type === '05') { // 特色分隔符
|
||||
this.createCircleArc();
|
||||
}
|
||||
}
|
||||
setType() {
|
||||
const type = this.model.sepType;
|
||||
const model = this.model;
|
||||
if (model && this.style && model.traingle) {
|
||||
if (type === '01') { // 普通分割
|
||||
const points = [
|
||||
[model.point.x, model.point.y - (this.style.Section.line.width)],
|
||||
[model.point.x, model.point.y + (this.style.Section.line.width)]
|
||||
];
|
||||
this.createModel(points);
|
||||
} else if (type === '02') { // 单侧分割符
|
||||
const points = [
|
||||
[model.point.x + model.drict * (this.style.Section.line.width), model.point.y - (this.style.Section.line.width * 1.5)],
|
||||
[model.point.x, model.point.y - (this.style.Section.line.width * 1.5)],
|
||||
[model.point.x, model.point.y + (this.style.Section.line.width * 1.5)]
|
||||
];
|
||||
this.createModel(points);
|
||||
} else if (type === '03') { // 尽头分隔符
|
||||
const points = [
|
||||
[model.point.x + model.drict * (this.style.Section.line.width) * 1.2, model.point.y - (this.style.Section.line.width * 1.2)],
|
||||
[model.point.x, model.point.y - (this.style.Section.line.width * 1.2)],
|
||||
[model.point.x, model.point.y + (this.style.Section.line.width * 1.2)],
|
||||
[model.point.x + model.drict * (this.style.Section.line.width) * 1.2, model.point.y + (this.style.Section.line.width * 1.2)]
|
||||
];
|
||||
const lineWidth = this.style.Section.separator.endWidth;
|
||||
const stroke = this.style.Section.separator.endColor;
|
||||
this.createModel(points, lineWidth, stroke);
|
||||
} else if (type === '04') { // 侵限分隔符
|
||||
this.createCircle();
|
||||
} else if (type === '05') { // 特色分隔符
|
||||
this.createCircleArc();
|
||||
}
|
||||
}
|
||||
|
||||
if (model.traingle) {
|
||||
this.origin = [model.point.x, model.point.y];
|
||||
this.rotation = Math.PI * 2 - Math.atan2(model.traingle.absy, model.traingle.absx) * model.traingle.drictx * model.traingle.dricty;
|
||||
this.dirty(); // 可以无需调用
|
||||
}
|
||||
}
|
||||
if (model.traingle) {
|
||||
this.origin = [model.point.x, model.point.y];
|
||||
this.rotation = Math.PI * 2 - Math.atan2(model.traingle.absy, model.traingle.absx) * model.traingle.drictx * model.traingle.dricty;
|
||||
this.dirty(); // 可以无需调用
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Line from 'zrender/src/graphic/shape/Line';
|
||||
import BezierCurve from 'zrender/src/graphic/shape/BezierCurve';
|
||||
import {
|
||||
import {
|
||||
cubicSubdivide,
|
||||
quadraticAt,
|
||||
cubicAt,
|
||||
@ -49,8 +49,8 @@ export default class ELines extends Group {
|
||||
this.add(this.section);
|
||||
} else {
|
||||
if (model.points.length == 2) {
|
||||
const spaceX= (model.points[1].x - model.points[0].x) / 3;
|
||||
const spaceY= (model.points[1].y - model.points[0].y) / 3;
|
||||
const spaceX = (model.points[1].x - model.points[0].x) / 3;
|
||||
const spaceY = (model.points[1].y - model.points[0].y) / 3;
|
||||
this.sectionM = new Line({
|
||||
isLine: true,
|
||||
zlevel: this.zlevel,
|
||||
@ -130,8 +130,7 @@ export default class ELines extends Group {
|
||||
(isTangent ? cubicDerivativeAt : cubicAt)(shape.x1, shape.cpx1, shape.cpx2, shape.x2, t),
|
||||
(isTangent ? cubicDerivativeAt : cubicAt)(shape.y1, shape.cpy1, shape.cpy2, shape.y2, t)
|
||||
];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return [
|
||||
(isTangent ? quadraticDerivativeAt : quadraticAt)(shape.x1, shape.cpx1, shape.x2, t),
|
||||
(isTangent ? quadraticDerivativeAt : quadraticAt)(shape.y1, shape.cpy1, shape.y2, t)
|
||||
@ -141,7 +140,7 @@ export default class ELines extends Group {
|
||||
|
||||
// 重新计算居中距离点
|
||||
couvert(shape) {
|
||||
let out = [];
|
||||
const out = [];
|
||||
var x1 = shape.x1;
|
||||
var y1 = shape.y1;
|
||||
var x2 = shape.x2;
|
||||
@ -150,7 +149,7 @@ export default class ELines extends Group {
|
||||
var cpy1 = shape.cpy1;
|
||||
var cpx2 = shape.cpx2;
|
||||
var cpy2 = shape.cpy2;
|
||||
|
||||
|
||||
cubicSubdivide(
|
||||
x1, cpx1, cpx2, x2, 0.3, out
|
||||
);
|
||||
@ -159,7 +158,7 @@ export default class ELines extends Group {
|
||||
x1, cpx1, cpx2, x2, 0.7, out
|
||||
);
|
||||
var n_x2 = out[3];
|
||||
|
||||
|
||||
cubicSubdivide(
|
||||
y1, cpy1, cpy2, y2, 0.3, out
|
||||
);
|
||||
@ -168,20 +167,20 @@ export default class ELines extends Group {
|
||||
y1, cpy1, cpy2, y2, 0.7, out
|
||||
);
|
||||
var n_y2 = out[3];
|
||||
|
||||
|
||||
var p = this.someVectorAt(shape, 0.5, true);
|
||||
var v = vec2.normalize(p, p);
|
||||
|
||||
var x0 = Math.sqrt((Math.pow(cpx1-x1, 2)+Math.pow(x2-cpx2, 2))/2, 2);
|
||||
var y0 = Math.sqrt((Math.pow(cpy1-y1, 2)+Math.pow(y2-cpy2, 2))/2, 2);
|
||||
|
||||
|
||||
var x0 = Math.sqrt((Math.pow(cpx1 - x1, 2) + Math.pow(x2 - cpx2, 2)) / 2, 2);
|
||||
var y0 = Math.sqrt((Math.pow(cpy1 - y1, 2) + Math.pow(y2 - cpy2, 2)) / 2, 2);
|
||||
|
||||
return {
|
||||
x1: n_x1,
|
||||
y1: n_y1,
|
||||
x2: n_x2,
|
||||
y2: n_y2,
|
||||
cpx1: (cpx1+cpx2)/2 + v[1]*x0*0.128,
|
||||
cpy1: (cpy1+cpy2)/2 + v[0]*y0*0.128
|
||||
cpx1: (cpx1 + cpx2) / 2 + v[1] * x0 * 0.128,
|
||||
cpy1: (cpy1 + cpy2) / 2 + v[0] * y0 * 0.128
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ export default class Section extends Group {
|
||||
this.style = style;
|
||||
this.selected = false; // 绘图选中状态
|
||||
this.selectedType = ''; // 绘图批量选中状态
|
||||
this.isShowShape = true;
|
||||
this.create();
|
||||
this.createMouseEvent();
|
||||
this.setState(model);
|
||||
@ -783,6 +784,7 @@ export default class Section extends Group {
|
||||
|
||||
/** 设置状态*/
|
||||
setState(model, flag = false) {
|
||||
if (!this.isShowShape) return;
|
||||
this.recover();
|
||||
// 实际上就是 状态重置 必须在设置其他状态之前 设置颜色之类的
|
||||
if (this.style.Switch.sectionAction.flag && model.relSwitchCode && !flag) {
|
||||
@ -887,4 +889,18 @@ export default class Section extends Group {
|
||||
this.section && this.section.setStyle({ stroke: 'rgba(255,255,255,0.8)' });
|
||||
}
|
||||
setShowMode() {}
|
||||
setShowStation(stationCode) {
|
||||
if (!stationCode || this.model.stationCode === stationCode) {
|
||||
this.eachChild(item => {
|
||||
item.show();
|
||||
});
|
||||
this.isShowShape = true;
|
||||
this.setState(this.model);
|
||||
} else {
|
||||
this.eachChild(item => {
|
||||
item.hide();
|
||||
});
|
||||
this.isShowShape = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ class Signal extends Group {
|
||||
this.count = parseInt(model.lampPositionType);
|
||||
this.lamps = new Array(this.count);
|
||||
this.zlevel = model.zlevel;
|
||||
this.isShowShape = true;
|
||||
this.z = 7;
|
||||
this.create();
|
||||
this.createMouseEvent();
|
||||
@ -461,6 +462,7 @@ class Signal extends Group {
|
||||
}
|
||||
|
||||
setState(model) {
|
||||
if (!this.isShowShape) return;
|
||||
this.recover();
|
||||
// /** 设置状态 (点灯类型)*/
|
||||
// switch (model.status) {
|
||||
@ -589,6 +591,20 @@ class Signal extends Group {
|
||||
}
|
||||
}
|
||||
setShowMode() {}
|
||||
setShowStation(stationCode) {
|
||||
if (!stationCode || this.model.stationCode === stationCode) {
|
||||
this.eachChild(item => {
|
||||
item.show();
|
||||
});
|
||||
this.isShowShape = true;
|
||||
this.setState(this.model);
|
||||
} else {
|
||||
this.eachChild(item => {
|
||||
item.hide();
|
||||
});
|
||||
this.isShowShape = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default Signal;
|
||||
|
@ -21,7 +21,7 @@ export default class Station extends Group {
|
||||
this.z = 40;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
|
||||
this.isShowShape = true;
|
||||
this.create();
|
||||
this.createTurnBack(); // 创建按图折返
|
||||
if (isShowThePrdType(model.prdType, style.Station.functionButtonShow) || model.previewOrMapDraw) {
|
||||
@ -312,6 +312,7 @@ export default class Station extends Group {
|
||||
|
||||
// 设置状态
|
||||
setState(model) {
|
||||
if (!this.isShowShape) return;
|
||||
switch (model.controlMode) {
|
||||
case '': // 无状态
|
||||
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
@ -378,4 +379,18 @@ export default class Station extends Group {
|
||||
this.guideLamp && this.guideLamp.hide();
|
||||
}
|
||||
}
|
||||
setShowStation(flag) {
|
||||
if (flag) {
|
||||
this.eachChild(item => {
|
||||
item.show();
|
||||
});
|
||||
this.isShowShape = true;
|
||||
this.setState(this.model);
|
||||
} else {
|
||||
this.eachChild(item => {
|
||||
item.hide();
|
||||
});
|
||||
this.isShowShape = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ export default class StationControl extends Group {
|
||||
this.z = 1;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.isShowShape = true;
|
||||
this.create();
|
||||
this.createMouseEvent();
|
||||
this.setState(model);
|
||||
@ -114,6 +115,7 @@ export default class StationControl extends Group {
|
||||
|
||||
// 设置状态
|
||||
setState(model) {
|
||||
if (!this.isShowShape) return;
|
||||
// switch (model.status) {
|
||||
// case '00': // 无状态
|
||||
// this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
@ -179,4 +181,18 @@ export default class StationControl extends Group {
|
||||
return null;
|
||||
}
|
||||
setShowMode() {}
|
||||
setShowStation(stationCode) {
|
||||
if (!stationCode || this.model.stationCode === stationCode) {
|
||||
this.eachChild(item => {
|
||||
item.show();
|
||||
});
|
||||
this.isShowShape = true;
|
||||
this.setState(this.model);
|
||||
} else {
|
||||
this.eachChild(item => {
|
||||
item.hide();
|
||||
});
|
||||
this.isShowShape = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ export default class StationCounter extends Group {
|
||||
this.style = style;
|
||||
this.zlevel = model.zlevel;
|
||||
this.z = 30;
|
||||
this.isShowShape = true;
|
||||
this.create();
|
||||
this.setState(model);
|
||||
}
|
||||
@ -81,11 +82,26 @@ export default class StationCounter extends Group {
|
||||
}
|
||||
|
||||
setState(model) {
|
||||
if (!this.isShowShape) return;
|
||||
}
|
||||
|
||||
getShapeTipPoint() {
|
||||
return null;
|
||||
}
|
||||
setShowMode() {}
|
||||
setShowStation(stationCode) {
|
||||
if (!stationCode || this.model.stationCode === stationCode) {
|
||||
this.eachChild(item => {
|
||||
item.show();
|
||||
});
|
||||
this.isShowShape = true;
|
||||
this.setState(this.model);
|
||||
} else {
|
||||
this.eachChild(item => {
|
||||
item.hide();
|
||||
});
|
||||
this.isShowShape = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,7 @@ export default class StationDelayUnlock extends Group {
|
||||
this.style = style;
|
||||
this.zlevel = model.zlevel;
|
||||
this.z = 1;
|
||||
this.isShowShape = true;
|
||||
this.create();
|
||||
this.setState(model);
|
||||
}
|
||||
@ -90,6 +91,7 @@ export default class StationDelayUnlock extends Group {
|
||||
|
||||
/** 延时解锁计数*/
|
||||
delayUnlock() {
|
||||
if (!this.isShowShape) return;
|
||||
this.table.setStyle('stroke', this.style.sidelineColor);
|
||||
this.time.setStyle('text', '' + this.model.remainTime);
|
||||
}
|
||||
@ -105,4 +107,18 @@ export default class StationDelayUnlock extends Group {
|
||||
return null;
|
||||
}
|
||||
setShowMode() {}
|
||||
setShowStation(stationCode) {
|
||||
if (!stationCode || this.model.stationCode === stationCode) {
|
||||
this.eachChild(item => {
|
||||
item.show();
|
||||
});
|
||||
this.isShowShape = true;
|
||||
this.setState(this.model);
|
||||
} else {
|
||||
this.eachChild(item => {
|
||||
item.hide();
|
||||
});
|
||||
this.isShowShape = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ class StationStand extends Group {
|
||||
this.style = style;
|
||||
this.zlevel = model.zlevel;
|
||||
this.z = 1;
|
||||
this.isShowShape = true;
|
||||
this.doors = new Group();
|
||||
this.create();
|
||||
this.createMouseEvent();
|
||||
@ -492,6 +493,7 @@ class StationStand extends Group {
|
||||
}
|
||||
|
||||
setState(model) {
|
||||
if (!this.isShowShape) return;
|
||||
// 新版地图使用新版状态变更方式
|
||||
this.recover();
|
||||
model.free && this.spare(); /** 空闲*/
|
||||
@ -581,5 +583,19 @@ class StationStand extends Group {
|
||||
this.downDetainLamp && this.downDetainLamp.hide();
|
||||
}
|
||||
}
|
||||
setShowStation(stationCode) {
|
||||
if (!stationCode || this.model.deviceStationCode === stationCode) {
|
||||
this.eachChild(item => {
|
||||
item.show();
|
||||
});
|
||||
this.isShowShape = true;
|
||||
this.setState(this.model);
|
||||
} else {
|
||||
this.eachChild(item => {
|
||||
item.hide();
|
||||
});
|
||||
this.isShowShape = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
export default StationStand;
|
||||
|
@ -15,7 +15,7 @@ import EHighlight from '../element/EHighlight';
|
||||
import ERhomboid from './ERhomboid';
|
||||
import ETriangle from './ETriangle';
|
||||
import store from '@/store';
|
||||
// import Vue from 'vue';
|
||||
import Vue from 'vue';
|
||||
|
||||
export default class Switch extends Group {
|
||||
constructor(model, style) {
|
||||
@ -26,6 +26,7 @@ export default class Switch extends Group {
|
||||
this.style = style;
|
||||
this.zlevel = model.zlevel;
|
||||
this.z = 6;
|
||||
this.isShowShape = true;
|
||||
this.triangle = new JTriangle(model.intersection, model.skew);
|
||||
this.create();
|
||||
this.createLockRect(); // 创建单锁矩形框显示
|
||||
@ -428,6 +429,7 @@ export default class Switch extends Group {
|
||||
}
|
||||
|
||||
setState(model) {
|
||||
if (!this.isShowShape) return;
|
||||
if (model.normalPosition) {
|
||||
this.setLocationAction(model); /** 定位*/
|
||||
} else if (model.reversePosition) {
|
||||
@ -483,4 +485,18 @@ export default class Switch extends Group {
|
||||
}
|
||||
}
|
||||
setShowMode() {}
|
||||
setShowStation(stationCode) {
|
||||
if (!stationCode || this.model.stationCode === stationCode) {
|
||||
this.eachChild(item => {
|
||||
item.show();
|
||||
});
|
||||
this.isShowShape = true;
|
||||
this.setState(this.model);
|
||||
} else {
|
||||
this.eachChild(item => {
|
||||
item.hide();
|
||||
});
|
||||
this.isShowShape = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ export default class Text2 extends Group {
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.z = 6;
|
||||
this.isShowShape = true;
|
||||
if (isShowThePrdType(model.prdType, model.showConditions) || model.previewOrMapDraw) {
|
||||
this.create();
|
||||
this.setState(model);
|
||||
@ -46,6 +47,7 @@ export default class Text2 extends Group {
|
||||
}
|
||||
|
||||
setState(model) {
|
||||
if (!this.isShowShape) return;
|
||||
}
|
||||
// 设置显示模式
|
||||
setShowMode() {
|
||||
@ -57,4 +59,18 @@ export default class Text2 extends Group {
|
||||
this.text && this.text.hide();
|
||||
}
|
||||
}
|
||||
setShowStation(stationCode) {
|
||||
if (!stationCode || this.model.stationCode === stationCode) {
|
||||
this.eachChild(item => {
|
||||
item.show();
|
||||
});
|
||||
this.isShowShape = true;
|
||||
this.setState(this.model);
|
||||
} else {
|
||||
this.eachChild(item => {
|
||||
item.hide();
|
||||
});
|
||||
this.isShowShape = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ export default class Train extends Group {
|
||||
this.section = null;
|
||||
this.nextPointIndex = 1;
|
||||
this.currentAdd = 0;
|
||||
this.isShowShape = true;
|
||||
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;
|
||||
@ -34,6 +35,7 @@ export default class Train extends Group {
|
||||
}
|
||||
this.create();
|
||||
this.setState(model, this);
|
||||
this.initShowStation(model);
|
||||
}
|
||||
|
||||
_computed() {
|
||||
@ -404,6 +406,7 @@ export default class Train extends Group {
|
||||
}
|
||||
// 设置状态
|
||||
setState(model, object) {
|
||||
if (!this.isShowShape) return;
|
||||
const flag = model.trainWindowModel ? model.trainWindowModel.reversal : false;
|
||||
if (model) {
|
||||
this.recover();
|
||||
@ -512,4 +515,25 @@ export default class Train extends Group {
|
||||
this.add(this.trainBorder);
|
||||
}
|
||||
setShowMode() {}
|
||||
initShowStation(model) {
|
||||
if (model.trainWindowModel && model.trainWindowModel.instance && !model.trainWindowModel.instance.isShowShape) {
|
||||
this.eachChild(item => {
|
||||
item.hide();
|
||||
});
|
||||
}
|
||||
}
|
||||
setShowStation(stationCode) {
|
||||
if ((this.model.sectionModel && this.model.sectionModel.stationCode === stationCode) || !stationCode ) {
|
||||
this.eachChild(item => {
|
||||
item.show();
|
||||
});
|
||||
this.isShowShape = true;
|
||||
this.setState(this.model, this);
|
||||
} else {
|
||||
this.eachChild(item => {
|
||||
item.hide();
|
||||
});
|
||||
this.isShowShape = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ class TrainWindow extends Group {
|
||||
this.style = style;
|
||||
this.z = 9;
|
||||
this.prdType = store.state.training.prdType;
|
||||
this.isShowShape = true;
|
||||
this.create(model);
|
||||
this.createMouseEvent();
|
||||
this.setState(model);
|
||||
@ -67,6 +68,7 @@ class TrainWindow extends Group {
|
||||
}
|
||||
|
||||
setState(model) {
|
||||
if (!this.isShowShape) return;
|
||||
this.setVisible(model.trainWindowShow);
|
||||
}
|
||||
|
||||
@ -79,6 +81,20 @@ class TrainWindow extends Group {
|
||||
return (store.getters['map/getDeviceByCode'](code) || {}).instance;
|
||||
}
|
||||
setShowMode() {}
|
||||
setShowStation(flag) {
|
||||
if (flag) {
|
||||
this.eachChild(item => {
|
||||
item.show();
|
||||
});
|
||||
this.isShowShape = true;
|
||||
this.setState(this.model);
|
||||
} else {
|
||||
this.eachChild(item => {
|
||||
item.hide();
|
||||
});
|
||||
this.isShowShape = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default TrainWindow;
|
||||
|
@ -14,6 +14,7 @@ export default class ZcControl extends Group {
|
||||
this.zlevel = model.zlevel;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.isShowShape = true;
|
||||
this.create(model);
|
||||
this.createMouseEvent();
|
||||
this.setState(model);
|
||||
@ -60,6 +61,7 @@ export default class ZcControl extends Group {
|
||||
|
||||
// 设置状态
|
||||
setState(model) {
|
||||
if (!this.isShowShape) return;
|
||||
}
|
||||
createMouseEvent() {
|
||||
if (this.style.ZcControl.mouseOverStyle) {
|
||||
@ -81,4 +83,18 @@ export default class ZcControl extends Group {
|
||||
return null;
|
||||
}
|
||||
setShowMode() {}
|
||||
setShowStation(stationCode) {
|
||||
if (!stationCode || this.model.stationCode === stationCode) {
|
||||
this.eachChild(item => {
|
||||
item.show();
|
||||
});
|
||||
this.isShowShape = true;
|
||||
this.setState(this.model);
|
||||
} else {
|
||||
this.eachChild(item => {
|
||||
item.hide();
|
||||
});
|
||||
this.isShowShape = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -102,12 +102,4 @@ 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();
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,166 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__systerm view-display"
|
||||
title="设备显示设置"
|
||||
:visible.sync="show"
|
||||
width="240px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-checkbox-group v-model="deviceLevels">
|
||||
<div>
|
||||
<el-checkbox :label="1">车次窗</el-checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<el-checkbox :label="2">区段边界</el-checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<el-checkbox :label="3">联锁自动进路表示灯</el-checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<el-checkbox :label="4">ATS自动触发表示灯</el-checkbox>
|
||||
</div>
|
||||
</el-checkbox-group>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="8" :offset="2">
|
||||
<el-button :id="domIdConfirm" class="commit" type="primary" :loading="loading" @click="commit">确定
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="3">
|
||||
<el-button :id="domIdCancel" class="cancal" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
import deviceType from '@/jmap/constant/deviceType';
|
||||
|
||||
export default {
|
||||
name: 'ViewDevice',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: null,
|
||||
operation: '',
|
||||
deviceLevels: [2, 3, 4, 5]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
}
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.setDeviceDisplay();
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
// 如果不是断点激活,而是第一次显示,需要初始化数据
|
||||
if (!this.dialogShow) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
over: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation,
|
||||
val: this.deviceLevels.sort().join('::')
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.setDeviceDisplay();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
setDeviceDisplay() {
|
||||
let show = false;
|
||||
let deviceList = [];
|
||||
|
||||
// 区段边界设置
|
||||
let borderBorderShow = this.deviceLevels.indexOf(2) !== -1;
|
||||
let sectionList = this.$store.getters['map/sectionList'];
|
||||
if (sectionList && sectionList.length > 0) {
|
||||
sectionList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { borderBorderShow })); // 区段边界
|
||||
});
|
||||
}
|
||||
|
||||
// 车次窗设置
|
||||
let trainWindowShow = this.deviceLevels.indexOf(1) !== -1;
|
||||
let trainWindowList = this.$store.getters['map/trainWindowList'];
|
||||
if (trainWindowList && trainWindowList.length > 0) {
|
||||
trainWindowList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { trainWindowShow })); // 车次窗
|
||||
});
|
||||
}
|
||||
|
||||
// 联锁自动进路表示灯和ATS自动触发表示灯设置
|
||||
let linkageAutoRouteShow = this.deviceLevels.indexOf(3) !== -1;// 联锁自动进路表示灯
|
||||
let atsAutoTriggerShow = this.deviceLevels.indexOf(4) !== -1;// ATS自动触发表示灯
|
||||
let signalList = this.$store.getters['map/signalList'];
|
||||
if (signalList && signalList.length > 0) {
|
||||
signalList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { linkageAutoRouteShow, atsAutoTriggerShow }));
|
||||
});
|
||||
}
|
||||
|
||||
this.$store.dispatch('map/updateMapDevices', deviceList);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
</style>
|
@ -1,248 +0,0 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__systerm view-name" title="名称显示设置" :visible.sync="show" width="320px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-checkbox-group v-model="nameLevels">
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-checkbox :label="1">信号机名称</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-checkbox :label="2">站台轨名称</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-checkbox :label="3" disabled>按钮名称</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-checkbox :label="4">折返轨名称</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-checkbox :label="5">股道名称</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-checkbox dio :label="6">转换轨名称</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-checkbox :label="7">道岔名称</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-checkbox dio :label="8">标识灯名称</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-checkbox :label="9">道岔区段名称</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-checkbox dio :label="10">目的地名称</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-checkbox :label="11">计轴区段名称</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-checkbox dio :label="12">公里标</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-checkbox-group>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="6" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="8">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'viewName',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: null,
|
||||
nameLevels: [1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.setNameDisplay();
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
//如果不是断点激活显示,而是第一次显示时,需要初始化参数
|
||||
if (!this.dialogShow) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
over: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation,
|
||||
val: this.nameLevels.sort().join('::')
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.setNameDisplay();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
})
|
||||
},
|
||||
setNameDisplay() {
|
||||
let deviceList = [];
|
||||
|
||||
//信号机
|
||||
let nameShow = this.nameLevels.indexOf(1) !== -1 ? true : false;
|
||||
let signalList = this.$store.getters['map/signalList'];
|
||||
if (signalList && signalList.length > 0) {
|
||||
signalList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow }));
|
||||
})
|
||||
}
|
||||
|
||||
//按钮名称
|
||||
nameShow = this.nameLevels.indexOf(3) !== -1 ? true : false;
|
||||
|
||||
|
||||
//道岔
|
||||
nameShow = this.nameLevels.indexOf(7) !== -1 ? true : false; //道岔名称
|
||||
let switchSectionNameShow = this.nameLevels.indexOf(9) !== -1 ? true : false; //道岔轨名称
|
||||
let switchList = this.$store.getters['map/switchList'];
|
||||
if (switchList && switchList.length > 0) {
|
||||
switchList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, switchSectionNameShow }));
|
||||
})
|
||||
}
|
||||
|
||||
//控制模式
|
||||
let indicatorShow = this.nameLevels.indexOf(8) !== -1 ? true : false;
|
||||
let control = this.$store.getters['map/stationControlList'];
|
||||
if (control && control.length > 0) {
|
||||
control.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { indicatorShow })); //标识灯名称
|
||||
})
|
||||
}
|
||||
|
||||
//区段
|
||||
nameShow = false;
|
||||
let standTrackNameShow = false;
|
||||
let reentryTrackNameShow = false;
|
||||
let transferTrackNameShow = false;
|
||||
let sectionList = this.$store.getters['map/sectionList'];
|
||||
if (sectionList && sectionList.length > 0) {
|
||||
sectionList.forEach(elem => {
|
||||
if (elem.isSwitchSection && elem.parentCode) {
|
||||
//道岔轨的区段名称默认不显示
|
||||
nameShow = false;
|
||||
} else {
|
||||
if (elem.type === '01') {
|
||||
nameShow = this.nameLevels.indexOf(11) !== -1 ? true : false;
|
||||
} else if (elem.type === '02') {
|
||||
//股道轨名称
|
||||
nameShow = this.nameLevels.indexOf(5) !== -1 ? true : false;
|
||||
} else if (elem.type === '03') {
|
||||
//道岔区段名称
|
||||
nameShow = this.nameLevels.indexOf(9) !== -1 ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
//站台轨名称
|
||||
if (elem.isStandTrack) {
|
||||
standTrackNameShow = this.nameLevels.indexOf(2) !== -1 ? true : false;
|
||||
}
|
||||
|
||||
//折返轨名称
|
||||
if (elem.isReentryTrack) {
|
||||
reentryTrackNameShow = this.nameLevels.indexOf(4) !== -1 ? true : false;
|
||||
}
|
||||
|
||||
//转换轨名称
|
||||
if (elem.isTransferTrack) {
|
||||
transferTrackNameShow = this.nameLevels.indexOf(6) !== -1 ? true : false;
|
||||
}
|
||||
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, standTrackNameShow, reentryTrackNameShow, transferTrackNameShow }));
|
||||
})
|
||||
}
|
||||
|
||||
//停车点
|
||||
let destCodeShow = this.nameLevels.indexOf(10) !== -1 ? true : false;
|
||||
let stopPointList = this.$store.getters['map/stopPointList'];
|
||||
if (stopPointList && stopPointList.length > 0) {
|
||||
stopPointList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { destCodeShow }));
|
||||
})
|
||||
}
|
||||
|
||||
//车站
|
||||
let kmPostShow = this.nameLevels.indexOf(12) !== -1 ? true : false;
|
||||
let stationList = this.$store.getters['map/stationList'];
|
||||
if (stationList && stationList.length > 0) {
|
||||
stationList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { kmPostShow })); //公里标
|
||||
})
|
||||
}
|
||||
|
||||
this.$store.dispatch('map/updateMapDevices', deviceList);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -1,192 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__systerm view-train-id"
|
||||
title="列车识别号显示设置"
|
||||
:visible.sync="show"
|
||||
width="420px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="padding: 10px 20px; border: 1px double lightgray;">
|
||||
<span class="base-label">计划车显示模式</span>
|
||||
<el-radio-group v-model="planMode">
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-radio :label="1">表号+车次号</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-radio :label="2">表号+车组号</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-radio :label="3">目的地号+车次号</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-radio :label="4">目的地号+车组号</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-radio :label="5">目的地号+表号+车次号</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-radio :label="6">目的地号+表号+车组号</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div style="padding: 10px 20px; border: 1px double lightgray; margin: 20px 0px;">
|
||||
<span class="base-label">头码车显示模式</span>
|
||||
<el-radio-group v-model="headMode">
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-radio :label="3">目的地号+车次号</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="8">
|
||||
<el-radio :label="4">目的地号+车组号</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div style="padding: 10px 20px; border: 1px double lightgray;">
|
||||
<span class="base-label">字体大小</span>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input v-model="fontSize" size="small" min="16" max="99" />
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="1">
|
||||
<span style="height:32px; line-height:32px;">(范围:16-99)</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="6" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="8">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'ViewTrainId',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: null,
|
||||
operation: '',
|
||||
planMode: 5,
|
||||
headMode: 5,
|
||||
fontSize: 16
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.setTrainDispaly();
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
|
||||
// 非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
over: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation,
|
||||
val: [this.planMode, this.headMode, this.fontSize].join('::')
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.setTrainDispaly();
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
setTrainDispaly() {
|
||||
const updatList = [];
|
||||
const trainList = this.$store.getters['training/viewTrainList']();
|
||||
if (trainList && trainList.length > 0) {
|
||||
const nameFormat = this.trainNameFormatBy(this.planMode);
|
||||
const nameFontSize = this.fontSize;
|
||||
updatList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameFormat, nameFontSize })); // 车次窗
|
||||
});
|
||||
|
||||
this.$store.dispatch('map/updateMapDevices', updatList);
|
||||
}
|
||||
},
|
||||
trainNameFormatBy(mode) {
|
||||
switch (mode.toString()) {
|
||||
case '1': return 'serviceNumber:tripNumber'; // 表号+车次号
|
||||
case '2': return 'serviceNumber:groupNumber'; // 表号+车组号
|
||||
case '3': return 'targetCode:tripNumber'; // 目的地号+车次号
|
||||
case '4': return 'targetCode:groupNumber'; // 目的地号+车组号
|
||||
case '5': return 'targetCode:serviceNumber:tripNumber'; // 目的地号+表号+车次号
|
||||
case '6': return 'targetCode:serviceNumber:groupNumber'; // 目的地号+表号+车组号
|
||||
}
|
||||
return ''; // 无格式类型
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -47,6 +47,8 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
clickNum:0,
|
||||
oldSelected:null,
|
||||
menuNormal: {
|
||||
Local: [
|
||||
// {
|
||||
@ -206,6 +208,23 @@ export default {
|
||||
switch (buttonOperation) {
|
||||
case OperationEvent.Signal.arrangementRoute.button.operation: {
|
||||
// 进路建立
|
||||
if (this.clickNum >= 1) {
|
||||
let route = null;
|
||||
this.routeList.forEach(elem => {
|
||||
if (elem.startSignalCode === this.oldSelected.code && elem.endSignalCode === selectType.code) {
|
||||
route = elem;
|
||||
}
|
||||
});
|
||||
if (route) {
|
||||
this.setRoute(route);
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow({}, `没有以[${this.oldSelected.name}(${this.oldSelected.code})]为始端信号机,以[${selectType.name}(${selectType.code})] 为终端信号机的进路`);
|
||||
}
|
||||
this.clickNum = 0;
|
||||
} else {
|
||||
this.oldSelected = selectType;
|
||||
this.clickNum++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case OperationEvent.Signal.cancelTrainRoute.button.operation: {
|
||||
@ -325,6 +344,23 @@ export default {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 现地设置进路
|
||||
setRoute(route) {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.Signal.arrangementRoute.menu.operation,
|
||||
param: {
|
||||
routeCode: route.code
|
||||
},
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}).catch((error) => {
|
||||
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||
});
|
||||
},
|
||||
// 取消进路
|
||||
cancelTrainRoute() {
|
||||
const operate = {
|
||||
|
@ -29,7 +29,7 @@ class Model {
|
||||
nameFontSize: 10 // 字体大小
|
||||
};
|
||||
this['private'][deviceType.TrainWindow] = {
|
||||
trainWindowShow: false
|
||||
trainWindowShow: true
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,6 @@
|
||||
<password-box ref="passwordBox" @setLoginResult="getLoginResult" />
|
||||
<view-train-id ref="viewTrainId" />
|
||||
<view-name ref="viewName" />
|
||||
<view-device ref="viewDevice" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
<train-add ref="trainAdd" />
|
||||
<train-transtalet ref="trainTranstalet" />
|
||||
@ -89,7 +88,6 @@ import TrainDelete from './menuDialog/trainDelete';
|
||||
import PasswordBox from './menuDialog/passwordBox';
|
||||
import ViewTrainId from './menuDialog/viewTrainId';
|
||||
import ViewName from './menuDialog/viewName';
|
||||
import ViewDevice from './menuDialog/viewDevice';
|
||||
import ManageUser from './menuDialog/manageUser';
|
||||
import HelpAbout from './menuDialog/helpAbout';
|
||||
import SetLimitSpeed from './menuDialog/setLimitSpeed';
|
||||
@ -104,7 +102,6 @@ export default {
|
||||
PasswordBox,
|
||||
ViewTrainId,
|
||||
ViewName,
|
||||
ViewDevice,
|
||||
TrainAdd,
|
||||
TrainTranstalet,
|
||||
TrainDelete,
|
||||
|
@ -76,12 +76,12 @@
|
||||
<button :id="MixinCommand.functionButton.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(MixinCommand.functionButton.button.operation, 'MixinCommand')">
|
||||
<span style="color: black">
|
||||
<center>
|
||||
<b style="color:deepskyblue">功</b>
|
||||
<b style="color:burlywood">能</b>
|
||||
<b style="color:#4B4B99">功</b>
|
||||
<b style="color:#943E3E">能</b>
|
||||
</center>
|
||||
<center>
|
||||
<b style="color: red">按</b>
|
||||
<b style="color:forestgreen">钮</b>
|
||||
<b style="color:#E64BE6">按</b>
|
||||
<b style="color:#4C994C">钮</b>
|
||||
</center>
|
||||
</span>
|
||||
</button>
|
||||
@ -332,18 +332,37 @@ export default {
|
||||
} else if (deviceList.length === 2) {
|
||||
this.routeList.forEach(item => {
|
||||
if (item.startSignalCode === deviceList[0].code && item.endSignalCode === deviceList[1].code) {
|
||||
item.type;
|
||||
const operate = this.handelOperate(item);
|
||||
console.log(operate, item);
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
handelFunctionButton(model, subType) {
|
||||
const operate = {
|
||||
send: true,
|
||||
operation: this.$store.state.menuOperation.buttonOperation,
|
||||
cmdType: '',
|
||||
param: {}
|
||||
};
|
||||
if (model._type === 'StationStand' && subType === 'StopJumpLamp') {
|
||||
operate.cmdType = CMD.Stand.CMD_STAND_SET_JUMP_STOP;
|
||||
operate.param = {standCode: model.code, trainGroupNumber: ''};
|
||||
} else if (model._type === 'StationStand' && subType === 'CancelStopJumpLamp') {
|
||||
operate.cmdType = CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP;
|
||||
operate.param = {standCode: model.code, trainGroupNumber: ''};
|
||||
} else if (model._type === 'MapCycleButtonVO' ) {
|
||||
operate.cmdType = CMD.Signal.CMD_SIGNAL_SET_AUTO_TURN_BACK;
|
||||
operate.param = {cycleCode: model.cycleCode};
|
||||
}
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {});
|
||||
console.log(operate);
|
||||
},
|
||||
selectedChange() {
|
||||
// 按钮按下时
|
||||
if (this.$store.state.menuOperation.buttonOperation) {
|
||||
const model = this.$store.state.menuOperation.selected; // 选择设备
|
||||
const subType = this.$store.state.menuOperation.subType; // 选择设备的子元素
|
||||
this.deviceList.push(model);
|
||||
if (model._type) {
|
||||
if (this.Signal.arrangementRoute.button.operation === this.$store.state.menuOperation.buttonOperation) {
|
||||
@ -351,8 +370,11 @@ export default {
|
||||
return;
|
||||
}
|
||||
this.arrangementRouteOperation(this.deviceList);
|
||||
} if (this.$store.state.menuOperation.buttonOperation === this.MixinCommand.functionButton.button.operation) {
|
||||
this.handelFunctionButton(model, subType);
|
||||
} else {
|
||||
const operate = this.handelOperate(model);
|
||||
console.log(operate);
|
||||
if (this.cmdTypeList.indexOf(model._type) >= 0) {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
|
@ -1,166 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="chengdou-03__systerm view-display"
|
||||
title="设备显示设置"
|
||||
:visible.sync="show"
|
||||
width="240px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-checkbox-group v-model="deviceLevels">
|
||||
<div>
|
||||
<el-checkbox :label="1">车次窗</el-checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<el-checkbox :label="2">区段边界</el-checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<el-checkbox :label="3">联锁自动进路表示灯</el-checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<el-checkbox :label="4">ATS自动触发表示灯</el-checkbox>
|
||||
</div>
|
||||
</el-checkbox-group>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="8" :offset="2">
|
||||
<el-button :id="domIdConfirm" class="commit" type="primary" :loading="loading" @click="commit">确定
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="3">
|
||||
<el-button :id="domIdCancel" class="cancal" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
import deviceType from '@/jmap/constant/deviceType';
|
||||
|
||||
export default {
|
||||
name: 'ViewDevice',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: null,
|
||||
operation: '',
|
||||
deviceLevels: [2, 3, 4, 5]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
}
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.setDeviceDisplay();
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
// 如果不是断点激活,而是第一次显示,需要初始化数据
|
||||
if (!this.dialogShow) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
over: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation,
|
||||
val: this.deviceLevels.sort().join('::')
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.setDeviceDisplay();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
setDeviceDisplay() {
|
||||
let show = false;
|
||||
let deviceList = [];
|
||||
|
||||
// 区段边界设置
|
||||
let borderBorderShow = this.deviceLevels.indexOf(2) !== -1;
|
||||
let sectionList = this.$store.getters['map/sectionList'];
|
||||
if (sectionList && sectionList.length > 0) {
|
||||
sectionList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { borderBorderShow })); // 区段边界
|
||||
});
|
||||
}
|
||||
|
||||
// 车次窗设置
|
||||
let trainWindowShow = this.deviceLevels.indexOf(1) !== -1;
|
||||
let trainWindowList = this.$store.getters['map/trainWindowList'];
|
||||
if (trainWindowList && trainWindowList.length > 0) {
|
||||
trainWindowList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { trainWindowShow })); // 车次窗
|
||||
});
|
||||
}
|
||||
|
||||
// 联锁自动进路表示灯和ATS自动触发表示灯设置
|
||||
let linkageAutoRouteShow = this.deviceLevels.indexOf(3) !== -1;// 联锁自动进路表示灯
|
||||
let atsAutoTriggerShow = this.deviceLevels.indexOf(4) !== -1;// ATS自动触发表示灯
|
||||
let signalList = this.$store.getters['map/signalList'];
|
||||
if (signalList && signalList.length > 0) {
|
||||
signalList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { linkageAutoRouteShow, atsAutoTriggerShow }));
|
||||
});
|
||||
}
|
||||
|
||||
this.$store.dispatch('map/updateMapDevices', deviceList);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
</style>
|
@ -10,6 +10,15 @@ class Theme {
|
||||
'06': 'ningbo_01',
|
||||
'07': 'haerbin_01' // 哈尔滨培训线路
|
||||
};
|
||||
this._localShowMode = { // 现地显示模式
|
||||
'01': 'all', // 成都一 全显
|
||||
'02': 'all', // 福州一 全显
|
||||
'03': 'all', // 北京一 全显
|
||||
'04': 'all', // 成都三 全显
|
||||
'05': 'all', // 国际版运行图皮肤 指向05 福州线路 全显
|
||||
'06': 'all', // 宁波一 全显
|
||||
'07': 'ecStation' // 哈尔滨培训线路 集中站显示
|
||||
};
|
||||
}
|
||||
|
||||
// 加载菜单组件
|
||||
|
@ -63,7 +63,7 @@ export default {
|
||||
this.$store.state.training.roles != 'BigScreen';
|
||||
},
|
||||
isShowBar() {
|
||||
return this.$store.state.training.prdType;
|
||||
return this.$store.state.training.prdType === '01';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -353,4 +353,15 @@ export default {
|
||||
.haerbin-01__systerm .el-dialog .button-group {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.haerbin-01__systerm .nav-border .el-button {
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
padding: 0px;
|
||||
width: 80px;
|
||||
border: 1px solid #1F313F;
|
||||
font-size: 12px;
|
||||
border-radius: 5px !important;
|
||||
color: #000;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,118 +1,75 @@
|
||||
<template>
|
||||
<div id="menuBar">
|
||||
<div class="nav">
|
||||
<template v-for="(item,i) in menu">
|
||||
<template v-if="noShowingChildren(item.children)">
|
||||
<li :id="item.operate.domId" :key="i" class="nav-li" @click="hookClick(item)">
|
||||
<span class="nav-li-text">{{ item.title }}</span>
|
||||
</li>
|
||||
</template>
|
||||
<template v-else>
|
||||
<li :id="item.operate.domId" :key="i" class="nav-li" @click.stop="selectedClassA(item, i)">
|
||||
<span class="nav-li-text">{{ item.title }}</span>
|
||||
<ul class="nav-ul" :class="{'active' :i==classA}">
|
||||
<template v-for="(child,j) in item.children">
|
||||
<template v-if="child.children&&child.children.length>0&&hasShowingChildren(child.children)">
|
||||
<li
|
||||
:id="child.operate.domId"
|
||||
:key="j"
|
||||
class="menu-li"
|
||||
@click.stop="selectedClassB(child, j)"
|
||||
>
|
||||
<div class="menu-li-block">
|
||||
<span class="menu-li-text">
|
||||
<span class="status"> </span>
|
||||
<span class="label">{{ child.title }}</span>
|
||||
</span>
|
||||
</div>
|
||||
<ul class="menu-ul" :class="{'active' :j==classB}">
|
||||
<template v-for="(grandchild,k) in child.children">
|
||||
<li
|
||||
v-if="grandchild.show"
|
||||
:id="grandchild.operate.domId"
|
||||
:key="k"
|
||||
class="menu-li"
|
||||
@click.stop="hookClick(grandchild)"
|
||||
>
|
||||
<div class="menu-li-block">
|
||||
<span class="menu-li-text">
|
||||
<span class="status"> </span>
|
||||
<span class="label">{{ grandchild.title }}</span>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</template>
|
||||
</ul>
|
||||
</li>
|
||||
</template>
|
||||
<template v-else>
|
||||
<li
|
||||
v-if="child.show"
|
||||
:id="child.operate.domId"
|
||||
:key="j"
|
||||
class="menu-li"
|
||||
@click.stop="hookClick(child)"
|
||||
>
|
||||
<div class="menu-li-block">
|
||||
<span class="menu-li-text">
|
||||
<span class="status"> </span>
|
||||
<span class="label">{{ child.title }}</span>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</template>
|
||||
<div class="haerbin-01__systerm nav">
|
||||
<el-row>
|
||||
<el-col :span="2">
|
||||
<div class="nav-border">
|
||||
<el-row>
|
||||
<el-button style="width: 100px;" plain @click="undeveloped">登录</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button style="width: 100px;" disabled plain />
|
||||
</el-row>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="nav-border">
|
||||
<el-row>
|
||||
<template v-for="(item, index) in centralizedStationList1">
|
||||
<el-col :key="index" :span="colsNum"><el-button style="width: 80px;" plain @click="switchShowStation(item)">{{ item.name }}</el-button></el-col>
|
||||
</template>
|
||||
</ul>
|
||||
</li>
|
||||
</template>
|
||||
</template>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<template v-for="(item, index) in centralizedStationList2">
|
||||
<el-col :key="index" :span="colsNum"><el-button style="width: 80px;" plain @click="switchShowStation(item)">{{ item.name }}</el-button></el-col>
|
||||
</template>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<div class="nav-border">
|
||||
<el-row>
|
||||
<el-col :span="6"><el-button style="width: 80px;" plain @click="undeveloped">A级警报</el-button></el-col>
|
||||
<el-col :span="6"><el-button style="width: 80px;" plain @click="undeveloped">B级警报</el-button></el-col>
|
||||
<el-col :span="6"><el-button style="width: 80px;" plain @click="undeveloped">C级警报</el-button></el-col>
|
||||
<el-col :span="6"><el-button style="width: 80px;" plain @click="undeveloped">记录</el-button></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6"><el-button style="width: 80px;" plain @click="undeveloped">声音</el-button></el-col>
|
||||
<el-col :span="6"><el-button style="width: 80px;" plain @click="undeveloped">双屏</el-button></el-col>
|
||||
<el-col :span="6"><el-button style="width: 80px;" plain @click="undeveloped">TGI</el-button></el-col>
|
||||
<el-col :span="6"><el-button style="width: 80px;" plain @click="undeveloped">管理</el-button></el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="nav-border">
|
||||
<el-row> </el-row>
|
||||
<el-row>
|
||||
<el-col :span="24"><div>{{ '版本:' + version }}</div></el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="nav-border">
|
||||
<el-row> </el-row>
|
||||
<el-row> </el-row>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<station-control-convert ref="stationControlConvert" />
|
||||
<password-box ref="passwordBox" @setLoginResult="getLoginResult" />
|
||||
<view-train-id ref="viewTrainId" />
|
||||
<view-name ref="viewName" />
|
||||
<view-device ref="viewDevice" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
<train-add ref="trainAdd" />
|
||||
<train-transtalet ref="trainTranstalet" />
|
||||
<train-delete ref="trainDelete" />
|
||||
<manage-user ref="manageUser" />
|
||||
<help-about ref="helpAbout" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { TrainingMode } from '@/scripts/ConstDic';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler.js';
|
||||
import { State2SimulationMap } from '@/scripts/cmdPlugin/Config.js';
|
||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||
import StationControlConvert from './menuDialog/stationControlConvert';
|
||||
import TrainAdd from './menuDialog/trainAdd';
|
||||
import TrainTranstalet from './menuDialog/trainTranstalet';
|
||||
import TrainDelete from './menuDialog/trainDelete';
|
||||
import PasswordBox from './menuDialog/passwordBox';
|
||||
import ViewTrainId from './menuDialog/viewTrainId';
|
||||
import ViewName from './menuDialog/viewName';
|
||||
import ViewDevice from './menuDialog/viewDevice';
|
||||
import ManageUser from './menuDialog/manageUser';
|
||||
import HelpAbout from './menuDialog/helpAbout';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
|
||||
export default {
|
||||
name: 'MenuBar',
|
||||
components: {
|
||||
NoticeInfo,
|
||||
StationControlConvert,
|
||||
PasswordBox,
|
||||
ViewTrainId,
|
||||
ViewName,
|
||||
ViewDevice,
|
||||
TrainAdd,
|
||||
TrainTranstalet,
|
||||
TrainDelete,
|
||||
ManageUser,
|
||||
HelpAbout
|
||||
NoticeInfo
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
@ -129,270 +86,11 @@ export default {
|
||||
tempClassA: -1,
|
||||
tempClassB: -1,
|
||||
valid: true,
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
Local: [
|
||||
{
|
||||
title: this.$t('menu.menuBar.system'),
|
||||
operate: OperationEvent.Command.mBar.system,
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.view'),
|
||||
operate: OperationEvent.Command.mBar.check,
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.refresh'),
|
||||
operate: OperationEvent.Command.mBar.fresh,
|
||||
click: this.refresh,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.display'),
|
||||
operate: OperationEvent.Command.mBar.view,
|
||||
children: [
|
||||
{
|
||||
title: this.$t('menu.menuBar.setTrainIdDisplay'),
|
||||
click: this.setTrainIdDisplay,
|
||||
operate: OperationEvent.Command.view.setTrainIdDisplay
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.setNameDisplay'),
|
||||
click: this.setNameDisplay,
|
||||
operate: OperationEvent.Command.view.setNameDisplay
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.setDeviceDisplay'),
|
||||
click: this.setDeviceDisplay,
|
||||
operate: OperationEvent.Command.view.setDeviceDisplay
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.stationMapSwitch'),
|
||||
operate: '',
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.controlModeSwitch'),
|
||||
operate: OperationEvent.Command.mBar.remoteControl,
|
||||
children: [
|
||||
{
|
||||
title: this.$t('menu.menuBar.toStationControl'),
|
||||
click: this.turnToStationControl,
|
||||
operate: OperationEvent.StationControl.requestStationControl.mbar
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.forcedStationControl'),
|
||||
click: this.mandatoryStationControl,
|
||||
operate: OperationEvent.StationControl.forcedStationControl.password
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.toCentralControl'),
|
||||
click: this.conterStationControl,
|
||||
operate: OperationEvent.StationControl.requestCentralControl.mbar,
|
||||
froce: true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.requestOperationArea'),
|
||||
operate: OperationEvent.Command.mBar.requestZone,
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.historyQuery'),
|
||||
operate: OperationEvent.Command.mBar.historyQuery,
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.userManage'),
|
||||
operate: OperationEvent.Command.mBar.userManage,
|
||||
children: [
|
||||
{
|
||||
title: this.$t('menu.menuBar.userManage'),
|
||||
click: this.userManage,
|
||||
operate: OperationEvent.Command.manage.userManage
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.help'),
|
||||
operate: OperationEvent.Command.mBar.help,
|
||||
children: [
|
||||
{
|
||||
title: this.$t('menu.menuBar.about'),
|
||||
click: this.about,
|
||||
operate: OperationEvent.Command.help.about
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
Center: [
|
||||
{
|
||||
title: this.$t('menu.menuBar.system'),
|
||||
operate: OperationEvent.Command.mBar.system,
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.view'),
|
||||
operate: OperationEvent.Command.mBar.check,
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.refresh'),
|
||||
operate: OperationEvent.Command.mBar.fresh,
|
||||
click: this.refresh,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.display'),
|
||||
operate: OperationEvent.Command.mBar.view,
|
||||
children: [
|
||||
{
|
||||
title: this.$t('menu.menuBar.setTrainIdDisplay'),
|
||||
click: this.setTrainIdDisplay,
|
||||
operate: OperationEvent.Command.view.setTrainIdDisplay
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.setNameDisplay'),
|
||||
click: this.setNameDisplay,
|
||||
operate: OperationEvent.Command.view.setNameDisplay
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.setDeviceDisplay'),
|
||||
click: this.setDeviceDisplay,
|
||||
operate: OperationEvent.Command.view.setDeviceDisplay
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.stationMapSwitch'),
|
||||
operate: '',
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.planCarOperation'),
|
||||
operate: OperationEvent.Command.mBar.planTrain,
|
||||
children: [
|
||||
{
|
||||
title: this.$t('menu.menuBar.addPlanCar'),
|
||||
click: this.addPlanTrain,
|
||||
operate: OperationEvent.Command.planTrain.addPlanTrain
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.panPlanCar'),
|
||||
click: this.translatPlanTrain,
|
||||
operate: OperationEvent.Command.planTrain.translatPlanTrain
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.deletePlanCar'),
|
||||
click: this.delPlanTrain,
|
||||
operate: OperationEvent.Command.planTrain.delPlanTrain
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.trainNumberMaintenance'),
|
||||
operate: '',
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.controlModeSwitch'),
|
||||
operate: OperationEvent.Command.mBar.remoteControl,
|
||||
children: [
|
||||
{
|
||||
title: this.$t('menu.menuBar.toStationControl'),
|
||||
click: this.turnToStationControl,
|
||||
operate: OperationEvent.StationControl.requestStationControl.mbar,
|
||||
froce: true
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.forcedStationControl'),
|
||||
click: this.mandatoryStationControl,
|
||||
operate: OperationEvent.StationControl.forcedStationControl.password,
|
||||
froce: true
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.toCentralControl'),
|
||||
click: this.conterStationControl,
|
||||
operate: OperationEvent.StationControl.requestCentralControl.mbar
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.requestOperationArea'),
|
||||
operate: OperationEvent.Command.mBar.requestZone,
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.schedulingLog'),
|
||||
operate: '',
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.systemAnalysis'),
|
||||
operate: '',
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.userManage'),
|
||||
operate: OperationEvent.Command.mBar.userManage,
|
||||
children: [
|
||||
{
|
||||
title: this.$t('menu.menuBar.userManage'),
|
||||
click: this.userManage,
|
||||
operate: OperationEvent.Command.manage.userManage
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.historyQuery'),
|
||||
operate: OperationEvent.Command.mBar.historyQuery,
|
||||
click: this.undeveloped,
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.menuBar.help'),
|
||||
operate: OperationEvent.Command.mBar.help,
|
||||
children: [
|
||||
{
|
||||
title: this.$t('menu.menuBar.about'),
|
||||
click: this.about,
|
||||
operate: OperationEvent.Command.help.about
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
stationCode: '',
|
||||
centralizedStationList1: [],
|
||||
centralizedStationList2: [],
|
||||
colsNum: 0,
|
||||
version: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -421,257 +119,41 @@ export default {
|
||||
this.classA = this.tempClassA;
|
||||
this.classB = this.tempClassB;
|
||||
}
|
||||
},
|
||||
'$store.state.training.operatemode': function (mode) {
|
||||
this.initMenu();
|
||||
},
|
||||
'$store.state.training.started': function (val) {
|
||||
this.closeMenu(true);
|
||||
},
|
||||
'$store.state.training.prdType': function () {
|
||||
this.initMenu();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.version = this.$store.state.map.version;
|
||||
this.initMenu();
|
||||
},
|
||||
methods: {
|
||||
initMenu(menu) {
|
||||
this.menu = MenuContextHandler.menuBarConvert(this.menuNormal[State2SimulationMap[this.$store.state.training.prdType]], this.$store.state.training.operatemode);
|
||||
this.clickEvent();
|
||||
this.closeMenu(true);
|
||||
},
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
if (document.getElementById('menuBar')) {
|
||||
self.closeMenu(false);
|
||||
}
|
||||
};
|
||||
},
|
||||
noShowingChildren(children) {
|
||||
if (!children || children.length <= 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
hasShowingChildren(children) {
|
||||
if (children && children.length > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
closeMenu(flag) {
|
||||
if (flag || (this.mode !== TrainingMode.EDIT && this.mode !== TrainingMode.TEACH)) {
|
||||
this.classA = this.tempClassA = -1;
|
||||
this.classB = this.tempClassB = -1;
|
||||
}
|
||||
},
|
||||
hookClick(item, event) {
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
|
||||
if (item && typeof item.click == 'function') {
|
||||
item.click(item.operate);
|
||||
}
|
||||
},
|
||||
selectedClassA(item, index) {
|
||||
const order = this.order || 0;
|
||||
if (this.mode !== TrainingMode.TEACH) { // 编辑模式下可显示
|
||||
this.popupMenuA(item, index);
|
||||
} else if (this.steps[order] && this.steps[order].type == 'bar') { // 操作步骤没有顶部操作顶部菜单都不可显示
|
||||
this.popupMenuA(item, index);
|
||||
}
|
||||
},
|
||||
// 弹出顶部菜单操作
|
||||
popupMenuA(item, index) {
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
|
||||
this.clickEvent();
|
||||
const operate = {
|
||||
operation: item.operate.operation
|
||||
};
|
||||
this.tempClassA = index;
|
||||
this.tempClassB = -1;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
initMenu() {
|
||||
const centralizedStationList = [];
|
||||
this.centralizedStationList1 = [];
|
||||
this.centralizedStationList2 = [];
|
||||
this.stationList.forEach(item => {
|
||||
if (item.centralized) {
|
||||
centralizedStationList.push(item);
|
||||
}
|
||||
});
|
||||
},
|
||||
selectedClassB(item, index) {
|
||||
const order = this.order || 0;
|
||||
if (this.mode !== TrainingMode.TEACH) { // 编辑模式下可显示
|
||||
this.popupMenuB(item, index);
|
||||
} else if (this.steps[order] && this.steps[order].type == 'bar') { // 操作步骤没有顶部操作顶部菜单都不可显示
|
||||
this.popupMenuB(item, index);
|
||||
}
|
||||
},
|
||||
popupMenuB(item, index) {
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
|
||||
const operate = {
|
||||
operation: item.operate.operation
|
||||
};
|
||||
this.tempClassB = index;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
centralizedStationList.forEach((item, index) => {
|
||||
if (index < centralizedStationList.length / 2) {
|
||||
this.centralizedStationList1.push(item);
|
||||
} else {
|
||||
this.centralizedStationList2.push(item);
|
||||
}
|
||||
});
|
||||
this.colsNum = 24 / this.centralizedStationList1.length;
|
||||
},
|
||||
// 转为站控
|
||||
turnToStationControl(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.stationControlConvert.doShow(operate);
|
||||
switchShowStation(station) {
|
||||
const nameList = Object.keys(this.$store.state.map.map);
|
||||
let list = [];
|
||||
nameList.forEach(item => {
|
||||
if (item !== 'skinVO') {
|
||||
list = [...list, ...this.$store.state.map.map[item]];
|
||||
}
|
||||
});
|
||||
},
|
||||
// 强制转为站控
|
||||
mandatoryStationControl(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.passwordBox.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 请求中控
|
||||
conterStationControl(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.stationControlConvert.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置列车识别号显示
|
||||
setTrainIdDisplay(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.viewTrainId.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置设备显示
|
||||
setNameDisplay(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.viewName.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置名称显示
|
||||
setDeviceDisplay(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.viewDevice.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 添加计划车
|
||||
addPlanTrain(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainAdd.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 平移计划车
|
||||
translatPlanTrain(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainTranstalet.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 删除计划车
|
||||
delPlanTrain(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainDelete.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 用户管理
|
||||
userManage(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.manageUser.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 关于
|
||||
about(order) {
|
||||
const operate = {
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.helpAbout.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 刷新
|
||||
refresh() {
|
||||
this.closeMenu(true);
|
||||
EventBus.$emit('refresh');
|
||||
},
|
||||
getLoginResult(operate) {
|
||||
/** 密码校验*/
|
||||
if (operate.operation == OperationEvent.StationControl.forcedStationControl.passwordConfirm.operation) {
|
||||
if (operate.success) {
|
||||
/** 校验成功*/
|
||||
this.$refs.stationControlConvert.doShow({ operation: OperationEvent.StationControl.forcedStationControl.mbar.operation });
|
||||
}
|
||||
}
|
||||
this.$jlmap.updateShowStation(list, station.code);
|
||||
this.$jlmap.setCenter(station.code);
|
||||
},
|
||||
undeveloped() {
|
||||
this.doClose();
|
||||
@ -694,7 +176,7 @@ export default {
|
||||
<style scoped rel="stylesheet/scss" lang="scss">
|
||||
@import "src/styles/mixin.scss";
|
||||
$width: 30px;
|
||||
$height: 30px;
|
||||
$height: 60px;
|
||||
$menuPadding: 10px;
|
||||
$menuItemHeight: 30px;
|
||||
$menuItemWidth: 190px;
|
||||
@ -705,9 +187,17 @@ export default {
|
||||
position: absolute;
|
||||
width: inherit;
|
||||
height: $height;
|
||||
line-height: $height;
|
||||
line-height: $height/2;
|
||||
}
|
||||
.nav-border {
|
||||
font-size: 12px;
|
||||
color: #000;
|
||||
text-align: center;
|
||||
border-top: 2px solid #7E8076;
|
||||
border-left: 2px solid #6A6B64;
|
||||
border-right: 2px solid #FBFBFA;
|
||||
border-bottom: 2px solid #FBFBFA;
|
||||
}
|
||||
|
||||
.nav {
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
@ -716,6 +206,7 @@ export default {
|
||||
background: -o-linear-gradient(#FDFDFE, #DEE3F3);
|
||||
background: -moz-linear-gradient(#FDFDFE, #DEE3F3);
|
||||
background: linear-gradient(#FDFDFE, #DEE3F3);
|
||||
/*background: #FFFFFF;*/
|
||||
border: 1px solid #B6BCCC !important;
|
||||
border-bottom: 2px solid #B6BCCC !important;
|
||||
list-style: none;
|
||||
|
@ -89,9 +89,6 @@
|
||||
<station-control ref="stationControl" />
|
||||
<detain-train-contorl ref="detainTrainContorl" />
|
||||
<detain-train-contorl-up-down ref="detainTrainContorlUpDown" />
|
||||
<view-train-id ref="viewTrainId" />
|
||||
<view-name ref="viewName" />
|
||||
<view-device ref="viewDevice" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
<train-add ref="trainAdd" />
|
||||
<train-transtalet ref="trainTranstalet" />
|
||||
@ -110,9 +107,6 @@ import DetainTrainContorlUpDown from './menuDialog/detainTrainContorlUpDown';
|
||||
import TrainAdd from './menuDialog/trainAdd';
|
||||
import TrainTranstalet from './menuDialog/trainTranstalet';
|
||||
import TrainDelete from './menuDialog/trainDelete';
|
||||
import ViewTrainId from './menuDialog/viewTrainId';
|
||||
import ViewName from './menuDialog/viewName';
|
||||
import ViewDevice from './menuDialog/viewDevice';
|
||||
import ManageUser from './menuDialog/manageUser';
|
||||
import HelpAbout from './menuDialog/helpAbout';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
||||
@ -125,9 +119,6 @@ export default {
|
||||
StationControl,
|
||||
DetainTrainContorl,
|
||||
DetainTrainContorlUpDown,
|
||||
ViewTrainId,
|
||||
ViewName,
|
||||
ViewDevice,
|
||||
TrainAdd,
|
||||
TrainTranstalet,
|
||||
TrainDelete,
|
||||
@ -309,28 +300,6 @@ export default {
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '显示',
|
||||
operate: OperationEvent.Command.mBar.view,
|
||||
hide: true,
|
||||
children: [
|
||||
{
|
||||
title: '设置列车识别号显示',
|
||||
click: this.setTrainIdDisplay,
|
||||
operate: OperationEvent.Command.view.setTrainIdDisplay
|
||||
},
|
||||
{
|
||||
title: '设置名称显示',
|
||||
click: this.setNameDisplay,
|
||||
operate: OperationEvent.Command.view.setNameDisplay
|
||||
},
|
||||
{
|
||||
title: '设置设备显示',
|
||||
click: this.setDeviceDisplay,
|
||||
operate: OperationEvent.Command.view.setDeviceDisplay
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: 'ATS终端操作',
|
||||
operate: '',
|
||||
@ -576,28 +545,6 @@ export default {
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '显示',
|
||||
operate: OperationEvent.Command.mBar.view,
|
||||
hide: true,
|
||||
children: [
|
||||
{
|
||||
title: '设置列车识别号显示',
|
||||
click: this.setTrainIdDisplay,
|
||||
operate: OperationEvent.Command.view.setTrainIdDisplay
|
||||
},
|
||||
{
|
||||
title: '设置名称显示',
|
||||
click: this.setNameDisplay,
|
||||
operate: OperationEvent.Command.view.setNameDisplay
|
||||
},
|
||||
{
|
||||
title: '设置设备显示',
|
||||
click: this.setDeviceDisplay,
|
||||
operate: OperationEvent.Command.view.setDeviceDisplay
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: 'ATS终端操作',
|
||||
operate: '',
|
||||
@ -924,48 +871,6 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置列车识别号显示
|
||||
setTrainIdDisplay(order) {
|
||||
const operate = {
|
||||
type: 'bar',
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.viewTrainId.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置设备显示
|
||||
setNameDisplay(order) {
|
||||
const operate = {
|
||||
type: 'bar',
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.viewName.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置名称显示
|
||||
setDeviceDisplay(order) {
|
||||
const operate = {
|
||||
type: 'bar',
|
||||
operation: order.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.closeMenu(true);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.viewDevice.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 添加计划车
|
||||
addPlanTrain(order) {
|
||||
const operate = {
|
||||
|
@ -1,166 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="ningbo-01__systerm view-display"
|
||||
title="设备显示设置"
|
||||
:visible.sync="show"
|
||||
width="240px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-checkbox-group v-model="deviceLevels">
|
||||
<div>
|
||||
<el-checkbox :label="1">车次窗</el-checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<el-checkbox :label="2">区段边界</el-checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<el-checkbox :label="3">联锁自动进路表示灯</el-checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<el-checkbox :label="4">ATS自动触发表示灯</el-checkbox>
|
||||
</div>
|
||||
</el-checkbox-group>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="8" :offset="2">
|
||||
<el-button :id="domIdConfirm" class="commit" type="primary" :loading="loading" @click="commit">确定
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="3">
|
||||
<el-button :id="domIdCancel" class="cancal" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
import deviceType from '@/jmap/constant/deviceType';
|
||||
|
||||
export default {
|
||||
name: 'ViewDevice',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: null,
|
||||
operation: '',
|
||||
deviceLevels: [2, 3, 4, 5]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
}
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.setDeviceDisplay();
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
// 如果不是断点激活,而是第一次显示,需要初始化数据
|
||||
if (!this.dialogShow) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
over: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation,
|
||||
val: this.deviceLevels.sort().join('::')
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.setDeviceDisplay();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
setDeviceDisplay() {
|
||||
let show = false;
|
||||
let deviceList = [];
|
||||
|
||||
// 区段边界设置
|
||||
let borderBorderShow = this.deviceLevels.indexOf(2) !== -1;
|
||||
let sectionList = this.$store.getters['map/sectionList'];
|
||||
if (sectionList && sectionList.length > 0) {
|
||||
sectionList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { borderBorderShow })); // 区段边界
|
||||
});
|
||||
}
|
||||
|
||||
// 车次窗设置
|
||||
let trainWindowShow = this.deviceLevels.indexOf(1) !== -1;
|
||||
let trainWindowList = this.$store.getters['map/trainWindowList'];
|
||||
if (trainWindowList && trainWindowList.length > 0) {
|
||||
trainWindowList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { trainWindowShow })); // 车次窗
|
||||
});
|
||||
}
|
||||
|
||||
// 联锁自动进路表示灯和ATS自动触发表示灯设置
|
||||
let linkageAutoRouteShow = this.deviceLevels.indexOf(3) !== -1;// 联锁自动进路表示灯
|
||||
let atsAutoTriggerShow = this.deviceLevels.indexOf(4) !== -1;// ATS自动触发表示灯
|
||||
let signalList = this.$store.getters['map/signalList'];
|
||||
if (signalList && signalList.length > 0) {
|
||||
signalList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { linkageAutoRouteShow, atsAutoTriggerShow }));
|
||||
});
|
||||
}
|
||||
|
||||
this.$store.dispatch('map/updateMapDevices', deviceList);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
</style>
|
@ -1,248 +0,0 @@
|
||||
<template>
|
||||
<el-dialog class="ningbo-01__systerm view-name" title="名称显示设置" :visible.sync="show" width="320px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-checkbox-group v-model="nameLevels">
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-checkbox :label="1">信号机名称</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-checkbox :label="2">站台轨名称</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-checkbox :label="3" disabled>按钮名称</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-checkbox :label="4">折返轨名称</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-checkbox :label="5">股道名称</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-checkbox dio :label="6">转换轨名称</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-checkbox :label="7">道岔名称</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-checkbox dio :label="8">标识灯名称</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-checkbox :label="9">道岔区段名称</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-checkbox dio :label="10">目的地名称</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-checkbox :label="11">计轴区段名称</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-checkbox dio :label="12">公里标</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-checkbox-group>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="6" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="8">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'viewName',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: null,
|
||||
nameLevels: [1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.setNameDisplay();
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
//如果不是断点激活显示,而是第一次显示时,需要初始化参数
|
||||
if (!this.dialogShow) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
over: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation,
|
||||
val: this.nameLevels.sort().join('::')
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.setNameDisplay();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
})
|
||||
},
|
||||
setNameDisplay() {
|
||||
let deviceList = [];
|
||||
|
||||
//信号机
|
||||
let nameShow = this.nameLevels.indexOf(1) !== -1 ? true : false;
|
||||
let signalList = this.$store.getters['map/signalList'];
|
||||
if (signalList && signalList.length > 0) {
|
||||
signalList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow }));
|
||||
})
|
||||
}
|
||||
|
||||
//按钮名称
|
||||
nameShow = this.nameLevels.indexOf(3) !== -1 ? true : false;
|
||||
|
||||
|
||||
//道岔
|
||||
nameShow = this.nameLevels.indexOf(7) !== -1 ? true : false; //道岔名称
|
||||
let switchSectionNameShow = this.nameLevels.indexOf(9) !== -1 ? true : false; //道岔轨名称
|
||||
let switchList = this.$store.getters['map/switchList'];
|
||||
if (switchList && switchList.length > 0) {
|
||||
switchList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, switchSectionNameShow }));
|
||||
})
|
||||
}
|
||||
|
||||
//控制模式
|
||||
let indicatorShow = this.nameLevels.indexOf(8) !== -1 ? true : false;
|
||||
let control = this.$store.getters['map/stationControlList'];
|
||||
if (control && control.length > 0) {
|
||||
control.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { indicatorShow })); //标识灯名称
|
||||
})
|
||||
}
|
||||
|
||||
//区段
|
||||
nameShow = false;
|
||||
let standTrackNameShow = false;
|
||||
let reentryTrackNameShow = false;
|
||||
let transferTrackNameShow = false;
|
||||
let sectionList = this.$store.getters['map/sectionList'];
|
||||
if (sectionList && sectionList.length > 0) {
|
||||
sectionList.forEach(elem => {
|
||||
if (elem.isSwitchSection && elem.parentCode) {
|
||||
//道岔轨的区段名称默认不显示
|
||||
nameShow = false;
|
||||
} else {
|
||||
if (elem.type === '01') {
|
||||
nameShow = this.nameLevels.indexOf(11) !== -1 ? true : false;
|
||||
} else if (elem.type === '02') {
|
||||
//股道轨名称
|
||||
nameShow = this.nameLevels.indexOf(5) !== -1 ? true : false;
|
||||
} else if (elem.type === '03') {
|
||||
//道岔区段名称
|
||||
nameShow = this.nameLevels.indexOf(9) !== -1 ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
//站台轨名称
|
||||
if (elem.isStandTrack) {
|
||||
standTrackNameShow = this.nameLevels.indexOf(2) !== -1 ? true : false;
|
||||
}
|
||||
|
||||
//折返轨名称
|
||||
if (elem.isReentryTrack) {
|
||||
reentryTrackNameShow = this.nameLevels.indexOf(4) !== -1 ? true : false;
|
||||
}
|
||||
|
||||
//转换轨名称
|
||||
if (elem.isTransferTrack) {
|
||||
transferTrackNameShow = this.nameLevels.indexOf(6) !== -1 ? true : false;
|
||||
}
|
||||
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, standTrackNameShow, reentryTrackNameShow, transferTrackNameShow }));
|
||||
})
|
||||
}
|
||||
|
||||
//停车点
|
||||
let destCodeShow = this.nameLevels.indexOf(10) !== -1 ? true : false;
|
||||
let stopPointList = this.$store.getters['map/stopPointList'];
|
||||
if (stopPointList && stopPointList.length > 0) {
|
||||
stopPointList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { destCodeShow }));
|
||||
})
|
||||
}
|
||||
|
||||
//车站
|
||||
let kmPostShow = this.nameLevels.indexOf(12) !== -1 ? true : false;
|
||||
let stationList = this.$store.getters['map/stationList'];
|
||||
if (stationList && stationList.length > 0) {
|
||||
stationList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { kmPostShow })); //公里标
|
||||
})
|
||||
}
|
||||
|
||||
this.$store.dispatch('map/updateMapDevices', deviceList);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -1,192 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="ningbo-01__systerm view-train-id"
|
||||
title="列车识别号显示设置"
|
||||
:visible.sync="show"
|
||||
width="420px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="padding: 10px 20px; border: 1px double lightgray;">
|
||||
<span class="base-label">计划车显示模式</span>
|
||||
<el-radio-group v-model="planMode">
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-radio :label="1">表号+车次号</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-radio :label="2">表号+车组号</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-radio :label="3">目的地号+车次号</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-radio :label="4">目的地号+车组号</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-radio :label="5">目的地号+表号+车次号</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-radio :label="6">目的地号+表号+车组号</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div style="padding: 10px 20px; border: 1px double lightgray; margin: 20px 0px;">
|
||||
<span class="base-label">头码车显示模式</span>
|
||||
<el-radio-group v-model="headMode">
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-radio :label="3">目的地号+车次号</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="8">
|
||||
<el-radio :label="4">目的地号+车组号</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div style="padding: 10px 20px; border: 1px double lightgray;">
|
||||
<span class="base-label">字体大小</span>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input v-model="fontSize" size="small" min="16" max="99" />
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="1">
|
||||
<span style="height:32px; line-height:32px;">(范围:16-99)</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="6" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="8">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'ViewTrainId',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: null,
|
||||
operation: '',
|
||||
planMode: 5,
|
||||
headMode: 5,
|
||||
fontSize: 16
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.setTrainDispaly();
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
|
||||
// 非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
over: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation,
|
||||
val: [this.planMode, this.headMode, this.fontSize].join('::')
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.setTrainDispaly();
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
setTrainDispaly() {
|
||||
const updatList = [];
|
||||
const trainList = this.$store.getters['training/viewTrainList']();
|
||||
if (trainList && trainList.length > 0) {
|
||||
const nameFormat = this.trainNameFormatBy(this.planMode);
|
||||
const nameFontSize = this.fontSize;
|
||||
updatList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameFormat, nameFontSize })); // 车次窗
|
||||
});
|
||||
|
||||
this.$store.dispatch('map/updateMapDevices', updatList);
|
||||
}
|
||||
},
|
||||
trainNameFormatBy(mode) {
|
||||
switch (mode.toString()) {
|
||||
case '1': return 'serviceNumber:tripNumber'; // 表号+车次号
|
||||
case '2': return 'serviceNumber:groupNumber'; // 表号+车组号
|
||||
case '3': return 'targetCode:tripNumber'; // 目的地号+车次号
|
||||
case '4': return 'targetCode:groupNumber'; // 目的地号+车组号
|
||||
case '5': return 'targetCode:serviceNumber:tripNumber'; // 目的地号+表号+车次号
|
||||
case '6': return 'targetCode:serviceNumber:groupNumber'; // 目的地号+表号+车组号
|
||||
}
|
||||
return ''; // 无格式类型
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -91,7 +91,11 @@ export default {
|
||||
/** 取消联锁自动触发 */
|
||||
CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER: {value:'Signal_Cancel_CI_Auto_Trigger', label: '取消联锁自动触发'},
|
||||
/** 查询进路状态 */
|
||||
CMD_SIGNAL_DETAIL: {value:'Signal_Detail', label: '查询进路状态'}
|
||||
CMD_SIGNAL_DETAIL: {value:'Signal_Detail', label: '查询进路状态'},
|
||||
/** 设置自动折返 */
|
||||
CMD_SIGNAL_SET_AUTO_TURN_BACK: {value: 'Signal_Set_Auto_Turn_Back', label: '设置自动折返'},
|
||||
/** 取消自动折返 */
|
||||
CMD_SIGNAL_CANCEL_AUTO_TURN_BACK: {value: 'Signal_Cancel_Auto_Turn_Back', label: '取消自动折返'}
|
||||
},
|
||||
|
||||
// 物理区段操作
|
||||
|
@ -196,7 +196,8 @@ const map = {
|
||||
trainDetails: null, // 地图'列车详情'显示
|
||||
deleteCount: 0, // 绘图快捷删除标识
|
||||
updateCount: 0, // 绘图快捷修改标识
|
||||
mousemove: 0 // 实训战场图移动标识
|
||||
mousemove: 0, // 实训战场图移动标识
|
||||
version: '' // 地图版本
|
||||
},
|
||||
|
||||
getters: {
|
||||
@ -255,7 +256,7 @@ const map = {
|
||||
},
|
||||
version: (state) => {
|
||||
if (state.map) {
|
||||
return state.map.version;
|
||||
return state.version;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@ -637,6 +638,9 @@ const map = {
|
||||
},
|
||||
updateRouteState: (state, status) => {
|
||||
state.routeData[status.code] = deepAssign(state.routeData[status.code], status);
|
||||
},
|
||||
setMapVersion:(state, version) => {
|
||||
state.version = version;
|
||||
}
|
||||
},
|
||||
|
||||
@ -784,6 +788,9 @@ const map = {
|
||||
|
||||
setMousemove: ({ commit }) => {
|
||||
commit('setMousemove');
|
||||
},
|
||||
setMapVersion: ({commit}, version) => {
|
||||
commit('setMapVersion', version);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,10 +3,10 @@ export function getBaseUrl() {
|
||||
let BASE_API;
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
BASE_API = 'http://192.168.3.41:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
||||
// BASE_API = 'http://b29z135112.zicp.vip';
|
||||
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
|
||||
|
@ -51,6 +51,7 @@ export function loadNewMapDataByGroup(group) {
|
||||
store.dispatch('map/setRouteData', routeData);
|
||||
const mapConfig = resp.data.configVO;
|
||||
store.dispatch('map/setMapConfig', mapConfig);
|
||||
store.dispatch('map/setMapVersion', resp.data.version);
|
||||
}).catch(error => {
|
||||
reject(error);
|
||||
});
|
||||
|
@ -4,7 +4,8 @@
|
||||
<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" />
|
||||
<show-mode v-if="isDesign" :local-station-show="handleDataLoaded " @setShowMode="setShowMode" />
|
||||
<switch-station v-show="isDesign && (showMode === '03') && localStationShow" ref="switchStation" :concentration-station-list="concentrationStationList" @setShowStation="setShowStation" />
|
||||
<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`)">
|
||||
@ -36,6 +37,7 @@ import localStore from 'storejs';
|
||||
import Jlmap from '@/jmapNew/map';
|
||||
import ZoomBox from './pendant/zoom';
|
||||
import ShowMode from './pendant/showMode';
|
||||
import SwitchStation from './pendant/switchStation';
|
||||
import ProgressBar from '@/views/components/progressBar/index';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { TrainingMode } from '@/scripts/ConstDic';
|
||||
@ -47,7 +49,8 @@ export default {
|
||||
components: {
|
||||
ZoomBox,
|
||||
ProgressBar,
|
||||
ShowMode
|
||||
ShowMode,
|
||||
SwitchStation
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -62,7 +65,11 @@ export default {
|
||||
y: 0
|
||||
},
|
||||
sectionActive: false,
|
||||
operate: null
|
||||
operate: null,
|
||||
concentrationStationList: [],
|
||||
showMode: '03',
|
||||
localStationShow: false,
|
||||
previewOrMapDraw: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -159,12 +166,9 @@ export default {
|
||||
// 默认个人地图绘制可以滚轮放大缩小 其他地图显示不允许此操作
|
||||
const path = window.location.href;
|
||||
const mouseWheelFlag = true;
|
||||
let previewOrMapDraw = false;
|
||||
// if (path.includes('design/userlist/map/draw') || path.includes('design/usermap/map/draw')) {
|
||||
// mouseWheelFlag = true;
|
||||
// }
|
||||
this.previewOrMapDraw = false;
|
||||
if (path.indexOf('map/draw') !== -1 || path.indexOf('mapPreviewNew') !== -1) {
|
||||
previewOrMapDraw = true;
|
||||
this.previewOrMapDraw = true;
|
||||
}
|
||||
const prdType = this.$route.query.prdType;
|
||||
Vue.prototype.$theme = new Theme();
|
||||
@ -183,7 +187,7 @@ export default {
|
||||
},
|
||||
showConfig: {
|
||||
prdType: prdType,
|
||||
previewOrMapDraw: previewOrMapDraw,
|
||||
previewOrMapDraw: this.previewOrMapDraw,
|
||||
showMode: '03'
|
||||
},
|
||||
methods: {
|
||||
@ -227,6 +231,18 @@ export default {
|
||||
// 地图数据加载完成
|
||||
handleDataLoaded() {
|
||||
this.$store.dispatch('map/mapDataLoaded');
|
||||
const concentrationStationList = [];
|
||||
this.$store.state.map.map.stationList.forEach(item => {
|
||||
if (item.centralized) {
|
||||
concentrationStationList.push({value: item.code, name: item.name});
|
||||
}
|
||||
});
|
||||
this.concentrationStationList = concentrationStationList;
|
||||
const lineCode = this.$store.state.map.map.skinVO.code;
|
||||
if (Vue.prototype.$theme) {
|
||||
this.localStationShow = Vue.prototype.$theme._localShowMode[lineCode] === 'ecStation';
|
||||
}
|
||||
this.$store.dispatch('map/setTrainWindowShow', this.previewOrMapDraw);
|
||||
},
|
||||
// 地图视图加载完成
|
||||
handleViewLoaded() {
|
||||
@ -330,10 +346,30 @@ export default {
|
||||
},
|
||||
// 切换现地行调显示界面(绘图和预览页面下)
|
||||
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];
|
||||
if (this.showMode !== showMode) {
|
||||
this.setShowStation('');
|
||||
this.$refs.switchStation.inintShowStation();
|
||||
}
|
||||
this.showMode = showMode;
|
||||
const nameList = Object.keys(this.$store.state.map.map);
|
||||
let list = [];
|
||||
nameList.forEach(item => {
|
||||
if (item !== 'skinVO') {
|
||||
list = [...list, ...this.$store.state.map.map[item]];
|
||||
}
|
||||
});
|
||||
this.$jlmap.updateShowMode(list, showMode);
|
||||
},
|
||||
setShowStation(stationCode) {
|
||||
const nameList = Object.keys(this.$store.state.map.map);
|
||||
let list = [];
|
||||
nameList.forEach(item => {
|
||||
if (item !== 'skinVO') {
|
||||
list = [...list, ...this.$store.state.map.map[item]];
|
||||
}
|
||||
});
|
||||
this.$jlmap.updateShowStation(list, stationCode);
|
||||
this.setCenter(stationCode);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -8,10 +8,18 @@
|
||||
<script>
|
||||
export default {
|
||||
name: 'ShowMode',
|
||||
props: {
|
||||
localStationShow: {
|
||||
type: String,
|
||||
default() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
offsetY: 15,
|
||||
offsetX: 20,
|
||||
offsetX: 150,
|
||||
swch: '03',
|
||||
swchList: [
|
||||
{ value: '03', name: '现地' },
|
||||
@ -27,6 +35,9 @@ export default {
|
||||
},
|
||||
'$route' () {
|
||||
this.setOffsetX();
|
||||
},
|
||||
localStationShow() {
|
||||
this.setOffsetX();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -54,12 +65,25 @@ export default {
|
||||
},
|
||||
setOffsetX() {
|
||||
if (this.$route.path.indexOf('mapPreviewNew') !== -1) {
|
||||
this.offsetX = 20;
|
||||
this.offsetX = this.localStationShow ? 150 : 20;
|
||||
} else if (this.$route.path.indexOf('map/draw') !== -1) {
|
||||
this.offsetX = 140;
|
||||
this.offsetX = this.localStationShow ? 270 : 140;
|
||||
}
|
||||
},
|
||||
switchMode(val) {
|
||||
if (val === '03' && this.localStationShow) {
|
||||
if (this.$route.path.indexOf('mapPreviewNew') !== -1) {
|
||||
this.offsetX = 150;
|
||||
} else if (this.$route.path.indexOf('map/draw') !== -1) {
|
||||
this.offsetX = 270;
|
||||
}
|
||||
} else {
|
||||
if (this.$route.path.indexOf('mapPreviewNew') !== -1) {
|
||||
this.offsetX = 20;
|
||||
} else if (this.$route.path.indexOf('map/draw') !== -1) {
|
||||
this.offsetX = 140;
|
||||
}
|
||||
}
|
||||
this.$emit('setShowMode', val);
|
||||
}
|
||||
}
|
||||
|
117
src/views/newMap/jlmapNew/pendant/switchStation.vue
Normal file
117
src/views/newMap/jlmapNew/pendant/switchStation.vue
Normal file
@ -0,0 +1,117 @@
|
||||
<template>
|
||||
<div class="zoom-box" :style="{top: offsetY+'px', right: offsetX+ 'px'}">
|
||||
<el-select v-model="showStation" size="small" :placeholder="$t('display.schema.selectProduct')" @change="switchMode">
|
||||
<el-option v-for="item in stationList" :key="item.value" :label="item.name" :value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'SwitchStation',
|
||||
props: {
|
||||
concentrationStationList: {
|
||||
type: String,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
offsetY: 15,
|
||||
offsetX: 20,
|
||||
showStation: '',
|
||||
stationList: [
|
||||
{ value: '', name: '全部' }
|
||||
]
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$store.state.config.menuBarLoadedCount': function (val) {
|
||||
this.$nextTick(() => {
|
||||
this.setPosition();
|
||||
});
|
||||
},
|
||||
'$route' () {
|
||||
this.setOffsetX();
|
||||
},
|
||||
concentrationStationList(val) {
|
||||
this.stationList = [...this.stationList, ...val];
|
||||
}
|
||||
},
|
||||
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;
|
||||
}
|
||||
});
|
||||
},
|
||||
inintShowStation() {
|
||||
this.showStation = '';
|
||||
},
|
||||
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('setShowStation', 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>
|
@ -31,13 +31,15 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user