diff --git a/src/assets/ctc_icon/rpadd.png b/src/assets/ctc_icon/rpadd.png
new file mode 100644
index 000000000..8e1564bdf
Binary files /dev/null and b/src/assets/ctc_icon/rpadd.png differ
diff --git a/src/directive/dialogDrag/dialogDrag.js b/src/directive/dialogDrag/dialogDrag.js
index 36af40898..5443adb03 100644
--- a/src/directive/dialogDrag/dialogDrag.js
+++ b/src/directive/dialogDrag/dialogDrag.js
@@ -10,10 +10,12 @@ export default {
const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
dialogHeaderEl.onmousedown = (e) => {
- e.stopPropagation();
+ e.stopPropagation();
/** 鼠标按下,计算当前元素距离可视区的距离*/
const disX = e.clientX - dialogHeaderEl.offsetLeft;
const disY = e.clientY - dialogHeaderEl.offsetTop;
+ const oY = e.offsetY;
+ const bY = dialogHeaderEl.offsetHeight - e.offsetY;
/** 获取到的值带px 正则匹配替换*/
let styL, styT;
@@ -31,10 +33,18 @@ export default {
}
document.onmousemove = function (e) {
- e.stopPropagation();
+ e.preventDefault();
+ e.stopPropagation();
+ let cY = e.clientY;
+ if (cY < oY) {
+ cY = oY;
+ }
+ if (cY > document.body.clientHeight - bY) {
+ cY = document.body.clientHeight - bY;
+ }
/** 通过事件委托,计算移动的距离*/
const l = e.clientX - disX;
- const t = e.clientY - disY;
+ const t = cY - disY;
/** 移动当前元素*/
dragDom.style.left = `${l + styL}px`;
@@ -48,7 +58,7 @@ export default {
};
document.onmouseup = function () {
- e.stopPropagation();
+ e.stopPropagation();
document.onmousemove = null;
document.onmouseup = null;
};
diff --git a/src/jmapNew/config/skinCode/datie_jd1a.js b/src/jmapNew/config/skinCode/datie_jd1a.js
index b0ad9d229..e4244837c 100644
--- a/src/jmapNew/config/skinCode/datie_jd1a.js
+++ b/src/jmapNew/config/skinCode/datie_jd1a.js
@@ -88,8 +88,8 @@ class SkinCode extends defaultStyle {
communicationOccupiedColor: '#FF0000', // 区段通信车占用颜色 (红色)
unCommunicationOccupiedColor: '#FF0000', // 区段非通讯车占用颜色 (红色)
- routeLockColor: '#FFFFFF', // 区段进路锁定颜色 (白色)
- faultLockColor: '#006400', // 区段故障锁定颜色
+ routeLockColor: '#FFFFFF', // 区段进路锁定颜色 (白色)<------
+ faultLockColor: '#FF0000', // 区段故障锁定颜色 <----
undefinedColor: '#0071C1', // 区段未定义颜色
blockColor: '#00FF00', // 区段封锁颜色
@@ -533,7 +533,7 @@ class SkinCode extends defaultStyle {
},
jointImg: { // 道岔 A B C D四元素属性配置
trapezoidLength: 8, // 直角梯形元素默认长度
- faultStatus: true, // 挤岔表示
+ faultStatus: false, // 挤岔表示
fork: true, // 挤岔专用(如有挤岔操作 变为true)
forKColor: 'red' // 挤岔颜色 配合挤岔专用
},
@@ -546,17 +546,22 @@ class SkinCode extends defaultStyle {
rectLock: { // 矩形封锁框图形
rectWidth: 18, // 矩形框 宽高
rectBorderColor: '#fff', // 矩形边框颜色
- block: true, // 封锁显示
+ block: false, // 封锁显示
blockColor: 'red', // 封锁颜色
followName: true // 位置跟随名称确定
},
arcBlcok: { // 圆形封锁图形
- show: true, // 显示
+ show: false, // 显示
shapeR: 10,
arcBorderColor: 'red', // 默认边框颜色
locationColor: 'red', // 定位封锁颜色
- inversionColor: 'red' // 反位封锁颜色
- }
+ inversionColor: 'red' // 反位封锁颜色
+ },
+ switchDot: { // 岔心小圆点
+ show: true,
+ monoLockColor: '#ff0000', // 单锁 红色
+ lockColor: '#0000ff' // 单封 蓝色
+ },
};
this[deviceType.LcControl] = {
diff --git a/src/jmapNew/constant/deviceType.js b/src/jmapNew/constant/deviceType.js
index 9904005df..4d995bb06 100644
--- a/src/jmapNew/constant/deviceType.js
+++ b/src/jmapNew/constant/deviceType.js
@@ -51,15 +51,15 @@ const deviceType = {
DirectionRod: 'DirectionRod',
Responder: 'Responder',
SignalButton: 'SignalButton',
- PickArrow: 'PickArrow',
- DepartArrow: 'DepartArrow',
- Occlusion: 'Occlusion',
- Accident: 'Accident',
- Recovery: 'Recovery',
- PickAssist: 'PickAssist',
- DepartAssist: 'DepartAssist',
- TotalAssist: 'TotalAssist',
- AssistStatus: 'AssistStatus',
- SectionOccupied: 'SectionOccupied'
+ PickArrow: 'PickArrow',
+ DepartArrow: 'DepartArrow',
+ Occlusion: 'Occlusion',
+ Accident: 'Accident',
+ Recovery: 'Recovery',
+ PickAssist: 'PickAssist',
+ DepartAssist: 'DepartAssist',
+ TotalAssist: 'TotalAssist',
+ AssistStatus: 'AssistStatus',
+ SectionOccupied: 'SectionOccupied'
};
export default deviceType;
diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js
index 956be2648..d7e2b81c3 100644
--- a/src/jmapNew/map.js
+++ b/src/jmapNew/map.js
@@ -13,6 +13,7 @@ import { deepAssign } from '@/utils/index';
import * as adapter from '@/jmapNew/utils/adapter';
import store from '@/store/index';
import Vue from 'vue';
+// import {createDevice} from './parser/parser-graph';
const renderer = 'canvas';
const devicePixelRatio = 1;
@@ -95,7 +96,12 @@ class Jlmap {
return defaultStateDict;
}
-
+ updateTransform(scaling, origin) {
+ this.$options.scaleRate = scaling;
+ this.$options.offsetX = origin ? origin.x : 0;
+ this.$options.offsetY = origin ? origin.y : 0;
+ this.$painter.updateTransform({ scaleRate: scaling, offsetX: origin ? origin.x : 0, offsetY: origin ? origin.y : 0 });
+ }
setMap(map, mapDevice, logicData) {
// 保存皮肤类型
if (map.skinVO) {
@@ -406,6 +412,71 @@ class Jlmap {
});
this.$painter.$transformHandle.revisibleAll();
}
+ updatePicture(list = []) {
+ list.forEach(item => {
+ const device = this.mapDevice[item];
+ if (device && device._type !== deviceType.Switch && device._type !== deviceType.Train) {
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](item);
+ device._dispose = pictureDevice ? pictureDevice.pictureHide : false;
+ this.$painter.updatePicture(device);
+ try {
+ if (device._type === deviceType.Section && device.type === '03') {
+ this.mapDevice[device.switch.code]._dispose = pictureDevice ? pictureDevice.pictureHide : false;
+ this.computedSwitch(device.switch);
+ this.$painter.updatePicture(this.mapDevice[device.switch.code]);
+ }
+ } catch (e) { console.error(e); }
+ }
+ });
+ }
+ handleResetPoint(points) {
+ return (points[points.length - 1].x >= points[0].x);
+ }
+ computedSwitch(switchDevice) {
+ const cnodeSection = this.mapDevice[switchDevice.sectionACode];
+ const lnodeSection = this.mapDevice[switchDevice.sectionBCode];
+ const rnodeSection = this.mapDevice[switchDevice.sectionCCode];
+
+ if (cnodeSection && lnodeSection && rnodeSection) {
+ let sectionCStar, sectionCEnd;
+ const rnodeSectionPoint = rnodeSection.instance ? rnodeSection.instance.computedPoints : rnodeSection.points;
+ const cnodeSectionPoint = cnodeSection.instance ? cnodeSection.instance.computedPoints : cnodeSection.points;
+ if (this.handleResetPoint(rnodeSection.points)) {
+ sectionCStar = rnodeSectionPoint[rnodeSectionPoint.length - 2];
+ sectionCEnd = rnodeSectionPoint[1];
+ } else {
+ sectionCStar = rnodeSectionPoint[1];
+ sectionCEnd = rnodeSectionPoint[rnodeSectionPoint.length - 2];
+ }
+ let intersectionStar, intersectionEnd;
+ if (this.handleResetPoint(cnodeSection.points)) {
+ intersectionStar = cnodeSectionPoint[0];
+ intersectionEnd = cnodeSectionPoint[cnodeSectionPoint.length - 1];
+ } else {
+ intersectionStar = cnodeSectionPoint[cnodeSectionPoint.length - 1];
+ intersectionEnd = cnodeSectionPoint[0];
+ }
+ if (cnodeSection.points[0].x == lnodeSection.points[lnodeSection.points.length - 1].x && cnodeSection.points[0].y == lnodeSection.points[lnodeSection.points.length - 1].y) {
+ this.mapDevice[switchDevice.code].intersection = {
+ x: intersectionStar.x,
+ y: intersectionStar.y
+ };
+ this.mapDevice[switchDevice.code].skew = {
+ x: sectionCStar.x,
+ y: sectionCStar.y
+ };
+ } else if (cnodeSection.points[cnodeSection.points.length - 1].x == lnodeSection.points[0].x && cnodeSection.points[cnodeSection.points.length - 1].y == lnodeSection.points[0].y) {
+ this.mapDevice[switchDevice.code].intersection = {
+ x: intersectionEnd.x,
+ y: intersectionEnd.y
+ };
+ this.mapDevice[switchDevice.code].skew = {
+ x: sectionCEnd.x,
+ y: sectionCEnd.y
+ };
+ }
+ }
+ }
update(list = [], fetch = true) {
this.setUpdateMapDevice(list, fetch); // 增加一个 前数据 处理 为了在区段中 获取全部的 道岔信息
diff --git a/src/jmapNew/mouseController.js b/src/jmapNew/mouseController.js
index d38195a0d..533de5072 100644
--- a/src/jmapNew/mouseController.js
+++ b/src/jmapNew/mouseController.js
@@ -106,7 +106,6 @@ class MouseController extends Eventful {
this._x = e.offsetX;
this._y = e.offsetY;
-
if (e.which == 1) {
this._preventDefaultMouseMove && eventTool.stop(e.event);
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
@@ -251,11 +250,12 @@ class MouseController extends Eventful {
if (item.instance && item.instance._type == deviceType.Section) {
let deviceBoundingRect = {};
if (item.type == '04') {
+ const rect = item.instance.getNameBoundingRect();
deviceBoundingRect = {
- x1: item.namePosition.x,
- y1: item.namePosition.y,
- x2: item.namePosition.x,
- y2: item.namePosition.y
+ x1: rect.x,
+ y1: rect.y,
+ x2: rect.x + rect.width,
+ y2:rect.y + rect.height
};
} else if (item.type == '05') {
const rect = item.instance.getBoundingRect();
@@ -267,10 +267,10 @@ class MouseController extends Eventful {
};
} else {
deviceBoundingRect = {
- x1: item.points[0].x,
- y1: item.points[0].y,
- x2: item.points[item.points.length - 1].x,
- y2: item.points[item.points.length - 1].y
+ x1: item.instance.computedPoints[0].x,
+ y1: item.instance.computedPoints[0].y,
+ x2: item.instance.computedPoints[item.points.length - 1].x,
+ y2: item.instance.computedPoints[item.points.length - 1].y
};
}
if (this.whetherInclude(boundingRect, deviceBoundingRect )) {
@@ -288,25 +288,25 @@ class MouseController extends Eventful {
}
} else if (item.instance && item.instance._type == deviceType.Signal) {
const deviceBoundingRect = {
- x1: item.position.x,
- y1: item.position.y,
- x2: item.position.x,
- y2: item.position.y
+ x1: item.instance.computedPosition.x,
+ y1: item.instance.computedPosition.y,
+ x2: item.instance.computedPosition.x,
+ y2: item.instance.computedPosition.y
};
if (this.whetherInclude(boundingRect, deviceBoundingRect )) {
includeDeviceList.push(item);
}
} else if (item.instance && item.instance._type == deviceType.Psd) {
const deviceBoundingRect = {
- x1: item.position.x,
- y1: item.position.y,
- x2: item.position.x,
- y2: item.position.y
+ x1: item.instance.computedPosition.x,
+ y1: item.instance.computedPosition.y,
+ x2: item.instance.computedPosition.x,
+ y2: item.instance.computedPosition.y
};
if (this.whetherInclude(boundingRect, deviceBoundingRect )) {
includeDeviceList.push(item);
- }
- } else if (item.instance && item.instance._type !== deviceType.TrainWindow && item.instance._type !== deviceType.CheckBox && item.instance._type !== deviceType.Train) {
+ } // item.instance._type !== deviceType.TrainWindow &&
+ } else if (item.instance && item.instance._type !== deviceType.CheckBox && item.instance._type !== deviceType.Train) {
const rect = item.instance.getBoundingRect();
const deviceBoundingRect = {
x1: rect.x,
diff --git a/src/jmapNew/options.js b/src/jmapNew/options.js
index c2b07e786..b8840f9a2 100644
--- a/src/jmapNew/options.js
+++ b/src/jmapNew/options.js
@@ -2,7 +2,7 @@ class Options {
constructor(opts, trigger) {
this.scaleIndex = 0;
this.scaleList = [
- 0.2, 0.4, 0.6, 0.8, 0.9,
+ 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
1, 1.2, 1.4, 1.6, 1.8,
2, 2.2, 2.4, 2.6, 2.8,
3, 3.2, 3.4, 3.6, 3.8,
diff --git a/src/jmapNew/painter.js b/src/jmapNew/painter.js
index a642e3474..396e9ae30 100644
--- a/src/jmapNew/painter.js
+++ b/src/jmapNew/painter.js
@@ -162,7 +162,22 @@ class Painter {
this.$transformHandleScreen.transformView(device.instance);
}
}
-
+ /** 画面更新 */
+ updatePicture(device) {
+ if (device) {
+ try {
+ if (device._dispose) {
+ this.delete(device);
+ } else {
+ device.instance && this.mapInstanceLevel[device._type].remove(device.instance);
+ device.instance = null;
+ this.add(device);
+ }
+ } catch (err) {
+ console.error(err);
+ }
+ }
+ }
/**
* 更新视图
* @param {*} device
@@ -182,6 +197,7 @@ class Painter {
}
} catch (err) {
console.error(err);
+ console.log(device, 'device');
}
}
}
diff --git a/src/jmapNew/parser/parser-graph.js b/src/jmapNew/parser/parser-graph.js
index ec111bc16..141877f3b 100644
--- a/src/jmapNew/parser/parser-graph.js
+++ b/src/jmapNew/parser/parser-graph.js
@@ -194,7 +194,6 @@ export function parser(data, skinCode, showConfig) {
// y: rnodeSection.points[1].y
};
}
-
const section = mapDevice[cnodeSection.parentCode];
if (section) {
mapDevice[elem.code].sectionName = section.name;
@@ -350,16 +349,16 @@ export function updateMapData(state, model) {
case deviceType.Axle: updateForList(model, state, 'indicatorLightList'); break;
case deviceType.SwitchFault: updateForList(model, state, 'indicatorLightList'); break;
case deviceType.IndicatorLight: updateForList(model, state, 'indicatorLightList'); break;
- case deviceType.PickArrow: updateForList(model, state, 'indicatorLightList');break;
- case deviceType.DepartArrow: updateForList(model, state, 'indicatorLightList'); break;
- case deviceType.Occlusion: updateForList(model, state, 'indicatorLightList'); break;
- case deviceType.Accident: updateForList(model, state, 'indicatorLightList'); break;
- case deviceType.Recovery: updateForList(model, state, 'indicatorLightList'); break;
- case deviceType.PickAssist: updateForList(model, state, 'indicatorLightList'); break;
- case deviceType.DepartAssist: updateForList(model, state, 'indicatorLightList'); break;
- case deviceType.TotalAssist: updateForList(model, state, 'indicatorLightList'); break;
- case deviceType.AssistStatus: updateForList(model, state, 'indicatorLightList'); break;
- case deviceType.SectionOccupied: updateForList(model, state, 'indicatorLightList'); break;
+ case deviceType.PickArrow: updateForList(model, state, 'indicatorLightList'); break;
+ case deviceType.DepartArrow: updateForList(model, state, 'indicatorLightList'); break;
+ case deviceType.Occlusion: updateForList(model, state, 'indicatorLightList'); break;
+ case deviceType.Accident: updateForList(model, state, 'indicatorLightList'); break;
+ case deviceType.Recovery: updateForList(model, state, 'indicatorLightList'); break;
+ case deviceType.PickAssist: updateForList(model, state, 'indicatorLightList'); break;
+ case deviceType.DepartAssist: updateForList(model, state, 'indicatorLightList'); break;
+ case deviceType.TotalAssist: updateForList(model, state, 'indicatorLightList'); break;
+ case deviceType.AssistStatus: updateForList(model, state, 'indicatorLightList'); break;
+ case deviceType.SectionOccupied: updateForList(model, state, 'indicatorLightList'); break;
case deviceType.SplitStation: updateForList(model, state, 'splitStationList'); break;
case deviceType.Arrow: updateForList(model, state, 'arrowList'); break;
case deviceType.Power: updateForList(model, state, 'powerLineList'); break;
diff --git a/src/jmapNew/shape/graph/Arrow/index.js b/src/jmapNew/shape/graph/Arrow/index.js
index 5d30765fe..1a916d3b7 100644
--- a/src/jmapNew/shape/graph/Arrow/index.js
+++ b/src/jmapNew/shape/graph/Arrow/index.js
@@ -8,6 +8,12 @@ export default class Arrow extends Group {
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ this.computedPosition = pictureDevice.position;
+ } else {
+ this.computedPosition = model.position;
+ }
this.z = 0;
this.model = model;
// this.style = style;
@@ -22,13 +28,13 @@ export default class Arrow extends Group {
z: this.z,
shape: {
points: [
- [model.position.x, model.position.y],
- [model.position.x + model.triangleLength, model.position.y - model.triangleHeight / 2],
- [model.position.x + model.triangleLength, model.position.y - model.lineWidth / 2],
- [model.position.x + model.length, model.position.y - model.lineWidth / 2],
- [model.position.x + model.length, model.position.y + model.lineWidth / 2],
- [model.position.x + model.triangleLength, model.position.y + model.lineWidth / 2],
- [model.position.x + model.triangleLength, model.position.y + model.triangleHeight / 2]
+ [this.computedPosition.x, this.computedPosition.y],
+ [this.computedPosition.x + model.triangleLength, this.computedPosition.y - model.triangleHeight / 2],
+ [this.computedPosition.x + model.triangleLength, this.computedPosition.y - model.lineWidth / 2],
+ [this.computedPosition.x + model.length, this.computedPosition.y - model.lineWidth / 2],
+ [this.computedPosition.x + model.length, this.computedPosition.y + model.lineWidth / 2],
+ [this.computedPosition.x + model.triangleLength, this.computedPosition.y + model.lineWidth / 2],
+ [this.computedPosition.x + model.triangleLength, this.computedPosition.y + model.triangleHeight / 2]
]
},
style: {
diff --git a/src/jmapNew/shape/graph/AutoTurnBack/EMouse.js b/src/jmapNew/shape/graph/AutoTurnBack/EMouse.js
index c0eb1a7ac..c1311fac6 100644
--- a/src/jmapNew/shape/graph/AutoTurnBack/EMouse.js
+++ b/src/jmapNew/shape/graph/AutoTurnBack/EMouse.js
@@ -13,8 +13,8 @@ export default class EMouse extends Group {
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,
+ x: this.device.computedPosition.x,
+ y: this.device.computedPosition.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.fontFamily,
diff --git a/src/jmapNew/shape/graph/AutoTurnBack/index.js b/src/jmapNew/shape/graph/AutoTurnBack/index.js
index 58e065fce..067a80cc1 100644
--- a/src/jmapNew/shape/graph/AutoTurnBack/index.js
+++ b/src/jmapNew/shape/graph/AutoTurnBack/index.js
@@ -16,6 +16,12 @@ export default class AutoTurnBack extends Group {
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ this.computedPosition = pictureDevice.position;
+ } else {
+ this.computedPosition = model.position;
+ }
this.model = model;
this.style = style;
this.isBigScreen = false;
@@ -31,8 +37,8 @@ export default class AutoTurnBack extends Group {
zlevel: this.zlevel,
z: this.z + 1,
shape: {
- cx: model.position.x,
- cy: model.position.y,
+ cx: this.computedPosition.x,
+ cy: this.computedPosition.y,
r: this.style.AutoTurnBack.lamp.radiusR
},
style: {
@@ -47,8 +53,8 @@ export default class AutoTurnBack extends Group {
z: this.z + 1,
position: [0, 0],
style: {
- x: model.position.x,
- y: model.position.y + this.style.AutoTurnBack.lamp.radiusR + this.style.AutoTurnBack.text.distance,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y + this.style.AutoTurnBack.lamp.radiusR + this.style.AutoTurnBack.text.distance,
fontWeight: this.style.AutoTurnBack.text.fontWeight,
fontSize: this.style.AutoTurnBack.text.fontSize,
fontFamily: this.style.fontFamily,
@@ -66,8 +72,8 @@ export default class AutoTurnBack extends Group {
z: this.z,
position: [0, 0],
style: {
- x: model.position.x,
- y: model.position.y + this.style.AutoTurnBack.lamp.radiusR + this.style.AutoTurnBack.subtitleText.distance,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y + this.style.AutoTurnBack.lamp.radiusR + this.style.AutoTurnBack.subtitleText.distance,
fontWeight: this.style.AutoTurnBack.subtitleText.fontWeight,
fontSize: this.style.AutoTurnBack.subtitleText.fontSize,
fontFamily: this.style.fontFamily,
@@ -185,6 +191,6 @@ export default class AutoTurnBack extends Group {
this.hideMode();
}
getAnchorPoint() {
- return this.model.position;
+ return this.computedPosition;
}
}
diff --git a/src/jmapNew/shape/graph/AutomacticRoute/EMouse.js b/src/jmapNew/shape/graph/AutomacticRoute/EMouse.js
index 2cf5d2e38..d945a85c3 100644
--- a/src/jmapNew/shape/graph/AutomacticRoute/EMouse.js
+++ b/src/jmapNew/shape/graph/AutomacticRoute/EMouse.js
@@ -13,8 +13,8 @@ export default class EMouse extends Group {
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,
+ x: this.device.computedPosition.x,
+ y: this.device.computedPosition.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.fontFamily,
diff --git a/src/jmapNew/shape/graph/AutomacticRoute/index.js b/src/jmapNew/shape/graph/AutomacticRoute/index.js
index 169fd6efe..c768ff9a1 100644
--- a/src/jmapNew/shape/graph/AutomacticRoute/index.js
+++ b/src/jmapNew/shape/graph/AutomacticRoute/index.js
@@ -15,6 +15,12 @@ export default class AutomacticRoute extends Group {
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ this.computedPosition = pictureDevice.position;
+ } else {
+ this.computedPosition = model.position;
+ }
this.model = model;
this.style = style;
this.isShowShape = true;
@@ -30,8 +36,8 @@ export default class AutomacticRoute extends Group {
zlevel: this.zlevel,
z: this.z,
shape: {
- cx: model.position.x,
- cy: model.position.y,
+ cx: this.computedPosition.x,
+ cy: this.computedPosition.y,
r: this.style.AutomaticRoute.lamp.radiusR
},
style: {
@@ -46,8 +52,8 @@ export default class AutomacticRoute extends Group {
z: this.z,
position: [0, 0],
style: {
- x: model.position.x,
- y: model.position.y + this.style.AutomaticRoute.lamp.radiusR + this.style.AutomaticRoute.text.distance,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y + this.style.AutomaticRoute.lamp.radiusR + this.style.AutomaticRoute.text.distance,
fontWeight: this.style.AutomaticRoute.text.fontWeight,
fontSize: this.style.AutomaticRoute.text.fontSize,
fontFamily: this.style.fontFamily,
@@ -65,8 +71,8 @@ export default class AutomacticRoute extends Group {
z: this.z,
position: [0, 0],
style: {
- x: model.position.x,
- y: model.position.y + this.style.AutomaticRoute.lamp.radiusR + this.style.AutomaticRoute.subtitleText.distance,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y + this.style.AutomaticRoute.lamp.radiusR + this.style.AutomaticRoute.subtitleText.distance,
fontWeight: this.style.AutomaticRoute.subtitleText.fontWeight,
fontSize: this.style.AutomaticRoute.subtitleText.fontSize,
fontFamily: this.style.fontFamily,
@@ -140,6 +146,6 @@ export default class AutomacticRoute extends Group {
this.subtitleText && this.subtitleText.show();
}
getAnchorPoint() {
- return this.model.position;
+ return this.computedPosition;
}
}
diff --git a/src/jmapNew/shape/graph/AxleReset/EMouse.js b/src/jmapNew/shape/graph/AxleReset/EMouse.js
index 26a5b406f..3dfd09e38 100644
--- a/src/jmapNew/shape/graph/AxleReset/EMouse.js
+++ b/src/jmapNew/shape/graph/AxleReset/EMouse.js
@@ -13,8 +13,8 @@ export default class EMouse extends Group {
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,
+ x: this.device.computedPosition.x,
+ y: this.device.computedPosition.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.fontFamily,
diff --git a/src/jmapNew/shape/graph/AxleReset/index.js b/src/jmapNew/shape/graph/AxleReset/index.js
index 8e4117910..b735bb71f 100644
--- a/src/jmapNew/shape/graph/AxleReset/index.js
+++ b/src/jmapNew/shape/graph/AxleReset/index.js
@@ -15,6 +15,12 @@ export default class AxleReset extends Group {
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ this.computedPosition = pictureDevice.position;
+ } else {
+ this.computedPosition = model.position;
+ }
this.model = model;
this.style = style;
this.isShowShape = true;
@@ -30,8 +36,8 @@ export default class AxleReset extends Group {
zlevel: this.zlevel,
z: this.z,
shape: {
- cx: model.position.x,
- cy: model.position.y,
+ cx: this.computedPosition.x,
+ cy: this.computedPosition.y,
r: this.style.AxleReset.lamp.radiusR
},
style: {
@@ -47,8 +53,8 @@ export default class AxleReset extends Group {
z: this.z,
position: [0, 0],
style: {
- x: model.position.x,
- y: model.position.y + this.style.AxleReset.lamp.radiusR + this.style.AxleReset.text.distance,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y + this.style.AxleReset.lamp.radiusR + this.style.AxleReset.text.distance,
fontWeight: this.style.AxleReset.text.fontWeight,
fontSize: this.style.AxleReset.text.fontSize,
fontFamily: this.style.fontFamily,
@@ -66,8 +72,8 @@ export default class AxleReset extends Group {
z: this.z,
position: [0, 0],
style: {
- x: model.position.x,
- y: model.position.y + this.style.AxleReset.lamp.radiusR + this.style.AxleReset.subtitleText.distance,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y + this.style.AxleReset.lamp.radiusR + this.style.AxleReset.subtitleText.distance,
fontWeight: this.style.AxleReset.subtitleText.fontWeight,
fontSize: this.style.AxleReset.subtitleText.fontSize,
fontFamily: this.style.fontFamily,
@@ -141,6 +147,6 @@ export default class AxleReset extends Group {
}
}
getAnchorPoint() {
- return this.model.position;
+ return this.computedPosition;
}
}
diff --git a/src/jmapNew/shape/graph/DirectionRod/index.js b/src/jmapNew/shape/graph/DirectionRod/index.js
index 7bf9589fe..9a86e8206 100644
--- a/src/jmapNew/shape/graph/DirectionRod/index.js
+++ b/src/jmapNew/shape/graph/DirectionRod/index.js
@@ -10,6 +10,12 @@ export default class DirectionRod extends Group {
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ this.computedPosition = pictureDevice.position;
+ } else {
+ this.computedPosition = model.position;
+ }
this.model = model;
this.style = style;
// this.isShowShape = true;
@@ -23,17 +29,17 @@ export default class DirectionRod extends Group {
this.rod = new Polygon({
zlevel: this.zlevel,
z: this.z,
- origin: [model.position.x + (style.DirectionRod.rodLength / 2), model.position.y],
+ origin: [this.computedPosition.x + (style.DirectionRod.rodLength / 2), this.computedPosition.y],
rotation: model.right ? Math.PI : 0,
shape: {
points: [
- [model.position.x, model.position.y],
- [model.position.x + style.DirectionRod.triangleLength, model.position.y + (style.DirectionRod.triangleHeight / 2)],
- [model.position.x + style.DirectionRod.triangleLength, model.position.y + (style.DirectionRod.rodHeight / 2)],
- [model.position.x + style.DirectionRod.rodLength, model.position.y + (style.DirectionRod.rodHeight / 2)],
- [model.position.x + style.DirectionRod.rodLength, model.position.y - (style.DirectionRod.rodHeight / 2)],
- [model.position.x + style.DirectionRod.triangleLength, model.position.y - (style.DirectionRod.rodHeight / 2)],
- [model.position.x + style.DirectionRod.triangleLength, model.position.y - (style.DirectionRod.triangleHeight / 2)]
+ [this.computedPosition.x, this.computedPosition.y],
+ [this.computedPosition.x + style.DirectionRod.triangleLength, this.computedPosition.y + (style.DirectionRod.triangleHeight / 2)],
+ [this.computedPosition.x + style.DirectionRod.triangleLength, this.computedPosition.y + (style.DirectionRod.rodHeight / 2)],
+ [this.computedPosition.x + style.DirectionRod.rodLength, this.computedPosition.y + (style.DirectionRod.rodHeight / 2)],
+ [this.computedPosition.x + style.DirectionRod.rodLength, this.computedPosition.y - (style.DirectionRod.rodHeight / 2)],
+ [this.computedPosition.x + style.DirectionRod.triangleLength, this.computedPosition.y - (style.DirectionRod.rodHeight / 2)],
+ [this.computedPosition.x + style.DirectionRod.triangleLength, this.computedPosition.y - (style.DirectionRod.triangleHeight / 2)]
]
},
style: {
@@ -44,8 +50,8 @@ export default class DirectionRod extends Group {
zlevel: this.zlevel,
z: this.z,
style: {
- x: model.position.x + style.DirectionRod.fontOffsetX,
- y: model.position.y + style.DirectionRod.fontOffsetY,
+ x: this.computedPosition.x + style.DirectionRod.fontOffsetX,
+ y: this.computedPosition.y + style.DirectionRod.fontOffsetY,
fontWeight: 'normal',
fontSize: style.DirectionRod.fontSize,
fontFamily: this.style.fontFamily,
diff --git a/src/jmapNew/shape/graph/FloodGate/index.js b/src/jmapNew/shape/graph/FloodGate/index.js
index 699031542..7337f3d21 100644
--- a/src/jmapNew/shape/graph/FloodGate/index.js
+++ b/src/jmapNew/shape/graph/FloodGate/index.js
@@ -12,6 +12,12 @@ export default class FloodGate extends Group {
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ this.computedPosition = pictureDevice.position;
+ } else {
+ this.computedPosition = model.position;
+ }
this.z = model.z;
this.model = model;
this.style = style;
@@ -26,8 +32,8 @@ export default class FloodGate extends Group {
zlevel: this.zlevel,
z: this.z,
shape: {
- x: this.model.position.x,
- y: this.model.position.y,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y,
width: this.model.width,
height: this.model.height
},
@@ -55,6 +61,6 @@ export default class FloodGate extends Group {
createMouseEvent() {
}
getAnchorPoint() {
- return this.model.position;
+ return this.computedPosition;
}
}
diff --git a/src/jmapNew/shape/graph/GuideLock/EMouse.js b/src/jmapNew/shape/graph/GuideLock/EMouse.js
index 4bdbe8731..3c4551ead 100644
--- a/src/jmapNew/shape/graph/GuideLock/EMouse.js
+++ b/src/jmapNew/shape/graph/GuideLock/EMouse.js
@@ -13,8 +13,8 @@ export default class EMouse extends Group {
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,
+ x: this.device.computedPosition.x,
+ y: this.device.computedPosition.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.fontFamily,
diff --git a/src/jmapNew/shape/graph/GuideLock/index.js b/src/jmapNew/shape/graph/GuideLock/index.js
index 7a83cb8e1..909bd6b41 100644
--- a/src/jmapNew/shape/graph/GuideLock/index.js
+++ b/src/jmapNew/shape/graph/GuideLock/index.js
@@ -15,6 +15,12 @@ export default class GuideLock extends Group {
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ this.computedPosition = pictureDevice.position;
+ } else {
+ this.computedPosition = model.position;
+ }
this.model = model;
this.style = style;
this.create();
@@ -29,8 +35,8 @@ export default class GuideLock extends Group {
zlevel: this.zlevel,
z: this.z,
shape: {
- cx: model.position.x,
- cy: model.position.y,
+ cx: this.computedPosition.x,
+ cy: this.computedPosition.y,
r: this.style.GuideLock.lamp.radiusR
},
style: {
@@ -45,8 +51,8 @@ export default class GuideLock extends Group {
z: this.z,
position: [0, 0],
style: {
- x: model.position.x,
- y: model.position.y + this.style.GuideLock.lamp.radiusR + this.style.GuideLock.text.distance,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y + this.style.GuideLock.lamp.radiusR + this.style.GuideLock.text.distance,
fontWeight: this.style.GuideLock.text.fontWeight,
fontSize: this.style.GuideLock.text.fontSize,
fontFamily: this.style.fontFamily,
@@ -64,8 +70,8 @@ export default class GuideLock extends Group {
z: this.z,
position: [0, 0],
style: {
- x: model.position.x,
- y: model.position.y + this.style.GuideLock.lamp.radiusR + this.style.GuideLock.subtitleText.distance,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y + this.style.GuideLock.lamp.radiusR + this.style.GuideLock.subtitleText.distance,
fontWeight: this.style.GuideLock.subtitleText.fontWeight,
fontSize: this.style.GuideLock.subtitleText.fontSize,
fontFamily: this.style.fontFamily,
@@ -146,6 +152,6 @@ export default class GuideLock extends Group {
}
}
getAnchorPoint() {
- return this.model.position;
+ return this.computedPosition;
}
}
diff --git a/src/jmapNew/shape/graph/LcControl/EMouse.js b/src/jmapNew/shape/graph/LcControl/EMouse.js
index 2cf5d2e38..d945a85c3 100644
--- a/src/jmapNew/shape/graph/LcControl/EMouse.js
+++ b/src/jmapNew/shape/graph/LcControl/EMouse.js
@@ -13,8 +13,8 @@ export default class EMouse extends Group {
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,
+ x: this.device.computedPosition.x,
+ y: this.device.computedPosition.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.fontFamily,
diff --git a/src/jmapNew/shape/graph/LcControl/index.js b/src/jmapNew/shape/graph/LcControl/index.js
index 015712294..df57ec78f 100644
--- a/src/jmapNew/shape/graph/LcControl/index.js
+++ b/src/jmapNew/shape/graph/LcControl/index.js
@@ -13,6 +13,12 @@ export default class LcControl extends Group {
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ this.computedPosition = pictureDevice.position;
+ } else {
+ this.computedPosition = model.position;
+ }
this.model = model;
this.style = style;
this.create();
@@ -27,8 +33,8 @@ export default class LcControl extends Group {
z: this.z,
arc: {
shape: {
- cx: model.position.x,
- cy: model.position.y,
+ cx: this.computedPosition.x,
+ cy: this.computedPosition.y,
r: this.style.LcControl.lamp.radiusR
},
subType: 'Control',
@@ -37,8 +43,8 @@ export default class LcControl extends Group {
},
text: {
position: [0, 0],
- x: model.position.x,
- y: model.position.y + this.style.LcControl.lamp.radiusR + this.style.LcControl.text.distance,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y + this.style.LcControl.lamp.radiusR + this.style.LcControl.text.distance,
fontWeight: this.style.LcControl.text.fontWeight,
fontSize: this.style.LcControl.text.fontSize,
fontFamily: this.style.fontFamily,
@@ -91,6 +97,6 @@ export default class LcControl extends Group {
return null;
}
getAnchorPoint() {
- return this.model.position;
+ return this.computedPosition;
}
}
diff --git a/src/jmapNew/shape/graph/LimitControl/EMouse.js b/src/jmapNew/shape/graph/LimitControl/EMouse.js
index c4c451e4b..55d1a36de 100644
--- a/src/jmapNew/shape/graph/LimitControl/EMouse.js
+++ b/src/jmapNew/shape/graph/LimitControl/EMouse.js
@@ -14,8 +14,8 @@ export default class EMouse extends Group {
z: this.device.z + 1,
position: [0, 0],
style: {
- x: this.device.model.position.x,
- y: this.device.model.position.y + this.device.style.LimitControl.lamp.radiusR + this.device.style.LimitControl.text.distance - 30,
+ x: this.device.computedPosition.x,
+ y: this.device.computedPosition.y + this.device.style.LimitControl.lamp.radiusR + this.device.style.LimitControl.text.distance - 30,
fontWeight: this.device.style.LimitControl.mouseOverStyle.fontWeight,
fontSize: this.device.style.LimitControl.mouseOverStyle.fontSize,
fontFamily: this.device.style.fontFormat,
diff --git a/src/jmapNew/shape/graph/LimitControl/index.js b/src/jmapNew/shape/graph/LimitControl/index.js
index d39da72f8..1ebe10266 100644
--- a/src/jmapNew/shape/graph/LimitControl/index.js
+++ b/src/jmapNew/shape/graph/LimitControl/index.js
@@ -13,6 +13,12 @@ export default class LimitControl extends Group {
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ this.computedPosition = pictureDevice.position;
+ } else {
+ this.computedPosition = model.position;
+ }
this.model = model;
this.style = style;
this.z = 20;
@@ -27,8 +33,8 @@ export default class LimitControl extends Group {
z: this.z,
arc: {
shape: {
- cx: model.position.x,
- cy: model.position.y,
+ cx: this.computedPosition.x,
+ cy: this.computedPosition.y,
r: this.style.LimitControl.lamp.radiusR
},
subType: 'Control',
@@ -39,8 +45,8 @@ export default class LimitControl extends Group {
},
text: {
position: [0, 0],
- x: model.position.x,
- y: model.position.y + this.style.LimitControl.lamp.radiusR + this.style.LimitControl.text.distance,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y + this.style.LimitControl.lamp.radiusR + this.style.LimitControl.text.distance,
fontWeight: this.style.LimitControl.text.fontWeight,
fontSize: this.style.LimitControl.text.fontSize,
fontFamily: this.style.fontFamily,
@@ -95,6 +101,6 @@ export default class LimitControl extends Group {
return null;
}
getAnchorPoint() {
- return this.model.position;
+ return this.computedPosition;
}
}
diff --git a/src/jmapNew/shape/graph/Line/index.js b/src/jmapNew/shape/graph/Line/index.js
index d4a77116e..8403236b4 100644
--- a/src/jmapNew/shape/graph/Line/index.js
+++ b/src/jmapNew/shape/graph/Line/index.js
@@ -8,6 +8,18 @@ export default class Line2 extends Group {
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ const points = [];
+ const offsetX = pictureDevice.position.x - model.points[0].x;
+ const offsetY = pictureDevice.position.y - model.points[0].y;
+ model.points.forEach(point => {
+ points.push({x: point.x + offsetX, y: point.y + offsetY});
+ });
+ this.computePoints = points;
+ } else {
+ this.computePoints = model.points;
+ }
this.z = 0;
this.model = model;
this.style = style.Line;
@@ -17,10 +29,10 @@ export default class Line2 extends Group {
create() {
const model = this.model;
- if (model && model.points.length > 1) {
+ if (this.computePoints.length > 1) {
const points = [];
const vicePoints = [];
- const modelPoints = model.points;
+ const modelPoints = this.computePoints;
const length = modelPoints.length;
const path = window.location.href;
if (model.type === '03' && !path.includes('/map/draw')) {
diff --git a/src/jmapNew/shape/graph/OutFrame/index.js b/src/jmapNew/shape/graph/OutFrame/index.js
index 228388f14..c52c80809 100644
--- a/src/jmapNew/shape/graph/OutFrame/index.js
+++ b/src/jmapNew/shape/graph/OutFrame/index.js
@@ -9,6 +9,12 @@ export default class OutFrame extends Group {
this._type = model._type;
this._code = model.code;
this.style = style;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ this.computedPosition = pictureDevice.position;
+ } else {
+ this.computedPosition = model.position;
+ }
this.zlevel = model.zlevel;
this.isBigScreen = false;
this.z = 0;
@@ -22,8 +28,8 @@ export default class OutFrame extends Group {
zlevel: this.zlevel,
z: this.z,
shape: {
- x: model.position.x - model.width / 2,
- y: model.position.y - model.height / 2,
+ x: this.computedPosition.x - model.width / 2,
+ y: this.computedPosition.y - model.height / 2,
width: model.width,
height: model.height
},
@@ -55,8 +61,8 @@ export default class OutFrame extends Group {
}
getAnchorPoint() {
return {
- x: this.model.position.x - this.model.width / 2,
- y: this.model.position.y - this.model.height / 2
+ x: this.computedPosition.x - this.model.width / 2,
+ y: this.computedPosition.y - this.model.height / 2
};
}
}
diff --git a/src/jmapNew/shape/graph/OverAp/index.js b/src/jmapNew/shape/graph/OverAp/index.js
index 7a30f8d92..ea1348341 100644
--- a/src/jmapNew/shape/graph/OverAp/index.js
+++ b/src/jmapNew/shape/graph/OverAp/index.js
@@ -9,6 +9,12 @@ export default class OverAp extends Group {
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ this.computedPoints = pictureDevice.position;
+ } else {
+ this.computedPoints = model.position;
+ }
this.model = model;
this.style = style;
this.z = 6;
@@ -19,14 +25,14 @@ export default class OverAp extends Group {
create() {
const model = this.model;
const style = this.style;
- if (model.points && style && style.Section) {
+ if (this.computedPoints && style && style.Section) {
this.text = new ETextName({
zlevel: this.zlevel,
z: this.z + 2,
style: this.style,
silent: false,
- x: model.points.x + 30,
- y: model.points.y - style.Section.line.width * 2,
+ x: this.computedPoints.x + 30,
+ y: this.computedPoints.y - style.Section.line.width * 2,
fontWeight: style.Section.name.fontWeight,
text: model.remainTime || 30,
textPosition: style.Section.name.textPosition,
@@ -59,8 +65,8 @@ export default class OverAp extends Group {
this.text && this.text.attr({
style: {
text: model.remainTime,
- x: model.points.x + offset,
- y: model.points.y - this.style.Section.line.width * 2
+ x: this.computedPoints.x + offset,
+ y: this.computedPoints.y - this.style.Section.line.width * 2
}
});
}
diff --git a/src/jmapNew/shape/graph/Power/index.js b/src/jmapNew/shape/graph/Power/index.js
index 508962d17..23c8c374f 100644
--- a/src/jmapNew/shape/graph/Power/index.js
+++ b/src/jmapNew/shape/graph/Power/index.js
@@ -10,6 +10,18 @@ export default class Line2 extends Group {
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ const points = [];
+ const offsetX = pictureDevice.position.x - model.points[0].x;
+ const offsetY = pictureDevice.position.y - model.points[0].y;
+ model.points.forEach(point => {
+ points.push({x: point.x + offsetX, y: point.y + offsetY});
+ });
+ this.computPoints = points;
+ } else {
+ this.computPoints = model.points;
+ }
this.z = 0;
this.model = model;
this.style = style;
@@ -22,10 +34,10 @@ export default class Line2 extends Group {
create() {
const model = this.model;
const style = this.style;
- if (model && model.points.length > 1) {
+ if (this.computPoints > 1) {
const points = [];
- for (let i = 0; i < model.points.length; i++) {
- points.push([model.points[i].x, model.points[i].y]);
+ for (let i = 0; i < this.computPoints.length; i++) {
+ points.push([this.computPoints[i].x, this.computPoints[i].y]);
}
this.line = new Polyline({
zlevel: this.zlevel,
@@ -47,7 +59,7 @@ export default class Line2 extends Group {
const model = this.model;
const style = this.style;
if (model && model.leftTerminal) { // 左端点
- const traingle = new JTriangle(model.points[0], model.points[1]);
+ const traingle = new JTriangle(this.computPoints[0], this.computPoints[1]);
this.leftTerminal = new ESeparator({
style: style,
zlevel: this.zlevel,
@@ -56,14 +68,14 @@ export default class Line2 extends Group {
width: model.width,
stroke: style.Power.noElectricStrokeColor,
point: {
- x: model.points[0].x,
- y: model.points[0].y
+ x: this.computPoints[0].x,
+ y: this.computPoints[0].y
}
});
this.add(this.leftTerminal);
}
if (model && model.rightTerminal) { // 右端点
- const traingle = new JTriangle(model.points[model.points.length - 2], model.points[model.points.length - 1]);
+ const traingle = new JTriangle(this.computPoints[this.computPoints.length - 2], this.computPoints[this.computPoints.length - 1]);
this.rightTerminal = new ESeparator({
style: style,
zlevel: this.zlevel,
@@ -72,8 +84,8 @@ export default class Line2 extends Group {
width: model.width,
stroke: style.Power.noElectricStrokeColor,
point: {
- x: model.points[model.points.length - 1].x,
- y: model.points[model.points.length - 1].y
+ x: this.computPoints[this.computPoints.length - 1].x,
+ y: this.computPoints[this.computPoints.length - 1].y
}
});
this.add(this.rightTerminal);
diff --git a/src/jmapNew/shape/graph/Psd/EHorizontal2Door.js b/src/jmapNew/shape/graph/Psd/EHorizontal2Door.js
index fcf71c13c..33cff02aa 100644
--- a/src/jmapNew/shape/graph/Psd/EHorizontal2Door.js
+++ b/src/jmapNew/shape/graph/Psd/EHorizontal2Door.js
@@ -20,8 +20,8 @@ class EHorizontal2Door extends Group {
zlevel: this.model.zlevel,
z: this.model.z,
shape: {
- x: model.position.x - model.width / 4,
- y: model.position.y - (model.height / 2),
+ x: model.computedPosition.x - model.width / 4,
+ y: model.computedPosition.y - (model.height / 2),
width: model.width / 4 - 2,
height: model.height
},
@@ -35,8 +35,8 @@ class EHorizontal2Door extends Group {
zlevel: this.model.zlevel,
z: this.model.z,
shape: {
- x: model.position.x,
- y: model.position.y - (model.height / 2),
+ x: model.computedPosition.x,
+ y: model.computedPosition.y - (model.height / 2),
width: model.width / 4 - 2,
height: model.height
},
diff --git a/src/jmapNew/shape/graph/Psd/ERectDoor.js b/src/jmapNew/shape/graph/Psd/ERectDoor.js
index b79958014..227cd39f9 100644
--- a/src/jmapNew/shape/graph/Psd/ERectDoor.js
+++ b/src/jmapNew/shape/graph/Psd/ERectDoor.js
@@ -17,8 +17,8 @@ class ERect2Door extends Group {
zlevel: this.model.zlevel,
z: this.model.z,
shape: {
- x: stand.position.x - (stand.width / 2) - 5,
- y: stand.position.y - (stand.height / 2) - 5,
+ x: stand.computedPosition.x - (stand.width / 2) - 5,
+ y: stand.computedPosition.y - (stand.height / 2) - 5,
width: stand.width + 10,
height: stand.height + 10
},
diff --git a/src/jmapNew/shape/graph/Psd/ESafeDoor.js b/src/jmapNew/shape/graph/Psd/ESafeDoor.js
index 200789551..132163fca 100644
--- a/src/jmapNew/shape/graph/Psd/ESafeDoor.js
+++ b/src/jmapNew/shape/graph/Psd/ESafeDoor.js
@@ -21,8 +21,8 @@ class ESafeDoor extends Group {
zlevel: this.model.zlevel,
z: this.model.z,
shape: {
- x: model.position.x - model.width / 2 - padding,
- y: model.position.y - (model.height / 2),
+ x: model.computedPosition.x - model.width / 2 - padding,
+ y: model.computedPosition.y - (model.height / 2),
width: model.width,
height: model.height
},
@@ -37,8 +37,8 @@ class ESafeDoor extends Group {
zlevel: this.model.zlevel,
z: this.model.z + 1,
shape: {
- x: model.position.x - model.width / 4 - padding,
- y: model.position.y - (model.height / 2) - 1,
+ x: model.computedPosition.x - model.width / 4 - padding,
+ y: model.computedPosition.y - (model.height / 2) - 1,
width: model.width / 2 + padding * 2,
height: model.height + 2
},
diff --git a/src/jmapNew/shape/graph/Psd/EVertical2Door.js b/src/jmapNew/shape/graph/Psd/EVertical2Door.js
index 31125cd64..0285fdf22 100644
--- a/src/jmapNew/shape/graph/Psd/EVertical2Door.js
+++ b/src/jmapNew/shape/graph/Psd/EVertical2Door.js
@@ -26,10 +26,10 @@ class EVertical2Door extends Group {
zlevel: this.model.zlevel,
z: this.model.z,
shape: {
- x1:model.position.x - model.width / 2,
- y1:model.position.y - (model.height / 2) + (1 + offesetY ) / 2 * (2 + (model.height)),
- x2:model.position.x + model.width / 2,
- y2:model.position.y - (model.height / 2) + (1 + offesetY ) / 2 * (2 + (model.height))
+ x1:model.computedPosition.x - model.width / 2,
+ y1:model.computedPosition.y - (model.height / 2) + (1 + offesetY ) / 2 * (2 + (model.height)),
+ x2:model.computedPosition.x + model.width / 2,
+ y2:model.computedPosition.y - (model.height / 2) + (1 + offesetY ) / 2 * (2 + (model.height))
},
style: {
lineWidth: (model.height),
@@ -42,10 +42,10 @@ class EVertical2Door extends Group {
zlevel: this.model.zlevel,
z: this.model.z,
shape: {
- x1:model.position.x - model.width / 2,
- y1:model.position.y - (model.height / 2) + (1 - offesetY) / 2 * ((model.height) + 2),
- x2:model.position.x + model.width / 2,
- y2:model.position.y - (model.height / 2) + (1 - offesetY) / 2 * ((model.height) + 2)
+ x1:model.computedPosition.x - model.width / 2,
+ y1:model.computedPosition.y - (model.height / 2) + (1 - offesetY) / 2 * ((model.height) + 2),
+ x2:model.computedPosition.x + model.width / 2,
+ y2:model.computedPosition.y - (model.height / 2) + (1 - offesetY) / 2 * ((model.height) + 2)
},
style: {
lineWidth: (model.height),
diff --git a/src/jmapNew/shape/graph/Psd/index.js b/src/jmapNew/shape/graph/Psd/index.js
index 5114fea16..99efd2e16 100644
--- a/src/jmapNew/shape/graph/Psd/index.js
+++ b/src/jmapNew/shape/graph/Psd/index.js
@@ -13,6 +13,12 @@ export default class Line2 extends Group {
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ this.computedPosition = pictureDevice.position;
+ } else {
+ this.computedPosition = model.position;
+ }
this.z = 1;
this.model = model;
this.style = style;
@@ -24,6 +30,7 @@ export default class Line2 extends Group {
create() {
/** 屏蔽门*/
const model = this.model;
+ model.computedPosition = this.computedPosition;
const style = this.style;
// 站台所有的绘图元素
const elementTypeList = {
@@ -85,6 +92,6 @@ export default class Line2 extends Group {
}
}
getAnchorPoint() {
- return this.model.position;
+ return this.computedPosition;
}
}
diff --git a/src/jmapNew/shape/graph/Resource/index.js b/src/jmapNew/shape/graph/Resource/index.js
index 4d25ad0fe..07fd11f2c 100644
--- a/src/jmapNew/shape/graph/Resource/index.js
+++ b/src/jmapNew/shape/graph/Resource/index.js
@@ -11,6 +11,12 @@ export default class Resource extends Group {
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ this.computedPosition = pictureDevice.position;
+ } else {
+ this.computedPosition = model.position;
+ }
this.model = model;
this.style = style;
this.z = model.zIndex || 1;
@@ -23,14 +29,14 @@ export default class Resource extends Group {
zlevel: this.zlevel,
z: this.z,
origin: {
- x: model.position.x,
- y: model.position.y
+ x: this.computedPosition.x,
+ y: this.computedPosition.y
},
rotation: -Math.PI / 180 * model.rotate,
style: {
image: model.url,
- x: model.position.x,
- y: model.position.y,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y,
width: model.width,
height: model.height
}
@@ -55,7 +61,7 @@ export default class Resource extends Group {
// 整体图片
transformRotation(item) {
if (this.model.rotate) {
- const origin = [this.model.position.x, this.model.position.y];
+ const origin = [this.computedPosition.x, this.computedPosition.y];
const rotation = -Math.PI / 180 * Number(this.model.rotate);
item.origin = origin;
item.rotation = rotation;
@@ -75,6 +81,6 @@ export default class Resource extends Group {
return null;
}
getAnchorPoint() {
- return this.model.position;
+ return this.computedPosition;
}
}
diff --git a/src/jmapNew/shape/graph/Responder/index.js b/src/jmapNew/shape/graph/Responder/index.js
index 77b970297..1f17e3e72 100644
--- a/src/jmapNew/shape/graph/Responder/index.js
+++ b/src/jmapNew/shape/graph/Responder/index.js
@@ -30,6 +30,12 @@ export default class Responder extends Group {
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ this.computedPosition = pictureDevice.position;
+ } else {
+ this.computedPosition = model.position;
+ }
this.model = model;
this.style = style;
this.anchorPoint = {x: 0, y: 0};
@@ -50,8 +56,8 @@ export default class Responder extends Group {
const blockWidth = responderStyle.block.width || 5;
const blockHeight = responderStyle.block.height || 12;
const blockStyle = responderStyle.block.mapStyle[model.type] || { fill: '#fff'};
- const blockX = model.position.x - blockWidth / 2 - distanceX;
- const blockY = model.position.y - blockHeight / 2 - distanceY;
+ const blockX = this.computedPosition.x - blockWidth / 2 - distanceX;
+ const blockY = this.computedPosition.y - blockHeight / 2 - distanceY;
this.anchorPoint = {x:blockX, y:blockY};
const textRadian = -Math.PI / 180 * Number(180 - model.textRotate);
const textDistanceX = model.textOffset.y * Math.sin(textRadian) + model.textOffset.x * Math.cos(textRadian);
@@ -60,7 +66,7 @@ export default class Responder extends Group {
const textY = blockY + textDistanceY;
const textName = `${model.type}-${model.name}`;
const textFill = responderStyle.text.textFill;
- const origin = [model.position.x, model.position.y];
+ const origin = [this.computedPosition.x, this.computedPosition.y];
const deltaFill = responderStyle.delta.fill;
const padding = 1.2;
diff --git a/src/jmapNew/shape/graph/SaidLamp/EMouse.js b/src/jmapNew/shape/graph/SaidLamp/EMouse.js
index 4bd9eb897..6576a040a 100644
--- a/src/jmapNew/shape/graph/SaidLamp/EMouse.js
+++ b/src/jmapNew/shape/graph/SaidLamp/EMouse.js
@@ -13,8 +13,8 @@ export default class EMouse extends Group {
z: this.device.z + 1,
position: [0, 0],
style: {
- x: this.device.model.position.x,
- y: this.device.model.position.y + this.device.deviceStyle.lamp.radiusR + this.device.deviceStyle.text.distance - 30,
+ x: this.device.computedPosition.x,
+ y: this.device.computedPosition.y + this.device.deviceStyle.lamp.radiusR + this.device.deviceStyle.text.distance - 30,
fontWeight: 'normal',
fontSize: this.device.deviceStyle.mouseOverStyle.fontSize,
fontFamily: this.device.style.fontFamily,
diff --git a/src/jmapNew/shape/graph/SaidLamp/index.js b/src/jmapNew/shape/graph/SaidLamp/index.js
index d5bd1ecb8..512632050 100644
--- a/src/jmapNew/shape/graph/SaidLamp/index.js
+++ b/src/jmapNew/shape/graph/SaidLamp/index.js
@@ -20,6 +20,12 @@ export default class SaidLamp extends Group {
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ this.computedPosition = pictureDevice.position;
+ } else {
+ this.computedPosition = model.position;
+ }
this.model = model;
this.style = style;
this.deviceStyle = style[model._type];
@@ -41,8 +47,8 @@ export default class SaidLamp extends Group {
z: this.z,
arc: {
shape: {
- cx: model.position.x,
- cy: model.position.y,
+ cx: this.computedPosition.x,
+ cy: this.computedPosition.y,
r: this.deviceStyle.lamp.radiusR
},
subType: 'Control',
@@ -52,8 +58,8 @@ export default class SaidLamp extends Group {
},
text: {
position: [0, 0],
- x: model.position.x,
- y: model.position.y + this.deviceStyle.lamp.radiusR + this.deviceStyle.text.distance,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y + this.deviceStyle.lamp.radiusR + this.deviceStyle.text.distance,
fontWeight: this.deviceStyle.text.fontWeight,
fontSize: this.deviceStyle.text.fontSize,
fontFamily: this.style.fontFamily,
@@ -69,8 +75,8 @@ export default class SaidLamp extends Group {
this.control = new ELampFilament({
zlevel: this.zlevel,
z: this.z,
- x: model.position.x,
- y: model.position.y,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y,
_subType: 'LampFilament',
width: this.deviceStyle.width,
fill: this.deviceStyle.defaultColor
@@ -80,8 +86,8 @@ export default class SaidLamp extends Group {
this.control = new EControlSwitch({
zlevel: this.zlevel,
z: this.z,
- x: model.position.x,
- y: model.position.y,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y,
_subType: 'ControlSwitch',
width: this.deviceStyle.width,
fill: this.deviceStyle.defaultColor
@@ -91,8 +97,8 @@ export default class SaidLamp extends Group {
this.control = new EDeviceStatus({
zlevel: this.zlevel,
z: this.z,
- x: model.position.x,
- y: model.position.y,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y,
mfNum: model.mfNum,
pfNum: model.pfNum,
style: this.style
@@ -102,8 +108,8 @@ export default class SaidLamp extends Group {
this.control = new EFoldbackMode({
zlevel: this.zlevel,
z: this.z,
- x: model.position.x,
- y: model.position.y,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y,
width: this.deviceStyle.rectWidth,
style: this.style
});
@@ -112,8 +118,8 @@ export default class SaidLamp extends Group {
this.control = new EModeStatus({
zlevel: this.zlevel,
z: this.z,
- x: model.position.x,
- y: model.position.y,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y,
style: this.style
});
this.add(this.control);
@@ -121,8 +127,8 @@ export default class SaidLamp extends Group {
this.control = new EAxle({
zlevel: this.zlevel,
z: this.z,
- x: model.position.x,
- y: model.position.y,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y,
style: this.style
});
this.add(this.control);
@@ -131,8 +137,8 @@ export default class SaidLamp extends Group {
this.control = new EUnmanned({
zlevel: this.zlevel,
z: this.z,
- x: model.position.x,
- y: model.position.y,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y,
_subType: 'Unmanned',
width: this.style.NoOneReturn.width,
fill: this.style.NoOneReturn.defaultColor
@@ -144,8 +150,8 @@ export default class SaidLamp extends Group {
z: this.z,
arc: {
shape: {
- cx: model.position.x,
- cy: model.position.y,
+ cx: this.computedPosition.x,
+ cy: this.computedPosition.y,
r: this.deviceStyle.lamp.radiusR
},
subType: 'Control',
@@ -154,8 +160,8 @@ export default class SaidLamp extends Group {
},
text: {
position: [0, 0],
- x: model.position.x,
- y: model.position.y + this.deviceStyle.lamp.radiusR + this.deviceStyle.text.distance,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y + this.deviceStyle.lamp.radiusR + this.deviceStyle.text.distance,
fontWeight: this.deviceStyle.text.fontWeight,
fontSize: this.deviceStyle.text.fontSize,
fontFamily: this.style.fontFamily,
@@ -172,19 +178,19 @@ export default class SaidLamp extends Group {
this.control = new EIndicatorLight({
zlevel: this.zlevel,
z: this.z,
- x: model.position.x,
- y: model.position.y,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y,
text: model.name,
style: this.style,
_subType: 'IndicatorLight'
});
this.add(this.control);
} else if (this._type === 'PickArrow' || this._type === 'DepartArrow') {
- this.control = new EPickOrDepartArrow({
+ this.control = new EPickOrDepartArrow({
zlevel: this.zlevel,
z: this.z,
- x: model.position.x,
- y: model.position.y,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y,
text: model.name,
right: model.right,
style: this.style,
diff --git a/src/jmapNew/shape/graph/Section/EAxle.js b/src/jmapNew/shape/graph/Section/EAxle.js
index c21a3ed56..728ddf1f5 100644
--- a/src/jmapNew/shape/graph/Section/EAxle.js
+++ b/src/jmapNew/shape/graph/Section/EAxle.js
@@ -24,14 +24,14 @@ export default class EAxle extends Group {
createAxleLeft() {
const model = this.model.modelData;
-
- const traingle = new JTriangle(model.points[0], model.points[1]);
+ const computedPoints = this.model.computedPoints;
+ const traingle = new JTriangle(computedPoints[0], computedPoints[1]);
const drictx = 1;
const dricty = model.leftAxlePosition === 1 || model.leftAxlePosition === 2 ? 1 : -1;
const isSpecial = model.leftAxlePosition === -2 || model.leftAxlePosition === 2;
- const difference = model.points[0].y - model.points[1].y;
+ const difference = computedPoints[0].y - computedPoints[1].y;
let point = {};
- point = {x:model.points[0].x, y: model.points[0].y};
+ point = {x:computedPoints[0].x, y: computedPoints[0].y};
if (model.leftAxleOffset) {
point.x = point.x + model.leftAxleOffset.x || 0;
point.y = point.y + model.leftAxleOffset.y || 0;
@@ -48,15 +48,16 @@ export default class EAxle extends Group {
createAxleRight() {
const model = this.model.modelData;
- const length = model.points.length;
- const traingle = new JTriangle(model.points[length - 2], model.points[length - 1]);
+ const computedPoints = this.model.computedPoints;
+ const length = computedPoints.length;
+ const traingle = new JTriangle(computedPoints[length - 2], computedPoints[length - 1]);
const drictx = -1;
const dricty = model.rightAxlePosition === 1 || model.rightAxlePosition === 2 ? 1 : -1;
const isSpecial = model.rightAxlePosition === -2 || model.rightAxlePosition === 2;
- const difference = model.points[length - 2].y - model.points[length - 1].y;
+ const difference = computedPoints[length - 2].y - computedPoints[length - 1].y;
let point = {};
- point = {x:model.points[length - 1].x, y: model.points[length - 1].y};
+ point = {x:computedPoints[length - 1].x, y: computedPoints[length - 1].y};
if (model.rightAxleOffset) {
point.x = point.x + model.rightAxleOffset.x || 0;
point.y = point.y + model.rightAxleOffset.y || 0;
diff --git a/src/jmapNew/shape/graph/Section/EBackArrow.js b/src/jmapNew/shape/graph/Section/EBackArrow.js
index 43f94edb5..3efa0f499 100644
--- a/src/jmapNew/shape/graph/Section/EBackArrow.js
+++ b/src/jmapNew/shape/graph/Section/EBackArrow.js
@@ -19,16 +19,16 @@ export default class EBackArrowGroup extends Group {
const height = style.Section.line.width * 1;
const turnBackDistance = style.Section.shuttleBack.distance + radius * 4;
- const points = model.points;
+ const computedPoints = this.model.computedPoints;
let x = -model.drict * width * 1.2;
let y = -turnBackDistance;
if (model.drict < 0) {
- x += points[0].x;
- y += points[0].y;
+ x += computedPoints[0].x;
+ y += computedPoints[0].y;
} else {
- x += points[points.length - 1].x;
- y += points[points.length - 1].y;
+ x += computedPoints[computedPoints.length - 1].x;
+ y += computedPoints[computedPoints.length - 1].y;
}
this.turnBack = new EBackArrow({
diff --git a/src/jmapNew/shape/graph/Section/EBadShunt.js b/src/jmapNew/shape/graph/Section/EBadShunt.js
index c08e970f4..9715e1583 100644
--- a/src/jmapNew/shape/graph/Section/EBadShunt.js
+++ b/src/jmapNew/shape/graph/Section/EBadShunt.js
@@ -16,9 +16,10 @@ export default class EBadShunt extends Group {
// 分路不良
const model = this.model.modelData;
const style = this.model.style;
+ const computedPoints = this.model.computedPoints;
/** 创建区段*/
- if (model && model.points.length > 1) {
- const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]);
+ if (computedPoints.length > 1) {
+ const traingle = new JTriangle(computedPoints[0], computedPoints[computedPoints.length - 1]);
let x = traingle.drictx * (style.Section.badShunt.distance) * traingle.getSinRate();
let y = traingle.dricty * (style.Section.badShunt.distance) * traingle.getCosRate();
if (x == Infinity) { x = 0; }
@@ -32,7 +33,7 @@ export default class EBadShunt extends Group {
isSwitchSection: model.switchSection,
relSwitchCode: model.relSwitchCode,
isCurve: model.curve, // 是否曲线
- points: model.points
+ points: computedPoints
});
// 下侧临时限速线
const badShuntRight = this.createLimit({
@@ -42,7 +43,7 @@ export default class EBadShunt extends Group {
isSwitchSection: model.switchSection,
relSwitchCode: model.relSwitchCode,
isCurve: model.curve, // 是否曲线
- points: model.points
+ points: computedPoints
});
badShuntLeft.forEach(item => {
this.add(item);
diff --git a/src/jmapNew/shape/graph/Section/EDerailer.js b/src/jmapNew/shape/graph/Section/EDerailer.js
index 28e06880c..c4b9423f1 100644
--- a/src/jmapNew/shape/graph/Section/EDerailer.js
+++ b/src/jmapNew/shape/graph/Section/EDerailer.js
@@ -1,85 +1,87 @@
-import Group from "zrender/src/container/Group";
-import Text from "zrender/src/graphic/Text";
-import Polygon from "zrender/src/graphic/shape/Polygon";
+import Group from 'zrender/src/container/Group';
+import Text from 'zrender/src/graphic/Text';
+import Polygon from 'zrender/src/graphic/shape/Polygon';
class EDerailer extends Group {
- constructor(model) {
- super();
- this.zlevel = model.zlevel;
+ constructor(model) {
+ super();
+ this.zlevel = model.zlevel;
this.z = model.z;
- this.style = model.style;
- this.model = model;
- this.create();
- }
+ this.style = model.style;
+ this.model = model;
+ this.create();
+ }
- create() {
- this.createText();
- this.createSymbol();
- }
+ create() {
+ this.createText();
+ this.createSymbol();
+ }
- createText() {
- const style = this.model.style;
- const model = this.model.modelData;
- const length = model.points.length;
- const offset = style.Section.derailer.text.offset||{};
- const offsetX = offset.x||0;
- const offsetY = offset.y||0;
- const positionX = (model.points[0].x + model.points[length-1].x) / 2 + offsetX;
- const positionY = (model.points[0].y + model.points[length-1].y) / 2 + offsetY;
+ createText() {
+ const style = this.model.style;
+ // const model = this.model.modelData;
+ const computedPoints = this.model.computedPoints;
+ const length = computedPoints.length;
+ const offset = style.Section.derailer.text.offset || {};
+ const offsetX = offset.x || 0;
+ const offsetY = offset.y || 0;
+ const positionX = (computedPoints[0].x + computedPoints[length - 1].x) / 2 + offsetX;
+ const positionY = (computedPoints[0].y + computedPoints[length - 1].y) / 2 + offsetY;
- this.text = new Text({
- zlevel: this.zlevel,
- z: this.z,
- style: {
- x: positionX,
+ this.text = new Text({
+ zlevel: this.zlevel,
+ z: this.z,
+ style: {
+ x: positionX,
y: positionY,
- text: 'T',
+ text: 'T',
fontWeight: style.fontWeight,
fontSize: style.fontSize,
fontFamily: style.fontFamily,
textFill: style.Section.derailer.text.color,
- textPosition: 'inside',
+ textPosition: 'inside',
textAlign: 'center',
textVerticalAlign: 'center'
- }
- })
- this.add(this.text);
- }
+ }
+ });
+ this.add(this.text);
+ }
- createSymbol() {
- const style = this.model.style;
- const model = this.model.modelData;
- const length = model.points.length;
- const offset = style.Section.derailer.symbol.offset||{};
- const offsetX = offset.x||0;
- const offsetY = offset.y||0;
- const pointX = (model.points[0].x + model.points[length-1].x) / 2 + offsetX;
- const pointY = (model.points[0].y + model.points[length-1].y) / 2 + offsetY;
+ createSymbol() {
+ const style = this.model.style;
+ // const model = this.model.modelData;
+ const length = this.model.computedPoints.length;
+ const computedPoints = this.model.computedPoints;
+ const offset = style.Section.derailer.symbol.offset || {};
+ const offsetX = offset.x || 0;
+ const offsetY = offset.y || 0;
+ const pointX = (computedPoints[0].x + computedPoints[length - 1].x) / 2 + offsetX;
+ const pointY = (computedPoints[0].y + computedPoints[length - 1].y) / 2 + offsetY;
- this.symbol = new Polygon({
- zlevel: this.zlevel,
- z: this.z,
- shape: {
- points: [
- [pointX-3, pointY],
- [pointX, pointY-8],
- [pointX+3, pointY]
- ]
- },
- style: {
- fill: style.Section.derailer.symbol.color,
- }
- })
- this.add(this.symbol);
- }
+ this.symbol = new Polygon({
+ zlevel: this.zlevel,
+ z: this.z,
+ shape: {
+ points: [
+ [pointX - 3, pointY],
+ [pointX, pointY - 8],
+ [pointX + 3, pointY]
+ ]
+ },
+ style: {
+ fill: style.Section.derailer.symbol.color
+ }
+ });
+ this.add(this.symbol);
+ }
- setTextStyle(style) {
- this.text && this.text.setStyle(style);
- }
+ setTextStyle(style) {
+ this.text && this.text.setStyle(style);
+ }
- setSymbolStyle(style) {
- this.symbol && this.symbol.setStyle(style);
- }
+ setSymbolStyle(style) {
+ this.symbol && this.symbol.setStyle(style);
+ }
}
export default EDerailer;
diff --git a/src/jmapNew/shape/graph/Section/ELimitLines.js b/src/jmapNew/shape/graph/Section/ELimitLines.js
index 81095cadb..ab993f658 100644
--- a/src/jmapNew/shape/graph/Section/ELimitLines.js
+++ b/src/jmapNew/shape/graph/Section/ELimitLines.js
@@ -16,9 +16,10 @@ export default class ELimitLines extends Group {
create() {
const model = this.model.modelData;
const style = this.model.style;
+ const computedPoints = this.model.computedPoints;
/** 创建区段*/
- if (model && model.points.length > 1) {
- const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]);
+ if (computedPoints.length > 1) {
+ const traingle = new JTriangle(computedPoints[0], computedPoints[computedPoints.length - 1]);
let x = traingle.drictx * (style.Section.speedLimit.distance) * traingle.getSinRate();
let y = traingle.dricty * (style.Section.speedLimit.distance) * traingle.getCosRate();
if (x == Infinity) { x = 0; }
@@ -32,7 +33,7 @@ export default class ELimitLines extends Group {
isSwitchSection: model.switchSection,
relSwitchCode: model.relSwitchCode,
isCurve: model.curve, // 是否曲线
- points: model.points
+ points: computedPoints
});
// 下侧临时限速线
const speedLimitRight = this.createLimit({
@@ -42,7 +43,7 @@ export default class ELimitLines extends Group {
isSwitchSection: model.switchSection,
relSwitchCode: model.relSwitchCode,
isCurve: model.curve, // 是否曲线
- points: model.points
+ points: computedPoints
});
speedLimitLeft.forEach(item => {
this.add(item);
diff --git a/src/jmapNew/shape/graph/Section/ELimitName.js b/src/jmapNew/shape/graph/Section/ELimitName.js
index ff300904b..57c97e972 100644
--- a/src/jmapNew/shape/graph/Section/ELimitName.js
+++ b/src/jmapNew/shape/graph/Section/ELimitName.js
@@ -13,15 +13,15 @@ export default class ELimitName extends Group {
create() {
/** 创建区段*/
- const model = this.model.modelData;
+ // const model = this.model.modelData;
const style = this.model.style;
-
+ const computedPoints = this.model.computedPoints;
const rectW = style.Section.speedLimitName.drogueWidth;
const rectH = style.Section.speedLimitName.drogueHeight;
- const x1 = model.points[0].x;
- const y1 = model.points[0].y + style.Section.speedLimitName.limitValueDistance;
- const x2 = model.points[model.points.length - 1].x;
- const y2 = model.points[model.points.length - 1].y + style.Section.speedLimitName.limitValueDistance;
+ const x1 = computedPoints[0].x;
+ const y1 = computedPoints[0].y + style.Section.speedLimitName.limitValueDistance;
+ const x2 = computedPoints[computedPoints.length - 1].x;
+ const y2 = computedPoints[computedPoints.length - 1].y + style.Section.speedLimitName.limitValueDistance;
if (style.Section.speedLimitName.leftName) {
const leftPoints = style.Section.speedLimitName.nameBackgroundIsRect ? [[x1, y1],
[x1 + rectW, y1],
diff --git a/src/jmapNew/shape/graph/Section/ELines.js b/src/jmapNew/shape/graph/Section/ELines.js
index 88a7c5d8e..bcd07f2f1 100644
--- a/src/jmapNew/shape/graph/Section/ELines.js
+++ b/src/jmapNew/shape/graph/Section/ELines.js
@@ -35,10 +35,10 @@ export default class ELines extends Group {
const relateSectionList = model.relateSectionList;
const sectionA = store.getters['map/getDeviceByCode'](relateSectionList[0]);
const sectionB = store.getters['map/getDeviceByCode'](relateSectionList[1]);
- const endPointA = sectionA.points[sectionA.points.length - 1];
- const startPointA = sectionA.points[0];
- const endPointB = sectionB.points[sectionB.points.length - 1];
- const startPointB = sectionB.points[0];
+ const endPointA = sectionA.instance.computedPoints[sectionA.instance.computedPoints.length - 1];
+ const startPointA = sectionA.instance.computedPoints[0];
+ const endPointB = sectionB.instance.computedPoints[sectionB.instance.computedPoints.length - 1];
+ const startPointB = sectionB.instance.computedPoints[0];
const result = segmentsIntr(startPointA, endPointA, startPointB, endPointB);
// this.cross = new Polyline({
// zlevel: this.zlevel,
@@ -167,10 +167,11 @@ export default class ELines extends Group {
createLine() {
const model = this.model.modelData;
const style = this.model.style;
+ const computedPoints = this.model.computedPoints; // 30
const Z = model.type == '02' ? this.z + 1 : this.z;
- const modelPoints = model.type == '04' ? [model.namePosition, model.namePosition] : model.points;
+ const modelPoints = model.type == '04' ? [model.namePosition, model.namePosition] : computedPoints;
const isCurve = model.curve;
/** 创建区段*/
if (model && modelPoints.length > 1) {
diff --git a/src/jmapNew/shape/graph/Section/EMouse.js b/src/jmapNew/shape/graph/Section/EMouse.js
index aaedfeeef..2d23b0b5b 100644
--- a/src/jmapNew/shape/graph/Section/EMouse.js
+++ b/src/jmapNew/shape/graph/Section/EMouse.js
@@ -77,23 +77,24 @@ class EMouse extends Group {
this.lineBorder.hide();
}
} else {
- const model = this.device.model;
+ // const model = this.device.model;
+ const computedPoints = this.device.computedPoints;
let points = [];
const pointsReverse = [];
- model.points.forEach((ele, index) => {
+ computedPoints.forEach((ele, index) => {
let flag = false;
- if (index == model.points.length - 1) {
- this.triangle = new JTriangle(model.points[index - 1], ele);
+ if (index == computedPoints.length - 1) {
+ this.triangle = new JTriangle(computedPoints[index - 1], ele);
} else {
- this.triangle = new JTriangle(ele, model.points[index + 1]);
+ this.triangle = new JTriangle(ele, computedPoints[index + 1]);
}
const directy = this.triangle.dricty;
if (index > 0) {
- if (model.points[index - 1].y == ele.y || index < model.points.length - 1 && model.points[index + 1].y == ele.y) {
+ if (computedPoints[index - 1].y == ele.y || index < computedPoints.length - 1 && computedPoints[index + 1].y == ele.y) {
flag = true;
}
} else {
- if (model.points[index + 1].y == ele.y) {
+ if (computedPoints[index + 1].y == ele.y) {
flag = true;
}
}
@@ -152,7 +153,7 @@ class EMouse extends Group {
this.TextName && this.TextName.show();
this.sectionTextBorder && this.sectionTextBorder.show();
if (this.device.model.type != '03') {
- this.lineBorder && this.lineBorder.show();
+ this.lineBorder && this.lineBorder.show();
}
const instance = this.getInstanceByCode(this.device.model.trainWindowCode);
if (instance && instance.mouseEvent && instance.mouseEvent.mouseEnter) {
diff --git a/src/jmapNew/shape/graph/Section/ESeparator.js b/src/jmapNew/shape/graph/Section/ESeparator.js
index 854c2c2e0..1dc58543b 100644
--- a/src/jmapNew/shape/graph/Section/ESeparator.js
+++ b/src/jmapNew/shape/graph/Section/ESeparator.js
@@ -23,15 +23,16 @@ export default class ESeparator extends Group {
create() {
/** 创建区段*/
const model = this.model.modelData;
+ const computedPoints = this.model.computedPoints;
const style = this.model.style;
- if (model && style && model.points && model.points.length > 1) {
+ if (model && style && computedPoints && computedPoints.length > 1) {
/** 创建左侧分隔符*/
- const traingleLeft = new JTriangle(model.points[0], model.points[1]);
+ const traingleLeft = new JTriangle(computedPoints[0], computedPoints[1]);
this.lPartition = this.setType({
traingle: traingleLeft,
point: {
- x: model.points[0].x,
- y: model.points[0].y
+ x: computedPoints[0].x,
+ y: computedPoints[0].y
},
sepType: model.sepTypeLeft,
drict: -1, // 方向
@@ -39,12 +40,12 @@ export default class ESeparator extends Group {
});
/** 创建右侧分隔符*/
- const traingleRight = new JTriangle(model.points[model.points.length - 2], model.points[model.points.length - 1]);
+ const traingleRight = new JTriangle(computedPoints[computedPoints.length - 2], computedPoints[computedPoints.length - 1]);
this.rPartition = this.setType({
traingle: traingleRight,
point: {
- x: model.points[model.points.length - 1].x,
- y: model.points[model.points.length - 1].y
+ x: computedPoints[computedPoints.length - 1].x,
+ y: computedPoints[computedPoints.length - 1].y
},
sepType: model.sepTypeRight,
drict: 1, // 方向
diff --git a/src/jmapNew/shape/graph/Section/EStopRouteImg.js b/src/jmapNew/shape/graph/Section/EStopRouteImg.js
index b2c72a13c..d3ef4fe91 100644
--- a/src/jmapNew/shape/graph/Section/EStopRouteImg.js
+++ b/src/jmapNew/shape/graph/Section/EStopRouteImg.js
@@ -16,7 +16,7 @@ export default class EStopRouteImg extends Group {
create() {
const model = this.model.modelData;
const style = this.model.style;
- const modelPoints = model.points;
+ const modelPoints = this.model.computedPoints;
if (model.type !== '04') {
const image = new Image(5, 8);
image.src = Stop_Route;
diff --git a/src/jmapNew/shape/graph/Section/ETextName.js b/src/jmapNew/shape/graph/Section/ETextName.js
index 6f9588dae..ebb8c6738 100644
--- a/src/jmapNew/shape/graph/Section/ETextName.js
+++ b/src/jmapNew/shape/graph/Section/ETextName.js
@@ -13,15 +13,16 @@ class ETextName extends Group {
create() {
const model = this.model.modelData;
const styleModel = this.model.style.Section[this.model.type];
+ const computedPoints = this.model.computedPoints;
let styleX = '';
let styleY = '';
let styleName = '';
let isCreate = false;
// 计算区段坐标位置
- const x = Math.min(model.points[0].x, model.points[model.points.length - 1].x) + Math.abs(model.points[model.points.length - 1].x - model.points[0].x) / 2;
- const y = Math.min(model.points[0].y, model.points[model.points.length - 1].y) + Math.abs(model.points[model.points.length - 1].y - model.points[0].y) / 2;
- const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]);
+ const x = Math.min(computedPoints[0].x, computedPoints[computedPoints.length - 1].x) + Math.abs(computedPoints[computedPoints.length - 1].x - computedPoints[0].x) / 2;
+ const y = Math.min(computedPoints[0].y, computedPoints[computedPoints.length - 1].y) + Math.abs(computedPoints[computedPoints.length - 1].y - computedPoints[0].y) / 2;
+ const traingle = new JTriangle(computedPoints[0], computedPoints[computedPoints.length - 1]);
const drict = model.trainPosType != '01' ? 1 : -1;
if (this.model.type == 'name') {
if (model.type == '01' && !model.parentCode) { // 物理区段名称
diff --git a/src/jmapNew/shape/graph/Section/EblockLines.js b/src/jmapNew/shape/graph/Section/EblockLines.js
index b3b2b12f9..faf44bd12 100644
--- a/src/jmapNew/shape/graph/Section/EblockLines.js
+++ b/src/jmapNew/shape/graph/Section/EblockLines.js
@@ -26,20 +26,20 @@ export default class ELines extends Group {
/** 创建区段*/
const model = this.model.modelData;
const style = this.model.style;
-
+ const computedPoints = this.model.computedPoints;
const isCurve = model.curve;
- if (model && model.points.length > 1) {
+ if (computedPoints.length > 1) {
if (isCurve) { // 曲线 用贝塞尔曲线绘图 封锁 必须4个点来绘图
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;
+ for (let i = 1; i < (computedPoints.length - 1); i++) {
+ shape[`cpx${i}`] = computedPoints[i].x;
+ shape[`cpy${i}`] = computedPoints[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`] = computedPoints[0].x;
+ shape[`y1`] = computedPoints[0].y;
+ shape[`x2`] = computedPoints[computedPoints.length - 1].x;
+ shape[`y2`] = computedPoints[computedPoints.length - 1].y;
this.section = new BezierCurve({
isLine: true,
zlevel: this.zlevel,
@@ -55,19 +55,19 @@ 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;
+ if (computedPoints.length == 2) {
+ const spaceX = (computedPoints[1].x - computedPoints[0].x) / 3;
+ const spaceY = (computedPoints[1].y - computedPoints[0].y) / 3;
this.sectionM = new Line({
isLine: true,
zlevel: this.zlevel,
progressive: model.progressive,
z: this.z,
shape: {
- x1: model.points[0].x + spaceX,
- y1: model.points[0].y + spaceY,
- x2: model.points[0].x + spaceX + spaceX,
- y2: model.points[0].y + spaceY + spaceY
+ x1: computedPoints[0].x + spaceX,
+ y1: computedPoints[0].y + spaceY,
+ x2: computedPoints[0].x + spaceX + spaceX,
+ y2: computedPoints[0].y + spaceY + spaceY
},
style: {
lineWidth: style.Section.line.width,
diff --git a/src/jmapNew/shape/graph/Section/index.js b/src/jmapNew/shape/graph/Section/index.js
index 3d6e78c40..164cbda03 100644
--- a/src/jmapNew/shape/graph/Section/index.js
+++ b/src/jmapNew/shape/graph/Section/index.js
@@ -58,8 +58,19 @@ export default class Section extends Group {
this._type = model._type;
this.zlevel = model.zlevel;
const amendData = store.getters['map/amendPoints'](this._code);
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
if (amendData) {
- model.points = amendData.points;
+ this.computedPoints = amendData.points;
+ } else if (pictureDevice) {
+ const points = [];
+ const offsetX = pictureDevice.position.x - model.points[0].x;
+ const offsetY = pictureDevice.position.y - model.points[0].y;
+ model.points.forEach(point => {
+ points.push({x: point.x + offsetX, y: point.y + offsetY});
+ });
+ this.computedPoints = points;
+ } else {
+ this.computedPoints = model.points;
}
this.z = 5 + parseInt(model.layer || 0);
this.model = model;
@@ -116,6 +127,7 @@ export default class Section extends Group {
z: this.z + elementZ,
style: style,
type: element,
+ computedPoints: this.computedPoints,
modelData: model
});
this.add(this[element]);
@@ -530,8 +542,8 @@ export default class Section extends Group {
}
}
// 分路不良
- // model.shuntingTypeList.length > 0 &&
- model.badShunt&& this.badShuntStatus();
+ // model.shuntingTypeList.length > 0 &&
+ model.badShunt && this.badShuntStatus();
}
}
@@ -557,7 +569,11 @@ export default class Section extends Group {
return this.name.getBoundingRect();
}
}
-
+ getNameBoundingRect() {
+ if (this.name && this.name.getBoundingRect()) {
+ return this.name.getBoundingRect();
+ } else { return {}; }
+ }
createMouseEvent() { // 鼠标事件
if (this.style.Section.mouseOverStyle) {
this.mouseEvent = new EMouse(this, this.model.relSwitchCode);
diff --git a/src/jmapNew/shape/graph/Signal/index.js b/src/jmapNew/shape/graph/Signal/index.js
index 93ceec109..ac8967111 100644
--- a/src/jmapNew/shape/graph/Signal/index.js
+++ b/src/jmapNew/shape/graph/Signal/index.js
@@ -190,9 +190,14 @@ class Signal extends Group {
this._code = model.code;
this._type = model._type;
const amendData = store.getters['map/amendPoints'](this._code);
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
if (amendData) {
- model.position = amendData.position;
model.rotate = amendData.rotate;
+ this.computedPosition = amendData.position;
+ } else if (pictureDevice) {
+ this.computedPosition = pictureDevice.position;
+ } else {
+ this.computedPosition = model.position;
}
this.model = model;
this.mapDevice = mapDevice;
@@ -223,18 +228,19 @@ class Signal extends Group {
create() {
const model = this.model;
const style = this.style;
+ const computedPosition = this.computedPosition;
const drict = this.model.showRight ? 1 : -1; // 朝向 左:右
const posit = this.model.positionType == '01' ? -1 : 1; // 位置 上:下
// 信号机高柱矮柱 (信号机底座)
- const sigPostY = model.position.y + model.positionPoint.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR);
+ const sigPostY = computedPosition.y + model.positionPoint.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR);
this.sigPost = new ESigPost({
zlevel: this.zlevel,
z: this.z,
style: style,
drict: drict,
type: model.lampPostType,
- x: model.position.x + model.positionPoint.x,
+ x: computedPosition.x + model.positionPoint.x,
y: sigPostY
});
if (style.Signal.ciConfirm) {
@@ -245,7 +251,7 @@ class Signal extends Group {
silent: false,
_subType: 'enabled', // 标识
style: {
- x: model.position.x + model.positionPoint.x - drict * 25,
+ x: computedPosition.x + model.positionPoint.x - drict * 25,
y: sigPostY + posit * 11,
fontSize: style.Signal.ciConfirm.fontSize,
text: style.Signal.ciConfirm.defaultText,
@@ -271,8 +277,8 @@ class Signal extends Group {
drict: drict,
x: endPoint.x + i * drict * style.Signal.lamp.radiusR * 2.3,
y: endPoint.y,
- originX: model.position.x + model.positionPoint.x,
- originY: model.position.y + model.positionPoint.y
+ originX: computedPosition.x + model.positionPoint.x,
+ originY: computedPosition.y + model.positionPoint.y
});
this.lamps.push(lamp);
}
@@ -348,8 +354,8 @@ class Signal extends Group {
this.sigBack.hide();
}
// 信号机名称
- const sigNameX = model.position.x + model.positionPoint.x - drict * (style.Signal.post.standardVerticalWidth) + model.namePosition.x;
- const sigNameY = model.position.y + model.positionPoint.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR * 2 + model.namePosition.y + style.Signal.text.distance);
+ const sigNameX = computedPosition.x + model.positionPoint.x - drict * (style.Signal.post.standardVerticalWidth) + model.namePosition.x;
+ const sigNameY = computedPosition.y + model.positionPoint.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR * 2 + model.namePosition.y + style.Signal.text.distance);
const textAlign = style.Signal.text.isAlignCenter ? 'middle' : this.model.showRight ? 'left' : 'right';
const textVerticalAlign = posit == 1 ? 'top' : 'bottom';
this.sigName = new ESigName({
@@ -368,7 +374,7 @@ class Signal extends Group {
textVerticalAlign: textVerticalAlign
});
- const timeNameY = model.position.y + model.positionPoint.y - posit * 15;
+ const timeNameY = computedPosition.y + model.positionPoint.y - posit * 15;
this.remainTimeName = new ESigName({
zlevel: this.zlevel,
z: this.z,
@@ -475,8 +481,8 @@ class Signal extends Group {
drict: drict,
x: endPoint.x,
y: endPoint.y,
- originX: model.position.x + model.positionPoint.x,
- originY: model.position.y + model.positionPoint.y
+ originX: computedPosition.x + model.positionPoint.x,
+ originY: computedPosition.y + model.positionPoint.y
});
this.add(this.virtualSignal); // 虚拟信号机 (哈尔滨线路)
} else {
@@ -486,12 +492,13 @@ class Signal extends Group {
createTransmission() {
const model = this.model;
const style = this.style;
+ const computedPosition = this.computedPosition;
const drict = this.model.showRight ? 1 : -1; // 朝向 左:右
const posit = this.model.positionType == '01' ? -1 : 1; // 位置 上:下
// 信号机名称
const actual = this.mapDevice[model.linkSignalCode];
- const sigNameX = model.position.x + model.positionPoint.x + drict * 0.433 * style.Signal.transmission.sideLength + model.namePosition.x;
- const sigNameY = model.position.y + model.positionPoint.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR * 2 + model.namePosition.y + style.Signal.text.distance);
+ const sigNameX = computedPosition.x + model.positionPoint.x + drict * 0.433 * style.Signal.transmission.sideLength + model.namePosition.x;
+ const sigNameY = computedPosition.y + model.positionPoint.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR * 2 + model.namePosition.y + style.Signal.text.distance);
const textAlign = style.Signal.text.isAlignCenter ? 'middle' : this.model.showRight ? 'left' : 'right';
const textVerticalAlign = posit == 1 ? 'top' : 'bottom';
const fillColor = actual.virtual ? style.Signal.transmission.fillColorVirtual : style.Signal.transmission.fillColor;
@@ -511,15 +518,15 @@ class Signal extends Group {
textVerticalAlign: textVerticalAlign
});
if (style.Signal.transmission) {
- const sigPostY = model.position.y + model.positionPoint.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR);
+ const sigPostY = computedPosition.y + model.positionPoint.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR);
this.transmission = new Polygon({
zlevel: this.zlevel,
z: this.z,
shape: {
points: [
- [model.position.x + model.positionPoint.x, sigPostY + style.Signal.transmission.sideLength / 2],
- [model.position.x + model.positionPoint.x, sigPostY - style.Signal.transmission.sideLength / 2],
- [model.position.x + model.positionPoint.x + drict * 0.866 * style.Signal.transmission.sideLength, sigPostY]
+ [computedPosition.x + model.positionPoint.x, sigPostY + style.Signal.transmission.sideLength / 2],
+ [computedPosition.x + model.positionPoint.x, sigPostY - style.Signal.transmission.sideLength / 2],
+ [computedPosition.x + model.positionPoint.x + drict * 0.866 * style.Signal.transmission.sideLength, sigPostY]
]
},
style: {
@@ -549,7 +556,7 @@ class Signal extends Group {
this.transformRotation(item);
} else if (item) {
if (item._subType !== 'SignalName' || this.model.nameRotated) {
- item.origin = [this.model.position.x + this.model.positionPoint.x, this.model.position.y + this.model.positionPoint.y];
+ item.origin = [this.computedPosition.x + this.model.positionPoint.x, this.computedPosition.y + this.model.positionPoint.y];
item.rotation = -Math.PI / 180 * Number(this.model.rotate);
item.dirty();
}
@@ -698,11 +705,11 @@ class Signal extends Group {
}
}
// 双黄灯
- doubleYellow() {
- this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
- this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.yellowColor);
+ doubleYellow() {
+ this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
+ this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.yellowColor);
}
- redWhite() {
+ redWhite() {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.whiteColor);
this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.redColor);
}
@@ -944,7 +951,7 @@ class Signal extends Group {
recover() {
this.sigName && this.sigName.show();
this.sigName && this.sigName.setAnimationEnd();
- this.lamps && this.lamps.forEach(item=> { item.show(); item.setGuideSectorShowHide(false); item.setBorderColor(this.style.Signal.lamp.borderColor) });
+ this.lamps && this.lamps.forEach(item=> { item.show(); item.setGuideSectorShowHide(false); item.setBorderColor(this.style.Signal.lamp.borderColor); });
this.sigName.setStyle({ textBorderWidth: 0 });
this.sigName.setColor(this.style.Signal.text.defaultColor);
this.remainTimeName && this.remainTimeName.hide();
@@ -1023,46 +1030,46 @@ class Signal extends Group {
/** 设置灯的颜色 */
switch (model.aspect) {
- // 红
- case 'R': {
- this.close(model.logicLight); // 信号关闭
- break;
- }
- // 绿
- case 'G': {
- this.openPositive(model.logicLight); // 信号正向开放
- break;
- }
- // 黄
- case 'Y': {
- this.openLateral(model.logicLight); // 信号侧向开放
- break;
- }
- // 红黄
- case 'RY': {
- this.guid(); // 引导信号显示
- break;
- }
- case 'W': {
- this.lampWhite();
- break;
- }
- case 'B': {
- this.lampBlue();
- break;
- }
- case 'YY': {
- this.doubleYellow();
- break;
- }
- case 'RW': {
- this.redWhite();
- break;
- }
- default: {
- this.close(model.logicLight); // 信号关闭
- break;
- }
+ // 红
+ case 'R': {
+ this.close(model.logicLight); // 信号关闭
+ break;
+ }
+ // 绿
+ case 'G': {
+ this.openPositive(model.logicLight); // 信号正向开放
+ break;
+ }
+ // 黄
+ case 'Y': {
+ this.openLateral(model.logicLight); // 信号侧向开放
+ break;
+ }
+ // 红黄
+ case 'RY': {
+ this.guid(); // 引导信号显示
+ break;
+ }
+ case 'W': {
+ this.lampWhite();
+ break;
+ }
+ case 'B': {
+ this.lampBlue();
+ break;
+ }
+ case 'YY': {
+ this.doubleYellow();
+ break;
+ }
+ case 'RW': {
+ this.redWhite();
+ break;
+ }
+ default: {
+ this.close(model.logicLight); // 信号关闭
+ break;
+ }
}
if (model.remainTime) {
@@ -1287,8 +1294,8 @@ class Signal extends Group {
}
getAnchorPoint() {
return {
- x:this.model.position.x + this.model.positionPoint.x,
- y:this.model.position.y + this.model.positionPoint.y
+ x:this.computedPosition.x + this.model.positionPoint.x,
+ y:this.computedPosition.y + this.model.positionPoint.y
};
}
}
diff --git a/src/jmapNew/shape/graph/SignalButton/index.js b/src/jmapNew/shape/graph/SignalButton/index.js
index a533eafb0..4ef5a048e 100644
--- a/src/jmapNew/shape/graph/SignalButton/index.js
+++ b/src/jmapNew/shape/graph/SignalButton/index.js
@@ -11,6 +11,12 @@ export default class SignalButton extends Group {
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ this.computedPosition = pictureDevice.position;
+ } else {
+ this.computedPosition = model.position;
+ }
this.z = 0;
this.model = model;
this.style = style;
@@ -21,55 +27,56 @@ export default class SignalButton extends Group {
create() {
const model = this.model;
+ const computedPosition = this.computedPosition;
const fillColor = this.getTypeColor();
const queryList = window.location.search.substring(1).split('&');
const queryCtc = queryList.find(item => {
- return item.includes('ctc');
- });
+ return item.includes('ctc');
+ });
const ctcArcList = ['OCCLUSION', 'RECOVERY', 'CHANGE_DIRECTION', 'ACCIDENT', 'DEPART_ASSIST', 'PICK_ASSIST', 'ASSIST'];
- if (queryCtc && ctcArcList.includes(model.type)){
- this.arcShape = new Arc({
- zlevel: this.zlevel,
- z: this.z,
- shape: {
- cx: this.model.position.x + 7,
- cy: this.model.position.y + 7,
- r: 7
- },
- style: {
- stroke: '#69666E',
- lineWidth: 1,
- fill: fillColor
- }
- });
- this.add(this.arcShape);
- } else {
- this.rectButton = new Rect({
- zlevel: this.zlevel,
- z: this.z,
- shape: {
- x: model.position.x,
- y: model.position.y,
- width: 14,
- height: 14
- },
- style: {
- lineDash: null,
- stroke: '#69666E',
- lineWidth:1,
- fill: fillColor
- }
- });
- this.add(this.rectButton);
- }
+ if (queryCtc && ctcArcList.includes(model.type)) {
+ this.arcShape = new Arc({
+ zlevel: this.zlevel,
+ z: this.z,
+ shape: {
+ cx: computedPosition.x + 7,
+ cy: computedPosition.y + 7,
+ r: 7
+ },
+ style: {
+ stroke: '#69666E',
+ lineWidth: 1,
+ fill: fillColor
+ }
+ });
+ this.add(this.arcShape);
+ } else {
+ this.rectButton = new Rect({
+ zlevel: this.zlevel,
+ z: this.z,
+ shape: {
+ x: computedPosition.x,
+ y: computedPosition.y,
+ width: 14,
+ height: 14
+ },
+ style: {
+ lineDash: null,
+ stroke: '#69666E',
+ lineWidth:1,
+ fill: fillColor
+ }
+ });
+ this.add(this.rectButton);
+ }
this.leftLine = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
- x1: model.position.x + 1,
- y1: model.position.y + 1,
- x2: model.position.x + 13,
- y2: model.position.y + 13
+ x1: computedPosition.x + 1,
+ y1: computedPosition.y + 1,
+ x2: computedPosition.x + 13,
+ y2: computedPosition.y + 13
},
style: {
lineWidth: 2,
@@ -82,10 +89,10 @@ export default class SignalButton extends Group {
zlevel: this.zlevel,
z: this.z + 1,
shape: {
- x1: model.position.x + 13,
- y1: model.position.y + 1,
- x2: model.position.x + 1,
- y2: model.position.y + 13
+ x1: computedPosition.x + 13,
+ y1: computedPosition.y + 1,
+ x2: computedPosition.x + 1,
+ y2: computedPosition.y + 13
},
style: {
lineWidth: 2,
@@ -98,10 +105,10 @@ export default class SignalButton extends Group {
zlevel: this.zlevel,
z: this.z + 1,
shape: {
- x1: model.position.x - 1,
- y1: model.position.y - 1,
- x2: model.position.x - 1,
- y2: model.position.y + 15
+ x1: computedPosition.x - 1,
+ y1: computedPosition.y - 1,
+ x2: computedPosition.x - 1,
+ y2: computedPosition.y + 15
},
style: {
lineWidth: 2,
@@ -114,10 +121,10 @@ export default class SignalButton extends Group {
zlevel: this.zlevel,
z: this.z + 1,
shape: {
- x1: model.position.x - 1,
- y1: model.position.y - 1,
- x2: model.position.x + 15,
- y2: model.position.y - 1
+ x1: computedPosition.x - 1,
+ y1: computedPosition.y - 1,
+ x2: computedPosition.x + 15,
+ y2: computedPosition.y - 1
},
style: {
lineWidth: 2,
@@ -130,10 +137,10 @@ export default class SignalButton extends Group {
zlevel: this.zlevel,
z: this.z + 1,
shape: {
- x1: model.position.x + 15,
- y1: model.position.y - 1,
- x2: model.position.x + 15,
- y2: model.position.y + 15
+ x1: computedPosition.x + 15,
+ y1: computedPosition.y - 1,
+ x2: computedPosition.x + 15,
+ y2: computedPosition.y + 15
},
style: {
lineWidth: 2,
@@ -146,10 +153,10 @@ export default class SignalButton extends Group {
zlevel: this.zlevel,
z: this.z + 1,
shape: {
- x1: model.position.x - 1,
- y1: model.position.y + 15,
- x2: model.position.x + 15,
- y2: model.position.y + 15
+ x1: computedPosition.x - 1,
+ y1: computedPosition.y + 15,
+ x2: computedPosition.x + 15,
+ y2: computedPosition.y + 15
},
style: {
lineWidth: 2,
@@ -164,8 +171,8 @@ export default class SignalButton extends Group {
zlevel: this.zlevel,
z: this.z,
style: {
- x: model.position.x + model.nameOffset.x,
- y: model.position.y + model.nameOffset.y,
+ x: computedPosition.x + model.nameOffset.x,
+ y: computedPosition.y + model.nameOffset.y,
fontWeight: '400',
fontSize: 10,
fontFamily: '',
@@ -214,7 +221,7 @@ export default class SignalButton extends Group {
} else if (this.model.type === 'GUIDE') {
color = '#5050E1';
} else if (list.includes(this.model.type)) {
- color = '#ccc';
+ color = '#ccc';
} else {
color = '#008000';
}
@@ -223,11 +230,11 @@ export default class SignalButton extends Group {
recover() {
this.stopAnimation();
this.rectButton && this.rectButton.setStyle({ fill:this.getTypeColor() });
- this.arcShape && this.arcShape.setStyle({ fill:this.getTypeColor() });
+ this.arcShape && this.arcShape.setStyle({ fill:this.getTypeColor() });
this.rightLine && this.rightLine.hide();
this.leftLine && this.leftLine.hide();
this.rectButton && this.rectButton.show();
- this.arcShape && this.arcShape.show();
+ this.arcShape && this.arcShape.show();
this.buttonText && this.buttonText.show();
this.leftBoard && this.leftBoard.hide();
this.rightBoard && this.rightBoard.hide();
diff --git a/src/jmapNew/shape/graph/SplitStation/index.js b/src/jmapNew/shape/graph/SplitStation/index.js
index 341e67332..b5a79ceaf 100644
--- a/src/jmapNew/shape/graph/SplitStation/index.js
+++ b/src/jmapNew/shape/graph/SplitStation/index.js
@@ -11,6 +11,12 @@ export default class SplitStation extends Group {
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ this.computedPosition = pictureDevice.position;
+ } else {
+ this.computedPosition = model.position;
+ }
this.model = model;
this.isBigScreen = false;
this.style = style;
@@ -19,6 +25,7 @@ export default class SplitStation extends Group {
create() {
const model = this.model;
const style = this.style;
+ const computedPosition = this.computedPosition;
if (!style.SplitStation) {
return;
}
@@ -26,10 +33,10 @@ export default class SplitStation extends Group {
zlevel: this.zlevel,
z: this.z,
shape: {
- x1: model.position.x,
- y1: model.position.y,
- x2: model.position.x,
- y2: model.position.y + style.SplitStation.height
+ x1: computedPosition.x,
+ y1: computedPosition.y,
+ x2: computedPosition.x,
+ y2: computedPosition.y + style.SplitStation.height
},
style: {
lineWidth: style.SplitStation.lineWidth,
@@ -41,17 +48,17 @@ export default class SplitStation extends Group {
z: this.z,
shape: {
points: [
- [model.position.x, model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2],
- [model.position.x - style.SplitStation.horizontalDistance, model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance],
- [model.position.x - style.SplitStation.horizontalDistance,
- model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 - style.SplitStation.lineWidth / 2],
- [model.position.x - style.SplitStation.horizontalDistance - style.SplitStation.lineLength,
- model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 - style.SplitStation.lineWidth / 2],
- [model.position.x - style.SplitStation.horizontalDistance - style.SplitStation.lineLength,
- model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 + style.SplitStation.lineWidth / 2],
- [model.position.x - style.SplitStation.horizontalDistance,
- model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 + style.SplitStation.lineWidth / 2],
- [model.position.x - style.SplitStation.horizontalDistance, model.position.y + style.SplitStation.height]
+ [computedPosition.x, computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2],
+ [computedPosition.x - style.SplitStation.horizontalDistance, computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance],
+ [computedPosition.x - style.SplitStation.horizontalDistance,
+ computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 - style.SplitStation.lineWidth / 2],
+ [computedPosition.x - style.SplitStation.horizontalDistance - style.SplitStation.lineLength,
+ computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 - style.SplitStation.lineWidth / 2],
+ [computedPosition.x - style.SplitStation.horizontalDistance - style.SplitStation.lineLength,
+ computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 + style.SplitStation.lineWidth / 2],
+ [computedPosition.x - style.SplitStation.horizontalDistance,
+ computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 + style.SplitStation.lineWidth / 2],
+ [computedPosition.x - style.SplitStation.horizontalDistance, computedPosition.y + style.SplitStation.height]
]
},
style: {
@@ -63,17 +70,17 @@ export default class SplitStation extends Group {
z: this.z,
shape: {
points: [
- [model.position.x, model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2],
- [model.position.x + style.SplitStation.horizontalDistance, model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance],
- [model.position.x + style.SplitStation.horizontalDistance,
- model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 - style.SplitStation.lineWidth / 2],
- [model.position.x + style.SplitStation.horizontalDistance + style.SplitStation.lineLength,
- model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 - style.SplitStation.lineWidth / 2],
- [model.position.x + style.SplitStation.horizontalDistance + style.SplitStation.lineLength,
- model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 + style.SplitStation.lineWidth / 2],
- [model.position.x + style.SplitStation.horizontalDistance,
- model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 + style.SplitStation.lineWidth / 2],
- [model.position.x + style.SplitStation.horizontalDistance, model.position.y + style.SplitStation.height]
+ [computedPosition.x, computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2],
+ [computedPosition.x + style.SplitStation.horizontalDistance, computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance],
+ [computedPosition.x + style.SplitStation.horizontalDistance,
+ computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 - style.SplitStation.lineWidth / 2],
+ [computedPosition.x + style.SplitStation.horizontalDistance + style.SplitStation.lineLength,
+ computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 - style.SplitStation.lineWidth / 2],
+ [computedPosition.x + style.SplitStation.horizontalDistance + style.SplitStation.lineLength,
+ computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 + style.SplitStation.lineWidth / 2],
+ [computedPosition.x + style.SplitStation.horizontalDistance,
+ computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 + style.SplitStation.lineWidth / 2],
+ [computedPosition.x + style.SplitStation.horizontalDistance, computedPosition.y + style.SplitStation.height]
]
},
style: {
@@ -85,7 +92,7 @@ export default class SplitStation extends Group {
z: this.z,
style: {
x: model.x,
- y: model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2,
+ y: computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2,
fontWeight: style.textStyle.fontWeight,
fontSize: style.SplitStation.fontSize,
fontFamily: style.fontFamily,
@@ -99,8 +106,8 @@ export default class SplitStation extends Group {
zlevel: this.zlevel,
z: this.z,
style: {
- x: model.position.x + style.SplitStation.horizontalDistance + style.SplitStation.lineLength,
- y: model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2,
+ x: computedPosition.x + style.SplitStation.horizontalDistance + style.SplitStation.lineLength,
+ y: computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2,
fontWeight: style.textStyle.fontWeight,
fontSize: style.SplitStation.fontSize,
fontFamily: style.fontFamily,
@@ -112,8 +119,8 @@ export default class SplitStation extends Group {
});
const leftTextWidth = this.leftText.getBoundingRect().width;
const rightTextWidth = this.rightText.getBoundingRect().width;
- this.leftText.setStyle('x', model.position.x - style.SplitStation.horizontalDistance - style.SplitStation.lineLength - leftTextWidth / 2);
- this.rightText.setStyle('x', model.position.x + style.SplitStation.horizontalDistance + style.SplitStation.lineLength + rightTextWidth / 2);
+ this.leftText.setStyle('x', computedPosition.x - style.SplitStation.horizontalDistance - style.SplitStation.lineLength - leftTextWidth / 2);
+ this.rightText.setStyle('x', computedPosition.x + style.SplitStation.horizontalDistance + style.SplitStation.lineLength + rightTextWidth / 2);
this.add(this.verticalLine);
this.add(this.arrowLeft);
this.add(this.arrowRight);
@@ -145,6 +152,6 @@ export default class SplitStation extends Group {
});
}
getAnchorPoint() {
- return this.model.position;
+ return this.computedPosition;
}
}
diff --git a/src/jmapNew/shape/graph/Station/EMouse.js b/src/jmapNew/shape/graph/Station/EMouse.js
index 156122f5c..2dbf894d3 100644
--- a/src/jmapNew/shape/graph/Station/EMouse.js
+++ b/src/jmapNew/shape/graph/Station/EMouse.js
@@ -15,7 +15,7 @@ export default class EMouse extends Group {
position: [0, 0],
style: {
x: 0,
- y: this.device.model.position.y + this.device.style.Station.StationControl.lamp.radiusR + this.device.style.Station.StationControl.text.distance - 25,
+ y: this.device.computedPosition.y + this.device.style.Station.StationControl.lamp.radiusR + this.device.style.Station.StationControl.text.distance - 25,
fontWeight: this.device.style.Station.StationControl.mouseOverStyle.fontWeight,
fontSize: this.device.style.Station.StationControl.mouseOverStyle.fontSize,
fontFamily: this.device.style.fontFamily,
@@ -32,7 +32,7 @@ export default class EMouse extends Group {
if (e.target &&
e.target.type == 'text' &&
e.target._subType == 'ControlSignal') {
- this.text.setStyle({x: e.target.style.x});
+ this.text.setStyle({x: e.target.style.x});
this.text.show();
}
}
diff --git a/src/jmapNew/shape/graph/Station/EStationText.js b/src/jmapNew/shape/graph/Station/EStationText.js
index 9350b2f67..672c8922d 100644
--- a/src/jmapNew/shape/graph/Station/EStationText.js
+++ b/src/jmapNew/shape/graph/Station/EStationText.js
@@ -18,8 +18,8 @@ class EStationText extends Group {
z: this.model.z,
silent: !model.visible || false,
style: {
- x: model.position.x,
- y: model.position.y,
+ x: model.computedPosition.x,
+ y: model.computedPosition.y,
fontWeight: style.Station.stationText.fontWeight,
fontSize: isNaN(Number(model.nameFont)) ? 20 : Number(model.nameFont),
fontFamily: style.fontFamily,
diff --git a/src/jmapNew/shape/graph/Station/EThreeLamp.js b/src/jmapNew/shape/graph/Station/EThreeLamp.js
index ea80858a0..01bb41bbf 100644
--- a/src/jmapNew/shape/graph/Station/EThreeLamp.js
+++ b/src/jmapNew/shape/graph/Station/EThreeLamp.js
@@ -42,41 +42,41 @@ export default class EThreeLamp extends Group {
}
});
this.control2 = new Arc({
- pop: model.pop,
- _subType: _subType,
- _nameType: _nameType,
- _val: _val,
- zlevel: this.zlevel,
- z: this.z,
- shape: {
- cx: model.point.x,
- cy: model.point.y,
- r: model.style.Station.StationControl.lamp.radiusR
- },
- style: {
- lineWidth: model.style.Station.StationControl.lamp.lineWidth || 0,
- fill: model.style.Station.StationControl.lamp.grayColor,
- stroke: model.style.Station.StationControl.lamp.strokeColor
- }
- });
+ pop: model.pop,
+ _subType: _subType,
+ _nameType: _nameType,
+ _val: _val,
+ zlevel: this.zlevel,
+ z: this.z,
+ shape: {
+ cx: model.point.x,
+ cy: model.point.y,
+ r: model.style.Station.StationControl.lamp.radiusR
+ },
+ style: {
+ lineWidth: model.style.Station.StationControl.lamp.lineWidth || 0,
+ fill: model.style.Station.StationControl.lamp.grayColor,
+ stroke: model.style.Station.StationControl.lamp.strokeColor
+ }
+ });
this.control3 = new Arc({
- pop: model.pop,
- _subType: _subType,
- _nameType: _nameType,
- _val: _val,
- zlevel: this.zlevel,
- z: this.z,
- shape: {
- cx: model.point.x + model.style.Station.StationControl.lamp.radiusR * 3,
- cy: model.point.y,
- r: model.style.Station.StationControl.lamp.radiusR
- },
- style: {
- lineWidth: model.style.Station.StationControl.lamp.lineWidth || 0,
- fill: model.style.Station.StationControl.lamp.grayColor,
- stroke: model.style.Station.StationControl.lamp.strokeColor
- }
- });
+ pop: model.pop,
+ _subType: _subType,
+ _nameType: _nameType,
+ _val: _val,
+ zlevel: this.zlevel,
+ z: this.z,
+ shape: {
+ cx: model.point.x + model.style.Station.StationControl.lamp.radiusR * 3,
+ cy: model.point.y,
+ r: model.style.Station.StationControl.lamp.radiusR
+ },
+ style: {
+ lineWidth: model.style.Station.StationControl.lamp.lineWidth || 0,
+ fill: model.style.Station.StationControl.lamp.grayColor,
+ stroke: model.style.Station.StationControl.lamp.strokeColor
+ }
+ });
this.text = new Text({
pop: model.pop,
diff --git a/src/jmapNew/shape/graph/Station/index.js b/src/jmapNew/shape/graph/Station/index.js
index cd309652e..db0d891f6 100644
--- a/src/jmapNew/shape/graph/Station/index.js
+++ b/src/jmapNew/shape/graph/Station/index.js
@@ -25,6 +25,18 @@ export default class Station extends Group {
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ const offsetX = pictureDevice.position.x - model.position.x;
+ const offsetY = pictureDevice.position.y - model.position.y;
+ this.computedPosition = pictureDevice.position;
+ this.computedTurnBackPoint = { x: model.turnBackPoint ? model.turnBackPoint.x + offsetX : 0, y: model.turnBackPoint ? model.turnBackPoint.y + offsetY : 0 };
+ this.computedControlModePoint = { x: model.controlModePoint.x + offsetX, y: model.controlModePoint.y + offsetY };
+ } else {
+ this.computedPosition = model.position;
+ this.computedTurnBackPoint = model.turnBackPoint;
+ this.computedControlModePoint = model.controlModePoint;
+ }
this.z = 40;
this.model = model;
this.style = style;
@@ -44,11 +56,12 @@ export default class Station extends Group {
const elementTypeList = {
'stationText': EStationText // 车站名称 (普通站台样式)
};
-
+ model.computedPosition = this.computedPosition;
// 遍历当前线路下的绘图元素 组合模式
traverseLineElements(style.Station, elementTypeList, model, style, this);
const path = window.location.href;
+ const computedPosition = this.computedPosition;
if (style.Station.kmPostShow || path.includes('/map/draw')) { // 公里标是否显示
let direction = 1;
if (this.style.Station.kilometerPosition == 'up') {
@@ -63,8 +76,8 @@ export default class Station extends Group {
zlevel: this.zlevel,
z: this.z,
position: [0, 0],
- x: model.position.x + offset.x,
- y: model.position.y + ((parseInt(model.nameFont) + 2) * direction) + offset.y,
+ x: computedPosition.x + offset.x,
+ y: computedPosition.y + ((parseInt(model.nameFont) + 2) * direction) + offset.y,
fontWeight: model.fontWeight,
fontSize: model.kmPostFont || 18,
fontFamily: style.fontFamily,
@@ -87,6 +100,7 @@ export default class Station extends Group {
}
createTurnBack() { // 创建按图折返
const model = this.model;
+ const computedTurnBackPoint = this.computedTurnBackPoint;
const style = this.style;
if (model.visible && model.createTurnBack) {
this.turnBacks = [];
@@ -96,8 +110,8 @@ export default class Station extends Group {
z: this.z,
position: [0, 0],
style: {
- x: model.turnBackPoint.x,
- y: model.turnBackPoint.y - style.Station.lamp.radiusR - style.Station.turnBack.toptextDistance,
+ x: computedTurnBackPoint.x,
+ y: computedTurnBackPoint.y - style.Station.lamp.radiusR - style.Station.turnBack.toptextDistance,
fontWeight: style.Station.text.fontWeight,
fontSize: style.Station.text.fontSize,
fontFamily: style.fontFamily,
@@ -115,8 +129,8 @@ export default class Station extends Group {
z: this.z,
arc: {
shape: {
- cx: model.turnBackPoint.x + style.Station.turnBack.lampSpace * index,
- cy: model.turnBackPoint.y,
+ cx: computedTurnBackPoint.x + style.Station.turnBack.lampSpace * index,
+ cy: computedTurnBackPoint.y,
r: style.Station.lamp.radiusR
},
lineWidth: 0,
@@ -125,8 +139,8 @@ export default class Station extends Group {
},
text: {
position: [0, 0],
- x: model.turnBackPoint.x + style.Station.turnBack.lampSpace * index,
- y: model.turnBackPoint.y + style.Station.lamp.radiusR + style.Station.StationControl.text.distance,
+ x: computedTurnBackPoint.x + style.Station.turnBack.lampSpace * index,
+ y: computedTurnBackPoint.y + style.Station.lamp.radiusR + style.Station.StationControl.text.distance,
fontWeight: style.Station.text.fontWeight,
fontSize: style.Station.text.fontSize,
fontFamily: style.fontFamily,
@@ -176,8 +190,9 @@ export default class Station extends Group {
this.setState(model);
}
createCtcControlMode() { // 大铁
- // 非常站控
- const model = this.model;
+ // 非常站控
+ // const model = this.model;
+ const computedControlModePoint = this.computedControlModePoint;
// 分散自律
this.selfDisciplineThree = new EThreeLamp({
_subType: 'veryControl',
@@ -185,8 +200,8 @@ export default class Station extends Group {
zlevel: this.zlevel,
z: this.z,
point: {
- x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.selfDisciplineThree.offset.x,
- y: model.controlModePoint.y + this.style.Station.StationControl.selfDisciplineThree.offset.y
+ x: computedControlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.selfDisciplineThree.offset.x,
+ y: computedControlModePoint.y + this.style.Station.StationControl.selfDisciplineThree.offset.y
},
context: this.style.Station.StationControl.selfDisciplineThree.text,
pop: false
@@ -199,8 +214,8 @@ export default class Station extends Group {
zlevel: this.zlevel,
z: this.z,
point: {
- x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.veryControl.offset.x,
- y: model.controlModePoint.y + this.style.Station.StationControl.veryControl.offset.y
+ x: computedControlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.veryControl.offset.x,
+ y: computedControlModePoint.y + this.style.Station.StationControl.veryControl.offset.y
},
context: this.style.Station.StationControl.veryControl.text,
pop: false
@@ -213,8 +228,8 @@ export default class Station extends Group {
zlevel: this.zlevel,
z: this.z,
point: {
- x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.graphRoad.offset.x,
- y: model.controlModePoint.y + this.style.Station.StationControl.graphRoad.offset.y
+ x: computedControlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.graphRoad.offset.x,
+ y: computedControlModePoint.y + this.style.Station.StationControl.graphRoad.offset.y
},
context: this.style.Station.StationControl.graphRoad.text,
pop: false
@@ -227,8 +242,8 @@ export default class Station extends Group {
zlevel: this.zlevel,
z: this.z,
point: {
- x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.planControl.offset.x,
- y: model.controlModePoint.y + this.style.Station.StationControl.planControl.offset.y
+ x: computedControlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.planControl.offset.x,
+ y: computedControlModePoint.y + this.style.Station.StationControl.planControl.offset.y
},
context: this.style.Station.StationControl.planControl.text,
pop: false
@@ -241,8 +256,8 @@ export default class Station extends Group {
zlevel: this.zlevel,
z: this.z,
point: {
- x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.centerCommunication.offset.x,
- y: model.controlModePoint.y + this.style.Station.StationControl.centerCommunication.offset.y
+ x: computedControlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.centerCommunication.offset.x,
+ y: computedControlModePoint.y + this.style.Station.StationControl.centerCommunication.offset.y
},
context: this.style.Station.StationControl.centerCommunication.text,
pop: false
@@ -255,8 +270,8 @@ export default class Station extends Group {
zlevel: this.zlevel,
z: this.z,
point: {
- x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.selfDisciplineCommunication.offset.x,
- y: model.controlModePoint.y + this.style.Station.StationControl.selfDisciplineCommunication.offset.y
+ x: computedControlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.selfDisciplineCommunication.offset.x,
+ y: computedControlModePoint.y + this.style.Station.StationControl.selfDisciplineCommunication.offset.y
},
context: this.style.Station.StationControl.selfDisciplineCommunication.text,
pop: false
@@ -269,8 +284,8 @@ export default class Station extends Group {
zlevel: this.zlevel,
z: this.z,
point: {
- x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.allowedTurnBack.offset.x,
- y: model.controlModePoint.y + this.style.Station.StationControl.allowedTurnBack.offset.y
+ x: computedControlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.allowedTurnBack.offset.x,
+ y: computedControlModePoint.y + this.style.Station.StationControl.allowedTurnBack.offset.y
},
context: this.style.Station.StationControl.allowedTurnBack.text,
pop: false
@@ -283,8 +298,8 @@ export default class Station extends Group {
zlevel: this.zlevel,
z: this.z,
point: {
- x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.trainControl.offset.x,
- y: model.controlModePoint.y + this.style.Station.StationControl.trainControl.offset.y
+ x: computedControlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.trainControl.offset.x,
+ y: computedControlModePoint.y + this.style.Station.StationControl.trainControl.offset.y
},
context: this.style.Station.StationControl.trainControl.text,
pop: false
@@ -292,13 +307,14 @@ export default class Station extends Group {
this.add(this.trainControl);
}
createControlModeAU() { // 西安二
- const model = this.model;
+ // const model = this.model;
+ const computedControlModePoint = this.computedControlModePoint;
this.stationControlAU = new Text({
zlevel: this.zlevel,
z: this.z,
style: {
- x: model.controlModePoint.x + this.style.Station.StationControl.text.offsetX * -1,
- y: model.controlModePoint.y + this.style.Station.StationControl.text.offsetY,
+ x: computedControlModePoint.x + this.style.Station.StationControl.text.offsetX * -1,
+ y: computedControlModePoint.y + this.style.Station.StationControl.text.offsetY,
fontWeight: this.style.Station.StationControl.text.fontWeight,
fontSize: this.style.Station.StationControl.text.fontSize,
fontFamily: this.style.fontFamily,
@@ -311,15 +327,16 @@ export default class Station extends Group {
this.add(this.stationControlAU);
}
createTroButton() {
- const model = this.model;
+ // const model = this.model;
+ const computedPosition = this.computedPosition;
const rect = this.stationText.getBoundingRect();
this.troButton = new Rect({
zlevel: this.zlevel,
z: this.z,
_subType: 'troButton',
shape: {
- x: model.position.x + rect.width / 2 + 5,
- y: model.position.y,
+ x: computedPosition.x + rect.width / 2 + 5,
+ y: computedPosition.y,
width: 25,
height: 25
},
@@ -332,13 +349,14 @@ export default class Station extends Group {
this.add(this.troButton);
}
createControlModeCC() { // 西安二
- const model = this.model;
+ // const model = this.model;
+ const computedControlModePoint = this.computedControlModePoint;
this.stationControlCC = new Text({
zlevel: this.zlevel,
z: this.z,
style: {
- x: model.controlModePoint.x + this.style.Station.StationControl.text.offsetX * 0,
- y: model.controlModePoint.y + this.style.Station.StationControl.text.offsetY,
+ x: computedControlModePoint.x + this.style.Station.StationControl.text.offsetX * 0,
+ y: computedControlModePoint.y + this.style.Station.StationControl.text.offsetY,
fontWeight: this.style.Station.StationControl.text.fontWeight,
fontSize: this.style.Station.StationControl.text.fontSize,
fontFamily: this.style.fontFamily,
@@ -352,13 +370,14 @@ export default class Station extends Group {
}
createControlModeCL() { // 西安二
- const model = this.model;
+ // const model = this.model;
+ const computedControlModePoint = this.computedControlModePoint;
this.stationControlCL = new Text({
zlevel: this.zlevel,
z: this.z,
style: {
- x: model.controlModePoint.x + this.style.Station.StationControl.text.offsetX * 1,
- y: model.controlModePoint.y + this.style.Station.StationControl.text.offsetY,
+ x: computedControlModePoint.x + this.style.Station.StationControl.text.offsetX * 1,
+ y: computedControlModePoint.y + this.style.Station.StationControl.text.offsetY,
fontWeight: this.style.Station.StationControl.text.fontWeight,
fontSize: this.style.Station.StationControl.text.fontSize,
fontFamily: this.style.fontFamily,
@@ -372,13 +391,14 @@ export default class Station extends Group {
}
createControlModeVA() { // 西安二
- const model = this.model;
+ // const model = this.model;
+ const computedControlModePoint = this.computedControlModePoint;
this.stationControlVA = new Text({
zlevel: this.zlevel,
z: this.z,
style: {
- x: model.controlModePoint.x + this.style.Station.StationControl.text.offsetX * 2,
- y: model.controlModePoint.y + this.style.Station.StationControl.text.offsetY,
+ x: computedControlModePoint.x + this.style.Station.StationControl.text.offsetX * 2,
+ y: computedControlModePoint.y + this.style.Station.StationControl.text.offsetY,
fontWeight: this.style.Station.StationControl.text.fontWeight,
fontSize: this.style.Station.StationControl.text.fontSize,
fontFamily: this.style.fontFamily,
@@ -392,7 +412,8 @@ export default class Station extends Group {
}
createEmergencyControl() { // 紧急站控
- const model = this.model;
+ // const model = this.model;
+ const computedControlModePoint = this.computedControlModePoint;
if (this.style.Station.StationControl.emergencyControl.show) {
this.emergencyControl = new ESingleControl({
_subType: 'emergency',
@@ -400,16 +421,16 @@ export default class Station extends Group {
zlevel: this.zlevel,
z: this.z,
point: {
- x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.emergencyControl.offset.x,
- y: model.controlModePoint.y + this.style.Station.StationControl.emergencyControl.offset.y
+ x: computedControlModePoint.x - this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.emergencyControl.offset.x,
+ y: computedControlModePoint.y + this.style.Station.StationControl.emergencyControl.offset.y
},
context: this.style.Station.StationControl.emergencyControl.text,
pop: false
});
this.add(this.emergencyControl);
if (this.style.Station.StationControl.emergencyControl.arrowShow) {
- const x = model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.emergencyControl.offset.x;
- const y = model.controlModePoint.y + this.style.Station.StationControl.emergencyControl.offset.y;
+ const x = computedControlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.emergencyControl.offset.x;
+ const y = computedControlModePoint.y + this.style.Station.StationControl.emergencyControl.offset.y;
const point = arrow(x, y + this.style.Station.StationControl.lamp.radiusR / 2, this.style.Station.StationControl.lamp.distance / 6, this.style.Station.StationControl.lamp.radiusR * 0.8);
this.emergencyArrowsControl = new EArrow({
zlevel: this.zlevel,
@@ -418,8 +439,8 @@ export default class Station extends Group {
count: this.count,
drict: 1,
point: point,
- x: model.controlModePoint.x + this.style.Station.StationControl.lamp.offset.x,
- y: model.controlModePoint.y + this.style.Station.StationControl.lamp.radiusR / 2 + this.style.Station.StationControl.lamp.offset.y,
+ x: computedControlModePoint.x + this.style.Station.StationControl.lamp.offset.x,
+ y: computedControlModePoint.y + this.style.Station.StationControl.lamp.radiusR / 2 + this.style.Station.StationControl.lamp.offset.y,
fill: this.style.Station.StationControl.emergencyControl.grayColor,
lineWidth: 1,
stroke: this.style.sidelineColor
@@ -429,63 +450,65 @@ export default class Station extends Group {
}
}
createSelfDiscipline() {
- const model = this.model;
- if (this.style.Station.StationControl.selfDiscipline) {
- this.selfDiscipline = new ESingleControl({
+ // const model = this.model;
+ const computedControlModePoint = this.computedControlModePoint;
+ if (this.style.Station.StationControl.selfDiscipline) {
+ this.selfDiscipline = new ESingleControl({
_subType: 'self_discipline',
style: this.style,
zlevel: this.zlevel,
z: this.z,
point: {
- x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.selfDiscipline.offset.x,
- y: model.controlModePoint.y + this.style.Station.StationControl.selfDiscipline.offset.y
+ x: computedControlModePoint.x - this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.selfDiscipline.offset.x,
+ y: computedControlModePoint.y + this.style.Station.StationControl.selfDiscipline.offset.y
},
context: this.style.Station.StationControl.selfDiscipline.text,
pop: false
});
- this.add(this.selfDiscipline);
+ this.add(this.selfDiscipline);
}
- if (this.style.Station.StationControl.selfDisciplineControl) {
- this.selfDisciplineControl = new ESingleControl({
+ if (this.style.Station.StationControl.selfDisciplineControl) {
+ this.selfDisciplineControl = new ESingleControl({
_subType: 'self_discipline_control',
style: this.style,
zlevel: this.zlevel,
z: this.z,
point: {
- x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.selfDisciplineControl.offset.x,
- y: model.controlModePoint.y + this.style.Station.StationControl.selfDisciplineControl.offset.y
+ x: computedControlModePoint.x - this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.selfDisciplineControl.offset.x,
+ y: computedControlModePoint.y + this.style.Station.StationControl.selfDisciplineControl.offset.y
},
context: this.style.Station.StationControl.selfDisciplineControl.text,
pop: false
});
- this.add(this.selfDisciplineControl);
+ this.add(this.selfDisciplineControl);
}
}
createVeryControl() {
- const model = this.model;
- if (this.style.Station.StationControl.veryControl) {
- this.veryControl = new ESingleControl({
+ // const model = this.model;
+ const computedControlModePoint = this.computedControlModePoint;
+ if (this.style.Station.StationControl.veryControl) {
+ this.veryControl = new ESingleControl({
_subType: 'very',
style: this.style,
zlevel: this.zlevel,
z: this.z,
point: {
- x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.veryControl.offset.x,
- y: model.controlModePoint.y + this.style.Station.StationControl.centerControl.offset.y
+ x: computedControlModePoint.x + this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.veryControl.offset.x,
+ y: computedControlModePoint.y + this.style.Station.StationControl.centerControl.offset.y
},
context: this.style.Station.StationControl.veryControl.text,
pop: false
});
- this.add(this.veryControl);
+ this.add(this.veryControl);
}
- if (this.style.Station.StationControl.veryControlButton) {
- this.veryControlButton = new Rect({
+ if (this.style.Station.StationControl.veryControlButton) {
+ this.veryControlButton = new Rect({
zlevel: this.zlevel,
z: this.z,
_subType: 'veryControlButton',
shape: {
- x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.veryControlButton.offset.x - this.style.Station.StationControl.lamp.radiusR,
- y: model.controlModePoint.y + this.style.Station.StationControl.veryControlButton.offset.y - this.style.Station.StationControl.lamp.radiusR,
+ x: computedControlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.veryControlButton.offset.x - this.style.Station.StationControl.lamp.radiusR,
+ y: computedControlModePoint.y + this.style.Station.StationControl.veryControlButton.offset.y - this.style.Station.StationControl.lamp.radiusR,
width: this.style.Station.StationControl.lamp.radiusR * 2,
height: this.style.Station.StationControl.lamp.radiusR * 2
},
@@ -495,15 +518,15 @@ export default class Station extends Group {
fill: this.style.Station.StationControl.veryControlButton.defaultColor
}
});
- this.add(this.veryControlButton);
- this.veryControlButtonText = new Text({
+ this.add(this.veryControlButton);
+ this.veryControlButtonText = new Text({
zlevel: this.zlevel,
z: this.z,
_subType: 'veryControlButtonText',
position: [0, 0],
style: {
- x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.veryControlButton.offset.y,
- y: model.controlModePoint.y + this.style.Station.StationControl.veryControlButton.offset.y + this.style.Station.StationControl.lamp.radiusR + this.style.Station.StationControl.text.distance,
+ x: computedControlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.veryControlButton.offset.y,
+ y: computedControlModePoint.y + this.style.Station.StationControl.veryControlButton.offset.y + this.style.Station.StationControl.lamp.radiusR + this.style.Station.StationControl.text.distance,
fontWeight: this.style.Station.StationControl.text.fontWeight,
fontSize: this.style.Station.StationControl.text.fontSize,
fontFamily: this.style.fontFamily,
@@ -514,11 +537,12 @@ export default class Station extends Group {
},
pop: false
});
- this.add(this.veryControlButtonText);
+ this.add(this.veryControlButtonText);
}
}
createCenterControl() { // 中控按钮
- const model = this.model;
+ // const model = this.model;
+ const computedControlModePoint = this.computedControlModePoint;
if (this.style.Station.StationControl.centerControl.show) {
this.centerControl = new ESingleControl({
_subType: 'center',
@@ -526,16 +550,16 @@ export default class Station extends Group {
zlevel: this.zlevel,
z: this.z,
point: {
- x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.centerControl.offset.x,
- y: model.controlModePoint.y + this.style.Station.StationControl.centerControl.offset.y
+ x: computedControlModePoint.x - this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.centerControl.offset.x,
+ y: computedControlModePoint.y + this.style.Station.StationControl.centerControl.offset.y
},
context: this.style.Station.StationControl.centerControl.text,
pop: false
});
this.add(this.centerControl);
if (this.style.Station.StationControl.centerControl.arrowShow) {
- const x = model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.emergencyControl.offset.x;
- const y = model.controlModePoint.y + this.style.Station.StationControl.emergencyControl.offset.y;
+ const x = computedControlModePoint.x - this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.emergencyControl.offset.x;
+ const y = computedControlModePoint.y + this.style.Station.StationControl.emergencyControl.offset.y;
const point = arrow(x, y + this.style.Station.StationControl.lamp.radiusR / 2, this.style.Station.StationControl.lamp.distance / 6, this.style.Station.StationControl.lamp.radiusR * 0.8);
this.centerArrowsControl = new EArrow({
zlevel: this.zlevel,
@@ -544,8 +568,8 @@ export default class Station extends Group {
count: this.count,
drict: 1,
point: point,
- x: model.controlModePoint.x + this.style.Station.StationControl.lamp.offset.x,
- y: model.controlModePoint.y + this.style.Station.StationControl.lamp.radiusR / 2 + this.style.Station.StationControl.lamp.offset.y,
+ x: computedControlModePoint.x + this.style.Station.StationControl.lamp.offset.x,
+ y: computedControlModePoint.y + this.style.Station.StationControl.lamp.radiusR / 2 + this.style.Station.StationControl.lamp.offset.y,
fill: this.style.Station.StationControl.centerControl.grayColor,
lineWidth: 1,
stroke: this.style.sidelineColor
@@ -561,8 +585,8 @@ export default class Station extends Group {
zlevel: this.zlevel,
z: this.z + 1,
point: {
- x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.lamp.offset.x,
- y: model.controlModePoint.y + this.style.Station.StationControl.lamp.offset.y
+ x: computedControlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.lamp.offset.x,
+ y: computedControlModePoint.y + this.style.Station.StationControl.lamp.offset.y
},
context: this.style.Station.StationControl.centerControl.buttonText,
pop: false
@@ -589,8 +613,8 @@ export default class Station extends Group {
zlevel: this.zlevel,
z: this.z + 1,
point: {
- x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 9 / 2 + this.style.Station.StationControl.lamp.offset.x,
- y: model.controlModePoint.y + this.style.Station.StationControl.lamp.offset.y
+ x: computedControlModePoint.x + this.style.Station.StationControl.lamp.distance * 9 / 2 + this.style.Station.StationControl.lamp.offset.x,
+ y: computedControlModePoint.y + this.style.Station.StationControl.lamp.offset.y
},
context: this.style.Station.StationControl.centerControl.lightText,
pop: false
@@ -617,8 +641,8 @@ export default class Station extends Group {
zlevel: this.zlevel,
z: this.z + 1,
point: {
- x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 + this.style.Station.StationControl.lamp.offset.x,
- y: model.controlModePoint.y + this.style.Station.StationControl.lamp.offset.y
+ x: computedControlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 + this.style.Station.StationControl.lamp.offset.x,
+ y: computedControlModePoint.y + this.style.Station.StationControl.lamp.offset.y
},
context: this.style.Station.StationControl.centerControl.preResetText,
pop: false
@@ -641,7 +665,8 @@ export default class Station extends Group {
}
createSubstationControl() { // 站控按钮
- const model = this.model;
+ // const model = this.model;
+ const computedControlModePoint = this.computedControlModePoint;
if (this.style.Station.StationControl.substationControl.show) {
this.substationControl = new ESingleControl({
_subType: 'substation',
@@ -649,16 +674,16 @@ export default class Station extends Group {
zlevel: this.zlevel,
z: this.z,
point: {
- x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.substationControl.offset.x,
- y: model.controlModePoint.y + this.style.Station.StationControl.substationControl.offset.y
+ x: computedControlModePoint.x + this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.substationControl.offset.x,
+ y: computedControlModePoint.y + this.style.Station.StationControl.substationControl.offset.y
},
context: this.style.Station.StationControl.substationControl.text,
pop: false
});
this.add(this.substationControl);
if (this.style.Station.StationControl.substationControl.arrowShow) {
- const x = this.model.controlModePoint.x + this.style.Station.StationControl.substationControl.offset.x;
- const y = this.model.controlModePoint.y + this.style.Station.StationControl.substationControl.offset.y;
+ const x = computedControlModePoint.x + this.style.Station.StationControl.substationControl.offset.x;
+ const y = computedControlModePoint.y + this.style.Station.StationControl.substationControl.offset.y;
const point = arrow(x, y + this.style.Station.StationControl.lamp.radiusR / 2, this.style.Station.StationControl.lamp.distance / 6, this.style.Station.StationControl.lamp.radiusR * 0.8);
this.substationArrowsControl = new EArrow({
zlevel: this.zlevel,
@@ -667,8 +692,8 @@ export default class Station extends Group {
count: this.count,
drict: 1,
point: point,
- x: model.controlModePoint.x + this.style.Station.StationControl.lamp.offset.x,
- y: model.controlModePoint.y + this.style.Station.StationControl.lamp.radiusR / 2 + this.style.Station.StationControl.lamp.offset.y,
+ x: computedControlModePoint.x + this.style.Station.StationControl.lamp.offset.x,
+ y: computedControlModePoint.y + this.style.Station.StationControl.lamp.radiusR / 2 + this.style.Station.StationControl.lamp.offset.y,
fill: this.style.Station.StationControl.substationControl.grayColor,
lineWidth: 1,
stroke: this.style.sidelineColor
@@ -679,7 +704,8 @@ export default class Station extends Group {
}
createInterconnectedControl() { // 联锁控
- const model = this.model;
+ // const model = this.model;
+ const computedControlModePoint = this.computedControlModePoint;
if (this.style.Station.StationControl.interconnectedControl.show) { // 成都三会显示
this.interconnectedControl = new ESingleControl({
_subType: 'interconnected',
@@ -687,8 +713,8 @@ export default class Station extends Group {
zlevel: this.zlevel,
z: this.z,
point: {
- x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.interconnectedControl.offset.x,
- y: model.controlModePoint.y + this.style.Station.StationControl.interconnectedControl.offset.y
+ x: computedControlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.interconnectedControl.offset.x,
+ y: computedControlModePoint.y + this.style.Station.StationControl.interconnectedControl.offset.y
},
context: this.style.Station.StationControl.interconnectedControl.text || '联锁控',
pop: false
@@ -821,7 +847,7 @@ export default class Station extends Group {
} else if (!store.getters['map/checkDeviceShow'](this._code)) {
this.eachChild(item => { item.hide(); });
} else {
- store.getters['map/checkStationGuideMaster'](this._code, model.sguideMasterLock, model.xguideMasterLock);
+ store.getters['map/checkStationGuideMaster'](this._code, model.sguideMasterLock, model.xguideMasterLock);
model.controlMode && this['handle' + model.controlMode]();
model.preResetValidDuration && this.handlePreResetLamp();
model.controller && this.handleComplexControl(model.controller);
@@ -1003,6 +1029,6 @@ export default class Station extends Group {
}
}
getAnchorPoint() {
- return this.model.position;
+ return this.computedPosition;
}
}
diff --git a/src/jmapNew/shape/graph/StationCounter/index.js b/src/jmapNew/shape/graph/StationCounter/index.js
index be05d40c6..6acb4d869 100644
--- a/src/jmapNew/shape/graph/StationCounter/index.js
+++ b/src/jmapNew/shape/graph/StationCounter/index.js
@@ -11,6 +11,12 @@ export default class StationCounter extends Group {
super();
this._code = model.code;
this._type = model._type;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ this.computedPosition = pictureDevice.position;
+ } else {
+ this.computedPosition = model.position;
+ }
this.model = model;
this.style = style;
this.zlevel = model.zlevel;
@@ -21,14 +27,15 @@ export default class StationCounter extends Group {
create() {
const model = this.model;
+ const computedPosition = this.computedPosition;
const style = this.style;
this.counter = new Text({
zlevel: this.zlevel,
z: this.z,
position: [0, 0],
style: {
- x: model.position.x,
- y: model.position.y,
+ x: computedPosition.x,
+ y: computedPosition.y,
fontWeight: 'normal',
fontSize: style.textFontSize,
fontFamily: style.fontFamily,
@@ -64,8 +71,8 @@ export default class StationCounter extends Group {
z: this.z,
position: [0, 0],
style: {
- x: model.position.x,
- y: model.position.y + this.rect.width + this.vPadding + style.textFontSize + style.StationCounter.text.distance,
+ x: computedPosition.x,
+ y: computedPosition.y + this.rect.width + this.vPadding + style.textFontSize + style.StationCounter.text.distance,
fontWeight: 'bold',
fontSize: style.textFontSize,
fontFamily: style.fontFamily,
@@ -99,7 +106,7 @@ export default class StationCounter extends Group {
return null;
}
getAnchorPoint() {
- return this.model.position;
+ return this.computedPosition;
}
}
diff --git a/src/jmapNew/shape/graph/StationDelayUnlock/index.js b/src/jmapNew/shape/graph/StationDelayUnlock/index.js
index 77208e9c4..5d05fdbf6 100644
--- a/src/jmapNew/shape/graph/StationDelayUnlock/index.js
+++ b/src/jmapNew/shape/graph/StationDelayUnlock/index.js
@@ -11,6 +11,12 @@ export default class StationDelayUnlock extends Group {
super();
this._code = model.code;
this._type = model._type;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ this.computedPosition = pictureDevice.position;
+ } else {
+ this.computedPosition = model.position;
+ }
this.model = model;
this.style = style;
this.zlevel = model.zlevel;
@@ -21,14 +27,15 @@ export default class StationDelayUnlock extends Group {
create() {
const model = this.model;
+ const computedPosition = this.computedPosition;
const style = this.style;
this.text = new Text({
zlevel: this.zlevel,
z: this.z,
position: [0, 0],
style: {
- x: model.position.x,
- y: model.position.y,
+ x: computedPosition.x,
+ y: computedPosition.y,
fontWeight: 'normal',
fontSize: model.textFont,
fontFamily: style.fontFamily,
@@ -45,8 +52,8 @@ export default class StationDelayUnlock extends Group {
z: this.z,
position: [0, 0],
style: {
- x: model.position.x,
- y: model.position.y + fontSize + style.StationDelayUnlock.text.distance,
+ x: computedPosition.x,
+ y: computedPosition.y + fontSize + style.StationDelayUnlock.text.distance,
fontWeight: 'normal',
fontSize: model.textFont,
fontFamily: style.fontFamily,
@@ -69,8 +76,8 @@ export default class StationDelayUnlock extends Group {
zlevel: this.zlevel,
z: this.z - 1,
shape: {
- x: model.position.x - this.lPadding,
- y: model.position.y - this.vPadding,
+ x: computedPosition.x - this.lPadding,
+ y: computedPosition.y - this.vPadding,
width: this.rect.width + this.lPadding * 2,
height: this.rect.height + this.vPadding * 2
},
@@ -119,6 +126,6 @@ export default class StationDelayUnlock extends Group {
this.time && this.time.show();
}
getAnchorPoint() {
- return this.model.position;
+ return this.computedPosition;
}
}
diff --git a/src/jmapNew/shape/graph/StationStand/EEarlyStart.js b/src/jmapNew/shape/graph/StationStand/EEarlyStart.js
index 351541379..2d312020f 100644
--- a/src/jmapNew/shape/graph/StationStand/EEarlyStart.js
+++ b/src/jmapNew/shape/graph/StationStand/EEarlyStart.js
@@ -12,13 +12,14 @@ class EEarlyStart extends Group {
create(deviceParam) {
if (!this.isNew) {
const model = this.model.modelData;
+ const computedPosition = this.model.modelData.computedPosition;
const style = this.model.style;
this.isNew = true;
/** 提前发车*/
const startD = model.right ? 1 : -1;
- const startX = model.position.x - startD * (deviceParam.offset.x - model.width / 2);
- const startY = model.position.y + startD * (deviceParam.offset.y - model.height / 2);
+ const startX = computedPosition.x - startD * (deviceParam.offset.x - model.width / 2);
+ const startY = computedPosition.y + startD * (deviceParam.offset.y - model.height / 2);
this.earlyStart = new Text({
zlevel: this.model.zlevel,
diff --git a/src/jmapNew/shape/graph/StationStand/ELevel.js b/src/jmapNew/shape/graph/StationStand/ELevel.js
index 4b35fb63f..f4d5ce315 100644
--- a/src/jmapNew/shape/graph/StationStand/ELevel.js
+++ b/src/jmapNew/shape/graph/StationStand/ELevel.js
@@ -12,13 +12,14 @@ class ELevel extends Group {
create() {
if (!this.isNew) {
const model = this.model.modelData;
+ const computedPosition = this.model.modelData.computedPosition;
const style = this.model.style;
this.isNew = true;
const levelDrict = model.right ? 1 : -1;
- const levelX = model.position.x - levelDrict * (style.StationStand.level.offset.x - model.width / 2);
- const levelY = model.position.y + levelDrict * (style.StationStand.level.offset.y);
+ const levelX = computedPosition.x - levelDrict * (style.StationStand.level.offset.x - model.width / 2);
+ const levelY = computedPosition.y + levelDrict * (style.StationStand.level.offset.y);
this.level = new Text({
zlevel: this.model.zlevel,
diff --git a/src/jmapNew/shape/graph/StationStand/EMouse.js b/src/jmapNew/shape/graph/StationStand/EMouse.js
index 37955f2e9..f5c7f0d54 100644
--- a/src/jmapNew/shape/graph/StationStand/EMouse.js
+++ b/src/jmapNew/shape/graph/StationStand/EMouse.js
@@ -15,12 +15,12 @@ export default class EMouse extends Group {
silent: true,
zlevel: this.zlevel,
z: 0,
- shape: {
- x: 0,
- y: 0,
- width: 0,
- height: 0
- },
+ shape: {
+ x: 0,
+ y: 0,
+ width: 0,
+ height: 0
+ },
style: {
lineDash: this.style.StationStand.mouseOverStyle.borderLineDash,
stroke: this.style.StationStand.mouseOverStyle.borderLineColor,
@@ -33,34 +33,34 @@ export default class EMouse extends Group {
}
mouseover(e) {
- const model = this.device.model;
- const mapDevice = this.device.mapDevice;
- const psdModel = mapDevice[model.psdCode];
- const rect = this.device.getBoundingRect().clone();
+ const model = this.device.model;
+ const mapDevice = this.device.mapDevice;
+ const psdModel = mapDevice[model.psdCode];
+ const rect = this.device.getBoundingRect().clone();
- if (psdModel && psdModel.instance) {
- rect.union( psdModel.instance.getBoundingRect());
- }
+ if (psdModel && psdModel.instance) {
+ rect.union( psdModel.instance.getBoundingRect());
+ }
- if (this.style.StationStand.mouseOverStyle.standBackgroundColor) {
- this.device.solidStand && this.device.solidStand.removeHover();
- this.device.solidStand && this.device.solidStand.addHover({
- fill: this.device.__over
- ? this.style.StationStand.mouseOverStyle.standBackgroundColorOver
- : this.style.StationStand.mouseOverStyle.standBackgroundColor
- });
- }
+ if (this.style.StationStand.mouseOverStyle.standBackgroundColor) {
+ this.device.solidStand && this.device.solidStand.removeHover();
+ this.device.solidStand && this.device.solidStand.addHover({
+ fill: this.device.__over
+ ? this.style.StationStand.mouseOverStyle.standBackgroundColorOver
+ : this.style.StationStand.mouseOverStyle.standBackgroundColor
+ });
+ }
- this.border.setShape(rect);
+ this.border.setShape(rect);
this.border.show();
}
mouseout(e) {
if (!this.device.__down) {
- if (this.style.StationStand.mouseOverStyle.standBackgroundColor) {
- this.device.solidStand && this.device.solidStand.removeHover();
- }
- this.border.hide();
+ if (this.style.StationStand.mouseOverStyle.standBackgroundColor) {
+ this.device.solidStand && this.device.solidStand.removeHover();
+ }
+ this.border.hide();
}
}
}
diff --git a/src/jmapNew/shape/graph/StationStand/EPatternFilter.js b/src/jmapNew/shape/graph/StationStand/EPatternFilter.js
index 584c171f8..3efcff38a 100644
--- a/src/jmapNew/shape/graph/StationStand/EPatternFilter.js
+++ b/src/jmapNew/shape/graph/StationStand/EPatternFilter.js
@@ -10,6 +10,7 @@ class EPatternFilter extends Group {
create() {
const model = this.model.modelData;
+ const computedPosition = this.model.modelData.computedPosition;
const style = this.model.style;
let direction = -1;
if ((model.right && model.inside) || (!model.right && !model.inside)) {
@@ -17,17 +18,17 @@ class EPatternFilter extends Group {
}
const startX = (model.width / 2 + style.StationStand.patternFilter.offset.x);
- const startY = model.position.y + (model.height / 2 + style.StationStand.patternFilter.offset.y) * direction + (1 + direction) / 2 * 14;
+ const startY = computedPosition.y + (model.height / 2 + style.StationStand.patternFilter.offset.y) * direction + (1 + direction) / 2 * 14;
this.patternFilter1 = new Polygon({
zlevel: this.model.zlevel,
z: this.model.z,
shape: {
points:[
- [model.position.x - startX, startY],
- [model.position.x - startX, startY - 14],
- [model.position.x - startX - 14, startY - 14],
- [model.position.x - startX - 14 - 10 * 0.866, startY - 7],
- [model.position.x - startX - 14, startY]
+ [computedPosition.x - startX, startY],
+ [computedPosition.x - startX, startY - 14],
+ [computedPosition.x - startX - 14, startY - 14],
+ [computedPosition.x - startX - 14 - 10 * 0.866, startY - 7],
+ [computedPosition.x - startX - 14, startY]
]
},
style: {
@@ -39,11 +40,11 @@ class EPatternFilter extends Group {
z: this.model.z,
shape: {
points:[
- [model.position.x + startX, startY],
- [model.position.x + startX, startY - 14],
- [model.position.x + startX + 14, startY - 14],
- [model.position.x + startX + 14 + 10 * 0.866, startY - 7],
- [model.position.x + startX + 14, startY]
+ [computedPosition.x + startX, startY],
+ [computedPosition.x + startX, startY - 14],
+ [computedPosition.x + startX + 14, startY - 14],
+ [computedPosition.x + startX + 14 + 10 * 0.866, startY - 7],
+ [computedPosition.x + startX + 14, startY]
]
},
style: {
diff --git a/src/jmapNew/shape/graph/StationStand/EReentry.js b/src/jmapNew/shape/graph/StationStand/EReentry.js
index 1d3fa74e5..978df7a9e 100644
--- a/src/jmapNew/shape/graph/StationStand/EReentry.js
+++ b/src/jmapNew/shape/graph/StationStand/EReentry.js
@@ -12,13 +12,14 @@ class EReentry extends Group {
create() {
if (!this.isNew) {
const model = this.model.modelData;
+ const computedPosition = this.model.modelData.computedPosition;
const style = this.model.style;
this.isNew = true;
const reentryH = style.StationStand.reentry.mergentR;
const isRight = model.right ? -1 : 1;
- const reentryX = model.position.x - (style.StationStand.reentry.position || isRight) * (style.StationStand.reentry.offset.x - model.width / 2);
- const reentryY = model.position.y + (style.StationStand.reentry.position || isRight) * (style.StationStand.reentry.offset.y) + isRight * reentryH;
+ const reentryX = computedPosition.x - (style.StationStand.reentry.position || isRight) * (style.StationStand.reentry.offset.x - model.width / 2);
+ const reentryY = computedPosition.y + (style.StationStand.reentry.position || isRight) * (style.StationStand.reentry.offset.y) + isRight * reentryH;
this.reentry = new Polygon({
zlevel: this.model.zlevel,
diff --git a/src/jmapNew/shape/graph/StationStand/EStationPlatform.js b/src/jmapNew/shape/graph/StationStand/EStationPlatform.js
index cd47703c1..cface7ab4 100644
--- a/src/jmapNew/shape/graph/StationStand/EStationPlatform.js
+++ b/src/jmapNew/shape/graph/StationStand/EStationPlatform.js
@@ -11,13 +11,14 @@ class EStationPlatform extends Group {
create() {
const model = this.model.modelData;
+ const computedPosition = this.model.modelData.computedPosition;
const style = this.model.style;
const buttonD = model.right ? 1 : -1;
const platFormOffset = model.inside ? style.StationStand.stationPlatform.insideOffset : style.StationStand.stationPlatform.outsideOffset;
- const buttonX = model.position.x - buttonD * ( model.width / 2 - 20);
+ const buttonX = computedPosition.x - buttonD * ( model.width / 2 - 20);
// platFormOffset.x -
- const buttonY = model.position.y + buttonD * (platFormOffset.y + buttonD * model.height / 2);
+ const buttonY = computedPosition.y + buttonD * (platFormOffset.y + buttonD * model.height / 2);
this.stationPlatform = new Polygon({
zlevel: this.model.zlevel,
z: this.model.z,
diff --git a/src/jmapNew/shape/graph/StationStand/ETime.js b/src/jmapNew/shape/graph/StationStand/ETime.js
index 7b1ed0a62..ff0265a24 100644
--- a/src/jmapNew/shape/graph/StationStand/ETime.js
+++ b/src/jmapNew/shape/graph/StationStand/ETime.js
@@ -11,11 +11,12 @@ class ETime extends Group {
create() {
if (!this.isNew) {
const model = this.model.modelData;
+ const computedPosition = this.model.modelData.computedPosition;
const style = this.model.style;
const timeDrict = model.right ? 1 : -1;
- const timeX = model.position.x + style.StationStand.stopTime.position * timeDrict * (style.StationStand.stopTime.offset.x - model.width / 2);
- const timeY = model.position.y + timeDrict * (style.StationStand.stopTime.offset.y - model.height / 2);
+ const timeX = computedPosition.x + style.StationStand.stopTime.position * timeDrict * (style.StationStand.stopTime.offset.x - model.width / 2);
+ const timeY = computedPosition.y + timeDrict * (style.StationStand.stopTime.offset.y - model.height / 2);
this.isNew = true;
this.time = new Text({
diff --git a/src/jmapNew/shape/graph/StationStand/ETrainDepart.js b/src/jmapNew/shape/graph/StationStand/ETrainDepart.js
index a3ac22737..9e94ea451 100644
--- a/src/jmapNew/shape/graph/StationStand/ETrainDepart.js
+++ b/src/jmapNew/shape/graph/StationStand/ETrainDepart.js
@@ -10,12 +10,13 @@ class ETrainDepart extends Group {
create() {
const model = this.model.modelData;
+ const computedPosition = this.model.modelData.computedPosition;
const style = this.model.style;
const trainDepartOffset = model.inside ? style.StationStand.trainDepart.insideOffset : style.StationStand.trainDepart.outsideOffset;
const trainDepartH = model.right ? 1 : -1;
- const departX = model.position.x + trainDepartH * trainDepartOffset.x;
- const departY = model.position.y + trainDepartH * trainDepartOffset.y;
+ const departX = computedPosition.x + trainDepartH * trainDepartOffset.x;
+ const departY = computedPosition.y + trainDepartH * trainDepartOffset.y;
this.trainDepart = new Text({
zlevel: this.model.zlevel,
diff --git a/src/jmapNew/shape/graph/StationStand/ETrainSetButton.js b/src/jmapNew/shape/graph/StationStand/ETrainSetButton.js
index 25dc4c2eb..cd9cddf84 100644
--- a/src/jmapNew/shape/graph/StationStand/ETrainSetButton.js
+++ b/src/jmapNew/shape/graph/StationStand/ETrainSetButton.js
@@ -11,11 +11,12 @@ class ETrainSetButton extends Group {
create() {
const model = this.model.modelData;
+ const computedPosition = this.model.modelData.computedPosition;
const style = this.model.style;
const buttonD = model.right ? 1 : -1;
- const buttonX = model.position.x - buttonD * (style.StationStand.trainSetButton.offset.x - model.width / 2);
- const buttonY = model.position.y + buttonD * (style.StationStand.trainSetButton.offset.y - model.height / 2);
+ const buttonX = computedPosition.x - buttonD * (style.StationStand.trainSetButton.offset.x - model.width / 2);
+ const buttonY = computedPosition.y + buttonD * (style.StationStand.trainSetButton.offset.y - model.height / 2);
this.trainSetButton = new Text({
zlevel: this.model.zlevel,
diff --git a/src/jmapNew/shape/graph/StationStand/ETrainStop.js b/src/jmapNew/shape/graph/StationStand/ETrainStop.js
index e4271141d..ecd70a621 100644
--- a/src/jmapNew/shape/graph/StationStand/ETrainStop.js
+++ b/src/jmapNew/shape/graph/StationStand/ETrainStop.js
@@ -11,13 +11,14 @@ class ETrainStop extends Group {
create() {
if (!this.isNew) {
const model = this.model.modelData;
+ const computedPosition = this.model.modelData.computedPosition;
const style = this.model.style;
this.isNew = true;
const stopTrainOffset = model.inside ? style.StationStand.trainStop.insideOffset : style.StationStand.trainStop.outsideOffset;
const stopTrainH = model.right ? 1 : -1;
- const stopX = model.position.x + stopTrainH * stopTrainOffset.x;
- const stopY = model.position.y + stopTrainH * stopTrainOffset.y;
+ const stopX = computedPosition.x + stopTrainH * stopTrainOffset.x;
+ const stopY = computedPosition.y + stopTrainH * stopTrainOffset.y;
this.trainStop = new Arc({
zlevel: this.model.zlevel,
diff --git a/src/jmapNew/shape/graph/StationStand/detain/EDetain.js b/src/jmapNew/shape/graph/StationStand/detain/EDetain.js
index 7fd1ff738..ee047da35 100644
--- a/src/jmapNew/shape/graph/StationStand/detain/EDetain.js
+++ b/src/jmapNew/shape/graph/StationStand/detain/EDetain.js
@@ -12,14 +12,15 @@ class EDetain extends Group {
create(deviceParam) {
if (!this.isNew) {
const model = this.model.modelData;
+ const computedPosition = this.model.modelData.computedPosition;
const style = this.model.style;
this.isNew = true;
/** 站台扣车*/
const detainOffset = model.inside ? deviceParam.insideOffset : deviceParam.outsideOffset;
const detainD = model.right ? 1 : -1;
- const detainX = model.position.x - detainD * (detainOffset.x - model.width / 2);
- const detainY = model.position.y + detainD * (detainOffset.y - model.height / 2);
+ const detainX = computedPosition.x - detainD * (detainOffset.x - model.width / 2);
+ const detainY = computedPosition.y + detainD * (detainOffset.y - model.height / 2);
this.detain = new Text({
zlevel: this.model.zlevel,
@@ -43,7 +44,7 @@ class EDetain extends Group {
if (deviceParam.special) {
//, 'textPadding':[1, 3], 'textBorderColor':'#fff', 'textBorderWidth':1
- this.detain.setStyle({x:model.position.x - detainD * (model.width / 2 + detainOffset.x), y: model.position.y - detainD * 10});
+ this.detain.setStyle({x:computedPosition.x - detainD * (model.width / 2 + detainOffset.x), y: computedPosition.y - detainD * 10});
}
}
}
diff --git a/src/jmapNew/shape/graph/StationStand/detain/EDetainCircle.js b/src/jmapNew/shape/graph/StationStand/detain/EDetainCircle.js
index 032b756be..46c4dfe8a 100644
--- a/src/jmapNew/shape/graph/StationStand/detain/EDetainCircle.js
+++ b/src/jmapNew/shape/graph/StationStand/detain/EDetainCircle.js
@@ -12,11 +12,11 @@ class EDetainCircle extends Group {
create() {
const model = this.model.modelData;
const style = this.model.style;
-
+ const computedPosition = this.model.modelData.computedPosition;
const detainD = model.right ? 1 : -1;
- const x = model.position.x + (model.width / 2) * detainD + detainD * style.StationStand.detainCircle.offset.x + detainD * style.StationStand.detainCircle.circleWidth / 2;
- const y = model.position.y;
+ const x = computedPosition.x + (model.width / 2) * detainD + detainD * style.StationStand.detainCircle.offset.x + detainD * style.StationStand.detainCircle.circleWidth / 2;
+ const y = computedPosition.y;
const radius = style.StationStand.detainCircle.circleWidth / 2;
this.detainCircle = new Circle({
diff --git a/src/jmapNew/shape/graph/StationStand/detain/EDetainHollow.js b/src/jmapNew/shape/graph/StationStand/detain/EDetainHollow.js
index c6574d2d3..a33f70fc3 100644
--- a/src/jmapNew/shape/graph/StationStand/detain/EDetainHollow.js
+++ b/src/jmapNew/shape/graph/StationStand/detain/EDetainHollow.js
@@ -10,12 +10,13 @@ class EDetainHollow extends EDetain {
create() {
const model = this.model.modelData;
+ const computedPosition = this.model.modelData.computedPosition;
const style = this.model.style;
/** 站台扣车*/
const detainOffset = model.inside ? style.StationStand.detainHollow.insideOffset : style.StationStand.detainHollow.outsideOffset;
const detainD = model.right ? 1 : -1;
- const detainX = model.position.x - detainD * (detainOffset.x - model.width / 2);
- const detainY = model.position.y + detainD * (detainOffset.y - model.height / 2);
+ const detainX = computedPosition.x - detainD * (detainOffset.x - model.width / 2);
+ const detainY = computedPosition.y + detainD * (detainOffset.y - model.height / 2);
if (!this.isNew) {
super.create(style.StationStand.detainHollow);
const offsetX = model.right ? 8 : -8;
diff --git a/src/jmapNew/shape/graph/StationStand/detain/EDetainRect.js b/src/jmapNew/shape/graph/StationStand/detain/EDetainRect.js
index 068ce9e38..30973729e 100644
--- a/src/jmapNew/shape/graph/StationStand/detain/EDetainRect.js
+++ b/src/jmapNew/shape/graph/StationStand/detain/EDetainRect.js
@@ -10,10 +10,11 @@ class EDetainCircle extends Group {
create() {
const model = this.model.modelData;
+ const computedPosition = this.model.modelData.computedPosition;
const style = this.model.style;
- const standX = model.position.x - model.width / 2;
- const standY = model.position.y - model.height / 2;
+ const standX = computedPosition.x - model.width / 2;
+ const standY = computedPosition.y - model.height / 2;
let y1;
let y2;
diff --git a/src/jmapNew/shape/graph/StationStand/emergent/EEmergentArrow.js b/src/jmapNew/shape/graph/StationStand/emergent/EEmergentArrow.js
index 2fd49e6a2..c4c1ae04e 100644
--- a/src/jmapNew/shape/graph/StationStand/emergent/EEmergentArrow.js
+++ b/src/jmapNew/shape/graph/StationStand/emergent/EEmergentArrow.js
@@ -13,12 +13,13 @@ class EEmergentArrow extends Group {
create() {
if (!this.isNew) {
const model = this.model.modelData;
+ const computedPosition = this.model.modelData.computedPosition;
const style = this.model.style;
const emergentOffset = model.inside ? style.StationStand.emergentArrow.insideOffset : style.StationStand.emergentArrow.outsideOffset;
const emergentH = model.right ? 1 : -1;
- const emergentX = model.position.x + emergentH * emergentOffset.x;
- const emergentY = model.position.y + emergentH * emergentOffset.y;
+ const emergentX = computedPosition.x + emergentH * emergentOffset.x;
+ const emergentY = computedPosition.y + emergentH * emergentOffset.y;
const rotation = model.right == 1 ? Math.PI / 2 : Math.PI * 3 / 2;
this.emergent = new Polygon({
diff --git a/src/jmapNew/shape/graph/StationStand/emergent/EEmergentCross.js b/src/jmapNew/shape/graph/StationStand/emergent/EEmergentCross.js
index 9060d3733..d6d23b3f9 100644
--- a/src/jmapNew/shape/graph/StationStand/emergent/EEmergentCross.js
+++ b/src/jmapNew/shape/graph/StationStand/emergent/EEmergentCross.js
@@ -12,12 +12,13 @@ class EEmergentCross extends Group {
create() {
const model = this.model.modelData;
+ const computedPosition = this.model.modelData.computedPosition;
const style = this.model.style;
const emergentOffset = model.inside ? style.StationStand.emergentCross.insideOffset : style.StationStand.emergentCross.outsideOffset;
const emergentH = model.right ? 1 : -1;
- const emergentX = model.position.x + emergentH * emergentOffset.x;
- const emergentY = model.position.y + emergentH * emergentOffset.y;
+ const emergentX = computedPosition.x + emergentH * emergentOffset.x;
+ const emergentY = computedPosition.y + emergentH * emergentOffset.y;
model.r = style.StationStand.emergentCross.mergentR;
model.n = style.StationStand.emergentCross.mergentN;
diff --git a/src/jmapNew/shape/graph/StationStand/emergent/EEmergentRhombus.js b/src/jmapNew/shape/graph/StationStand/emergent/EEmergentRhombus.js
index c2ef4c8e6..7210a3111 100644
--- a/src/jmapNew/shape/graph/StationStand/emergent/EEmergentRhombus.js
+++ b/src/jmapNew/shape/graph/StationStand/emergent/EEmergentRhombus.js
@@ -11,12 +11,13 @@ class EEmergentRhombus extends Group {
create() {
if (!this.isNew) {
const model = this.model.modelData;
+ const computedPosition = this.model.modelData.computedPosition;
const style = this.model.style;
const emergentOffset = model.inside ? style.StationStand.emergentRhombus.insideOffset : style.StationStand.emergentRhombus.outsideOffset;
const emergentH = model.right ? 1 : -1;
- const emergentX = model.position.x + emergentH * emergentOffset.x;
- const emergentY = model.position.y + emergentH * emergentOffset.y;
+ const emergentX = computedPosition.x + emergentH * emergentOffset.x;
+ const emergentY = computedPosition.y + emergentH * emergentOffset.y;
model.r = style.StationStand.emergentRhombus.mergentR;
model.n = style.StationStand.emergentRhombus.mergentN;
diff --git a/src/jmapNew/shape/graph/StationStand/index.js b/src/jmapNew/shape/graph/StationStand/index.js
index ae6cf1b4a..12c635464 100644
--- a/src/jmapNew/shape/graph/StationStand/index.js
+++ b/src/jmapNew/shape/graph/StationStand/index.js
@@ -45,6 +45,12 @@ class StationStand extends Group {
super();
this._code = model.code;
this._type = model._type;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ this.computedPosition = pictureDevice.position;
+ } else {
+ this.computedPosition = model.position;
+ }
this.model = model;
this.style = style;
this.zlevel = model.zlevel;
@@ -59,7 +65,7 @@ class StationStand extends Group {
// 加载皮肤控制的元素
const model = this.model;
const style = this.style;
-
+ model.computedPosition = this.computedPosition;
// // 站台所有的绘图元素
const elementTypeList = {
'solidStand':ESolidStand, // 矩形实心站台 (普通站台样式)
@@ -248,7 +254,7 @@ class StationStand extends Group {
this.highlight && this.highlight.drawSelected(selected);
}
getAnchorPoint() {
- return this.model.position;
+ return this.computedPosition;
}
}
export default StationStand;
diff --git a/src/jmapNew/shape/graph/StationStand/jump/EJump.js b/src/jmapNew/shape/graph/StationStand/jump/EJump.js
index 9003befb7..f36b0763b 100644
--- a/src/jmapNew/shape/graph/StationStand/jump/EJump.js
+++ b/src/jmapNew/shape/graph/StationStand/jump/EJump.js
@@ -10,13 +10,14 @@ class EJump extends Group {
create(deviceParam) {
if (!this.isNew) {
const model = this.model.modelData;
+ const computedPosition = this.model.modelData.computedPosition;
const style = this.model.style;
this.isNew = true;
const jumpDirct = model.right ? -1 : 1;
const jumpOffsetY = model.inside ? -1 : 1;
- const jumpX = model.position.x - jumpDirct * (deviceParam.offset.x - model.width / 2);
- const jumpY = model.position.y + jumpDirct * jumpOffsetY * deviceParam.offset.y;
+ const jumpX = computedPosition.x - jumpDirct * (deviceParam.offset.x - model.width / 2);
+ const jumpY = computedPosition.y + jumpDirct * jumpOffsetY * deviceParam.offset.y;
if (deviceParam.special) {
this.jump = new Text({
@@ -24,7 +25,7 @@ class EJump extends Group {
z: this.model.z,
style: {
x: jumpX,
- y: model.position.y + jumpDirct * jumpOffsetY * deviceParam.offset.y,
+ y: computedPosition.y + jumpDirct * jumpOffsetY * deviceParam.offset.y,
fontWeight: deviceParam.fontWeight,
fontSize: deviceParam.fontSize,
fontFamily: style.fontFamily,
diff --git a/src/jmapNew/shape/graph/StationStand/jump/EJumpCircle.js b/src/jmapNew/shape/graph/StationStand/jump/EJumpCircle.js
index 0b8f47e29..246c4dbc1 100644
--- a/src/jmapNew/shape/graph/StationStand/jump/EJumpCircle.js
+++ b/src/jmapNew/shape/graph/StationStand/jump/EJumpCircle.js
@@ -9,11 +9,12 @@ class EJumpCircle extends EJump {
}
create() {
const model = this.model.modelData;
+ const computedPosition = this.model.modelData.computedPosition;
const style = this.model.style;
const jumpDirct = model.right ? -1 : 1;
- const jumpCX = model.position.x - jumpDirct * (style.StationStand.jumpCircle.offset.x - model.width / 2);
- const jumpCY = model.position.y + jumpDirct * style.StationStand.jumpCircle.offset.y;
+ const jumpCX = computedPosition.x - jumpDirct * (style.StationStand.jumpCircle.offset.x - model.width / 2);
+ const jumpCY = computedPosition.y + jumpDirct * style.StationStand.jumpCircle.offset.y;
if (!this.isNew) {
super.create(style.StationStand.jumpCircle);
diff --git a/src/jmapNew/shape/graph/StationStand/safeStand/EGapStand.js b/src/jmapNew/shape/graph/StationStand/safeStand/EGapStand.js
index fa7a409ef..8201de20d 100644
--- a/src/jmapNew/shape/graph/StationStand/safeStand/EGapStand.js
+++ b/src/jmapNew/shape/graph/StationStand/safeStand/EGapStand.js
@@ -12,9 +12,10 @@ class EGapStand extends Group {
create() {
const model = this.model.modelData;
+ const computedPosition = this.model.modelData.computedPosition;
const style = this.model.style;
- const standX = model.position.x - model.width / 2;
- const standY = model.position.y - model.height / 2;
+ const standX = computedPosition.x - model.width / 2;
+ const standY = computedPosition.y - model.height / 2;
this.stand1 = new Rect({
zlevel: this.model.zlevel,
diff --git a/src/jmapNew/shape/graph/StationStand/safeStand/EHollowStand.js b/src/jmapNew/shape/graph/StationStand/safeStand/EHollowStand.js
index 0a918c5c4..a649688f8 100644
--- a/src/jmapNew/shape/graph/StationStand/safeStand/EHollowStand.js
+++ b/src/jmapNew/shape/graph/StationStand/safeStand/EHollowStand.js
@@ -10,9 +10,10 @@ class EHollowStand extends Group {
create() {
const model = this.model.modelData;
+ const computedPosition = this.model.modelData.computedPosition;
const style = this.model.style;
- const standX = model.position.x - model.width / 2;
- const standY = model.position.y - model.height / 2;
+ const standX = computedPosition.x - model.width / 2;
+ const standY = computedPosition.y - model.height / 2;
this.stand = new Rect({
zlevel: this.model.zlevel,
diff --git a/src/jmapNew/shape/graph/StationStand/safeStand/ELineStand.js b/src/jmapNew/shape/graph/StationStand/safeStand/ELineStand.js
index c5cabba12..fffa00868 100644
--- a/src/jmapNew/shape/graph/StationStand/safeStand/ELineStand.js
+++ b/src/jmapNew/shape/graph/StationStand/safeStand/ELineStand.js
@@ -12,9 +12,10 @@ class ESolidStand extends Group {
create() {
const model = this.model.modelData;
+ const computedPosition = this.model.modelData.computedPosition;
const style = this.model.style;
- const standX = model.position.x - model.width / 2;
- const standY = model.position.y - model.height / 2;
+ const standX = computedPosition.x - model.width / 2;
+ const standY = computedPosition.y - model.height / 2;
const direction = model.right ? 1 : -1;
this.stand = new Polyline({
diff --git a/src/jmapNew/shape/graph/StationStand/safeStand/ESolidStand.js b/src/jmapNew/shape/graph/StationStand/safeStand/ESolidStand.js
index 0217ce637..57f8cbd09 100644
--- a/src/jmapNew/shape/graph/StationStand/safeStand/ESolidStand.js
+++ b/src/jmapNew/shape/graph/StationStand/safeStand/ESolidStand.js
@@ -11,9 +11,10 @@ class ESolidStand extends Group {
create() {
const model = this.model.modelData;
+ const computedPosition = this.model.modelData.computedPosition;
const style = this.model.style;
- const standX = model.position.x - model.width / 2;
- const standY = model.position.y - model.height / 2;
+ const standX = computedPosition.x - model.width / 2;
+ const standY = computedPosition.y - model.height / 2;
this.stand = new Rect({
zlevel: this.model.zlevel,
@@ -58,8 +59,8 @@ class ESolidStand extends Group {
zlevel: this.model.zlevel,
z: this.model.z + 10,
style: {
- x: model.position.x + 35,
- y: model.position.y - 20,
+ x: computedPosition.x + 35,
+ y: computedPosition.y - 20,
text: `${'站台人数: ' + model.num ? model.num : 0}`,
textFill: '#000',
textAlign: 'left',
diff --git a/src/jmapNew/shape/graph/StationTurnBack/EMouse.js b/src/jmapNew/shape/graph/StationTurnBack/EMouse.js
index c0eb1a7ac..c1311fac6 100644
--- a/src/jmapNew/shape/graph/StationTurnBack/EMouse.js
+++ b/src/jmapNew/shape/graph/StationTurnBack/EMouse.js
@@ -13,8 +13,8 @@ export default class EMouse extends Group {
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,
+ x: this.device.computedPosition.x,
+ y: this.device.computedPosition.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.fontFamily,
diff --git a/src/jmapNew/shape/graph/StationTurnBack/index.js b/src/jmapNew/shape/graph/StationTurnBack/index.js
index a8ac3da7f..7c3fd90ca 100644
--- a/src/jmapNew/shape/graph/StationTurnBack/index.js
+++ b/src/jmapNew/shape/graph/StationTurnBack/index.js
@@ -12,6 +12,12 @@ export default class StationTurnBack extends Group {
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ this.computedPosition = pictureDevice.position;
+ } else {
+ this.computedPosition = model.position;
+ }
this.z = 40;
this.model = model;
this.style = style;
@@ -23,14 +29,15 @@ export default class StationTurnBack extends Group {
create() {
const model = this.model;
const style = this.style;
+ const computedPosition = this.computedPosition;
if (model.show && !style.StationTurnBack.spliceShow) {
this.control = new Circle({
zlevel: this.zlevel,
z: this.z,
shape: {
- cx: model.position.x,
- cy: model.position.y,
+ cx: computedPosition.x,
+ cy: computedPosition.y,
r: style.StationTurnBack.lamp.radiusR
},
style: {
@@ -43,8 +50,8 @@ export default class StationTurnBack extends Group {
zlevel: this.zlevel,
z: this.z,
shape: {
- x: model.position.x - style.StationTurnBack.lamp.radiusR - style.StationTurnBack.rect.padding / 2,
- y: model.position.y - style.StationTurnBack.lamp.radiusR - style.StationTurnBack.rect.padding / 2,
+ x: computedPosition.x - style.StationTurnBack.lamp.radiusR - style.StationTurnBack.rect.padding / 2,
+ y: computedPosition.y - style.StationTurnBack.lamp.radiusR - style.StationTurnBack.rect.padding / 2,
width: style.StationTurnBack.lamp.radiusR * 2 + style.StationTurnBack.rect.padding,
height: style.StationTurnBack.lamp.radiusR * 2 + style.StationTurnBack.rect.padding
},
@@ -63,8 +70,8 @@ export default class StationTurnBack extends Group {
z: this.z,
position: [0, 0],
style: {
- x: model.position.x,
- y: model.position.y - style.StationTurnBack.lamp.radiusR - style.StationTurnBack.text.distance,
+ x: computedPosition.x,
+ y: computedPosition.y - style.StationTurnBack.lamp.radiusR - style.StationTurnBack.text.distance,
fontWeight: style.StationTurnBack.text.fontWeight,
fontSize: style.StationTurnBack.text.fontSize,
fontFamily: style.fontFamily,
@@ -86,8 +93,8 @@ export default class StationTurnBack extends Group {
z: this.z,
position: [0, 0],
style: {
- x: model.position.x,
- y: model.position.y + style.StationTurnBack.lamp.radiusR + style.StationTurnBack.text.distance,
+ x: computedPosition.x,
+ y: computedPosition.y + style.StationTurnBack.lamp.radiusR + style.StationTurnBack.text.distance,
fontWeight: style.StationTurnBack.text.fontWeight,
fontSize: style.StationTurnBack.text.fontSize,
fontFamily: style.fontFamily,
@@ -104,8 +111,8 @@ export default class StationTurnBack extends Group {
this.control = new EFoldbackMode({
zlevel: this.zlevel,
z: this.z,
- x: model.position.x,
- y: model.position.y,
+ x: computedPosition.x,
+ y: computedPosition.y,
width: style.ReturnModeGroup.rectWidth,
style: style
});
@@ -196,7 +203,7 @@ export default class StationTurnBack extends Group {
};
}
getAnchorPoint() {
- return this.model.position;
+ return this.computedPosition;
}
getBoundingRect() {
diff --git a/src/jmapNew/shape/graph/Switch/ESwDot.js b/src/jmapNew/shape/graph/Switch/ESwDot.js
new file mode 100644
index 000000000..27714b7ae
--- /dev/null
+++ b/src/jmapNew/shape/graph/Switch/ESwDot.js
@@ -0,0 +1,35 @@
+import Group from 'zrender/src/container/Group'
+import Circle from 'zrender/src/graphic/shape/Circle'
+
+class ESwDot extends Group {
+ constructor(model, drictx, dricty) {
+ super()
+ this.model = model
+ this.dricty = dricty > 0
+ this.drictx = drictx > 0
+ this.create()
+ }
+ create() {
+ const { model } = this
+ this.dot = new Circle({
+ zlevel: model.zlevel,
+ z: model.z || 0 + 12,
+ shape: {
+ cx: model.intersection.x + (this.drictx ? 12 : -12),
+ cy: model.intersection.y + (this.dricty ? 8 : -8),
+ r: 2
+ },
+ style: {
+ fill: '#FF0000'
+ }
+ })
+ this.add(this.dot)
+ }
+ setColor(color) {
+ console.log(this.dot)
+ console.log(color)
+ this.dot.setStyle({ fill: color })
+ }
+}
+
+export default ESwDot
diff --git a/src/jmapNew/shape/graph/Switch/index.js b/src/jmapNew/shape/graph/Switch/index.js
index 8c7976b21..c624de3ba 100644
--- a/src/jmapNew/shape/graph/Switch/index.js
+++ b/src/jmapNew/shape/graph/Switch/index.js
@@ -13,6 +13,7 @@ import EMouse from './EMouse';
import EHighlight from '../element/EHighlight';
import ETriangle from './ETriangle';
import store from '@/store/index';
+import ESwDot from './ESwDot';
export default class Switch extends Group {
constructor(model, {style, mapDevice}) {
@@ -53,34 +54,36 @@ export default class Switch extends Group {
const directx = this.triangle.drictx;
const directy = this.triangle.dricty;
const switchWidth1 = style.Section.line.width / 2;
-
let directxA = 1;
- let sectionATriangle = new JTriangle(sectionAModel.points[0], sectionAModel.points[1]);
- let sectionBTriangle = new JTriangle(sectionBModel.points[0], sectionBModel.points[1]);
- let sectionCTriangle = new JTriangle(sectionCModel.points[0], sectionCModel.points[1]);
+ const sectionAPoints = sectionAModel.instance ? sectionAModel.instance.computedPoints : sectionAModel.points;
+ const sectionBPoints = sectionBModel.instance ? sectionBModel.instance.computedPoints : sectionBModel.points;
+ const sectionCPoints = sectionCModel.instance ? sectionCModel.instance.computedPoints : sectionCModel.points;
+ let sectionATriangle = new JTriangle(sectionAPoints[0], sectionAPoints[1]);
+ let sectionBTriangle = new JTriangle(sectionBPoints[0], sectionBPoints[1]);
+ let sectionCTriangle = new JTriangle(sectionCPoints[0], sectionCPoints[1]);
const sectionAPoint = { x: model.intersection.x, y: model.intersection.y };
- if (sectionAModel.points[0].x == model.intersection.x && sectionAModel.points[0].y == model.intersection.y) {
- sectionATriangle = new JTriangle(sectionAModel.points[0], sectionAModel.points[1]);
+ if (sectionAPoints[0].x == model.intersection.x && sectionAPoints[0].y == model.intersection.y) {
+ sectionATriangle = new JTriangle(sectionAPoints[0], sectionAPoints[1]);
directxA = 1;
}
- if (sectionAModel.points[sectionAModel.points.length - 1].x == model.intersection.x && sectionAModel.points[sectionAModel.points.length - 1].y == model.intersection.y) {
- sectionATriangle = new JTriangle(sectionAModel.points[sectionAModel.points.length - 2], sectionAModel.points[sectionAModel.points.length - 1]);
+ if (sectionAPoints[sectionAPoints.length - 1].x == model.intersection.x && sectionAPoints[sectionAPoints.length - 1].y == model.intersection.y) {
+ sectionATriangle = new JTriangle(sectionAPoints[sectionAPoints.length - 2], sectionAPoints[sectionAPoints.length - 1]);
directxA = -1;
}
- if (sectionBModel.points[0].x == model.intersection.x && sectionBModel.points[0].y == model.intersection.y) {
- sectionBTriangle = new JTriangle(sectionBModel.points[0], sectionBModel.points[1]);
+ if (sectionBPoints[0].x == model.intersection.x && sectionBPoints[0].y == model.intersection.y) {
+ sectionBTriangle = new JTriangle(sectionBPoints[0], sectionBPoints[1]);
}
- if (sectionBModel.points[sectionBModel.points.length - 1].x == model.intersection.x && sectionBModel.points[sectionBModel.points.length - 1].y == model.intersection.y) {
- sectionBTriangle = new JTriangle(sectionBModel.points[sectionBModel.points.length - 2], sectionBModel.points[sectionBModel.points.length - 1]);
+ if (sectionBPoints[sectionBPoints.length - 1].x == model.intersection.x && sectionBPoints[sectionBPoints.length - 1].y == model.intersection.y) {
+ sectionBTriangle = new JTriangle(sectionBPoints[sectionBPoints.length - 2], sectionBPoints[sectionBPoints.length - 1]);
}
- if (sectionCModel.points[0].x == model.intersection.x && sectionCModel.points[0].y == model.intersection.y) {
- sectionCTriangle = new JTriangle(sectionCModel.points[0], sectionCModel.points[1]);
+ if (sectionCPoints[0].x == model.intersection.x && sectionCPoints[0].y == model.intersection.y) {
+ sectionCTriangle = new JTriangle(sectionCPoints[0], sectionCPoints[1]);
}
- if (sectionCModel.points[sectionCModel.points.length - 1].x == model.intersection.x && sectionCModel.points[sectionCModel.points.length - 1].y == model.intersection.y) {
- sectionCTriangle = new JTriangle(sectionCModel.points[sectionCModel.points.length - 2], sectionCModel.points[sectionCModel.points.length - 1]);
+ if (sectionCPoints[sectionCPoints.length - 1].x == model.intersection.x && sectionCPoints[sectionCPoints.length - 1].y == model.intersection.y) {
+ sectionCTriangle = new JTriangle(sectionCPoints[sectionCPoints.length - 2], sectionCPoints[sectionCPoints.length - 1]);
}
const swPadding = rateOpen
@@ -212,12 +215,19 @@ export default class Switch extends Group {
}
});
+ if (this.style.Switch.switchDot && this.style.Switch.switchDot.show) {
+ const { drictx, dricty } = this.triangle;
+ this.dot = new ESwDot(model, drictx, dricty);
+ this.add(this.dot);
+ }
+
this.add(this.shapeModelA);
this.add(this.shapeModelB);
this.add(this.shapeModelC);
this.add(this.shapeBlockCover);
this.add(this.name);
this.add(this.enabledName);
+
style.Switch.text.show && model.nameShow ? this.name.show() : this.name.hide();
}
@@ -343,6 +353,7 @@ export default class Switch extends Group {
this.artificialArc && this.artificialArc.hide();
this.name && this.name.show();
this.limitName && this.limitName.show();
+ this.dot && this.dot.hide();
}
/** 定位*/
@@ -434,28 +445,20 @@ export default class Switch extends Group {
.start();
}
// N-定位 R-反位 NO-无(失表) EX-挤叉
- setSwitchFault(fault, pos) {
- if (this.style.Switch.jointImg.faultStatus && fault && (pos == 'NO' || pos == 'EX') ) { // 宁波线失表状态
- this.setForkAction(fault); // 道岔挤岔
- } else if (this.style.Switch.faultNoHandle ) {
- this.shapeModelA.hide();
- this.shapeModelB.hide();
- this.shapeModelC.hide();
- } else {
- const faultList = ['SPLIT', 'SQUEEZE', 'NORMAL_SPLIT', 'REVERSE_SPLIT', 'SPLIT_1'];
- // (fault === 'SPLIT' || fault === 'SQUEEZE' || (fault === 'NORMAL_SPLIT' && !reversePosition) || (fault === 'REVERSE_SPLIT' && !normalPosition))
- if (this.model.switchFaultCode && fault && faultList.includes(fault) ) {
- const switchFault = this.mapDevice[this.model.switchFaultCode];
- switchFault.instance.setControlColor('#F00', true);
- } else if (this.model.switchFaultCode) {
- const switchFault = this.mapDevice[this.model.switchFaultCode];
- switchFault.instance.setControlColor(this.style.backgroundColor, false);
- }
- // stopAnimation
- this.shapeModelB.stopAnimation(false);
- this.shapeModelC.stopAnimation(false);
- this.shapeModelA.stopAnimation(false);
+ setSwitchFault(fault) {
+ const faultList = ['SPLIT', 'SQUEEZE', 'NORMAL_SPLIT', 'REVERSE_SPLIT', 'SPLIT_1'];
+ // (fault === 'SPLIT' || fault === 'SQUEEZE' || (fault === 'NORMAL_SPLIT' && !reversePosition) || (fault === 'REVERSE_SPLIT' && !normalPosition))
+ if (this.model.switchFaultCode && fault && faultList.includes(fault) ) {
+ const switchFault = this.mapDevice[this.model.switchFaultCode];
+ switchFault.instance.setControlColor('#F00', true);
+ } else if (this.model.switchFaultCode) {
+ const switchFault = this.mapDevice[this.model.switchFaultCode];
+ switchFault.instance.setControlColor(this.style.backgroundColor, false);
}
+ // stopAnimation
+ this.shapeModelB.stopAnimation(false);
+ this.shapeModelC.stopAnimation(false);
+ this.shapeModelA.stopAnimation(false);
}
/** 挤叉*/
setForkAction(fault) {
@@ -514,6 +517,10 @@ export default class Switch extends Group {
this.lockArc.setStyle({ stroke: this.style.Switch.arcBlcok.inversionColor });
}
}
+ if (this.style.Switch.switchDot && this.style.Switch.switchDot.show) {
+ this.dot.show();
+ this.dot.setColor(this.style.Switch.switchDot.monoLockColor);
+ }
this.setTextColor(this.style.Switch.text.monolockLocationColor);
}
@@ -567,6 +574,10 @@ export default class Switch extends Group {
this.lockRect.setStyle({ stroke: this.style.Switch.rectLock.blockColor, fill: this.style.Switch.rectLock.blockFillColor });
}
}
+ if (this.style.Switch.switchDot && this.style.Switch.switchDot.show) {
+ this.dot.show();
+ this.dot.setColor(this.style.Switch.switchDot.lockColor);
+ }
// if (this.style.Switch.coverBlock && this.style.Switch.coverBlock.show) {
// this.shapeBlockCover.show();
@@ -706,7 +717,7 @@ export default class Switch extends Group {
this.setAshShow();
}
} else {
- this.setSwitchFault(model.fault, model.pos);
+ this.setSwitchFault(model.fault);
// model.pos == 'NO' || model.pos == 'EX';
// N-定位 R-反位 NO-无(失表) EX-挤叉
@@ -718,14 +729,23 @@ export default class Switch extends Group {
this.switchPosition = 'reverse';
this.setInversionAction(model); /** 反位*/
} else if (model.pos == 'NO') {
- this.setLossAction(model.fault); // 失去
+ // 宁波线失表
+ if (this.style.Switch.jointImg.faultStatus && model.fault) {
+ this.setForkAction(model.fault);
+ } else if (this.style.Switch.faultNoHandle) {
+ this.shapeModelA.hide();
+ this.shapeModelB.hide();
+ this.shapeModelC.hide();
+ } else {
+ this.setLossAction(model.fault); // 失去
+ }
} else if (model.pos == 'EX') {
this.setForkAction(model.fault); // 挤岔
}
model.isCiConfirm && this.setCiConfirm(); // 道岔使能显示
model.singleLock && this.setMonolock(model.pos); // 道岔单锁
- model.guideMasterLock && this.setMonolock(model.pos); // 引导总锁
+ model.guideMasterLock && this.setMonolock(model.pos); // 引导总锁
model.blockade && this.block(model.pos); // 道岔封锁
model.singleLock && model.blockade && this.blockMonolock(); // 单锁&锁闭状态
const path = window.location.href;
diff --git a/src/jmapNew/shape/graph/Text/index.js b/src/jmapNew/shape/graph/Text/index.js
index 48b2f5ef0..4fbf3cab4 100644
--- a/src/jmapNew/shape/graph/Text/index.js
+++ b/src/jmapNew/shape/graph/Text/index.js
@@ -10,6 +10,12 @@ export default class Text2 extends Group {
this._type = model._type;
this.name = model.code;
this.zlevel = model.zlevel;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ this.computedPosition = pictureDevice.position;
+ } else {
+ this.computedPosition = model.position;
+ }
this.model = model;
this.style = style;
this.z = 6;
@@ -21,6 +27,7 @@ export default class Text2 extends Group {
create() {
var model = this.model;
+ const computedPosition = this.computedPosition;
var [direction, content] = model.content.split('::');
if (direction == 'V') {
content = content.split('').join('\n');
@@ -32,8 +39,8 @@ export default class Text2 extends Group {
zlevel: this.zlevel,
z: this.z,
style: {
- x: model.position.x,
- y: model.position.y,
+ x: computedPosition.x,
+ y: computedPosition.y,
text: content,
fontFamily: this.style.fontFamily,
fontSize: Number(model.font),
@@ -58,7 +65,7 @@ export default class Text2 extends Group {
if (this.text) {
return this.text.getBoundingRect().clone();
} else {
- return new BoundingRect(this.model.position.x, this.model.position.y, 0, 0);
+ return new BoundingRect(this.computedPosition.x, this.computedPosition.y, 0, 0);
}
}
screenShow() {
@@ -70,6 +77,6 @@ export default class Text2 extends Group {
}
}
getAnchorPoint() {
- return this.model.position;
+ return this.computedPosition;
}
}
diff --git a/src/jmapNew/shape/graph/Train/index.js b/src/jmapNew/shape/graph/Train/index.js
index 7af64ad8f..882ac0511 100644
--- a/src/jmapNew/shape/graph/Train/index.js
+++ b/src/jmapNew/shape/graph/Train/index.js
@@ -41,12 +41,12 @@ export default class Train extends Group {
if (model.trainWindowModel) {
const amendData = store.getters['map/amendPoints'](model.trainWindowModel.code);
if (amendData) {
- model.trainWindowModel.point = amendData.position;
+ model.trainWindowModel.instance.computedPoint = amendData.position;
model.trainWindowModel.reversal = amendData.reversal;
}
this.point = {
- x: model.trainWindowModel.point.x,
- y: model.trainWindowModel.point.y
+ x: model.trainWindowModel.instance.computedPoint.x,
+ y: model.trainWindowModel.instance.computedPoint.y
};
if (model.right) {
this.point.x = this.point.x - style.Train.trainHead.trainConntWidth * this.newScale - style.Train.common.trainWidth / 2;
@@ -178,8 +178,8 @@ export default class Train extends Group {
if (style.Train.directionArrow.hasArrow) { // 列车运行上下方箭头(eg:宁波yi)
const arrowPoint = { x: 0, y: 0 };
if (model.trainWindowModel) {
- arrowPoint.x = model.trainWindowModel.point.x;
- arrowPoint.y = model.right ? model.trainWindowModel.point.y + style.Train.directionArrow.distanceBottom : model.trainWindowModel.point.y - style.Train.directionArrow.distanceTop;
+ arrowPoint.x = model.trainWindowModel.instance.computedPoint.x;
+ arrowPoint.y = model.right ? model.trainWindowModel.instance.computedPoint.y + style.Train.directionArrow.distanceBottom : model.trainWindowModel.instance.computedPoint.y - style.Train.directionArrow.distanceTop;
}
this.directionArrow = new EDirection({
zlevel: this.zlevel,
diff --git a/src/jmapNew/shape/graph/TrainWindow/index.js b/src/jmapNew/shape/graph/TrainWindow/index.js
index 2e4bdce1e..3329eddc4 100644
--- a/src/jmapNew/shape/graph/TrainWindow/index.js
+++ b/src/jmapNew/shape/graph/TrainWindow/index.js
@@ -11,9 +11,14 @@ class TrainWindow extends Group {
this._type = model._type;
this.zlevel = model.zlevel;
const amendData = store.getters['map/amendPoints'](this._code);
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
if (amendData) {
- model.point = amendData.position;
model.reversal = amendData.reversal;
+ this.computedPoint = amendData.position;
+ } else if (pictureDevice) {
+ this.computedPoint = pictureDevice.position;
+ } else {
+ this.computedPoint = model.point;
}
this.model = model;
this.style = style;
@@ -40,7 +45,7 @@ class TrainWindow extends Group {
/** 创建车次窗*/
createTrainWindow() {
const model = this.model;
- const point = model.point || model.position;
+ const point = this.computedPoint;
this.trainRect = new Polygon({
_subType: 'TrainWindow',
zlevel: this.zlevel,
@@ -94,7 +99,7 @@ class TrainWindow extends Group {
return (store.getters['map/getDeviceByCode'](code) || {}).instance;
}
getAnchorPoint() {
- return this.model.point || this.model.position;
+ return this.computedPoint;
}
}
diff --git a/src/jmapNew/shape/graph/ZcControl/EMouse.js b/src/jmapNew/shape/graph/ZcControl/EMouse.js
index bedc46d8a..ae8bbdb5c 100644
--- a/src/jmapNew/shape/graph/ZcControl/EMouse.js
+++ b/src/jmapNew/shape/graph/ZcControl/EMouse.js
@@ -14,8 +14,8 @@ export default class EMouse extends Group {
z: this.device.z + 1,
position: [0, 0],
style: {
- x: this.device.model.position.x,
- y: this.device.model.position.y + this.device.style.ZcControl.lamp.radiusR + this.device.style.ZcControl.text.distance - 30,
+ x: this.device.computedPosition.x,
+ y: this.device.computedPosition.y + this.device.style.ZcControl.lamp.radiusR + this.device.style.ZcControl.text.distance - 30,
fontWeight: this.device.style.ZcControl.mouseOverStyle.fontWeight,
fontSize: this.device.style.ZcControl.mouseOverStyle.fontSize,
fontFamily: this.device.style.fontFamily,
diff --git a/src/jmapNew/shape/graph/ZcControl/index.js b/src/jmapNew/shape/graph/ZcControl/index.js
index 52701ef89..4f4f0fb80 100644
--- a/src/jmapNew/shape/graph/ZcControl/index.js
+++ b/src/jmapNew/shape/graph/ZcControl/index.js
@@ -13,6 +13,12 @@ export default class ZcControl extends Group {
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
+ const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
+ if (pictureDevice) {
+ this.computedPosition = pictureDevice.position;
+ } else {
+ this.computedPosition = model.position;
+ }
this.model = model;
this.style = style;
this.isShowShape = true;
@@ -29,8 +35,8 @@ export default class ZcControl extends Group {
z: this.z,
arc: {
shape: {
- cx: model.position.x,
- cy: model.position.y,
+ cx: this.computedPosition.x,
+ cy: this.computedPosition.y,
r: this.style.ZcControl.lamp.radiusR
},
subType: 'Control',
@@ -41,8 +47,8 @@ export default class ZcControl extends Group {
},
text: {
position: [0, 0],
- x: model.position.x,
- y: model.position.y + this.style.ZcControl.lamp.radiusR + this.style.ZcControl.text.distance,
+ x: this.computedPosition.x,
+ y: this.computedPosition.y + this.style.ZcControl.lamp.radiusR + this.style.ZcControl.text.distance,
fontWeight: this.style.ZcControl.text.fontWeight,
fontSize: this.style.ZcControl.text.fontSize,
fontFamily: this.style.fontFamily,
diff --git a/src/jmapNew/shape/graph/checkBox/checkBox.js b/src/jmapNew/shape/graph/checkBox/checkBox.js
index 5d4253608..e3742a144 100644
--- a/src/jmapNew/shape/graph/checkBox/checkBox.js
+++ b/src/jmapNew/shape/graph/checkBox/checkBox.js
@@ -30,4 +30,5 @@ export default class checkBox extends Group {
});
this.add(this.box);
}
+ setState() {}
}
diff --git a/src/jmapNew/theme/components/utils/menuOperate.js b/src/jmapNew/theme/components/utils/menuOperate.js
index 0755d7f2a..bccfd8a23 100644
--- a/src/jmapNew/theme/components/utils/menuOperate.js
+++ b/src/jmapNew/theme/components/utils/menuOperate.js
@@ -564,15 +564,45 @@ export const menuOperate = {
operation: OperationEvent.CTCCommand.autoTrigger.menu.operation,
cmdType: CMD.CTC.CTC_AUTO_TRIGGER
},
- // 批量修改股道
- batchModifyTrackSection:{
- operation: OperationEvent.CTCCommand.batchModifyTrackSection.menu.operation,
- cmdType: CMD.CTC.CTC_BATCH_MODIFY_RUN_PLAN
+ // // 批量修改股道
+ // batchModifyTrackSection:{
+ // operation: OperationEvent.CTCCommand.batchModifyTrackSection.menu.operation,
+ // cmdType: CMD.CTC.CTC_BATCH_MODIFY_RUN_PLAN
+ // },
+ // 修改股道
+ modifyTrackSection:{
+ operation: OperationEvent.CTCCommand.modifyTrackSection.menu.operation,
+ cmdType: CMD.CTC.CTC_MODIFY_SECTION
},
- // 移除行车日志
- deleteRunplan:{
- operation: OperationEvent.CTCCommand.deleteRunplan.menu.operation,
- cmdType: CMD.CTC.CTC_REMOVE_RUN_PLAN
+ // 车站发送计划
+ stationSendRunplan:{
+ operation: OperationEvent.CTCCommand.stationSendRunplan.menu.operation,
+ cmdType: CMD.CTC.CTC_STATION_SEND_OUT_RUN_PLAN
+ },
+ // 车站取消红闪
+ stationCancleTwinkle:{
+ operation: OperationEvent.CTCCommand.stationCancleTwinkle.menu.operation,
+ cmdType: CMD.CTC.CTC_CANCEL_TWINKLE
+ },
+ // // 移除行车日志
+ // deleteRunplan:{
+ // operation: OperationEvent.CTCCommand.deleteRunplan.menu.operation,
+ // cmdType: CMD.CTC.CTC_REMOVE_RUN_PLAN
+ // },
+ // 设置删除标识
+ setDeleteRunplanLabel:{
+ operation: OperationEvent.CTCCommand.setDeleteRunplanLabel.menu.operation,
+ cmdType: CMD.CTC.CTC_LOG_SET_DELETE_LABEL
+ },
+ // 设置超限
+ setTransfinite:{
+ operation: OperationEvent.CTCCommand.setTransfinite.menu.operation,
+ cmdType: CMD.CTC.CTC_LOG_SET_TRANSFINITE
+ },
+ // 行车日志保存运行计划
+ logSaveRunplan:{
+ operation: OperationEvent.CTCCommand.logSaveRunplan.menu.operation,
+ cmdType: CMD.CTC.CTC_LOG_SAVE_RUN_PLAN
},
// 修改行车计划的邻站信息
modifyAdjacentStation:{
@@ -594,6 +624,47 @@ export const menuOperate = {
operation: OperationEvent.CTCCommand.agreeNotcie.menu.operation,
cmdType: CMD.CTC.CTC_AGREE_NOTICE
},
+ // 取消到达
+ cancleArrive:{
+ operation: OperationEvent.CTCCommand.cancleArrive.menu.operation,
+ cmdType: CMD.CTC.CTC_LOG_CANCEL_ARRIVE
+ },
+ // 取消出发
+ cancleDepature:{
+ operation: OperationEvent.CTCCommand.cancleDepature.menu.operation,
+ cmdType: CMD.CTC.CTC_LOG_CANCEL_DEPARTURE
+ },
+ // 取消闭塞
+ cancleBlock:{
+ operation: OperationEvent.CTCCommand.cancleBlock.menu.operation,
+ cmdType: CMD.CTC.CTC_LOG_CANCEL_BLOCK
+ },
+ // 设置重点列车
+ setKeyTrains:{
+ operation: OperationEvent.CTCCommand.setKeyTrains.menu.operation,
+ cmdType: CMD.CTC.CTC_LOG_SET_KEY_TRAINS
+ },
+ // 设置允许出入口与基本路径不一致
+ setEntryOutDiscordant:{
+ operation: OperationEvent.CTCCommand.setEntryOutDiscordant.menu.operation,
+ cmdType: CMD.CTC.CTC_LOG_SET_ENTRY_OUT_DISCORDANT
+ },
+ // 设置允许股道与基本路径不一致
+ setTrackDiscordant:{
+ operation: OperationEvent.CTCCommand.setTrackDiscordant.menu.operation,
+ cmdType: CMD.CTC.CTC_LOG_SET_TRACK_DISCORDANT
+ },
+ // 设置始发
+ setStartRunplan:{
+ operation: OperationEvent.CTCCommand.setStartRunplan.menu.operation,
+ cmdType: CMD.CTC.CTC_LOG_SET_START_RUN_PLAN
+ },
+ // 设置终到
+ setEndRunplan:{
+ operation: OperationEvent.CTCCommand.setEndRunplan.menu.operation,
+ cmdType: CMD.CTC.CTC_LOG_SET_END_RUN_PLAN
+ },
+
// 增加列车固定径路
addTrainFixedPath:{
operation: OperationEvent.CTCCommand.addTrainFixedPath.menu.operation,
@@ -642,6 +713,16 @@ export const menuOperate = {
modifyDispatcherLogerRpSection:{
operation: OperationEvent.CTCCommand.modifyDispatcherLogerRpSection.menu.operation,
cmdType: CMD.CTC.CTC_ZONE_SAVE_TRACK_SECTION
+ },
+ // 调度台行车计划修改时间
+ modifyDispatcherLogerRpPlanTime:{
+ operation: OperationEvent.CTCCommand.modifyDispatcherLogerRpSection.menu.operation,
+ cmdType: CMD.CTC.CTC_ZONE_SAVE_PLAN_TIME
+ },
+ // 调度台行车计划修改出入口
+ modifyDispatcherLogerRpDirection:{
+ operation: OperationEvent.CTCCommand.modifyDispatcherLogerRpSection.menu.operation,
+ cmdType: CMD.CTC.CTC_ZONE_SAVE_DIRECTION
}
},
Rail: {
@@ -653,6 +734,10 @@ export const menuOperate = {
operation: OperationEvent.RailCommand.railQueryTicket.menu.operation,
cmdType: CMD.RAIL.CMD_RAIL_QUERY_TICKET
},
+ railGiveTicketTo: {
+ operation: OperationEvent.RailCommand.railGiveTicketTo.menu.operation,
+ cmdType: CMD.RAIL.CMD_RAIL_GIVE_TICKET_TO
+ },
railFillInRegister: {
operation: OperationEvent.RailCommand.railFillInRegister.menu.operation,
cmdType: CMD.RAIL.CMD_RAIL_FILL_IN_REGISTER
diff --git a/src/jmapNew/theme/datie_02/menus/bottomTable.vue b/src/jmapNew/theme/datie_02/menus/bottomTable.vue
index e5687c866..951aa37af 100644
--- a/src/jmapNew/theme/datie_02/menus/bottomTable.vue
+++ b/src/jmapNew/theme/datie_02/menus/bottomTable.vue
@@ -157,6 +157,10 @@ export default {
const offset = val ? 162 : 0;
EventBus.$emit('setMenuButtonPosition', offset);
},
+ '$store.state.socket.simulationReset': function (val) {
+ this.sequenceMap = {};
+ this.sequenceList = [];
+ },
'$store.state.socket.railCtcStatusMsg': function (val) {
if (val && val.length) {
val.forEach(item => {
@@ -169,6 +173,11 @@ export default {
}
});
}
+ if (item && item.routeSequence && item.routeSequence.deletedLineIds && item.routeSequence.deletedLineIds.length) {
+ item.routeSequence.deletedLineIds.forEach(elem => {
+ delete this.sequenceMap[elem];
+ });
+ }
});
this.sequenceList = [];
for (const key in this.sequenceMap) {
diff --git a/src/jmapNew/theme/datie_02/menus/dialog/deleteRunplan.vue b/src/jmapNew/theme/datie_02/menus/dialog/deleteRunplan.vue
index 0b9134b52..2cddd04cb 100644
--- a/src/jmapNew/theme/datie_02/menus/dialog/deleteRunplan.vue
+++ b/src/jmapNew/theme/datie_02/menus/dialog/deleteRunplan.vue
@@ -46,7 +46,8 @@ export default {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
- return this.dialogShow ? OperationEvent.CTCCommand.deleteRunplan.menu.domId : '';
+ // deleteRunplan
+ return this.dialogShow ? OperationEvent.CTCCommand.setDeleteRunplanLabel.menu.domId : '';
},
title() {
return '警告';
@@ -69,7 +70,9 @@ export default {
},
commit() {
this.loading = true;
- commitOperate(menuOperate.CTC.deleteRunplan, this.model, 2).then(({valid})=>{
+ // 设置删除标识
+ // deleteRunplan;
+ commitOperate(menuOperate.CTC.setDeleteRunplanLabel, this.model, 2).then(({valid})=>{
this.loading = false;
this.$emit('clearRpRow');
if (valid) {
diff --git a/src/jmapNew/theme/datie_02/menus/dialog/sendRunplan.vue b/src/jmapNew/theme/datie_02/menus/dialog/sendRunplan.vue
index 26e4fb5dd..a56d5f917 100644
--- a/src/jmapNew/theme/datie_02/menus/dialog/sendRunplan.vue
+++ b/src/jmapNew/theme/datie_02/menus/dialog/sendRunplan.vue
@@ -134,9 +134,9 @@ export default {
tableData1:[],
tableData2:[],
addModel:{
- stationCode:'',
- planParamList:[],
- force:1
+ stationCode:''
+ // planParamList:[],
+ // force:1
}
};
},
@@ -148,15 +148,15 @@ export default {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
- return this.dialogShow ? OperationEvent.CTCCommand.batchModifyTrackSection.menu.domId : '';
+ return this.dialogShow ? OperationEvent.CTCCommand.stationSendRunplan.menu.domId : '';
},
title() {
return '发送计划';
}
},
methods:{
- doShow(tableData, activeDepartRunPlan, activeArriveRunPlan, filterSectionList) {
- this.addModel.planParamList = [];
+ doShow(tableData, filterSectionList) {
+ // this.addModel.planParamList = [];
this.tableData1 = [];
tableData.forEach(element => {
if (element.arriveRunPlan && element.arriveRunPlan.sectionCode) {
@@ -171,24 +171,24 @@ export default {
});
// filterSectionList
this.addModel.stationCode = this.$store.state.training.roleDeviceCode;
- const activeDepartRunPlanList = Object.values(activeDepartRunPlan).filter(activeDepart=>{ return activeDepart.changeSectionCode && activeDepart.changeSectionCode != activeDepart.sectionCode; });
- if (activeDepartRunPlanList.length > 0) {
- activeDepartRunPlanList.forEach(depart=>{
- this.addModel.planParamList.push({
- runPlanCode:depart.code,
- departSectionCode:depart.changeSectionCode
- });
- });
- }
- const activeArriveRunPlanList = Object.values(activeArriveRunPlan).filter(activeArrive=>{ return activeArrive.changeSectionCode && activeArrive.changeSectionCode != activeArrive.sectionCode; });
- if (activeArriveRunPlanList.length > 0) {
- activeArriveRunPlanList.forEach(arrive=>{
- this.addModel.planParamList.push({
- runPlanCode:arrive.code,
- arriveSectionCode:arrive.changeSectionCode
- });
- });
- }
+ // const activeDepartRunPlanList = Object.values(activeDepartRunPlan).filter(activeDepart=>{ return activeDepart.changeSectionCode && activeDepart.changeSectionCode != activeDepart.sectionCode; });
+ // if (activeDepartRunPlanList.length > 0) {
+ // activeDepartRunPlanList.forEach(depart=>{
+ // this.addModel.planParamList.push({
+ // runPlanCode:depart.code,
+ // departSectionCode:depart.changeSectionCode
+ // });
+ // });
+ // }
+ // const activeArriveRunPlanList = Object.values(activeArriveRunPlan).filter(activeArrive=>{ return activeArrive.changeSectionCode && activeArrive.changeSectionCode != activeArrive.sectionCode; });
+ // if (activeArriveRunPlanList.length > 0) {
+ // activeArriveRunPlanList.forEach(arrive=>{
+ // this.addModel.planParamList.push({
+ // runPlanCode:arrive.code,
+ // arriveSectionCode:arrive.changeSectionCode
+ // });
+ // });
+ // }
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
@@ -200,21 +200,21 @@ export default {
this.$store.dispatch('training/emitTipFresh');
},
commit() {
- if (this.addModel.planParamList.length > 0) {
- const params = this.addModel;
- this.loading = true;
- commitOperate(menuOperate.CTC.batchModifyTrackSection, params, 3).then(({valid})=>{
- this.loading = false;
- if (valid) {
- this.$emit('closeFlash');
- this.doClose();
- }
- }).catch(() => {
- this.loading = false;
+ // if (this.addModel.planParamList.length > 0) {
+ const params = this.addModel;
+ this.loading = true;
+ commitOperate(menuOperate.CTC.stationSendRunplan, params, 3).then(({valid})=>{
+ this.loading = false;
+ if (valid) {
+ // this.$emit('closeFlash');
this.doClose();
- this.$emit('noticeInfo');
- });
- }
+ }
+ }).catch(() => {
+ this.loading = false;
+ this.doClose();
+ this.$emit('noticeInfo');
+ });
+ // }
// * @param stationCode 车站编码
// * @param runPlanCode 运行编码
diff --git a/src/jmapNew/theme/datie_02/menus/dialog/stageRunplan.vue b/src/jmapNew/theme/datie_02/menus/dialog/stageRunplan.vue
index 6a55e1b49..89b7b22ee 100644
--- a/src/jmapNew/theme/datie_02/menus/dialog/stageRunplan.vue
+++ b/src/jmapNew/theme/datie_02/menus/dialog/stageRunplan.vue
@@ -53,9 +53,12 @@
width="100"
>
-
+