Merge remote-tracking branch 'origin/test'

This commit is contained in:
fan 2022-07-14 18:15:52 +08:00
commit d2cf5489b3
219 changed files with 21968 additions and 1538 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -14,6 +14,8 @@ export default {
/** 鼠标按下,计算当前元素距离可视区的距离*/
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.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`;

View File

@ -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' // 反位封锁颜色
}
},
switchDot: { // 岔心小圆点
show: true,
monoLockColor: '#ff0000', // 单锁 红色
lockColor: '#0000ff' // 单封 蓝色
},
};
this[deviceType.LcControl] = {

View File

@ -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); // 增加一个 前数据 处理 为了在区段中 获取全部的 道岔信息

View File

@ -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,

View File

@ -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,

View File

@ -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');
}
}
}

View File

@ -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;

View File

@ -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: {

View File

@ -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,

View File

@ -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;
}
}

View File

@ -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,

View File

@ -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;
}
}

View File

@ -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,

View File

@ -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;
}
}

View File

@ -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,

View File

@ -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;
}
}

View File

@ -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,

View File

@ -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;
}
}

View File

@ -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,

View File

@ -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;
}
}

View File

@ -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,

View File

@ -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;
}
}

View File

@ -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')) {

View File

@ -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
};
}
}

View File

@ -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
}
});
}

View File

@ -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);

View File

@ -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
},

View File

@ -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
},

View File

@ -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
},

View File

@ -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),

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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,

View File

@ -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,8 +178,8 @@ 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'
@ -183,8 +189,8 @@ export default class SaidLamp extends Group {
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,

View File

@ -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;

View File

@ -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({

View File

@ -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);

View File

@ -1,6 +1,6 @@
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) {
@ -19,13 +19,14 @@ class EDerailer extends Group {
createText() {
const style = this.model.style;
const model = this.model.modelData;
const length = model.points.length;
// 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 = (model.points[0].x + model.points[length-1].x) / 2 + offsetX;
const positionY = (model.points[0].y + model.points[length-1].y) / 2 + offsetY;
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,
@ -42,19 +43,20 @@ class EDerailer extends Group {
textAlign: 'center',
textVerticalAlign: 'center'
}
})
});
this.add(this.text);
}
createSymbol() {
const style = this.model.style;
const model = this.model.modelData;
const length = model.points.length;
// 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 = (model.points[0].x + model.points[length-1].x) / 2 + offsetX;
const pointY = (model.points[0].y + model.points[length-1].y) / 2 + offsetY;
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,
@ -67,9 +69,9 @@ class EDerailer extends Group {
]
},
style: {
fill: style.Section.derailer.symbol.color,
fill: style.Section.derailer.symbol.color
}
})
});
this.add(this.symbol);
}

View File

@ -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);

View File

@ -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],

View File

@ -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) {

View File

@ -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;
}
}

View File

@ -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, // 方向

View File

@ -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;

View File

@ -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) { // 物理区段名称

View File

@ -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,

View File

@ -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]);
@ -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);

View File

@ -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();
}
@ -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();
@ -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
};
}
}

View File

@ -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,6 +27,7 @@ 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 => {
@ -32,8 +39,8 @@ export default class SignalButton extends Group {
zlevel: this.zlevel,
z: this.z,
shape: {
cx: this.model.position.x + 7,
cy: this.model.position.y + 7,
cx: computedPosition.x + 7,
cy: computedPosition.y + 7,
r: 7
},
style: {
@ -48,8 +55,8 @@ export default class SignalButton extends Group {
zlevel: this.zlevel,
z: this.z,
shape: {
x: model.position.x,
y: model.position.y,
x: computedPosition.x,
y: computedPosition.y,
width: 14,
height: 14
},
@ -66,10 +73,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 + 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: '',

View File

@ -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;
}
}

View File

@ -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,

View File

@ -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,

View File

@ -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,
@ -177,7 +191,8 @@ export default class Station extends Group {
}
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,7 +450,8 @@ export default class Station extends Group {
}
}
createSelfDiscipline() {
const model = this.model;
// const model = this.model;
const computedControlModePoint = this.computedControlModePoint;
if (this.style.Station.StationControl.selfDiscipline) {
this.selfDiscipline = new ESingleControl({
_subType: 'self_discipline',
@ -437,8 +459,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.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
@ -452,8 +474,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.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
@ -462,7 +484,8 @@ export default class Station extends Group {
}
}
createVeryControl() {
const model = this.model;
// const model = this.model;
const computedControlModePoint = this.computedControlModePoint;
if (this.style.Station.StationControl.veryControl) {
this.veryControl = new ESingleControl({
_subType: 'very',
@ -470,8 +493,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.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
@ -484,8 +507,8 @@ export default class Station extends Group {
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
},
@ -502,8 +525,8 @@ export default class Station extends Group {
_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,
@ -518,7 +541,8 @@ export default class Station extends Group {
}
}
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
@ -1003,6 +1029,6 @@ export default class Station extends Group {
}
}
getAnchorPoint() {
return this.model.position;
return this.computedPosition;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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,

View File

@ -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,

View File

@ -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: {

View File

@ -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,

View File

@ -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,

View File

@ -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({

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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});
}
}
}

View File

@ -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({

View File

@ -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;

View File

@ -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;

View File

@ -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({

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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,

View File

@ -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);

View File

@ -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,

View File

@ -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,

View File

@ -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({

View File

@ -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',

View File

@ -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,

View File

@ -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() {

View File

@ -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

View File

@ -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,14 +445,7 @@ 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 {
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) ) {
@ -456,7 +460,6 @@ export default class Switch extends Group {
this.shapeModelC.stopAnimation(false);
this.shapeModelA.stopAnimation(false);
}
}
/** 挤叉*/
setForkAction(fault) {
if (this.style.Switch.jointImg.fork) {
@ -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,7 +729,16 @@ export default class Switch extends Group {
this.switchPosition = 'reverse';
this.setInversionAction(model); /** 反位*/
} else if (model.pos == 'NO') {
// 宁波线失表
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); // 挤岔
}

View File

@ -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;
}
}

View File

@ -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,

View File

@ -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;
}
}

View File

@ -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,

View File

@ -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,

View File

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

View File

@ -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

View File

@ -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) {

View File

@ -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) {

View File

@ -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,13 +200,13 @@ export default {
this.$store.dispatch('training/emitTipFresh');
},
commit() {
if (this.addModel.planParamList.length > 0) {
// if (this.addModel.planParamList.length > 0) {
const params = this.addModel;
this.loading = true;
commitOperate(menuOperate.CTC.batchModifyTrackSection, params, 3).then(({valid})=>{
commitOperate(menuOperate.CTC.stationSendRunplan, params, 3).then(({valid})=>{
this.loading = false;
if (valid) {
this.$emit('closeFlash');
// this.$emit('closeFlash');
this.doClose();
}
}).catch(() => {
@ -214,7 +214,7 @@ export default {
this.doClose();
this.$emit('noticeInfo');
});
}
// }
// * @param stationCode
// * @param runPlanCode

View File

@ -53,9 +53,12 @@
width="100"
>
<template slot-scope="scope">
<div v-if="scope.row.arriveSectionCode">
<div v-if="scope.row.status==-1">删除</div>
<div v-else-if="scope.row.status==1">{{ sectionMap[scope.row.arriveSectionCode] }}</div>
<div v-else-if="scope.row.arriveSectionCode">{{ sectionMap[scope.row.arriveSectionCode]+'['+sectionMap[scope.row.oldArriveSectionCode]+']' }}</div>
<!-- scope.row.status==1||( -->
<div v-else-if="scope.row.arriveSectionCode&&!scope.row.oldArriveSectionCode">{{ sectionMap[scope.row.arriveSectionCode] }}</div>
<div v-else>{{ sectionMap[scope.row.arriveSectionCode]+'['+sectionMap[scope.row.oldArriveSectionCode]+']' }}</div>
</div>
</template>
</el-table-column>
<el-table-column
@ -64,8 +67,10 @@
width="170"
>
<template slot-scope="scope">
<div v-if="scope.row.arrivePlanTime">
<div v-if="scope.row.status==-1">删除</div>
<div v-else>{{ scope.row.arrivePlanTime }}</div>
</div>
</template>
</el-table-column>
<el-table-column
@ -74,10 +79,13 @@
width="100"
>
<template slot-scope="scope">
<div v-if="scope.row.departSectionCode">
<div v-if="scope.row.status==-1">删除</div>
<!-- {{ sectionMap }} -->
<div v-else-if="scope.row.status==1">{{ sectionMap[scope.row.departSectionCode] }}</div>
<div v-else-if="scope.row.departSectionCode">{{ sectionMap[scope.row.departSectionCode]+'['+sectionMap[scope.row.oldDepartSectionCode]+']' }}</div>
<!-- scope.row.status==1 -->
<div v-else-if="scope.row.departSectionCode&&!scope.row.oldDepartSectionCode">{{ sectionMap[scope.row.departSectionCode] }}</div>
<div v-else>{{ sectionMap[scope.row.departSectionCode]+'['+sectionMap[scope.row.oldDepartSectionCode]+']' }}</div>
</div>
</template>
</el-table-column>
<el-table-column
@ -86,8 +94,10 @@
width="170"
>
<template slot-scope="scope">
<div v-if="scope.row.departPlanTime">
<div v-if="scope.row.status==-1">删除</div>
<div v-else>{{ scope.row.departPlanTime }}</div>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -0,0 +1,446 @@
<template>
<el-dialog
v-dialogDrag
class="chengdou-03__systerm train-set-plan"
:title="title"
:visible.sync="show"
width="670px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-form id="AddTrainRunplanForm" ref="form" :model="model" label-width="80px" :rules="rules">
<el-form-item label="车站:" prop="stationCode" style="width: 100%;">
<el-select v-model="model.stationCode" placeholder="" style="width:180px" disabled>
<el-option
v-for="item in stationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="到达车次:" prop="arriveTripNumber">
<el-input v-model="model.arriveTripNumber" style="width:160px" :disabled="model.startRunPlan" />
</el-form-item>
<el-form-item label="出发车次:" prop="departTripNumber" style="margin-left: 66px;">
<el-input v-model="model.departTripNumber" style="width:160px" :disabled="model.endRunPlan" />
</el-form-item>
<el-form-item label="列车类型:" prop="trainType">
<el-select v-model="model.trainType" placeholder="" style="width:180px" popper-class="trainRpSelect">
<el-option
v-for="item in trainTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="运行类型:" prop="runType" style="margin-left: 45px;">
<el-select v-model="model.runType" placeholder="" style="width:180px" popper-class="trainRpSelect">
<el-option
v-for="item in runTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="到达超限:" prop="arriveTransfinite">
<el-select v-model="model.arriveTransfinite" placeholder="" style="width:180px" :disabled="model.startRunPlan" popper-class="trainRpSelect">
<el-option
v-for="item in transfiniteList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="出发超限:" prop="departTransfinite" style="margin-left: 45px;">
<el-select v-model="model.departTransfinite" placeholder="" style="width:180px" :disabled="model.endRunPlan" popper-class="trainRpSelect">
<el-option
v-for="item in transfiniteList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="接车口:" prop="arriveDirectionCode">
<el-select v-model="model.arriveDirectionCode" placeholder="" style="width:180px" :disabled="model.startRunPlan" popper-class="trainRpSelect">
<el-option
v-for="item in mapStationDirectionList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="发车口:" prop="departDirectionCode" style="margin-left:45px;">
<el-select v-model="model.departDirectionCode" placeholder="" style="width:180px" :disabled="model.endRunPlan" popper-class="trainRpSelect">
<el-option
v-for="item in mapStationDirectionList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="接车股道:" prop="arriveSectionCode">
<el-select v-model="model.arriveSectionCode" placeholder="" style="width:160px" :disabled="model.startRunPlan" popper-class="trainRpSelect">
<el-option
v-for="item in filterSectionList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="发车股道:" prop="departSectionCode" style="margin-left: 67px;">
<el-select v-model="model.departSectionCode" placeholder="" style="width:160px" :disabled="model.endRunPlan" popper-class="trainRpSelect">
<el-option
v-for="item in filterSectionList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="到达时间:" prop="arrivePlanTime">
<el-date-picker v-model="model.arrivePlanTime" type="datetime" :disabled="model.startRunPlan" value-format="yyyy-MM-dd HH:mm" format="yyyy-MM-dd HH:mm" style="width:160px" />
</el-form-item>
<el-form-item label="" prop="startRunPlan" class="noMargin" style="margin-left:10px;">
<el-checkbox v-model="model.startRunPlan" @change="changeStartRp">始发</el-checkbox>
</el-form-item>
<el-form-item label="出发时间:" prop="departPlanTime" style="margin-left:10px;">
<el-date-picker v-model="model.departPlanTime" type="datetime" :disabled="model.endRunPlan" value-format="yyyy-MM-dd HH:mm" format="yyyy-MM-dd HH:mm" style="width:160px" />
</el-form-item>
<el-form-item label="" prop="endRunPlan" class="noMargin" style="margin-left:10px;">
<el-checkbox v-model="model.endRunPlan" @change="changeEndRp">终到</el-checkbox>
</el-form-item>
<div>
<el-form-item label="" prop="arriveElectrical" class="noMargin" style="margin-left:80px;margin-bottom: 0px;">
<el-checkbox v-model="model.arriveElectrical" :disabled="model.startRunPlan">到达电力</el-checkbox>
</el-form-item>
<el-form-item label="" prop="departElectrical" class="noMargin" style="margin-left:80px;">
<el-checkbox v-model="model.departElectrical" :disabled="model.endRunPlan">出发电力</el-checkbox>
</el-form-item>
</div>
<el-form-item label="" prop="passenger" class="noMargin" style="margin-left:30px;">
<el-checkbox v-model="model.passenger">办理客运</el-checkbox>
</el-form-item>
<el-form-item label="" prop="keyTrains" class="noMargin" style="margin-left:50px;">
<el-checkbox v-model="model.keyTrains">重点列车</el-checkbox>
</el-form-item>
<el-form-item label="" prop="military" class="noMargin" style="margin-left:50px;">
<el-checkbox v-model="model.military">军用</el-checkbox>
</el-form-item>
<br>
<el-form-item label="" prop="trackDiscordant" style="margin-left:80px;width: 220px;" class="noMargin">
<el-checkbox v-model="model.trackDiscordant">运行股道与基本径路不一致</el-checkbox>
</el-form-item>
<el-form-item label="" prop="entryOutDiscordant" style="margin-left:90px;width: 220px;" class="noMargin">
<el-checkbox v-model="model.entryOutDiscordant">出入口与基本径路不一致</el-checkbox>
</el-form-item>
</el-form>
<el-row justify="center" style="margin-top:10px">
<el-col :span="7" :offset="5">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="7" :offset="2">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
export default {
name: 'TrainRunplan',
data() {
var validateTripNumber = (rule, value, callback) => {
if (value) {
const judge = /^[a-zA-Z0-9]*[\d]$/.test(value);
if (judge) {
if (value.toString().length > 6 || value.toString().length < 2) {
callback('车次长度2-6位');
} else {
callback();
}
} else {
callback('字母+数字,最后一位数字');
}
} else {
// callback('');
callback();
}
};
return {
dialogShow: false,
loading: false,
title:'',
mapStationDirectionList:[],
filterSectionList:[],
trainTypeList:[
//
{name:'管内特快旅客列车', code:'LOCAL_EXPRESS_PASSENGER_TRAIN' },
{name:'管内快速旅客列车', code:'LOCAL_FAST_PASSENGER_TRAIN' },
{name:'管内普通旅客快车', code:'LOCAL_PASSENGER_TRAIN' },
{name:'管内普通旅客慢车', code:'LOCAL_SLOW_PASSENGER_TRAIN' },
{name:'管内临时旅客列车', code:'LOCAL_TEMPORARY_PASSENGER_TRAIN' },
{name:'管内临时旅游列车', code:'LOCAL_TEMPORARY_TOURIST_TRAIN' },
//
{name:'跨局快速旅客列车', code:'FAST_PASSENGER_TRAIN' },
{name:'跨局临时旅游列车', code:'TEMPORARY_TOURIST_TRAIN' },
{name:'跨两局普通旅客快车', code:'TWO_PASSENGER_TRAIN' },
{name:'跨两局普通旅客慢车', code:'TWO_SLOW_PASSENGER_TRAIN' },
{name:'跨两局临时旅客列车', code:'TWO_TEMPORARY_PASSENGER_TRAIN' },
{name:'跨三局及其以上普通旅客快车', code:'MORE_PASSENGER_TRAIN' },
//
{name:'回送出入厂客车底列车', code:'BACK_FACTORY_PASSENGER_TRAIN' },
{name:'因故折返旅客列车', code:'FAULT_TRUE_BACK_PASSENGER_TRAIN' }
],
runTypeList:[
{name:'快速旅客列车', code:'FAST_PASSENGER_TRAIN' }
],
transfiniteList:[
{name:'不超限', code:'NO' },
{name:'超级超限', code:'TRANSFINITE_SUPER' },
{name:'一级超限', code:'TRANSFINITE_ONE_LEVEL' },
{name:'二级超限', code:'TRANSFINITE_TWO_LEVEL' }
],
model:{
runPlanCode:'', //
stationCode:'', //
trainType:'', //
runType:'', //
arriveSectionCode:'', //
arrivePlanTime:'', //
arriveTripNumber:'', //
arriveDirectionCode:'', //
arriveTransfinite:null, //
arriveElectrical:false, //
departSectionCode:'', //
departPlanTime:'', //
departTripNumber:'', //
departDirectionCode:'', //
departTransfinite:null, //
departElectrical:false, //
startRunPlan:false, // true,false
endRunPlan:false, // true,false
passenger:false, // true,false
keyTrains:false, // true,false
military:false, // true,false
trackDiscordant:false, //
entryOutDiscordant:false //
},
rules: {
arriveTripNumber:[
{ required: true, validator: validateTripNumber, trigger: 'blur' }
],
departTripNumber:[
{ required: true, validator: validateTripNumber, trigger: 'blur' }
]
}
};
},
computed: {
...mapGetters('map', [
'stationList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.CTCCommand.addDispatcherLogerRp.menu.domId : '';
}
},
methods: {
doShow(row, filterSectionList) {
const stationCode = this.$store.state.training.roleDeviceCode;
this.mapStationDirectionList = Object.values(this.$store.state.map.mapStationDirectionData).filter(each=>{ return each.stationCode == stationCode; });
this.filterSectionList = filterSectionList;
this.dialogShow = true;
if (row.code) {
this.title = '修改列车信息';
this.model = {
runPlanCode:row.code, //
stationCode:row.stationCode, //
trainType:row.trainType, //
runType:row.runType, //
startRunPlan:row.startRunPlan, // true,false
endRunPlan:row.endRunPlan, // true,false
passenger:row.passenger == 'PASSENGER', // true,false
keyTrains:row.keyTrains, // true,false
military:row.military, // true,false
trackDiscordant:row.trackDiscordant, //
entryOutDiscordant:row.entryOutDiscordant//
};
//
if (row.arriveRunPlan) {
this.model.arriveSectionCode = row.arriveRunPlan.sectionCode;
// debugger;
this.model.arrivePlanTime = row.arriveRunPlan.planTime;
this.model.arriveTripNumber = row.arriveRunPlan.tripNumber;
this.model.arriveDirectionCode = row.arriveRunPlan.accessName; //
this.model.arriveTransfinite = row.arriveRunPlan.transfinite; //
this.model.arriveElectrical = row.arriveRunPlan.electrical; //
}
//
if (row.departRunPlan) {
this.model.departSectionCode = row.departRunPlan.planTime;
this.model.departPlanTime = row.departRunPlan.planTime;
this.model.departTripNumber = row.departRunPlan.tripNumber;
this.model.departDirectionCode = row.departRunPlan.accessName;
this.model.departTransfinite = row.departRunPlan.transfinite;
this.model.departElectrical = row.departRunPlan.electrical;
}
} else {
this.title = '新增列车信息';
this.model.stationCode = row.stationCode;
this.model.trainType = 'LOCAL_EXPRESS_PASSENGER_TRAIN'; //
this.model.runType = 'FAST_PASSENGER_TRAIN'; //
}
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
changeEndRp(data) {
if (data) {
this.model.departSectionCode = '';
this.model.departPlanTime = '';
this.model.departTripNumber = '';
this.model.departDirectionCode = '';
this.model.departTransfinite = null;
this.model.departElectrical = false;
}
},
changeStartRp(data) {
if (data) {
this.model.arriveSectionCode = '';
this.model.arrivePlanTime = '';
this.model.arriveTripNumber = '';
this.model.arriveDirectionCode = '';
this.model.arriveTransfinite = null;
this.model.arriveElectrical = false;
}
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.model = {
runPlanCode:'', //
stationCode:'', //
trainType:'', //
runType:'', //
arriveSectionCode:'', //
arrivePlanTime:'', //
arriveTripNumber:'', //
arriveDirectionCode:'', //
arriveTransfinite:null, //
arriveElectrical:false, //
departSectionCode:'', //
departPlanTime:'', //
departTripNumber:'', //
departDirectionCode:'', //
departTransfinite:null, //
departElectrical:false, //
startRunPlan:false, // true,false
endRunPlan:false, // true,false
passenger:false, // true,false
keyTrains:false, // true,false
military:false, // true,false
trackDiscordant:false, //
entryOutDiscordant:false //
};
this.$store.dispatch('training/emitTipFresh');
},
//
commit() {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
if (!this.model.runPlanCode) { delete this.model.runPlanCode; }
const stationCode = this.$store.state.training.roleDeviceCode;
commitOperate(menuOperate.CTC.logSaveRunplan, {stationCode:stationCode, runPlanParam:this.model, force:1}, 3).then(({valid, response})=>{
if (valid) {
// this.$emit('addDisLoger', response.data);
this.$emit('clearRpRow');
this.doClose();
}
}).catch(() => {
this.$emit('clearRpRow');
this.doClose();
this.$emit('noticeInfo');
});
}
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$emit('clearRpRow');
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>
<style lang="scss">
.chengdou-03__systerm .el-dialog #AddTrainRunplanForm .el-form-item label{
padding-right:5px;
line-height:30px;
}
.chengdou-03__systerm .el-dialog #AddTrainRunplanForm .el-form-item{
margin-bottom:20px;
}
#AddTrainRunplanForm .el-form-item__content{
line-height:30px;
}
#AddTrainRunplanForm{
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
#AddTrainRunplanForm .el-input__inner {
height: 22px !important;
line-height: 22px !important;
}
#AddTrainRunplanForm span.el-input__suffix .el-input__icon{
height:22px;
line-height:22px;
}
#AddTrainRunplanForm span.el-input__prefix .el-input__icon{
line-height:22px;
display:none;
}
#AddTrainRunplanForm .el-form-item.noMargin .el-form-item__content{
margin-left:0px !important;
}
#AddTrainRunplanForm .el-form-item.noMargin .el-checkbox__label{
padding-left: 5px;
vertical-align: top;
line-height: 30px;
}
#AddTrainRunplanForm .el-input--prefix .el-input__inner{
padding-left:10px;
padding-right: 26px;
}
.trainRpSelect {z-index:2014 !important;}
</style>

View File

@ -4,8 +4,8 @@
<menu-bar v-if="isShowBar" ref="menuBar" :date-strin="dateString1" :selected="selected" />
<div v-if="isCtc" style="position: absolute; top: 64px;z-index: 10;background: #F0F0F0;padding: 2px;height: 65px;width: 100%;">
<div style="display: flex;">
<img :src="ctcBarIcon1" class="img-box">
<img :src="ctcBarIcon2" class="img-box">
<img :src="ctcBarIcon1" class="img-box" @click="zhanjiantouming">
<img :src="ctcBarIcon2" class="img-box" @click="danzhanxianshi">
<img :src="ctcBarIcon3" class="img-box">
<img :src="ctcBarIcon4" class="img-box">
<img :src="ctcBarIcon5" class="img-box">
@ -140,6 +140,7 @@ export default {
data() {
return {
currentRailwaySimulationRunplan:{},
showCentralizedStationCode: '',
alarmMessages: [
{ id: 1, message: '这是告警信息一' },
{ id: 2, message: '这是告警信息二' },
@ -244,6 +245,7 @@ export default {
},
beforeDestroy() {
window.onclick = function (e) {};
this.$store.dispatch('map/setPictureDeviceMap', {});
},
methods: {
changeSignedStatus(info) {
@ -260,6 +262,41 @@ export default {
this.$refs.cmdManage.doShow();
}
},
zhanjiantouming() {
this.$store.dispatch('map/setPictureDeviceMap', {});
this.showCentralizedStationCode = this.$store.state.map.showCentralizedStationCode || this.showCentralizedStationCode;
const mapDevice = this.$store.state.map.mapDevice;
const list = [];
for (const key in mapDevice) {
list.push(mapDevice[key]);
}
if (this.$store.state.map.map && this.$store.state.map.map.pictureList) {
const picture = this.$store.state.map.map.pictureList.find(picture => picture.stationCode === this.showCentralizedStationCode && picture.type === 'lucency');
if (picture) {
this.$jlmap.updateShowStation(list, '');
this.$store.dispatch('map/setPictureDeviceMap', picture.deviceMap);
const deviceList = [];
const mapDevice = this.$store.state.map.mapDevice;
for (const deviceCode in mapDevice) {
deviceList.push(deviceCode);
}
this.$jlmap.updatePicture(deviceList);
this.$jlmap.updateTransform(picture.scaling, picture.origin);
}
}
},
danzhanxianshi() {
this.$store.dispatch('map/setPictureDeviceMap', {});
const mapDevice = this.$store.state.map.mapDevice;
const map = this.$store.state.map.map;
const list = [];
for (const key in mapDevice) {
list.push(mapDevice[key]);
}
this.$jlmap.updateShowStation(list, this.$store.state.map.showCentralizedStationCode || this.showCentralizedStationCode);
this.$jlmap.setCenter(this.$store.state.map.showCentralizedStationCode || this.showCentralizedStationCode);
this.$jlmap.updateTransform(map.scaling, map.origin);
},
getRailwaySimulationRunplanSend() {
const stationCode = this.$store.state.training.roleDeviceCode;
const railwaySimulationRunplanSendMap = this.$store.state.socket.railwaySimulationRunplanSendMap;

View File

@ -8,6 +8,9 @@
<div class="eachRpImage">
<img :src="Rpw" class="eachRpImageIn">
</div>
<div class="eachRpImage">
<img :src="RpAdd" class="eachRpImageIn" @click="addTrainRunplan">
</div>
<div class="eachRpImage">
<img :src="Rpd" class="eachRpImageIn">
</div>
@ -49,7 +52,7 @@
<div class="runplanClickBtn">阶段记事</div>
</div>
<div class="runplanStatusGroup">
<div class="eachRunplanStatus">2020年11月15日22:23:21</div>
<div class="eachRunplanStatus">{{ dateString1 + ' ' + time }}</div>
<div class="eachRunplanStatus">与中心通信正常</div>
<div class="eachRunplanStatus">与车站服务器通信正常</div>
</div>
@ -64,9 +67,9 @@
<div class="runplanContentBtn">出发(F4)</div>
<div class="runplanContentBtn">通过(F11)</div>
<div class="runplanContentBtn">邻站(F6)</div>
<div class="runplanContentBtn">取消接车(Esc)</div>
<div class="runplanContentBtn">取消闭塞(F6)</div>
<div class="runplanContentBtn">取消发车(F7)</div>
<div class="runplanContentBtn" @click="cancleArrive">取消接车(Esc)</div>
<div class="runplanContentBtn" @click="cancleBlock">取消闭塞(F6)</div>
<div class="runplanContentBtn" @click="cancleDepature">取消发车(F7)</div>
</div>
</div>
<div class="runplanContentR">
@ -77,6 +80,7 @@
border
height="695"
highlight-current-row
:row-class-name="judgeColor"
style="width: 100%;border:1px #ccc solid"
@cell-click="selectedTripNumber"
@current-change="handleCurrentChange"
@ -88,7 +92,9 @@
width="100"
>
<template slot-scope="scope">
<div>{{ scope.row.tripNumber }} {{ scope.row.delete?'(删)':'' }}</div>
<div :class="scope.row.twinkle?'flashTrip noChange':'noChange'" style="color:#000">
{{ scope.row.tripNumber }} {{ scope.row.status==1?'(删)':scope.row.twinkle?'(*)':scope.row.keyTrains?'(重)':'' }}
</div>
</template>
</el-table-column>
<el-table-column label="到 达">
@ -98,12 +104,18 @@
<div class="runplanTableTname"><br><br>&nbsp;</div>
<div class="runplanTableNo">1</div>
</template>
<template slot-scope="scope">
<div v-if="scope.row.arriveRunPlan" class="noChange">{{ scope.row.arriveRunPlan.down }}</div>
</template>
</el-table-column>
<el-table-column width="80" prop="arriveRunPlan.up">
<template slot="header">
<div class="runplanTableTname"><br><br>&nbsp;</div>
<div class="runplanTableNo">2</div>
</template>
<template slot-scope="scope">
<div v-if="scope.row.arriveRunPlan" class="noChange">{{ scope.row.arriveRunPlan.up }}</div>
</template>
</el-table-column>
</el-table-column>
<el-table-column width="155" prop="arriveRunPlan.accessName">
@ -112,7 +124,7 @@
<div class="runplanTableNo">3</div>
</template>
<template slot-scope="scope">
<div v-if="scope.row.arriveRunPlan" class="accessName" :title="scope.row.arriveRunPlan.accessName">{{ scope.row.arriveRunPlan.accessName }}</div>
<div v-if="scope.row.arriveRunPlan" class="noChange" :title="mapStationDirectionData[scope.row.arriveRunPlan.accessName].name ">{{ mapStationDirectionData[scope.row.arriveRunPlan.accessName].name }}</div>
</template>
</el-table-column>
<el-table-column width="60" prop="arriveRunPlan.sectionCode">
@ -127,9 +139,9 @@
placeholder=""
size="mini"
popper-class="stationSelect"
@focus="focusArriveRunPlan($event,scope.row)"
@change="changeArriveRunPlan($event,scope.row,scope.$index)"
>
<!-- :class="judgeColor({scope.row,scope.$index})" -->
<el-option
v-for="item in filterSectionList"
:key="item.code"
@ -169,7 +181,7 @@
<div class="runplanTableNo">7</div>
</template>
<template slot-scope="scope">
<div v-if="scope.row.arriveRunPlan">{{ coverTime(scope.row.arriveRunPlan.planTime) }}</div>
<div v-if="scope.row.arriveRunPlan" class="noChange">{{ coverRealTime(scope.row.arriveRunPlan.planTime) }}</div>
</template>
</el-table-column>
<el-table-column width="70" prop="arriveRunPlan.actualTime">
@ -177,6 +189,11 @@
<div class="runplanTableTname runplanFourLevel"><br></div>
<div class="runplanTableNo">8</div>
</template>
<template slot-scope="scope">
<div v-if="scope.row.arriveRunPlan" style="line-height:28px" :class="scope.row.arriveRunPlan.finish? (scope.row.passenger=='PASSENGER'?'fontRed':'fontBlue'):'fontBlack'">
{{ scope.row.arriveRunPlan.actualTime }}
</div>
</template>
</el-table-column>
</el-table-column>
</el-table-column>
@ -271,12 +288,18 @@
<div class="runplanTableTname"><br><br>&nbsp;</div>
<div class="runplanTableNo">19</div>
</template>
<template slot-scope="scope">
<div v-if="scope.row.departRunPlan" class="noChange">{{ scope.row.departRunPlan.down }}</div>
</template>
</el-table-column>
<el-table-column width="80" prop="departRunPlan.up">
<template slot="header">
<div class="runplanTableTname"><br><br>&nbsp;</div>
<div class="runplanTableNo">20</div>
</template>
<template slot-scope="scope">
<div v-if="scope.row.departRunPlan" class="noChange">{{ scope.row.departRunPlan.up }}</div>
</template>
</el-table-column>
</el-table-column>
<el-table-column width="60" prop="departRunPlan.sectionCode">
@ -291,7 +314,6 @@
placeholder=""
size="mini"
popper-class="stationSelect"
@focus="focusDepartRunPlan($event,scope.row)"
@change="changeDepartRunPlan($event,scope.row,scope.$index)"
>
<el-option
@ -309,7 +331,7 @@
<div class="runplanTableNo">22</div>
</template>
<template slot-scope="scope">
<div v-if="scope.row.departRunPlan" class="accessName" :title="scope.row.departRunPlan.accessName">{{ scope.row.departRunPlan.accessName }}</div>
<div v-if="scope.row.departRunPlan" class="noChange" :title="mapStationDirectionData[scope.row.departRunPlan.accessName].name">{{ mapStationDirectionData[scope.row.departRunPlan.accessName].name }}</div>
</template>
</el-table-column>
<el-table-column label="时 分">
@ -342,7 +364,7 @@
<div class="runplanTableNo">25</div>
</template>
<template slot-scope="scope">
<div v-if="scope.row.departRunPlan">{{ coverTime(scope.row.departRunPlan.planTime) }}</div>
<div v-if="scope.row.departRunPlan" class="noChange">{{ coverRealTime(scope.row.departRunPlan.planTime) }}</div>
</template>
</el-table-column>
<el-table-column width="70" prop="departRunPlan.actualTime">
@ -350,6 +372,11 @@
<div class="runplanTableTname runplanFourLevel"><br></div>
<div class="runplanTableNo">26</div>
</template>
<template slot-scope="scope">
<div v-if="scope.row.departRunPlan" :class="scope.row.departRunPlan.finish? (scope.row.passenger=='PASSENGER'?'fontRed':'fontBlue'):'fontBlack'">
{{ scope.row.departRunPlan.actualTime }}
</div>
</template>
</el-table-column>
</el-table-column>
</el-table-column>
@ -396,11 +423,14 @@
<div class="runplanTableNo">31</div>
</template>
</el-table-column>
<el-table-column width="70">
<el-table-column width="70" prop="planProperties">
<template slot="header">
<div class="runplanTableTname runplanTwo2Level"><br><br><br></div>
<div class="runplanTableNo">32</div>
</template>
<template slot-scope="scope">
<div>{{ scope.row.planProperties }}</div>
</template>
</el-table-column>
<el-table-column width="70">
<template slot="header">
@ -408,22 +438,64 @@
<div class="runplanTableNo">33</div>
</template>
</el-table-column>
<el-table-column width="90" prop="transfinite">
<template slot="header">
<div class="runplanTableTname runplanTwo3Level"><br><br></div>
<div class="runplanTableNo">33</div>
</template>
<template slot-scope="scope">
<el-select
v-model="tableData[scope.$index].transfinite"
placeholder=""
size="mini"
popper-class="stationSelect"
@change="changeTransfinite($event,scope.row,scope.$index)"
>
<!-- :class="judgeColor({scope.row,scope.$index})" -->
<el-option
v-for="item in transfiniteList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
</el-table>
<div v-show="rpMenuPopShow" class="rpMenuPopOut" @click="closeRpMenu">
<div class="rpMenuPop" :style="{'top':rpMenuPopTop+'px'}">
<div class="eachRpMenu">上报到达点</div>
<div class="eachRpMenu">上报出发点</div>
<div class="eachRpMenu">上报通过点</div>
<div class="eachRpMenu">为始发车</div>
<div class="eachRpMenu">为终到车</div>
<div class="eachRpMenu" @click="setStartRunplan">
<span v-if="startRunplan" class="eachRpMenuSelect"></span>
<span>为始发车</span>
</div>
<div class="eachRpMenu" @click="setEndRunplan">
<span v-if="endRunplan" class="eachRpMenuSelect"></span>
<span>为终到车</span>
</div>
<div class="eachRpSep" />
<div class="eachRpMenu">上报速报信息</div>
<div class="eachRpMenu" @click="modifyTripNumber">修改车次号</div>
<div class="eachRpMenu" @click="modifyAdjacentStation">修改相关邻站</div>
<div class="eachRpMenu" @click="deleteRunplan">删除</div>
<!-- <div class="eachRpMenu" @click="deleteRunplan">删除</div> -->
<!-- setDeleteRunplanLabel -->
<div class="eachRpSep" />
<div class="eachRpMenu">清楚闪烁</div>
<div class="eachRpMenu" @click="clearFlash">清除闪烁</div>
<div class="eachRpMenu">全体信息</div>
<div class="eachRpSep" />
<div class="eachRpMenu" @click="modifyTrainRunplan">修改列车</div>
<div class="eachRpMenu" @click="setKeyTrains">设置取消重点列车</div>
<div class="eachRpMenu" @click="deleteRunplan">设置删除标识</div>
<div class="eachRpMenu" @click="setTrackDiscordant">
<span v-if="trackDiscordant" class="eachRpMenuSelect"></span>
<span>允许股道与基本路径不一致</span>
</div>
<div class="eachRpMenu" @click="setEntryOutDiscordant">
<span v-if="entryOutDiscordant" class="eachRpMenuSelect"></span>
<span>允许出入口与基本路径不一致</span>
</div>
</div>
</div>
</div>
@ -483,11 +555,13 @@
</div>
</div>
<send-runplan ref="sendRunplan" @closeFlash="closeFlash" @noticeInfo="noticeInfo" />
<send-runplan ref="sendRunplan" @noticeInfo="noticeInfo" />
<!-- @closeFlash="closeFlash" -->
<stage-runplan ref="stageRunplan" @closeFlash="closeStageFlash" @noticeInfo="noticeInfo" />
<modify-adjacent-station ref="modifyAdjacentStation" @clearRpRow="clearRpRow" @noticeInfo="noticeInfo" />
<delete-runplan ref="deleteRunplan" @clearRpRow="clearRpRow" @noticeInfo="noticeInfo" />
<modify-trip-number ref="modifyTripNumber" @clearRpRow="clearRpRow" @noticeInfo="noticeInfo" />
<train-runplan ref="trainRunplan" @clearRpRow="clearRpRow" @noticeInfo="noticeInfo" />
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
</div>
</template>
@ -504,12 +578,16 @@ import Rpsa from '@/assets/ctc_icon/rpsa.png';
import Rpb from '@/assets/ctc_icon/rpb.png';
import Rpwp from '@/assets/ctc_icon/rpwp.png';
import Rph from '@/assets/ctc_icon/rph.png';
import RpAdd from '@/assets/ctc_icon/rpadd.png';
import { timeFormat } from '@/utils/date';
import { prefixIntrger } from '@/utils/date';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import SendRunplan from './dialog/sendRunplan';
import StageRunplan from './dialog/stageRunplan';
import DeleteRunplan from './dialog/deleteRunplan';
import ModifyAdjacentStation from './dialog/modifyAdjacentStation';
import ModifyTripNumber from './dialog/modifyTripNumber';
import TrainRunplan from './dialog/trainRunplan';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { copyAssign } from '@/utils/index';
import { mapGetters } from 'vuex';
@ -521,10 +599,14 @@ export default {
DeleteRunplan,
ModifyAdjacentStation,
ModifyTripNumber,
TrainRunplan,
NoticeInfo
},
data() {
return {
time: '00:00:00',
dateString: '',
dateString1: '',
isShow:false,
rpMenuPopShow:false,
rpMenuPopTop:0,
@ -540,31 +622,94 @@ export default {
Rpb:Rpb,
Rpwp:Rpwp,
Rph:Rph,
RpAdd:RpAdd,
tableData:[],
filterSectionList:[],
activeDepartRunPlan:{},
activeArriveRunPlan:{},
startRunplan:false,
endRunplan:false,
trackDiscordant:false,
entryOutDiscordant:false,
// activeDepartRunPlan:{},
// activeArriveRunPlan:{},
currentRailwaySimulationRunplan:{},
// radioSelected:''
currentRow:null
currentRow:null,
transfiniteList:[
{label:'不超限', value:'NO'},
{label:'一级超限', value:'TRANSFINITE_ONE_LEVEL'},
{label:'二级超限', value:'TRANSFINITE_TWO_LEVEL'},
{label:'超级超限', value:'TRANSFINITE_SUPER'}
]
};
},
computed: {
...mapGetters('map', [
'sectionList'
])
]),
mapStationDirectionData() {
return this.$store.state.map.mapStationDirectionData;
}
},
watch:{
'$store.state.socket.simulationTimeSync': function (time) { // 仿
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(time)}`));
const date = new Date(+new Date(`${new Date().toLocaleDateString()} ${timeFormat(time)}`));
this.initDate(date);
},
'$store.state.socket.railCtcRunplanChange': function (val) {
this.loadData();
},
'$store.state.socket.railwaySimulationRunplanSendChange': function (val) {
this.getRailwaySimulationRunplanSend();
},
'$store.state.socket.changedCtcRunplanMap': function (val) {
this.judgeStationCtcRunplan();
},
// 仿-仿
'$store.state.socket.simulationReset': function (val) {
this.$store.dispatch('socket/resetRailCtcRunplanInitMsg');
this.loadData();
}
// railwaySimulationRunplanSendMap
// railwaySimulationRunplanSendChange
},
methods:{
initDate(date) {
this.time = `${prefixIntrger(date.getHours(), 2)}:${prefixIntrger(date.getMinutes(), 2)}:${prefixIntrger(date.getSeconds(), 2)}`;
const years = date.getFullYear() + '';
let months = date.getMonth() + 1 + '';
let dates = date.getDate() + '';
if (months.length < 2) { months = '0' + months; }
if (dates.length < 2) { dates = '0' + dates; }
this.dateString = years + months + dates;
this.dateString1 = years + '年' + months + '月' + dates + '日';
},
judgeColor({row, rowIndex}) {
if (row.effect) {
if (row.passenger == 'PASSENGER') {
return 'fontRed';
} else if (row.passenger == 'GOODS_TRAIN') {
return 'fontBlue';
} else {
return 'fontBlack';
}
} else {
if (row.passenger == 'PASSENGER') {
return 'fontPink';
} else if (row.passenger == 'GOODS_TRAIN') {
return 'fontLightBlue';
} else {
return 'fontBlack';
}
}
},
judgeStationCtcRunplan() {
const changedCtcRunplanMap = this.$store.state.socket.changedCtcRunplanMap;
const stationCode = this.$store.state.training.roleDeviceCode;
if (changedCtcRunplanMap[stationCode]) {
document.getElementById('sendRunplan').classList.add('active');
} else {
this.closeFlash();
}
},
getRailwaySimulationRunplanSend() {
const stationCode = this.$store.state.training.roleDeviceCode;
const railwaySimulationRunplanSendMap = this.$store.state.socket.railwaySimulationRunplanSendMap;
@ -573,8 +718,8 @@ export default {
document.getElementById('stageRunplan').classList.add('active');
this.currentRailwaySimulationRunplan = railwaySimulationRunplanSendMap;
} else {
const sendRunplan = document.getElementById('stageRunplan').className;
document.getElementById('stageRunplan').className = sendRunplan.replace('active', '');
const stageRunplan = document.getElementById('stageRunplan').className;
document.getElementById('stageRunplan').className = stageRunplan.replace('active', '');
}
},
loadData() {
@ -594,8 +739,12 @@ export default {
return data.stationCode == this.$store.state.training.roleDeviceCode;
});
this.tableData.sort((prev, next)=>{
const prevPlanTime = prev.departRunPlan ? prev.departRunPlan.planTime : prev.arriveRunPlan ? prev.arriveRunPlan.planTime : '00:00:00';
const nextPlanTime = next.departRunPlan ? next.departRunPlan.planTime : next.arriveRunPlan ? next.arriveRunPlan.planTime : '00:00:00';
const prevPlanTime = prev.departRunPlan ? (prev.departRunPlan.actualTime || prev.departRunPlan.planTime)
: prev.arriveRunPlan ? (prev.arriveRunPlan.actualTime || prev.arriveRunPlan.planTime) : '00:00:00';
const nextPlanTime = next.departRunPlan ? (next.departRunPlan.actualTime || next.departRunPlan.planTime)
: next.arriveRunPlan ? (next.arriveRunPlan.actualTime || next.arriveRunPlan.planTime) : '00:00:00';
// console.log(prevPlanTime, nextPlanTime, '66666666');
// const nextPlanTime = next.departRunPlan ? next.departRunPlan.planTime : next.arriveRunPlan ? next.arriveRunPlan.planTime : '00:00:00';
return new Date('2000-06-18 ' + prevPlanTime).getTime() - new Date('2000-06-18 ' + nextPlanTime).getTime();
});
},
@ -611,6 +760,7 @@ export default {
this.loadData();
this.isShow = true;
this.getRailwaySimulationRunplanSend();
this.judgeStationCtcRunplan();
window.addEventListener('keydown', this.handleKeyDown);
// arriveRunPlan: Object
// code: "00110010"
@ -649,12 +799,16 @@ export default {
this.stageRunplan();
break;
}
// Esc
// F6
// F7
}
}
},
sendRunplan() {
if (document.getElementById('sendRunplan').className.includes('active')) {
this.$refs.sendRunplan.doShow(this.tableData, this.activeDepartRunPlan, this.activeArriveRunPlan, this.filterSectionList);
this.$refs.sendRunplan.doShow(this.tableData, this.filterSectionList);
// this.activeDepartRunPlan, this.activeArriveRunPlan,
}
},
stageRunplan() {
@ -663,28 +817,73 @@ export default {
this.$refs.stageRunplan.doShow(this.currentRailwaySimulationRunplan[stationCode]);
}
},
focusDepartRunPlan(event, row) {
this.activeDepartRunPlan[row.code] = {sectionCode:event, code:row.code};
},
//
changeDepartRunPlan(event, row, index) {
const activeDepart = this.activeDepartRunPlan[row.code];
if (activeDepart) {
activeDepart.changeSectionCode = event;
document.getElementById('sendRunplan').classList.add('active');
//
changeTransfinite(event, row, index) {
const params = {
stationCode:row.stationCode,
runPlanCode:row.code,
transfinite:row.transfinite
};
commitOperate(menuOperate.CTC.setTransfinite, params, 3).then(({valid})=>{
this.loading = false;
if (valid) {
}
}).catch(() => {
this.loading = false;
});
},
//
changeDepartRunPlan(event, row, index) {
const params = {
stationCode:row.stationCode,
runPlanCode:row.code,
arriveSection:'',
departSection:row.departRunPlan.sectionCode,
force:1
};
commitOperate(menuOperate.CTC.modifyTrackSection, params, 3).then(({valid})=>{
this.loading = false;
if (valid) {
}
}).catch(() => {
this.loading = false;
});
// const activeDepart = this.activeDepartRunPlan[row.code];
// if (activeDepart) {
// activeDepart.changeSectionCode = event;
// document.getElementById('sendRunplan').classList.add('active');
// }
// console.log(event, this.tableData[index].departRunPlan.sectionCode, row.departRunPlan.sectionCode, '------');
},
focusArriveRunPlan(event, row) {
this.activeArriveRunPlan[row.code] = {sectionCode:event, code:row.code};
},
//
changeArriveRunPlan(event, row, index) {
const activeArrive = this.activeArriveRunPlan[row.code];
if (activeArrive) {
activeArrive.changeSectionCode = event;
// if(activeArrive.changeSectionCode!=)
document.getElementById('sendRunplan').classList.add('active');
const params = {
stationCode:row.stationCode,
runPlanCode:row.code,
arriveSection:row.arriveRunPlan.sectionCode,
departSection:'',
force:1
};
// stationCode
// runPlanCode
// arriveSection
// departSection
// force
// element.arriveRunPlan.sectionCode
// element.departRunPlan.sectionCode
commitOperate(menuOperate.CTC.modifyTrackSection, params, 3).then(({valid})=>{
this.loading = false;
if (valid) {
}
}).catch(() => {
this.loading = false;
});
// const activeArrive = this.activeArriveRunPlan[row.code];
// if (activeArrive) {
// activeArrive.changeSectionCode = event;
// // if(activeArrive.changeSectionCode!=)
// document.getElementById('sendRunplan').classList.add('active');
// }
// CTC_MODIFY_TRACK_SECTION
//
// * @param stationCode
@ -704,24 +903,28 @@ export default {
// force 0:1
},
closeDialog() {
this.closeFlash();
// this.closeFlash();
this.doClose();
this.activeDepartRunPlan = {};
this.activeArriveRunPlan = {};
// this.activeDepartRunPlan = {};
// this.activeArriveRunPlan = {};
},
closeFlash() {
const sendRunplan = document.getElementById('sendRunplan').className;
document.getElementById('sendRunplan').className = sendRunplan.replace('active', '');
},
closeStageFlash() {
const sendRunplan = document.getElementById('stageRunplan').className;
document.getElementById('stageRunplan').className = sendRunplan.replace('active', '');
const stageRunplan = document.getElementById('stageRunplan').className;
document.getElementById('stageRunplan').className = stageRunplan.replace('active', '');
const stationCode = this.$store.state.training.roleDeviceCode;
this.$store.dispatch('socket/deleteRailwaySimulationRunplan', stationCode);
},
selectedTripNumber(row, column, cell, event) {
if (column.property == 'tripNumber') {
if (this.currentRow && this.currentRow.code == row.code) {
this.startRunplan = row.startRunPlan;
this.endRunplan = row.endRunPlan;
this.trackDiscordant = row.trackDiscordant;
this.entryOutDiscordant = row.entryOutDiscordant;
this.rpMenuPopShow = true;
const offsetTop = cell.offsetTop - document.querySelector('#runplanContentTable .el-table__body-wrapper').scrollTop;
this.rpMenuPopTop = offsetTop - 202 > 0 ? offsetTop - 380 > 0 ? offsetTop - 202 + 100 : offsetTop - 202 + 190 : offsetTop + 180;
@ -733,6 +936,10 @@ export default {
} else {
this.currentRow = null;
// this.rpMenuPopShow = false;
this.startRunplan = false;
this.endRunplan = false;
this.trackDiscordant = false;
this.entryOutDiscordant = false;
this.$refs.runplanContentTable.setCurrentRow();
}
},
@ -745,6 +952,10 @@ export default {
closeRpMenu() {
this.clearRpRow();
this.rpMenuPopShow = false;
this.startRunplan = false;
this.endRunplan = false;
this.trackDiscordant = false;
this.entryOutDiscordant = false;
},
//
modifyTripNumber(event) {
@ -764,12 +975,144 @@ export default {
this.rpMenuPopShow = false;
this.$refs.deleteRunplan.doShow(this.currentRow);
},
//
clearFlash() {
if (this.currentRow && this.currentRow.twinkle) {
event.stopPropagation();
this.rpMenuPopShow = false;
commitOperate(menuOperate.CTC.stationCancleTwinkle, {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code}, 3).then(({valid})=>{
this.loading = false;
this.clearRpRow();
if (valid) {
// this.doClose();
}
}).catch(() => {
this.loading = false;
this.clearRpRow();
this.noticeInfo();
});
}
},
//
modifyTrainRunplan() {
if (this.currentRow) {
event.stopPropagation();
this.rpMenuPopShow = false;
const params = copyAssign({}, this.currentRow);
this.$refs.trainRunplan.doShow(params, this.filterSectionList);
}
},
//
addTrainRunplan() {
const stationCode = this.$store.state.training.roleDeviceCode;
this.$refs.trainRunplan.doShow({stationCode:stationCode}, this.filterSectionList);
},
//
setKeyTrains() {
if (this.currentRow) {
event.stopPropagation();
this.rpMenuPopShow = false;
const params = {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code};
params.status = this.currentRow.keyTrains ? 0 : 1;
commitOperate(menuOperate.CTC.setKeyTrains, params, 3).then(({valid})=>{
this.loading = false;
this.clearRpRow();
if (valid) {
// this.doClose();
}
}).catch(() => {
this.loading = false;
this.clearRpRow();
this.noticeInfo();
});
}
},
//
setEntryOutDiscordant() {
if (this.currentRow) {
event.stopPropagation();
this.rpMenuPopShow = false;
const params = {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code};
params.status = this.currentRow.entryOutDiscordant ? 0 : 1;
commitOperate(menuOperate.CTC.setEntryOutDiscordant, params, 3).then(({valid})=>{
this.loading = false;
this.clearRpRow();
if (valid) {
// this.doClose();
}
}).catch(() => {
this.loading = false;
this.clearRpRow();
this.noticeInfo();
});
}
},
//
setTrackDiscordant() {
if (this.currentRow) {
event.stopPropagation();
this.rpMenuPopShow = false;
const params = {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code};
params.status = this.currentRow.trackDiscordant ? 0 : 1;
commitOperate(menuOperate.CTC.setTrackDiscordant, params, 3).then(({valid})=>{
this.loading = false;
this.clearRpRow();
if (valid) {
// this.doClose();
}
}).catch(() => {
this.loading = false;
this.clearRpRow();
this.noticeInfo();
});
}
},
//
setStartRunplan() {
if (this.currentRow) {
event.stopPropagation();
this.rpMenuPopShow = false;
const params = {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code};
params.status = this.currentRow.startRunPlan ? 0 : 1;
commitOperate(menuOperate.CTC.setStartRunplan, params, 3).then(({valid})=>{
this.loading = false;
this.clearRpRow();
if (valid) {
// this.doClose();
}
}).catch(() => {
this.loading = false;
this.clearRpRow();
this.noticeInfo();
});
}
},
//
setEndRunplan() {
if (this.currentRow) {
event.stopPropagation();
this.rpMenuPopShow = false;
const params = {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code};
params.status = this.currentRow.endRunPlan ? 0 : 1;
commitOperate(menuOperate.CTC.setEndRunplan, params, 3).then(({valid})=>{
this.loading = false;
this.clearRpRow();
if (valid) {
// this.doClose();
}
}).catch(() => {
this.loading = false;
this.clearRpRow();
this.noticeInfo();
});
}
},
//
sendNotcie() {
// && this.currentRow.departRunPlan && this.currentRow.departRunPlan.adjacentMessage == 0
if (this.currentRow && this.currentRow.departRunPlan) {
this.loading = true;
commitOperate(menuOperate.CTC.sendNotcie, {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code}, 2).then(({valid})=>{
commitOperate(menuOperate.CTC.sendNotcie, {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code}, 3).then(({valid})=>{
this.loading = false;
this.clearRpRow();
// if (valid) {
@ -784,10 +1127,11 @@ export default {
}
},
//
agreeNotcie() {
if (this.currentRow && this.currentRow.arriveRunPlan && this.currentRow.arriveRunPlan.adjacentMessage == 1) {
commitOperate(menuOperate.CTC.agreeNotcie, {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code}, 2).then(({valid})=>{
//
cancleArrive() {
if (this.currentRow && this.currentRow.arriveRunPlan) {
//
commitOperate(menuOperate.CTC.cancleArrive, {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code}, 3).then(({valid})=>{
this.loading = false;
this.clearRpRow();
if (valid) {
@ -796,12 +1140,66 @@ export default {
}).catch(() => {
this.loading = false;
this.clearRpRow();
this.noticeInfo();
});
}
},
//
cancleDepature() {
if (this.currentRow && this.currentRow.departRunPlan) {
commitOperate(menuOperate.CTC.cancleDepature, {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code}, 3).then(({valid})=>{
this.loading = false;
this.clearRpRow();
if (valid) {
// this.doClose();
}
}).catch(() => {
this.loading = false;
this.clearRpRow();
this.noticeInfo();
});
}
},
//
cancleBlock() {
if (this.currentRow &&
(
(this.currentRow.departRunPlan && this.currentRow.departRunPlan.adjacentMessage == 1) ||
(this.currentRow.arriveRunPlan && this.currentRow.arriveRunPlan.adjacentMessage == 1)
)
) {
commitOperate(menuOperate.CTC.cancleBlock, {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code}, 3).then(({valid})=>{
this.loading = false;
this.clearRpRow();
if (valid) {
// this.doClose();
}
}).catch(() => {
this.loading = false;
this.clearRpRow();
this.noticeInfo();
});
}
},
//
agreeNotcie() {
if (this.currentRow && this.currentRow.arriveRunPlan && this.currentRow.arriveRunPlan.adjacentMessage == 1) {
commitOperate(menuOperate.CTC.agreeNotcie, {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code}, 3).then(({valid})=>{
this.loading = false;
this.clearRpRow();
if (valid) {
// this.doClose();
}
}).catch(() => {
this.loading = false;
this.clearRpRow();
this.noticeInfo();
});
}
},
// startRunplan
// endRunplan
noticeInfo() {
this.$refs.noticeInfo.doShow();
},
@ -1028,6 +1426,14 @@ export default {
-moz-animation:changeColor 1s infinite; /* Firefox */
-webkit-animation:changeColor 1s infinite; /* Safari and Chrome */
}
.flashTrip{
animation:flashColor 1s infinite;
-moz-animation:flashColor 1s infinite; /* Firefox */
-webkit-animation:flashColor 1s infinite; /* Safari and Chrome */
}
.noChange{
line-height: 28px;
}
@keyframes changeColor
{
0% {background:#f0f0f0;}
@ -1046,6 +1452,24 @@ export default {
50% {background:#ff1900;}
100% {background:#f0f0f0;}
}
@keyframes flashColor
{
0% {background:#fff;}
50% {background:#ff1900;}
100% {background:#fff;}
}
@-moz-keyframes flashColor /* Firefox */
{
0% {background:#fff;}
50% {background:#ff1900;}
100% {background:#fff;}
}
@-webkit-keyframes flashColor /* Safari and Chrome */
{
0% {background:#fff;}
50% {background:#ff1900;}
100% {background:#fff;}
}
.eachRpImage{display: inline-block;vertical-align: top;margin-top: 3px;}
.eachRpImageIn{height:26px;cursor: pointer;}
.rpMenuPop{
@ -1063,7 +1487,9 @@ export default {
top:0;
}
.eachRpMenu{
padding: 5px 20px;font-size:14px;cursor: pointer;
padding: 5px 30px;
font-size:14px;
cursor: pointer;
}
.eachRpMenu:hover{
background:#fff;
@ -1122,4 +1548,21 @@ export default {
}
.passagerTrain{background:#f00;width: 100%;height: 28px;}
.goodTrain{background:#00f;width: 100%;height: 28px;}
.fontRed{color:#f00}
.fontBlue{color:#00f}
.fontBlack{color:#000}
.fontPink{color: #FF1493;}
.fontLightBlue{color: #87CEFA;}
.eachRpMenuSelect{
display: inline-block;
padding: 3px 5px 0px 5px;
border: 1px #94c0fb solid;
border-radius: 3px;
background: rgba(148,192,251,0.3);
color: #0f1aff;
font-size: 12px;
line-height: 12px;
position: absolute;
left: 10px;
}
</style>

View File

@ -0,0 +1,292 @@
<template>
<div v-show="showTable" style="background: #F0F0F0;z-index: 10;position: absolute;left: 0;bottom: 0;width: 100%;font-size: 14px;">
<i class="el-icon-close close_icon" @click.stop="doClose" />
<el-row>
<el-col :span="11" style="padding: 0 10px;">
<div style="border: 1px solid #C7C7C7;margin-top: 10px;">
<div style="position: relative; top: -8px;left: 15px;width: 130px;background: #f0f0f0;">列车进路序列 可修改</div>
<div style="width: 100%;background: #9F9F9F">
<el-table
ref="sequenceTable"
:data="sequenceList"
height="90"
:row-class-name="tableRowClassName"
border
style="width: 650px"
:cell-style="{padding: 0}"
:default-sort="{prop: 'startTime', order: 'ascending'}"
>
<el-table-column type="index" width="30" label="序" label-class-name="bottom-table-label-header" />
<el-table-column property="tripNumber" label="车次" width="60" label-class-name="bottom-table-label-header">
<template slot-scope="scope">
<div style="width: 100%;height: 22px;" @contextmenu="popMenuShow(scope.row, '' ,$event)">{{ scope.row.tripNumber }}</div>
</template>
</el-table-column>
<el-table-column property="trackName" label="股道" width="50" label-class-name="bottom-table-label-header" />
<el-table-column property="autoTrigger" label="自触" width="50" label-class-name="bottom-table-label-header">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.autoTrigger" @change="triggerChange(scope.row)" />
</template>
</el-table-column>
<el-table-column property="direction" label="方向" width="100" label-class-name="bottom-table-label-header" />
<el-table-column property="startTime" label="开始" width="80" label-class-name="bottom-table-label-header" />
<el-table-column property="planTime" label="计划" width="90" label-class-name="bottom-table-label-header" />
<el-table-column property="" label="状态" width="90" label-class-name="bottom-table-label-header">
<template slot-scope="scope">
<span>{{ getRouteStatus(scope.row.status) }}</span>
</template>
</el-table-column>
<el-table-column property="description" label="进路描述" label-class-name="bottom-table-label-header">
<template slot-scope="scope">
<span>{{ getRouteName(scope.row.routeCode) }}</span>
</template>
</el-table-column>
</el-table>
</div>
</div>
<div style="display: flex;align-items: center;">
<div style="margin-right: 10px;">车站</div>
<el-select v-model="stationCode" size="mini" @change="stationChange">
<el-option
v-for="item in stationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<div style="border: 1px outset #C7C7C7;margin-left: 20px;padding: 3px;">释放权限</div>
<div style="margin-left: 10px;">字体</div>
<div style="margin-left: 10px;border: 1px inset #C7C7C7;padding: 3px;">常规</div>
</div>
</el-col>
<el-col :span="13">
<div style="border: 1px solid #C7C7C7;margin-top: 10px;">
<div style="position: relative; top: -8px;left: 15px;width: 103px;background: #f0f0f0;">调车进路 可修改</div>
<el-row>
<el-col :span="12" style="padding: 0 10px;">
<div style="border: 1px solid #C7C7C7;">
<div style="position: relative; top: -8px;left: 15px;width: 86px;background: #f0f0f0;">调车进路序列</div>
<div style="width: 100%;background: #9F9F9F">
<el-table :data="tableData" height="55" border style="width: 465px" :cell-style="{padding: 0}">
<el-table-column type="index" label="顺序" width="50" label-class-name="bottom-table-label-header" />
<el-table-column property="" label="勾序" width="50" label-class-name="bottom-table-label-header" />
<el-table-column property="" label="进路及方向" width="95" label-class-name="bottom-table-label-header" />
<el-table-column property="" label="自触" width="50" label-class-name="bottom-table-label-header" />
<el-table-column property="" label="状态" width="50" label-class-name="bottom-table-label-header" />
<el-table-column property="" label="触发时间" width="80" label-class-name="bottom-table-label-header" />
<el-table-column property="" label="占用时间" label-class-name="bottom-table-label-header" />
</el-table>
</div>
</div>
</el-col>
<el-col :span="12" style="padding: 0 10px;">
<div style="border: 1px solid #C7C7C7;">
<div style="position: relative; top: -8px;left: 15px;width: 44px;background: #f0f0f0;">勾序列</div>
<div style="width: 100%;background: #9F9F9F">
<el-table :data="tableData" height="55" style="width: 360px" border :cell-style="{padding: 0}">
<el-table-column type="index" label="钩计划" width="70" label-class-name="bottom-table-label-header" />
<el-table-column property="" label="股道" width="50" label-class-name="bottom-table-label-header" />
<el-table-column property="" label="操作" width="50" label-class-name="bottom-table-label-header" />
<el-table-column property="" label="状态" width="50" label-class-name="bottom-table-label-header" />
<el-table-column property="" label="记事" width="50" label-class-name="bottom-table-label-header" />
<el-table-column property="" label="作业时间" label-class-name="bottom-table-label-header" />
</el-table>
</div>
</div>
</el-col>
</el-row>
</div>
<el-row>
<div style="display: flex;align-items: center;">
<div>作业单</div>
<el-select v-model="sheetValue" size="mini" style="margin-left: 10px;width: 500px;">
<el-option
v-for="item in sheetList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<div style="border: 1px outset #C7C7C7;margin-left: 20px;padding: 3px;">单头信息</div>
<div style="border: 1px outset #C7C7C7;margin-left: 20px;padding: 3px;">删除</div>
<div style="border: 1px outset #C7C7C7;margin-left: 20px;padding: 3px;">发送</div>
</div>
</el-row>
<el-row>
<div style="display: flex;">
<div>历史进路</div>
<div style="margin-left: 300px;">状态</div>
</div>
</el-row>
</el-col>
</el-row>
<pop-menu ref="popMenu" :menu="menu" style="background: #DFE3E6;" />
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { EventBus } from '@/scripts/event-bus'; // 996
import { menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import PopMenu from '@/components/PopMenu';
export default {
name: 'BottomTable',
components: {
PopMenu
},
data() {
return {
tableData: [{}],
stationCode: '',
sheetValue: '',
routeParam: {},
showTable: false,
sheetList: [{ label: '历史进路', value: 'historyRoute' }],
sequenceList: [],
sequenceMap: {},
menu: [{label: '人工触发', handler: this.artificialTrigger, disabled: false}, {label: '删除', handler: this.artificialTrigger, disabled: true}]
};
},
computed: {
...mapGetters('map', [
'stationList'
])
},
watch: {
'showTable': function (val) {
const offset = val ? 162 : 0;
EventBus.$emit('setMenuButtonPosition', offset);
},
'$store.state.socket.railCtcStatusMsg': function (val) {
if (val && val.length) {
val.forEach(item => {
if (item && item.routeSequence && item.routeSequence.lines && item.routeSequence.lines.length) {
item.routeSequence.lines.forEach(elem => {
if (!this.sequenceMap[elem.id]) {
this.sequenceMap[elem.id] = Object.assign(elem, { stationCode: item.stationCode, readOnly: item.readOnly });
} else {
this.sequenceMap[elem.id] = Object.assign(this.sequenceMap[elem.id], elem, { stationCode: item.stationCode, readOnly: item.readOnly });
}
});
}
});
this.sequenceList = [];
for (const key in this.sequenceMap) {
if (this.sequenceMap[key].stationCode === this.stationCode) {
this.sequenceList.push(this.sequenceMap[key]);
}
}
}
}
},
mounted() {
EventBus.$on('bottomTableShowOrHidden', () => {
this.showTable = !this.showTable;
});
if (this.stationList && this.stationList.length) {
this.stationCode = this.stationList[0].code;
}
},
methods: {
doShow() {
this.showTable = true;
},
doClose() {
this.showTable = false;
},
getRouteStatus(status) {
if (status === '2') {
return '触发完成';
} else if (status === '1') {
return '正在触发';
} else {
return '等待中';
}
},
triggerChange(row) {
const triggerParam = { stationCode: this.stationCode, tripNumber: row.tripNumber, routeCode: row.routeCode, trigger: row.autoTrigger };
if (row.autoTrigger) {
this.setTrigger(triggerParam, row);
} else {
this.cancelTrigger(triggerParam, row);
}
},
stationChange(stationCode) {
this.sequenceList = [];
for (const key in this.sequenceMap) {
if (this.sequenceMap[key].stationCode === stationCode) {
this.sequenceList.push(this.sequenceMap[key]);
}
}
},
tableRowClassName({row, rowIndex}) {
if (row.status === '0') {
return 'bottom-table-route-wait';
} else if (row.tripNumber) {
return 'bottom-table-route-green';
} else {
return 'bottom-table-route-gray';
}
},
getRouteName(code) {
if (code) {
const route = this.$store.state.map.routeData[code];
return route ? route.name : '';
} else { return ''; }
},
setTrigger(triggerParam, row) {
commitOperate(menuOperate.CTC.autoTrigger, triggerParam, 3).then(({valid, operate})=>{
if (valid) {
this.$message.success('设置自动触发成功!');
}
}).catch((e) => {
console.error(e);
row.autoTrigger = false;
this.$message.error('设置自动触发失败!');
});
},
popMenuShow(item, type, e) {
this.routeParam = {routeCode: item.routeCode, tripNumber: item.tripNumber, force: false, duration: null};
this.$refs.popMenu.resetShowPosition({x: e.x, y:e.y});
},
cancelTrigger(triggerParam, row) {
commitOperate(menuOperate.CTC.autoTrigger, triggerParam, 3).then(({valid, operate})=>{
if (valid) {
this.$message.success('取消自动触发成功!');
}
}).catch((e) => {
console.error(e);
row.autoTrigger = true;
this.$message.error('取消自动触发失败!');
});
},
artificialTrigger() {
commitOperate(menuOperate.CTC.setRoute, this.routeParam, 3).then(({valid, operate})=>{
if (valid) {
this.$message.success('人工触发成功!');
}
}).catch((e) => {
console.error(e);
this.$message.error('人工触发失败!');
});
}
}
};
</script>
<style scoped>
</style>
<style>
.bottom-table-label-header{
background: #FFF3EE;
}
.bottom-table-route-wait {
background: #ff0 !important;
}
.bottom-table-route-gray{
background: #c0c0c0 !important;
}
.bottom-table-route-green{
background: #0f0 !important;
}
</style>

View File

@ -0,0 +1,210 @@
<template>
<el-dialog
v-dialogDrag
class="chengdou-03__systerm train-set-plan"
:title="title"
:visible.sync="show"
width="360px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row>
<el-col :span="11">车次号</el-col>
<el-col :span="11" :offset="1">上下行</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="addModel.tripNumber" size="mini" @blur="handleTripNumber" />
<div class="tripNumberTips">{{ messageTip1 }}</div>
</el-col>
<el-col :span="11" :offset="1">
<el-select v-model="addModel.right" size="mini" disabled>
<el-option :value="true" :label="rightTrueLabel" />
<el-option :value="false" :label="rightFalseLabel" />
</el-select>
<div class="tripNumberTips">{{ messageTip2 }}</div>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="5">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import {mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus';
export default {
name: 'TrainSetPlan',
components: {
NoticeInfo
},
data() {
return {
trainNoList: [],
selected: null,
messageTip1:'',
messageTip2:'',
addModel: {
tripNumber: '',
right: '',
sectionCode: ''
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'mapConfig'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.editTrainId.menu.domId : '';
},
title() {
return '模拟车次输入';
},
rightTrueLabel() {
return this.mapConfig.upRight ? '上行' : '下行';
},
rightFalseLabel() {
return this.mapConfig.upRight ? '下行' : '上行';
}
},
watch:{},
methods: {
doShow(operate, selected) {
this.$root.$emit('dialogOpen', selected);
this.selected = selected;
//
this.addModel.sectionCode = selected.code;
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.addModel = {
tripNumber: '',
right: '',
sectionCode: ''
};
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
mouseCancelState(this.selected);
},
handleTripNumber() {
const figuresOfServiceMinNumber = 2;
const figuresOfServiceMaxNumber = 6;
// this.$store.state.map.mapConfig.figuresOfServiceNumber;
const tripNumber = this.addModel.tripNumber;
const judge = /^[a-zA-Z0-9]*[\d]$/.test(this.addModel.tripNumber);
if (judge) {
if (tripNumber.toString().length > figuresOfServiceMaxNumber || tripNumber.toString().length < figuresOfServiceMinNumber) {
this.messageTip1 = '车次号长度' + figuresOfServiceMinNumber + '-' + figuresOfServiceMaxNumber + '位';
} else {
this.addModel.tripNumber = tripNumber;
this.messageTip1 = '';
const result = this.addModel.tripNumber.match(/[\d]$(?=[a-zA-Z0-9]*)/);
if (result) {
const is_even = result[0] % 2 == 0;
this.addModel.right = is_even;
}
}
} else {
this.addModel.tripNumber = '';
this.messageTip1 = '请输入车次号(最后一位必须是数字)';
}
},
commit() {
const figuresOfServiceMinNumber = 2;
const figuresOfServiceMaxNumber = 6;
let result = false;
const tripNumber = this.addModel.tripNumber;
if (tripNumber.toString().length > figuresOfServiceMaxNumber || tripNumber.toString().length < figuresOfServiceMinNumber) {
result = false;
} else {
result = true;
}
if (this.addModel.tripNumber && result) {
// if (this.addModel.right === '') {
// this.messageTip2 = '';
// return;
// }
const params = {
tripNumber: this.addModel.tripNumber,
sectionCode: this.addModel.sectionCode,
right: this.addModel.right
};
this.messageTip1 = '';
this.loading = true;
commitOperate(menuOperate.Section.addSpareTrain, params, 2).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow();
});
} else {
if (this.addModel.tripNumber) {
this.messageTip1 = '该车次号长度' + figuresOfServiceMinNumber + '-' + figuresOfServiceMaxNumber + '位';
} else {
this.messageTip1 = '请输入车次号';
}
}
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
/deep/ .el-row {
margin: 10px
}
.ningbo-01__systerm .el-dialog .base-label {
// background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
.tripNumberTips{
margin-top: 7px;
color: #f00;
font-size: 13px;
}
</style>

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