resolve conflict
This commit is contained in:
commit
505c0ae95d
@ -6,7 +6,7 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "vue-cli-service serve --open",
|
"start": "vue-cli-service serve --open",
|
||||||
"dev": "node --max_old_space_size=4096 node_modules/@vue/cli-service/bin/vue-cli-service.js serve",
|
"dev": "node --max_old_space_size=4096 node_modules/@vue/cli-service/bin/vue-cli-service.js serve",
|
||||||
"build": "vue-cli-service build --mode production",
|
"build": "vue-cli-service build --mode production",
|
||||||
"test": "vue-cli-service build --mode staging",
|
"test": "vue-cli-service build --mode staging",
|
||||||
"local": "vue-cli-service build --mode",
|
"local": "vue-cli-service build --mode",
|
||||||
|
BIN
src/assets/ctc_icon/rpadd.png
Normal file
BIN
src/assets/ctc_icon/rpadd.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
@ -13,6 +13,7 @@ import { deepAssign } from '@/utils/index';
|
|||||||
import * as adapter from '@/jmapNew/utils/adapter';
|
import * as adapter from '@/jmapNew/utils/adapter';
|
||||||
import store from '@/store/index';
|
import store from '@/store/index';
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
|
// import {createDevice} from './parser/parser-graph';
|
||||||
|
|
||||||
const renderer = 'canvas';
|
const renderer = 'canvas';
|
||||||
const devicePixelRatio = 1;
|
const devicePixelRatio = 1;
|
||||||
@ -82,7 +83,10 @@ class Jlmap {
|
|||||||
loadStyle(lineCode) {
|
loadStyle(lineCode) {
|
||||||
return selectLineCode(lineCode);
|
return selectLineCode(lineCode);
|
||||||
}
|
}
|
||||||
|
reloadStyle(lineCode) {
|
||||||
|
this.style = selectLineCode(lineCode);
|
||||||
|
this.$zr.dom.style.backgroundColor = this.style.backgroundColor || '#000';
|
||||||
|
}
|
||||||
loadDefaultState() { // 加载默认状态
|
loadDefaultState() { // 加载默认状态
|
||||||
const defaultStateDict = {};
|
const defaultStateDict = {};
|
||||||
|
|
||||||
@ -95,7 +99,12 @@ class Jlmap {
|
|||||||
|
|
||||||
return defaultStateDict;
|
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) {
|
setMap(map, mapDevice, logicData) {
|
||||||
// 保存皮肤类型
|
// 保存皮肤类型
|
||||||
if (map.skinVO) {
|
if (map.skinVO) {
|
||||||
@ -408,28 +417,69 @@ class Jlmap {
|
|||||||
}
|
}
|
||||||
updatePicture(list = []) {
|
updatePicture(list = []) {
|
||||||
list.forEach(item => {
|
list.forEach(item => {
|
||||||
const device = this.mapDevice[item.code];
|
const device = this.mapDevice[item];
|
||||||
const type = device._type;
|
if (device && device._type !== deviceType.Switch && device._type !== deviceType.Train) {
|
||||||
const pointsDevice = ['LINE', 'POWER', 'SECTION'];
|
const pictureDevice = store.getters['map/getPictureDeviceByCode'](item);
|
||||||
const pointDevice = ['OVERAP', 'TRAINWINDOW'];
|
device._dispose = pictureDevice ? pictureDevice.pictureHide : false;
|
||||||
device._dispose = item.pictureHide;
|
this.$painter.updatePicture(device);
|
||||||
if (pointsDevice.includes(type.toUpperCase())) {
|
try {
|
||||||
const offsetX = item.position.x - device.points[0].x;
|
if (device._type === deviceType.Section && device.type === '03') {
|
||||||
const offsetY = item.position.y - device.points[0].y;
|
this.mapDevice[device.switch.code]._dispose = pictureDevice ? pictureDevice.pictureHide : false;
|
||||||
device.points.forEach(point => {
|
this.computedSwitch(device.switch);
|
||||||
point.x = point.x + offsetX;
|
this.$painter.updatePicture(this.mapDevice[device.switch.code]);
|
||||||
point.y = point.y + offsetY;
|
}
|
||||||
});
|
} catch (e) { console.error(e); }
|
||||||
} else if (pointDevice.includes(type.toUpperCase())) {
|
|
||||||
device.point.x = item.position.x;
|
|
||||||
device.point.y = item.position.y;
|
|
||||||
} else if (type !== 'Switch') {
|
|
||||||
device.position.x = item.position.x;
|
|
||||||
device.position.y = item.position.y;
|
|
||||||
}
|
}
|
||||||
this.$painter.updatePicture(device);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
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) {
|
update(list = [], fetch = true) {
|
||||||
this.setUpdateMapDevice(list, fetch); // 增加一个 前数据 处理 为了在区段中 获取全部的 道岔信息
|
this.setUpdateMapDevice(list, fetch); // 增加一个 前数据 处理 为了在区段中 获取全部的 道岔信息
|
||||||
|
|
||||||
|
@ -250,11 +250,12 @@ class MouseController extends Eventful {
|
|||||||
if (item.instance && item.instance._type == deviceType.Section) {
|
if (item.instance && item.instance._type == deviceType.Section) {
|
||||||
let deviceBoundingRect = {};
|
let deviceBoundingRect = {};
|
||||||
if (item.type == '04') {
|
if (item.type == '04') {
|
||||||
|
const rect = item.instance.getNameBoundingRect();
|
||||||
deviceBoundingRect = {
|
deviceBoundingRect = {
|
||||||
x1: item.namePosition.x,
|
x1: rect.x,
|
||||||
y1: item.namePosition.y,
|
y1: rect.y,
|
||||||
x2: item.namePosition.x,
|
x2: rect.x + rect.width,
|
||||||
y2: item.namePosition.y
|
y2:rect.y + rect.height
|
||||||
};
|
};
|
||||||
} else if (item.type == '05') {
|
} else if (item.type == '05') {
|
||||||
const rect = item.instance.getBoundingRect();
|
const rect = item.instance.getBoundingRect();
|
||||||
@ -266,10 +267,10 @@ class MouseController extends Eventful {
|
|||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
deviceBoundingRect = {
|
deviceBoundingRect = {
|
||||||
x1: item.points[0].x,
|
x1: item.instance.computedPoints[0].x,
|
||||||
y1: item.points[0].y,
|
y1: item.instance.computedPoints[0].y,
|
||||||
x2: item.points[item.points.length - 1].x,
|
x2: item.instance.computedPoints[item.points.length - 1].x,
|
||||||
y2: item.points[item.points.length - 1].y
|
y2: item.instance.computedPoints[item.points.length - 1].y
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (this.whetherInclude(boundingRect, deviceBoundingRect )) {
|
if (this.whetherInclude(boundingRect, deviceBoundingRect )) {
|
||||||
@ -287,25 +288,25 @@ class MouseController extends Eventful {
|
|||||||
}
|
}
|
||||||
} else if (item.instance && item.instance._type == deviceType.Signal) {
|
} else if (item.instance && item.instance._type == deviceType.Signal) {
|
||||||
const deviceBoundingRect = {
|
const deviceBoundingRect = {
|
||||||
x1: item.position.x,
|
x1: item.instance.computedPosition.x,
|
||||||
y1: item.position.y,
|
y1: item.instance.computedPosition.y,
|
||||||
x2: item.position.x,
|
x2: item.instance.computedPosition.x,
|
||||||
y2: item.position.y
|
y2: item.instance.computedPosition.y
|
||||||
};
|
};
|
||||||
if (this.whetherInclude(boundingRect, deviceBoundingRect )) {
|
if (this.whetherInclude(boundingRect, deviceBoundingRect )) {
|
||||||
includeDeviceList.push(item);
|
includeDeviceList.push(item);
|
||||||
}
|
}
|
||||||
} else if (item.instance && item.instance._type == deviceType.Psd) {
|
} else if (item.instance && item.instance._type == deviceType.Psd) {
|
||||||
const deviceBoundingRect = {
|
const deviceBoundingRect = {
|
||||||
x1: item.position.x,
|
x1: item.instance.computedPosition.x,
|
||||||
y1: item.position.y,
|
y1: item.instance.computedPosition.y,
|
||||||
x2: item.position.x,
|
x2: item.instance.computedPosition.x,
|
||||||
y2: item.position.y
|
y2: item.instance.computedPosition.y
|
||||||
};
|
};
|
||||||
if (this.whetherInclude(boundingRect, deviceBoundingRect )) {
|
if (this.whetherInclude(boundingRect, deviceBoundingRect )) {
|
||||||
includeDeviceList.push(item);
|
includeDeviceList.push(item);
|
||||||
}
|
} // item.instance._type !== deviceType.TrainWindow &&
|
||||||
} else if (item.instance && item.instance._type !== deviceType.TrainWindow && item.instance._type !== deviceType.CheckBox && item.instance._type !== deviceType.Train) {
|
} else if (item.instance && item.instance._type !== deviceType.CheckBox && item.instance._type !== deviceType.Train) {
|
||||||
const rect = item.instance.getBoundingRect();
|
const rect = item.instance.getBoundingRect();
|
||||||
const deviceBoundingRect = {
|
const deviceBoundingRect = {
|
||||||
x1: rect.x,
|
x1: rect.x,
|
||||||
|
@ -2,7 +2,7 @@ class Options {
|
|||||||
constructor(opts, trigger) {
|
constructor(opts, trigger) {
|
||||||
this.scaleIndex = 0;
|
this.scaleIndex = 0;
|
||||||
this.scaleList = [
|
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,
|
1, 1.2, 1.4, 1.6, 1.8,
|
||||||
2, 2.2, 2.4, 2.6, 2.8,
|
2, 2.2, 2.4, 2.6, 2.8,
|
||||||
3, 3.2, 3.4, 3.6, 3.8,
|
3, 3.2, 3.4, 3.6, 3.8,
|
||||||
|
@ -164,7 +164,6 @@ class Painter {
|
|||||||
}
|
}
|
||||||
/** 画面更新 */
|
/** 画面更新 */
|
||||||
updatePicture(device) {
|
updatePicture(device) {
|
||||||
console.log(device, 'device');
|
|
||||||
if (device) {
|
if (device) {
|
||||||
try {
|
try {
|
||||||
if (device._dispose) {
|
if (device._dispose) {
|
||||||
@ -198,6 +197,7 @@ class Painter {
|
|||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
console.log(device, 'device');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -194,7 +194,6 @@ export function parser(data, skinCode, showConfig) {
|
|||||||
// y: rnodeSection.points[1].y
|
// y: rnodeSection.points[1].y
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const section = mapDevice[cnodeSection.parentCode];
|
const section = mapDevice[cnodeSection.parentCode];
|
||||||
if (section) {
|
if (section) {
|
||||||
mapDevice[elem.code].sectionName = section.name;
|
mapDevice[elem.code].sectionName = section.name;
|
||||||
|
@ -8,6 +8,12 @@ export default class Arrow extends Group {
|
|||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
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.z = 0;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
// this.style = style;
|
// this.style = style;
|
||||||
@ -22,13 +28,13 @@ export default class Arrow extends Group {
|
|||||||
z: this.z,
|
z: this.z,
|
||||||
shape: {
|
shape: {
|
||||||
points: [
|
points: [
|
||||||
[model.position.x, model.position.y],
|
[this.computedPosition.x, this.computedPosition.y],
|
||||||
[model.position.x + model.triangleLength, model.position.y - model.triangleHeight / 2],
|
[this.computedPosition.x + model.triangleLength, this.computedPosition.y - model.triangleHeight / 2],
|
||||||
[model.position.x + model.triangleLength, model.position.y - model.lineWidth / 2],
|
[this.computedPosition.x + model.triangleLength, this.computedPosition.y - model.lineWidth / 2],
|
||||||
[model.position.x + model.length, model.position.y - model.lineWidth / 2],
|
[this.computedPosition.x + model.length, this.computedPosition.y - model.lineWidth / 2],
|
||||||
[model.position.x + model.length, model.position.y + model.lineWidth / 2],
|
[this.computedPosition.x + model.length, this.computedPosition.y + model.lineWidth / 2],
|
||||||
[model.position.x + model.triangleLength, model.position.y + model.lineWidth / 2],
|
[this.computedPosition.x + model.triangleLength, this.computedPosition.y + model.lineWidth / 2],
|
||||||
[model.position.x + model.triangleLength, model.position.y + model.triangleHeight / 2]
|
[this.computedPosition.x + model.triangleLength, this.computedPosition.y + model.triangleHeight / 2]
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
|
@ -13,8 +13,8 @@ export default class EMouse extends Group {
|
|||||||
z: this.device.z + 1,
|
z: this.device.z + 1,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: this.device.model.position.x,
|
x: this.device.computedPosition.x,
|
||||||
y: this.device.model.position.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30,
|
y: this.device.computedPosition.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30,
|
||||||
fontWeight: 'normal',
|
fontWeight: 'normal',
|
||||||
fontSize: this.device.style.LcControl.mouseOverStyle.fontSize,
|
fontSize: this.device.style.LcControl.mouseOverStyle.fontSize,
|
||||||
fontFamily: this.device.style.fontFamily,
|
fontFamily: this.device.style.fontFamily,
|
||||||
|
@ -16,6 +16,12 @@ export default class AutoTurnBack extends Group {
|
|||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
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.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.isBigScreen = false;
|
this.isBigScreen = false;
|
||||||
@ -31,8 +37,8 @@ export default class AutoTurnBack extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z + 1,
|
z: this.z + 1,
|
||||||
shape: {
|
shape: {
|
||||||
cx: model.position.x,
|
cx: this.computedPosition.x,
|
||||||
cy: model.position.y,
|
cy: this.computedPosition.y,
|
||||||
r: this.style.AutoTurnBack.lamp.radiusR
|
r: this.style.AutoTurnBack.lamp.radiusR
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
@ -47,8 +53,8 @@ export default class AutoTurnBack extends Group {
|
|||||||
z: this.z + 1,
|
z: this.z + 1,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: model.position.y + this.style.AutoTurnBack.lamp.radiusR + this.style.AutoTurnBack.text.distance,
|
y: this.computedPosition.y + this.style.AutoTurnBack.lamp.radiusR + this.style.AutoTurnBack.text.distance,
|
||||||
fontWeight: this.style.AutoTurnBack.text.fontWeight,
|
fontWeight: this.style.AutoTurnBack.text.fontWeight,
|
||||||
fontSize: this.style.AutoTurnBack.text.fontSize,
|
fontSize: this.style.AutoTurnBack.text.fontSize,
|
||||||
fontFamily: this.style.fontFamily,
|
fontFamily: this.style.fontFamily,
|
||||||
@ -66,8 +72,8 @@ export default class AutoTurnBack extends Group {
|
|||||||
z: this.z,
|
z: this.z,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: model.position.y + this.style.AutoTurnBack.lamp.radiusR + this.style.AutoTurnBack.subtitleText.distance,
|
y: this.computedPosition.y + this.style.AutoTurnBack.lamp.radiusR + this.style.AutoTurnBack.subtitleText.distance,
|
||||||
fontWeight: this.style.AutoTurnBack.subtitleText.fontWeight,
|
fontWeight: this.style.AutoTurnBack.subtitleText.fontWeight,
|
||||||
fontSize: this.style.AutoTurnBack.subtitleText.fontSize,
|
fontSize: this.style.AutoTurnBack.subtitleText.fontSize,
|
||||||
fontFamily: this.style.fontFamily,
|
fontFamily: this.style.fontFamily,
|
||||||
@ -185,6 +191,6 @@ export default class AutoTurnBack extends Group {
|
|||||||
this.hideMode();
|
this.hideMode();
|
||||||
}
|
}
|
||||||
getAnchorPoint() {
|
getAnchorPoint() {
|
||||||
return this.model.position;
|
return this.computedPosition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,8 @@ export default class EMouse extends Group {
|
|||||||
z: this.device.z + 1,
|
z: this.device.z + 1,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: this.device.model.position.x,
|
x: this.device.computedPosition.x,
|
||||||
y: this.device.model.position.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30,
|
y: this.device.computedPosition.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30,
|
||||||
fontWeight: 'normal',
|
fontWeight: 'normal',
|
||||||
fontSize: this.device.style.LcControl.mouseOverStyle.fontSize,
|
fontSize: this.device.style.LcControl.mouseOverStyle.fontSize,
|
||||||
fontFamily: this.device.style.fontFamily,
|
fontFamily: this.device.style.fontFamily,
|
||||||
|
@ -15,6 +15,12 @@ export default class AutomacticRoute extends Group {
|
|||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
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.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.isShowShape = true;
|
this.isShowShape = true;
|
||||||
@ -30,8 +36,8 @@ export default class AutomacticRoute extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
shape: {
|
shape: {
|
||||||
cx: model.position.x,
|
cx: this.computedPosition.x,
|
||||||
cy: model.position.y,
|
cy: this.computedPosition.y,
|
||||||
r: this.style.AutomaticRoute.lamp.radiusR
|
r: this.style.AutomaticRoute.lamp.radiusR
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
@ -46,8 +52,8 @@ export default class AutomacticRoute extends Group {
|
|||||||
z: this.z,
|
z: this.z,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: model.position.y + this.style.AutomaticRoute.lamp.radiusR + this.style.AutomaticRoute.text.distance,
|
y: this.computedPosition.y + this.style.AutomaticRoute.lamp.radiusR + this.style.AutomaticRoute.text.distance,
|
||||||
fontWeight: this.style.AutomaticRoute.text.fontWeight,
|
fontWeight: this.style.AutomaticRoute.text.fontWeight,
|
||||||
fontSize: this.style.AutomaticRoute.text.fontSize,
|
fontSize: this.style.AutomaticRoute.text.fontSize,
|
||||||
fontFamily: this.style.fontFamily,
|
fontFamily: this.style.fontFamily,
|
||||||
@ -65,8 +71,8 @@ export default class AutomacticRoute extends Group {
|
|||||||
z: this.z,
|
z: this.z,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: model.position.y + this.style.AutomaticRoute.lamp.radiusR + this.style.AutomaticRoute.subtitleText.distance,
|
y: this.computedPosition.y + this.style.AutomaticRoute.lamp.radiusR + this.style.AutomaticRoute.subtitleText.distance,
|
||||||
fontWeight: this.style.AutomaticRoute.subtitleText.fontWeight,
|
fontWeight: this.style.AutomaticRoute.subtitleText.fontWeight,
|
||||||
fontSize: this.style.AutomaticRoute.subtitleText.fontSize,
|
fontSize: this.style.AutomaticRoute.subtitleText.fontSize,
|
||||||
fontFamily: this.style.fontFamily,
|
fontFamily: this.style.fontFamily,
|
||||||
@ -140,6 +146,6 @@ export default class AutomacticRoute extends Group {
|
|||||||
this.subtitleText && this.subtitleText.show();
|
this.subtitleText && this.subtitleText.show();
|
||||||
}
|
}
|
||||||
getAnchorPoint() {
|
getAnchorPoint() {
|
||||||
return this.model.position;
|
return this.computedPosition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,8 @@ export default class EMouse extends Group {
|
|||||||
z: this.device.z + 1,
|
z: this.device.z + 1,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: this.device.model.position.x,
|
x: this.device.computedPosition.x,
|
||||||
y: this.device.model.position.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30,
|
y: this.device.computedPosition.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30,
|
||||||
fontWeight: 'normal',
|
fontWeight: 'normal',
|
||||||
fontSize: this.device.style.LcControl.mouseOverStyle.fontSize,
|
fontSize: this.device.style.LcControl.mouseOverStyle.fontSize,
|
||||||
fontFamily: this.device.style.fontFamily,
|
fontFamily: this.device.style.fontFamily,
|
||||||
|
@ -15,6 +15,12 @@ export default class AxleReset extends Group {
|
|||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
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.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.isShowShape = true;
|
this.isShowShape = true;
|
||||||
@ -30,8 +36,8 @@ export default class AxleReset extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
shape: {
|
shape: {
|
||||||
cx: model.position.x,
|
cx: this.computedPosition.x,
|
||||||
cy: model.position.y,
|
cy: this.computedPosition.y,
|
||||||
r: this.style.AxleReset.lamp.radiusR
|
r: this.style.AxleReset.lamp.radiusR
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
@ -47,8 +53,8 @@ export default class AxleReset extends Group {
|
|||||||
z: this.z,
|
z: this.z,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: model.position.y + this.style.AxleReset.lamp.radiusR + this.style.AxleReset.text.distance,
|
y: this.computedPosition.y + this.style.AxleReset.lamp.radiusR + this.style.AxleReset.text.distance,
|
||||||
fontWeight: this.style.AxleReset.text.fontWeight,
|
fontWeight: this.style.AxleReset.text.fontWeight,
|
||||||
fontSize: this.style.AxleReset.text.fontSize,
|
fontSize: this.style.AxleReset.text.fontSize,
|
||||||
fontFamily: this.style.fontFamily,
|
fontFamily: this.style.fontFamily,
|
||||||
@ -66,8 +72,8 @@ export default class AxleReset extends Group {
|
|||||||
z: this.z,
|
z: this.z,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: model.position.y + this.style.AxleReset.lamp.radiusR + this.style.AxleReset.subtitleText.distance,
|
y: this.computedPosition.y + this.style.AxleReset.lamp.radiusR + this.style.AxleReset.subtitleText.distance,
|
||||||
fontWeight: this.style.AxleReset.subtitleText.fontWeight,
|
fontWeight: this.style.AxleReset.subtitleText.fontWeight,
|
||||||
fontSize: this.style.AxleReset.subtitleText.fontSize,
|
fontSize: this.style.AxleReset.subtitleText.fontSize,
|
||||||
fontFamily: this.style.fontFamily,
|
fontFamily: this.style.fontFamily,
|
||||||
@ -141,6 +147,6 @@ export default class AxleReset extends Group {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
getAnchorPoint() {
|
getAnchorPoint() {
|
||||||
return this.model.position;
|
return this.computedPosition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,12 @@ export default class DirectionRod extends Group {
|
|||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
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.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
// this.isShowShape = true;
|
// this.isShowShape = true;
|
||||||
@ -23,17 +29,17 @@ export default class DirectionRod extends Group {
|
|||||||
this.rod = new Polygon({
|
this.rod = new Polygon({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
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,
|
rotation: model.right ? Math.PI : 0,
|
||||||
shape: {
|
shape: {
|
||||||
points: [
|
points: [
|
||||||
[model.position.x, model.position.y],
|
[this.computedPosition.x, this.computedPosition.y],
|
||||||
[model.position.x + style.DirectionRod.triangleLength, model.position.y + (style.DirectionRod.triangleHeight / 2)],
|
[this.computedPosition.x + style.DirectionRod.triangleLength, this.computedPosition.y + (style.DirectionRod.triangleHeight / 2)],
|
||||||
[model.position.x + style.DirectionRod.triangleLength, model.position.y + (style.DirectionRod.rodHeight / 2)],
|
[this.computedPosition.x + style.DirectionRod.triangleLength, this.computedPosition.y + (style.DirectionRod.rodHeight / 2)],
|
||||||
[model.position.x + style.DirectionRod.rodLength, model.position.y + (style.DirectionRod.rodHeight / 2)],
|
[this.computedPosition.x + style.DirectionRod.rodLength, this.computedPosition.y + (style.DirectionRod.rodHeight / 2)],
|
||||||
[model.position.x + style.DirectionRod.rodLength, model.position.y - (style.DirectionRod.rodHeight / 2)],
|
[this.computedPosition.x + style.DirectionRod.rodLength, this.computedPosition.y - (style.DirectionRod.rodHeight / 2)],
|
||||||
[model.position.x + style.DirectionRod.triangleLength, model.position.y - (style.DirectionRod.rodHeight / 2)],
|
[this.computedPosition.x + style.DirectionRod.triangleLength, this.computedPosition.y - (style.DirectionRod.rodHeight / 2)],
|
||||||
[model.position.x + style.DirectionRod.triangleLength, model.position.y - (style.DirectionRod.triangleHeight / 2)]
|
[this.computedPosition.x + style.DirectionRod.triangleLength, this.computedPosition.y - (style.DirectionRod.triangleHeight / 2)]
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
@ -44,8 +50,8 @@ export default class DirectionRod extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
style: {
|
style: {
|
||||||
x: model.position.x + style.DirectionRod.fontOffsetX,
|
x: this.computedPosition.x + style.DirectionRod.fontOffsetX,
|
||||||
y: model.position.y + style.DirectionRod.fontOffsetY,
|
y: this.computedPosition.y + style.DirectionRod.fontOffsetY,
|
||||||
fontWeight: 'normal',
|
fontWeight: 'normal',
|
||||||
fontSize: style.DirectionRod.fontSize,
|
fontSize: style.DirectionRod.fontSize,
|
||||||
fontFamily: this.style.fontFamily,
|
fontFamily: this.style.fontFamily,
|
||||||
|
@ -12,6 +12,12 @@ export default class FloodGate extends Group {
|
|||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
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.z = model.z;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
@ -26,8 +32,8 @@ export default class FloodGate extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
shape: {
|
shape: {
|
||||||
x: this.model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: this.model.position.y,
|
y: this.computedPosition.y,
|
||||||
width: this.model.width,
|
width: this.model.width,
|
||||||
height: this.model.height
|
height: this.model.height
|
||||||
},
|
},
|
||||||
@ -55,6 +61,6 @@ export default class FloodGate extends Group {
|
|||||||
createMouseEvent() {
|
createMouseEvent() {
|
||||||
}
|
}
|
||||||
getAnchorPoint() {
|
getAnchorPoint() {
|
||||||
return this.model.position;
|
return this.computedPosition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,8 @@ export default class EMouse extends Group {
|
|||||||
z: this.device.z + 1,
|
z: this.device.z + 1,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: this.device.model.position.x,
|
x: this.device.computedPosition.x,
|
||||||
y: this.device.model.position.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30,
|
y: this.device.computedPosition.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30,
|
||||||
fontWeight: 'normal',
|
fontWeight: 'normal',
|
||||||
fontSize: this.device.style.LcControl.mouseOverStyle.fontSize,
|
fontSize: this.device.style.LcControl.mouseOverStyle.fontSize,
|
||||||
fontFamily: this.device.style.fontFamily,
|
fontFamily: this.device.style.fontFamily,
|
||||||
|
@ -15,6 +15,12 @@ export default class GuideLock extends Group {
|
|||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
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.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.create();
|
this.create();
|
||||||
@ -29,8 +35,8 @@ export default class GuideLock extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
shape: {
|
shape: {
|
||||||
cx: model.position.x,
|
cx: this.computedPosition.x,
|
||||||
cy: model.position.y,
|
cy: this.computedPosition.y,
|
||||||
r: this.style.GuideLock.lamp.radiusR
|
r: this.style.GuideLock.lamp.radiusR
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
@ -45,8 +51,8 @@ export default class GuideLock extends Group {
|
|||||||
z: this.z,
|
z: this.z,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: model.position.y + this.style.GuideLock.lamp.radiusR + this.style.GuideLock.text.distance,
|
y: this.computedPosition.y + this.style.GuideLock.lamp.radiusR + this.style.GuideLock.text.distance,
|
||||||
fontWeight: this.style.GuideLock.text.fontWeight,
|
fontWeight: this.style.GuideLock.text.fontWeight,
|
||||||
fontSize: this.style.GuideLock.text.fontSize,
|
fontSize: this.style.GuideLock.text.fontSize,
|
||||||
fontFamily: this.style.fontFamily,
|
fontFamily: this.style.fontFamily,
|
||||||
@ -64,8 +70,8 @@ export default class GuideLock extends Group {
|
|||||||
z: this.z,
|
z: this.z,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: model.position.y + this.style.GuideLock.lamp.radiusR + this.style.GuideLock.subtitleText.distance,
|
y: this.computedPosition.y + this.style.GuideLock.lamp.radiusR + this.style.GuideLock.subtitleText.distance,
|
||||||
fontWeight: this.style.GuideLock.subtitleText.fontWeight,
|
fontWeight: this.style.GuideLock.subtitleText.fontWeight,
|
||||||
fontSize: this.style.GuideLock.subtitleText.fontSize,
|
fontSize: this.style.GuideLock.subtitleText.fontSize,
|
||||||
fontFamily: this.style.fontFamily,
|
fontFamily: this.style.fontFamily,
|
||||||
@ -146,6 +152,6 @@ export default class GuideLock extends Group {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
getAnchorPoint() {
|
getAnchorPoint() {
|
||||||
return this.model.position;
|
return this.computedPosition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,8 @@ export default class EMouse extends Group {
|
|||||||
z: this.device.z + 1,
|
z: this.device.z + 1,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: this.device.model.position.x,
|
x: this.device.computedPosition.x,
|
||||||
y: this.device.model.position.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30,
|
y: this.device.computedPosition.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30,
|
||||||
fontWeight: 'normal',
|
fontWeight: 'normal',
|
||||||
fontSize: this.device.style.LcControl.mouseOverStyle.fontSize,
|
fontSize: this.device.style.LcControl.mouseOverStyle.fontSize,
|
||||||
fontFamily: this.device.style.fontFamily,
|
fontFamily: this.device.style.fontFamily,
|
||||||
|
@ -13,6 +13,12 @@ export default class LcControl extends Group {
|
|||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
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.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.create();
|
this.create();
|
||||||
@ -27,8 +33,8 @@ export default class LcControl extends Group {
|
|||||||
z: this.z,
|
z: this.z,
|
||||||
arc: {
|
arc: {
|
||||||
shape: {
|
shape: {
|
||||||
cx: model.position.x,
|
cx: this.computedPosition.x,
|
||||||
cy: model.position.y,
|
cy: this.computedPosition.y,
|
||||||
r: this.style.LcControl.lamp.radiusR
|
r: this.style.LcControl.lamp.radiusR
|
||||||
},
|
},
|
||||||
subType: 'Control',
|
subType: 'Control',
|
||||||
@ -37,8 +43,8 @@ export default class LcControl extends Group {
|
|||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
x: model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: model.position.y + this.style.LcControl.lamp.radiusR + this.style.LcControl.text.distance,
|
y: this.computedPosition.y + this.style.LcControl.lamp.radiusR + this.style.LcControl.text.distance,
|
||||||
fontWeight: this.style.LcControl.text.fontWeight,
|
fontWeight: this.style.LcControl.text.fontWeight,
|
||||||
fontSize: this.style.LcControl.text.fontSize,
|
fontSize: this.style.LcControl.text.fontSize,
|
||||||
fontFamily: this.style.fontFamily,
|
fontFamily: this.style.fontFamily,
|
||||||
@ -91,6 +97,6 @@ export default class LcControl extends Group {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
getAnchorPoint() {
|
getAnchorPoint() {
|
||||||
return this.model.position;
|
return this.computedPosition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,8 +14,8 @@ export default class EMouse extends Group {
|
|||||||
z: this.device.z + 1,
|
z: this.device.z + 1,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: this.device.model.position.x,
|
x: this.device.computedPosition.x,
|
||||||
y: this.device.model.position.y + this.device.style.LimitControl.lamp.radiusR + this.device.style.LimitControl.text.distance - 30,
|
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,
|
fontWeight: this.device.style.LimitControl.mouseOverStyle.fontWeight,
|
||||||
fontSize: this.device.style.LimitControl.mouseOverStyle.fontSize,
|
fontSize: this.device.style.LimitControl.mouseOverStyle.fontSize,
|
||||||
fontFamily: this.device.style.fontFormat,
|
fontFamily: this.device.style.fontFormat,
|
||||||
|
@ -13,6 +13,12 @@ export default class LimitControl extends Group {
|
|||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
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.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.z = 20;
|
this.z = 20;
|
||||||
@ -27,8 +33,8 @@ export default class LimitControl extends Group {
|
|||||||
z: this.z,
|
z: this.z,
|
||||||
arc: {
|
arc: {
|
||||||
shape: {
|
shape: {
|
||||||
cx: model.position.x,
|
cx: this.computedPosition.x,
|
||||||
cy: model.position.y,
|
cy: this.computedPosition.y,
|
||||||
r: this.style.LimitControl.lamp.radiusR
|
r: this.style.LimitControl.lamp.radiusR
|
||||||
},
|
},
|
||||||
subType: 'Control',
|
subType: 'Control',
|
||||||
@ -39,8 +45,8 @@ export default class LimitControl extends Group {
|
|||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
x: model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: model.position.y + this.style.LimitControl.lamp.radiusR + this.style.LimitControl.text.distance,
|
y: this.computedPosition.y + this.style.LimitControl.lamp.radiusR + this.style.LimitControl.text.distance,
|
||||||
fontWeight: this.style.LimitControl.text.fontWeight,
|
fontWeight: this.style.LimitControl.text.fontWeight,
|
||||||
fontSize: this.style.LimitControl.text.fontSize,
|
fontSize: this.style.LimitControl.text.fontSize,
|
||||||
fontFamily: this.style.fontFamily,
|
fontFamily: this.style.fontFamily,
|
||||||
@ -95,6 +101,6 @@ export default class LimitControl extends Group {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
getAnchorPoint() {
|
getAnchorPoint() {
|
||||||
return this.model.position;
|
return this.computedPosition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,18 @@ export default class Line2 extends Group {
|
|||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
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.z = 0;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style.Line;
|
this.style = style.Line;
|
||||||
@ -17,10 +29,10 @@ export default class Line2 extends Group {
|
|||||||
|
|
||||||
create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
if (model && model.points.length > 1) {
|
if (this.computePoints.length > 1) {
|
||||||
const points = [];
|
const points = [];
|
||||||
const vicePoints = [];
|
const vicePoints = [];
|
||||||
const modelPoints = model.points;
|
const modelPoints = this.computePoints;
|
||||||
const length = modelPoints.length;
|
const length = modelPoints.length;
|
||||||
const path = window.location.href;
|
const path = window.location.href;
|
||||||
if (model.type === '03' && !path.includes('/map/draw')) {
|
if (model.type === '03' && !path.includes('/map/draw')) {
|
||||||
|
@ -9,6 +9,12 @@ export default class OutFrame extends Group {
|
|||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this.style = style;
|
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.zlevel = model.zlevel;
|
||||||
this.isBigScreen = false;
|
this.isBigScreen = false;
|
||||||
this.z = 0;
|
this.z = 0;
|
||||||
@ -22,8 +28,8 @@ export default class OutFrame extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
shape: {
|
shape: {
|
||||||
x: model.position.x - model.width / 2,
|
x: this.computedPosition.x - model.width / 2,
|
||||||
y: model.position.y - model.height / 2,
|
y: this.computedPosition.y - model.height / 2,
|
||||||
width: model.width,
|
width: model.width,
|
||||||
height: model.height
|
height: model.height
|
||||||
},
|
},
|
||||||
@ -55,8 +61,8 @@ export default class OutFrame extends Group {
|
|||||||
}
|
}
|
||||||
getAnchorPoint() {
|
getAnchorPoint() {
|
||||||
return {
|
return {
|
||||||
x: this.model.position.x - this.model.width / 2,
|
x: this.computedPosition.x - this.model.width / 2,
|
||||||
y: this.model.position.y - this.model.height / 2
|
y: this.computedPosition.y - this.model.height / 2
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,12 @@ export default class OverAp extends Group {
|
|||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
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.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.z = 6;
|
this.z = 6;
|
||||||
@ -19,14 +25,14 @@ export default class OverAp extends Group {
|
|||||||
create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.style;
|
const style = this.style;
|
||||||
if (model.points && style && style.Section) {
|
if (this.computedPoints && style && style.Section) {
|
||||||
this.text = new ETextName({
|
this.text = new ETextName({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z + 2,
|
z: this.z + 2,
|
||||||
style: this.style,
|
style: this.style,
|
||||||
silent: false,
|
silent: false,
|
||||||
x: model.points.x + 30,
|
x: this.computedPoints.x + 30,
|
||||||
y: model.points.y - style.Section.line.width * 2,
|
y: this.computedPoints.y - style.Section.line.width * 2,
|
||||||
fontWeight: style.Section.name.fontWeight,
|
fontWeight: style.Section.name.fontWeight,
|
||||||
text: model.remainTime || 30,
|
text: model.remainTime || 30,
|
||||||
textPosition: style.Section.name.textPosition,
|
textPosition: style.Section.name.textPosition,
|
||||||
@ -59,8 +65,8 @@ export default class OverAp extends Group {
|
|||||||
this.text && this.text.attr({
|
this.text && this.text.attr({
|
||||||
style: {
|
style: {
|
||||||
text: model.remainTime,
|
text: model.remainTime,
|
||||||
x: model.points.x + offset,
|
x: this.computedPoints.x + offset,
|
||||||
y: model.points.y - this.style.Section.line.width * 2
|
y: this.computedPoints.y - this.style.Section.line.width * 2
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,18 @@ export default class Line2 extends Group {
|
|||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
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.z = 0;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
@ -22,10 +34,10 @@ export default class Line2 extends Group {
|
|||||||
create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.style;
|
const style = this.style;
|
||||||
if (model && model.points.length > 1) {
|
if (this.computPoints.length > 1) {
|
||||||
const points = [];
|
const points = [];
|
||||||
for (let i = 0; i < model.points.length; i++) {
|
for (let i = 0; i < this.computPoints.length; i++) {
|
||||||
points.push([model.points[i].x, model.points[i].y]);
|
points.push([this.computPoints[i].x, this.computPoints[i].y]);
|
||||||
}
|
}
|
||||||
this.line = new Polyline({
|
this.line = new Polyline({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
@ -47,7 +59,7 @@ export default class Line2 extends Group {
|
|||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.style;
|
const style = this.style;
|
||||||
if (model && model.leftTerminal) { // 左端点
|
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({
|
this.leftTerminal = new ESeparator({
|
||||||
style: style,
|
style: style,
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
@ -56,14 +68,14 @@ export default class Line2 extends Group {
|
|||||||
width: model.width,
|
width: model.width,
|
||||||
stroke: style.Power.noElectricStrokeColor,
|
stroke: style.Power.noElectricStrokeColor,
|
||||||
point: {
|
point: {
|
||||||
x: model.points[0].x,
|
x: this.computPoints[0].x,
|
||||||
y: model.points[0].y
|
y: this.computPoints[0].y
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.add(this.leftTerminal);
|
this.add(this.leftTerminal);
|
||||||
}
|
}
|
||||||
if (model && model.rightTerminal) { // 右端点
|
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({
|
this.rightTerminal = new ESeparator({
|
||||||
style: style,
|
style: style,
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
@ -72,8 +84,8 @@ export default class Line2 extends Group {
|
|||||||
width: model.width,
|
width: model.width,
|
||||||
stroke: style.Power.noElectricStrokeColor,
|
stroke: style.Power.noElectricStrokeColor,
|
||||||
point: {
|
point: {
|
||||||
x: model.points[model.points.length - 1].x,
|
x: this.computPoints[this.computPoints.length - 1].x,
|
||||||
y: model.points[model.points.length - 1].y
|
y: this.computPoints[this.computPoints.length - 1].y
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.add(this.rightTerminal);
|
this.add(this.rightTerminal);
|
||||||
|
@ -20,8 +20,8 @@ class EHorizontal2Door extends Group {
|
|||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
z: this.model.z,
|
z: this.model.z,
|
||||||
shape: {
|
shape: {
|
||||||
x: model.position.x - model.width / 4,
|
x: model.computedPosition.x - model.width / 4,
|
||||||
y: model.position.y - (model.height / 2),
|
y: model.computedPosition.y - (model.height / 2),
|
||||||
width: model.width / 4 - 2,
|
width: model.width / 4 - 2,
|
||||||
height: model.height
|
height: model.height
|
||||||
},
|
},
|
||||||
@ -35,8 +35,8 @@ class EHorizontal2Door extends Group {
|
|||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
z: this.model.z,
|
z: this.model.z,
|
||||||
shape: {
|
shape: {
|
||||||
x: model.position.x,
|
x: model.computedPosition.x,
|
||||||
y: model.position.y - (model.height / 2),
|
y: model.computedPosition.y - (model.height / 2),
|
||||||
width: model.width / 4 - 2,
|
width: model.width / 4 - 2,
|
||||||
height: model.height
|
height: model.height
|
||||||
},
|
},
|
||||||
|
@ -17,8 +17,8 @@ class ERect2Door extends Group {
|
|||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
z: this.model.z,
|
z: this.model.z,
|
||||||
shape: {
|
shape: {
|
||||||
x: stand.position.x - (stand.width / 2) - 5,
|
x: stand.computedPosition.x - (stand.width / 2) - 5,
|
||||||
y: stand.position.y - (stand.height / 2) - 5,
|
y: stand.computedPosition.y - (stand.height / 2) - 5,
|
||||||
width: stand.width + 10,
|
width: stand.width + 10,
|
||||||
height: stand.height + 10
|
height: stand.height + 10
|
||||||
},
|
},
|
||||||
|
@ -21,8 +21,8 @@ class ESafeDoor extends Group {
|
|||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
z: this.model.z,
|
z: this.model.z,
|
||||||
shape: {
|
shape: {
|
||||||
x: model.position.x - model.width / 2 - padding,
|
x: model.computedPosition.x - model.width / 2 - padding,
|
||||||
y: model.position.y - (model.height / 2),
|
y: model.computedPosition.y - (model.height / 2),
|
||||||
width: model.width,
|
width: model.width,
|
||||||
height: model.height
|
height: model.height
|
||||||
},
|
},
|
||||||
@ -37,8 +37,8 @@ class ESafeDoor extends Group {
|
|||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
z: this.model.z + 1,
|
z: this.model.z + 1,
|
||||||
shape: {
|
shape: {
|
||||||
x: model.position.x - model.width / 4 - padding,
|
x: model.computedPosition.x - model.width / 4 - padding,
|
||||||
y: model.position.y - (model.height / 2) - 1,
|
y: model.computedPosition.y - (model.height / 2) - 1,
|
||||||
width: model.width / 2 + padding * 2,
|
width: model.width / 2 + padding * 2,
|
||||||
height: model.height + 2
|
height: model.height + 2
|
||||||
},
|
},
|
||||||
|
@ -26,10 +26,10 @@ class EVertical2Door extends Group {
|
|||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
z: this.model.z,
|
z: this.model.z,
|
||||||
shape: {
|
shape: {
|
||||||
x1:model.position.x - model.width / 2,
|
x1:model.computedPosition.x - model.width / 2,
|
||||||
y1:model.position.y - (model.height / 2) + (1 + offesetY ) / 2 * (2 + (model.height)),
|
y1:model.computedPosition.y - (model.height / 2) + (1 + offesetY ) / 2 * (2 + (model.height)),
|
||||||
x2:model.position.x + model.width / 2,
|
x2:model.computedPosition.x + model.width / 2,
|
||||||
y2:model.position.y - (model.height / 2) + (1 + offesetY ) / 2 * (2 + (model.height))
|
y2:model.computedPosition.y - (model.height / 2) + (1 + offesetY ) / 2 * (2 + (model.height))
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
lineWidth: (model.height),
|
lineWidth: (model.height),
|
||||||
@ -42,10 +42,10 @@ class EVertical2Door extends Group {
|
|||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
z: this.model.z,
|
z: this.model.z,
|
||||||
shape: {
|
shape: {
|
||||||
x1:model.position.x - model.width / 2,
|
x1:model.computedPosition.x - model.width / 2,
|
||||||
y1:model.position.y - (model.height / 2) + (1 - offesetY) / 2 * ((model.height) + 2),
|
y1:model.computedPosition.y - (model.height / 2) + (1 - offesetY) / 2 * ((model.height) + 2),
|
||||||
x2:model.position.x + model.width / 2,
|
x2:model.computedPosition.x + model.width / 2,
|
||||||
y2:model.position.y - (model.height / 2) + (1 - offesetY) / 2 * ((model.height) + 2)
|
y2:model.computedPosition.y - (model.height / 2) + (1 - offesetY) / 2 * ((model.height) + 2)
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
lineWidth: (model.height),
|
lineWidth: (model.height),
|
||||||
|
@ -13,6 +13,12 @@ export default class Line2 extends Group {
|
|||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
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.z = 1;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
@ -24,6 +30,7 @@ export default class Line2 extends Group {
|
|||||||
create() {
|
create() {
|
||||||
/** 屏蔽门*/
|
/** 屏蔽门*/
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
|
model.computedPosition = this.computedPosition;
|
||||||
const style = this.style;
|
const style = this.style;
|
||||||
// 站台所有的绘图元素
|
// 站台所有的绘图元素
|
||||||
const elementTypeList = {
|
const elementTypeList = {
|
||||||
@ -85,6 +92,6 @@ export default class Line2 extends Group {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
getAnchorPoint() {
|
getAnchorPoint() {
|
||||||
return this.model.position;
|
return this.computedPosition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,12 @@ export default class Resource extends Group {
|
|||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
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.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.z = model.zIndex || 1;
|
this.z = model.zIndex || 1;
|
||||||
@ -23,14 +29,14 @@ export default class Resource extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
origin: {
|
origin: {
|
||||||
x: model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: model.position.y
|
y: this.computedPosition.y
|
||||||
},
|
},
|
||||||
rotation: -Math.PI / 180 * model.rotate,
|
rotation: -Math.PI / 180 * model.rotate,
|
||||||
style: {
|
style: {
|
||||||
image: model.url,
|
image: model.url,
|
||||||
x: model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: model.position.y,
|
y: this.computedPosition.y,
|
||||||
width: model.width,
|
width: model.width,
|
||||||
height: model.height
|
height: model.height
|
||||||
}
|
}
|
||||||
@ -55,7 +61,7 @@ export default class Resource extends Group {
|
|||||||
// 整体图片
|
// 整体图片
|
||||||
transformRotation(item) {
|
transformRotation(item) {
|
||||||
if (this.model.rotate) {
|
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);
|
const rotation = -Math.PI / 180 * Number(this.model.rotate);
|
||||||
item.origin = origin;
|
item.origin = origin;
|
||||||
item.rotation = rotation;
|
item.rotation = rotation;
|
||||||
@ -75,6 +81,6 @@ export default class Resource extends Group {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
getAnchorPoint() {
|
getAnchorPoint() {
|
||||||
return this.model.position;
|
return this.computedPosition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,12 @@ export default class Responder extends Group {
|
|||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
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.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.anchorPoint = {x: 0, y: 0};
|
this.anchorPoint = {x: 0, y: 0};
|
||||||
@ -50,8 +56,8 @@ export default class Responder extends Group {
|
|||||||
const blockWidth = responderStyle.block.width || 5;
|
const blockWidth = responderStyle.block.width || 5;
|
||||||
const blockHeight = responderStyle.block.height || 12;
|
const blockHeight = responderStyle.block.height || 12;
|
||||||
const blockStyle = responderStyle.block.mapStyle[model.type] || { fill: '#fff'};
|
const blockStyle = responderStyle.block.mapStyle[model.type] || { fill: '#fff'};
|
||||||
const blockX = model.position.x - blockWidth / 2 - distanceX;
|
const blockX = this.computedPosition.x - blockWidth / 2 - distanceX;
|
||||||
const blockY = model.position.y - blockHeight / 2 - distanceY;
|
const blockY = this.computedPosition.y - blockHeight / 2 - distanceY;
|
||||||
this.anchorPoint = {x:blockX, y:blockY};
|
this.anchorPoint = {x:blockX, y:blockY};
|
||||||
const textRadian = -Math.PI / 180 * Number(180 - model.textRotate);
|
const textRadian = -Math.PI / 180 * Number(180 - model.textRotate);
|
||||||
const textDistanceX = model.textOffset.y * Math.sin(textRadian) + model.textOffset.x * Math.cos(textRadian);
|
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 textY = blockY + textDistanceY;
|
||||||
const textName = `${model.type}-${model.name}`;
|
const textName = `${model.type}-${model.name}`;
|
||||||
const textFill = responderStyle.text.textFill;
|
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 deltaFill = responderStyle.delta.fill;
|
||||||
const padding = 1.2;
|
const padding = 1.2;
|
||||||
|
|
||||||
|
@ -13,8 +13,8 @@ export default class EMouse extends Group {
|
|||||||
z: this.device.z + 1,
|
z: this.device.z + 1,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: this.device.model.position.x,
|
x: this.device.computedPosition.x,
|
||||||
y: this.device.model.position.y + this.device.deviceStyle.lamp.radiusR + this.device.deviceStyle.text.distance - 30,
|
y: this.device.computedPosition.y + this.device.deviceStyle.lamp.radiusR + this.device.deviceStyle.text.distance - 30,
|
||||||
fontWeight: 'normal',
|
fontWeight: 'normal',
|
||||||
fontSize: this.device.deviceStyle.mouseOverStyle.fontSize,
|
fontSize: this.device.deviceStyle.mouseOverStyle.fontSize,
|
||||||
fontFamily: this.device.style.fontFamily,
|
fontFamily: this.device.style.fontFamily,
|
||||||
|
@ -20,6 +20,12 @@ export default class SaidLamp extends Group {
|
|||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
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.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.deviceStyle = style[model._type];
|
this.deviceStyle = style[model._type];
|
||||||
@ -41,8 +47,8 @@ export default class SaidLamp extends Group {
|
|||||||
z: this.z,
|
z: this.z,
|
||||||
arc: {
|
arc: {
|
||||||
shape: {
|
shape: {
|
||||||
cx: model.position.x,
|
cx: this.computedPosition.x,
|
||||||
cy: model.position.y,
|
cy: this.computedPosition.y,
|
||||||
r: this.deviceStyle.lamp.radiusR
|
r: this.deviceStyle.lamp.radiusR
|
||||||
},
|
},
|
||||||
subType: 'Control',
|
subType: 'Control',
|
||||||
@ -52,8 +58,8 @@ export default class SaidLamp extends Group {
|
|||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
x: model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: model.position.y + this.deviceStyle.lamp.radiusR + this.deviceStyle.text.distance,
|
y: this.computedPosition.y + this.deviceStyle.lamp.radiusR + this.deviceStyle.text.distance,
|
||||||
fontWeight: this.deviceStyle.text.fontWeight,
|
fontWeight: this.deviceStyle.text.fontWeight,
|
||||||
fontSize: this.deviceStyle.text.fontSize,
|
fontSize: this.deviceStyle.text.fontSize,
|
||||||
fontFamily: this.style.fontFamily,
|
fontFamily: this.style.fontFamily,
|
||||||
@ -69,8 +75,8 @@ export default class SaidLamp extends Group {
|
|||||||
this.control = new ELampFilament({
|
this.control = new ELampFilament({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
x: model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: model.position.y,
|
y: this.computedPosition.y,
|
||||||
_subType: 'LampFilament',
|
_subType: 'LampFilament',
|
||||||
width: this.deviceStyle.width,
|
width: this.deviceStyle.width,
|
||||||
fill: this.deviceStyle.defaultColor
|
fill: this.deviceStyle.defaultColor
|
||||||
@ -80,8 +86,8 @@ export default class SaidLamp extends Group {
|
|||||||
this.control = new EControlSwitch({
|
this.control = new EControlSwitch({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
x: model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: model.position.y,
|
y: this.computedPosition.y,
|
||||||
_subType: 'ControlSwitch',
|
_subType: 'ControlSwitch',
|
||||||
width: this.deviceStyle.width,
|
width: this.deviceStyle.width,
|
||||||
fill: this.deviceStyle.defaultColor
|
fill: this.deviceStyle.defaultColor
|
||||||
@ -91,8 +97,8 @@ export default class SaidLamp extends Group {
|
|||||||
this.control = new EDeviceStatus({
|
this.control = new EDeviceStatus({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
x: model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: model.position.y,
|
y: this.computedPosition.y,
|
||||||
mfNum: model.mfNum,
|
mfNum: model.mfNum,
|
||||||
pfNum: model.pfNum,
|
pfNum: model.pfNum,
|
||||||
style: this.style
|
style: this.style
|
||||||
@ -102,8 +108,8 @@ export default class SaidLamp extends Group {
|
|||||||
this.control = new EFoldbackMode({
|
this.control = new EFoldbackMode({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
x: model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: model.position.y,
|
y: this.computedPosition.y,
|
||||||
width: this.deviceStyle.rectWidth,
|
width: this.deviceStyle.rectWidth,
|
||||||
style: this.style
|
style: this.style
|
||||||
});
|
});
|
||||||
@ -112,8 +118,8 @@ export default class SaidLamp extends Group {
|
|||||||
this.control = new EModeStatus({
|
this.control = new EModeStatus({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
x: model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: model.position.y,
|
y: this.computedPosition.y,
|
||||||
style: this.style
|
style: this.style
|
||||||
});
|
});
|
||||||
this.add(this.control);
|
this.add(this.control);
|
||||||
@ -121,8 +127,8 @@ export default class SaidLamp extends Group {
|
|||||||
this.control = new EAxle({
|
this.control = new EAxle({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
x: model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: model.position.y,
|
y: this.computedPosition.y,
|
||||||
style: this.style
|
style: this.style
|
||||||
});
|
});
|
||||||
this.add(this.control);
|
this.add(this.control);
|
||||||
@ -131,8 +137,8 @@ export default class SaidLamp extends Group {
|
|||||||
this.control = new EUnmanned({
|
this.control = new EUnmanned({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
x: model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: model.position.y,
|
y: this.computedPosition.y,
|
||||||
_subType: 'Unmanned',
|
_subType: 'Unmanned',
|
||||||
width: this.style.NoOneReturn.width,
|
width: this.style.NoOneReturn.width,
|
||||||
fill: this.style.NoOneReturn.defaultColor
|
fill: this.style.NoOneReturn.defaultColor
|
||||||
@ -144,8 +150,8 @@ export default class SaidLamp extends Group {
|
|||||||
z: this.z,
|
z: this.z,
|
||||||
arc: {
|
arc: {
|
||||||
shape: {
|
shape: {
|
||||||
cx: model.position.x,
|
cx: this.computedPosition.x,
|
||||||
cy: model.position.y,
|
cy: this.computedPosition.y,
|
||||||
r: this.deviceStyle.lamp.radiusR
|
r: this.deviceStyle.lamp.radiusR
|
||||||
},
|
},
|
||||||
subType: 'Control',
|
subType: 'Control',
|
||||||
@ -154,8 +160,8 @@ export default class SaidLamp extends Group {
|
|||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
x: model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: model.position.y + this.deviceStyle.lamp.radiusR + this.deviceStyle.text.distance,
|
y: this.computedPosition.y + this.deviceStyle.lamp.radiusR + this.deviceStyle.text.distance,
|
||||||
fontWeight: this.deviceStyle.text.fontWeight,
|
fontWeight: this.deviceStyle.text.fontWeight,
|
||||||
fontSize: this.deviceStyle.text.fontSize,
|
fontSize: this.deviceStyle.text.fontSize,
|
||||||
fontFamily: this.style.fontFamily,
|
fontFamily: this.style.fontFamily,
|
||||||
@ -172,19 +178,19 @@ export default class SaidLamp extends Group {
|
|||||||
this.control = new EIndicatorLight({
|
this.control = new EIndicatorLight({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
x: model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: model.position.y,
|
y: this.computedPosition.y,
|
||||||
text: model.name,
|
text: model.name,
|
||||||
style: this.style,
|
style: this.style,
|
||||||
_subType: 'IndicatorLight'
|
_subType: 'IndicatorLight'
|
||||||
});
|
});
|
||||||
this.add(this.control);
|
this.add(this.control);
|
||||||
} else if (this._type === 'PickArrow' || this._type === 'DepartArrow') {
|
} else if (this._type === 'PickArrow' || this._type === 'DepartArrow') {
|
||||||
this.control = new EPickOrDepartArrow({
|
this.control = new EPickOrDepartArrow({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
x: model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: model.position.y,
|
y: this.computedPosition.y,
|
||||||
text: model.name,
|
text: model.name,
|
||||||
right: model.right,
|
right: model.right,
|
||||||
style: this.style,
|
style: this.style,
|
||||||
|
@ -24,14 +24,14 @@ export default class EAxle extends Group {
|
|||||||
|
|
||||||
createAxleLeft() {
|
createAxleLeft() {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
|
const computedPoints = this.model.computedPoints;
|
||||||
const traingle = new JTriangle(model.points[0], model.points[1]);
|
const traingle = new JTriangle(computedPoints[0], computedPoints[1]);
|
||||||
const drictx = 1;
|
const drictx = 1;
|
||||||
const dricty = model.leftAxlePosition === 1 || model.leftAxlePosition === 2 ? 1 : -1;
|
const dricty = model.leftAxlePosition === 1 || model.leftAxlePosition === 2 ? 1 : -1;
|
||||||
const isSpecial = model.leftAxlePosition === -2 || model.leftAxlePosition === 2;
|
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 = {};
|
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) {
|
if (model.leftAxleOffset) {
|
||||||
point.x = point.x + model.leftAxleOffset.x || 0;
|
point.x = point.x + model.leftAxleOffset.x || 0;
|
||||||
point.y = point.y + model.leftAxleOffset.y || 0;
|
point.y = point.y + model.leftAxleOffset.y || 0;
|
||||||
@ -48,15 +48,16 @@ export default class EAxle extends Group {
|
|||||||
|
|
||||||
createAxleRight() {
|
createAxleRight() {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
const length = model.points.length;
|
const computedPoints = this.model.computedPoints;
|
||||||
const traingle = new JTriangle(model.points[length - 2], model.points[length - 1]);
|
const length = computedPoints.length;
|
||||||
|
const traingle = new JTriangle(computedPoints[length - 2], computedPoints[length - 1]);
|
||||||
const drictx = -1;
|
const drictx = -1;
|
||||||
const dricty = model.rightAxlePosition === 1 || model.rightAxlePosition === 2 ? 1 : -1;
|
const dricty = model.rightAxlePosition === 1 || model.rightAxlePosition === 2 ? 1 : -1;
|
||||||
const isSpecial = model.rightAxlePosition === -2 || model.rightAxlePosition === 2;
|
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 = {};
|
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) {
|
if (model.rightAxleOffset) {
|
||||||
point.x = point.x + model.rightAxleOffset.x || 0;
|
point.x = point.x + model.rightAxleOffset.x || 0;
|
||||||
point.y = point.y + model.rightAxleOffset.y || 0;
|
point.y = point.y + model.rightAxleOffset.y || 0;
|
||||||
|
@ -19,16 +19,16 @@ export default class EBackArrowGroup extends Group {
|
|||||||
const height = style.Section.line.width * 1;
|
const height = style.Section.line.width * 1;
|
||||||
const turnBackDistance = style.Section.shuttleBack.distance + radius * 4;
|
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 x = -model.drict * width * 1.2;
|
||||||
let y = -turnBackDistance;
|
let y = -turnBackDistance;
|
||||||
|
|
||||||
if (model.drict < 0) {
|
if (model.drict < 0) {
|
||||||
x += points[0].x;
|
x += computedPoints[0].x;
|
||||||
y += points[0].y;
|
y += computedPoints[0].y;
|
||||||
} else {
|
} else {
|
||||||
x += points[points.length - 1].x;
|
x += computedPoints[computedPoints.length - 1].x;
|
||||||
y += points[points.length - 1].y;
|
y += computedPoints[computedPoints.length - 1].y;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.turnBack = new EBackArrow({
|
this.turnBack = new EBackArrow({
|
||||||
|
@ -16,9 +16,10 @@ export default class EBadShunt extends Group {
|
|||||||
// 分路不良
|
// 分路不良
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
|
const computedPoints = this.model.computedPoints;
|
||||||
/** 创建区段*/
|
/** 创建区段*/
|
||||||
if (model && model.points.length > 1) {
|
if (computedPoints.length > 1) {
|
||||||
const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]);
|
const traingle = new JTriangle(computedPoints[0], computedPoints[computedPoints.length - 1]);
|
||||||
let x = traingle.drictx * (style.Section.badShunt.distance) * traingle.getSinRate();
|
let x = traingle.drictx * (style.Section.badShunt.distance) * traingle.getSinRate();
|
||||||
let y = traingle.dricty * (style.Section.badShunt.distance) * traingle.getCosRate();
|
let y = traingle.dricty * (style.Section.badShunt.distance) * traingle.getCosRate();
|
||||||
if (x == Infinity) { x = 0; }
|
if (x == Infinity) { x = 0; }
|
||||||
@ -32,7 +33,7 @@ export default class EBadShunt extends Group {
|
|||||||
isSwitchSection: model.switchSection,
|
isSwitchSection: model.switchSection,
|
||||||
relSwitchCode: model.relSwitchCode,
|
relSwitchCode: model.relSwitchCode,
|
||||||
isCurve: model.curve, // 是否曲线
|
isCurve: model.curve, // 是否曲线
|
||||||
points: model.points
|
points: computedPoints
|
||||||
});
|
});
|
||||||
// 下侧临时限速线
|
// 下侧临时限速线
|
||||||
const badShuntRight = this.createLimit({
|
const badShuntRight = this.createLimit({
|
||||||
@ -42,7 +43,7 @@ export default class EBadShunt extends Group {
|
|||||||
isSwitchSection: model.switchSection,
|
isSwitchSection: model.switchSection,
|
||||||
relSwitchCode: model.relSwitchCode,
|
relSwitchCode: model.relSwitchCode,
|
||||||
isCurve: model.curve, // 是否曲线
|
isCurve: model.curve, // 是否曲线
|
||||||
points: model.points
|
points: computedPoints
|
||||||
});
|
});
|
||||||
badShuntLeft.forEach(item => {
|
badShuntLeft.forEach(item => {
|
||||||
this.add(item);
|
this.add(item);
|
||||||
|
@ -1,85 +1,87 @@
|
|||||||
import Group from "zrender/src/container/Group";
|
import Group from 'zrender/src/container/Group';
|
||||||
import Text from "zrender/src/graphic/Text";
|
import Text from 'zrender/src/graphic/Text';
|
||||||
import Polygon from "zrender/src/graphic/shape/Polygon";
|
import Polygon from 'zrender/src/graphic/shape/Polygon';
|
||||||
|
|
||||||
class EDerailer extends Group {
|
class EDerailer extends Group {
|
||||||
constructor(model) {
|
constructor(model) {
|
||||||
super();
|
super();
|
||||||
this.zlevel = model.zlevel;
|
this.zlevel = model.zlevel;
|
||||||
this.z = model.z;
|
this.z = model.z;
|
||||||
this.style = model.style;
|
this.style = model.style;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.create();
|
this.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
create() {
|
create() {
|
||||||
this.createText();
|
this.createText();
|
||||||
this.createSymbol();
|
this.createSymbol();
|
||||||
}
|
}
|
||||||
|
|
||||||
createText() {
|
createText() {
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
const model = this.model.modelData;
|
// const model = this.model.modelData;
|
||||||
const length = model.points.length;
|
const computedPoints = this.model.computedPoints;
|
||||||
const offset = style.Section.derailer.text.offset||{};
|
const length = computedPoints.length;
|
||||||
const offsetX = offset.x||0;
|
const offset = style.Section.derailer.text.offset || {};
|
||||||
const offsetY = offset.y||0;
|
const offsetX = offset.x || 0;
|
||||||
const positionX = (model.points[0].x + model.points[length-1].x) / 2 + offsetX;
|
const offsetY = offset.y || 0;
|
||||||
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({
|
this.text = new Text({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
style: {
|
style: {
|
||||||
x: positionX,
|
x: positionX,
|
||||||
y: positionY,
|
y: positionY,
|
||||||
text: 'T',
|
text: 'T',
|
||||||
fontWeight: style.fontWeight,
|
fontWeight: style.fontWeight,
|
||||||
fontSize: style.fontSize,
|
fontSize: style.fontSize,
|
||||||
fontFamily: style.fontFamily,
|
fontFamily: style.fontFamily,
|
||||||
textFill: style.Section.derailer.text.color,
|
textFill: style.Section.derailer.text.color,
|
||||||
textPosition: 'inside',
|
textPosition: 'inside',
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
textVerticalAlign: 'center'
|
textVerticalAlign: 'center'
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
this.add(this.text);
|
this.add(this.text);
|
||||||
}
|
}
|
||||||
|
|
||||||
createSymbol() {
|
createSymbol() {
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
const model = this.model.modelData;
|
// const model = this.model.modelData;
|
||||||
const length = model.points.length;
|
const length = this.model.computedPoints.length;
|
||||||
const offset = style.Section.derailer.symbol.offset||{};
|
const computedPoints = this.model.computedPoints;
|
||||||
const offsetX = offset.x||0;
|
const offset = style.Section.derailer.symbol.offset || {};
|
||||||
const offsetY = offset.y||0;
|
const offsetX = offset.x || 0;
|
||||||
const pointX = (model.points[0].x + model.points[length-1].x) / 2 + offsetX;
|
const offsetY = offset.y || 0;
|
||||||
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({
|
this.symbol = new Polygon({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
shape: {
|
shape: {
|
||||||
points: [
|
points: [
|
||||||
[pointX-3, pointY],
|
[pointX - 3, pointY],
|
||||||
[pointX, pointY-8],
|
[pointX, pointY - 8],
|
||||||
[pointX+3, pointY]
|
[pointX + 3, pointY]
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
fill: style.Section.derailer.symbol.color,
|
fill: style.Section.derailer.symbol.color
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
this.add(this.symbol);
|
this.add(this.symbol);
|
||||||
}
|
}
|
||||||
|
|
||||||
setTextStyle(style) {
|
setTextStyle(style) {
|
||||||
this.text && this.text.setStyle(style);
|
this.text && this.text.setStyle(style);
|
||||||
}
|
}
|
||||||
|
|
||||||
setSymbolStyle(style) {
|
setSymbolStyle(style) {
|
||||||
this.symbol && this.symbol.setStyle(style);
|
this.symbol && this.symbol.setStyle(style);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default EDerailer;
|
export default EDerailer;
|
||||||
|
@ -16,9 +16,10 @@ export default class ELimitLines extends Group {
|
|||||||
create() {
|
create() {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
|
const computedPoints = this.model.computedPoints;
|
||||||
/** 创建区段*/
|
/** 创建区段*/
|
||||||
if (model && model.points.length > 1) {
|
if (computedPoints.length > 1) {
|
||||||
const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]);
|
const traingle = new JTriangle(computedPoints[0], computedPoints[computedPoints.length - 1]);
|
||||||
let x = traingle.drictx * (style.Section.speedLimit.distance) * traingle.getSinRate();
|
let x = traingle.drictx * (style.Section.speedLimit.distance) * traingle.getSinRate();
|
||||||
let y = traingle.dricty * (style.Section.speedLimit.distance) * traingle.getCosRate();
|
let y = traingle.dricty * (style.Section.speedLimit.distance) * traingle.getCosRate();
|
||||||
if (x == Infinity) { x = 0; }
|
if (x == Infinity) { x = 0; }
|
||||||
@ -32,7 +33,7 @@ export default class ELimitLines extends Group {
|
|||||||
isSwitchSection: model.switchSection,
|
isSwitchSection: model.switchSection,
|
||||||
relSwitchCode: model.relSwitchCode,
|
relSwitchCode: model.relSwitchCode,
|
||||||
isCurve: model.curve, // 是否曲线
|
isCurve: model.curve, // 是否曲线
|
||||||
points: model.points
|
points: computedPoints
|
||||||
});
|
});
|
||||||
// 下侧临时限速线
|
// 下侧临时限速线
|
||||||
const speedLimitRight = this.createLimit({
|
const speedLimitRight = this.createLimit({
|
||||||
@ -42,7 +43,7 @@ export default class ELimitLines extends Group {
|
|||||||
isSwitchSection: model.switchSection,
|
isSwitchSection: model.switchSection,
|
||||||
relSwitchCode: model.relSwitchCode,
|
relSwitchCode: model.relSwitchCode,
|
||||||
isCurve: model.curve, // 是否曲线
|
isCurve: model.curve, // 是否曲线
|
||||||
points: model.points
|
points: computedPoints
|
||||||
});
|
});
|
||||||
speedLimitLeft.forEach(item => {
|
speedLimitLeft.forEach(item => {
|
||||||
this.add(item);
|
this.add(item);
|
||||||
|
@ -13,15 +13,15 @@ export default class ELimitName extends Group {
|
|||||||
|
|
||||||
create() {
|
create() {
|
||||||
/** 创建区段*/
|
/** 创建区段*/
|
||||||
const model = this.model.modelData;
|
// const model = this.model.modelData;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
|
const computedPoints = this.model.computedPoints;
|
||||||
const rectW = style.Section.speedLimitName.drogueWidth;
|
const rectW = style.Section.speedLimitName.drogueWidth;
|
||||||
const rectH = style.Section.speedLimitName.drogueHeight;
|
const rectH = style.Section.speedLimitName.drogueHeight;
|
||||||
const x1 = model.points[0].x;
|
const x1 = computedPoints[0].x;
|
||||||
const y1 = model.points[0].y + style.Section.speedLimitName.limitValueDistance;
|
const y1 = computedPoints[0].y + style.Section.speedLimitName.limitValueDistance;
|
||||||
const x2 = model.points[model.points.length - 1].x;
|
const x2 = computedPoints[computedPoints.length - 1].x;
|
||||||
const y2 = model.points[model.points.length - 1].y + style.Section.speedLimitName.limitValueDistance;
|
const y2 = computedPoints[computedPoints.length - 1].y + style.Section.speedLimitName.limitValueDistance;
|
||||||
if (style.Section.speedLimitName.leftName) {
|
if (style.Section.speedLimitName.leftName) {
|
||||||
const leftPoints = style.Section.speedLimitName.nameBackgroundIsRect ? [[x1, y1],
|
const leftPoints = style.Section.speedLimitName.nameBackgroundIsRect ? [[x1, y1],
|
||||||
[x1 + rectW, y1],
|
[x1 + rectW, y1],
|
||||||
|
@ -35,10 +35,10 @@ export default class ELines extends Group {
|
|||||||
const relateSectionList = model.relateSectionList;
|
const relateSectionList = model.relateSectionList;
|
||||||
const sectionA = store.getters['map/getDeviceByCode'](relateSectionList[0]);
|
const sectionA = store.getters['map/getDeviceByCode'](relateSectionList[0]);
|
||||||
const sectionB = store.getters['map/getDeviceByCode'](relateSectionList[1]);
|
const sectionB = store.getters['map/getDeviceByCode'](relateSectionList[1]);
|
||||||
const endPointA = sectionA.points[sectionA.points.length - 1];
|
const endPointA = sectionA.instance.computedPoints[sectionA.instance.computedPoints.length - 1];
|
||||||
const startPointA = sectionA.points[0];
|
const startPointA = sectionA.instance.computedPoints[0];
|
||||||
const endPointB = sectionB.points[sectionB.points.length - 1];
|
const endPointB = sectionB.instance.computedPoints[sectionB.instance.computedPoints.length - 1];
|
||||||
const startPointB = sectionB.points[0];
|
const startPointB = sectionB.instance.computedPoints[0];
|
||||||
const result = segmentsIntr(startPointA, endPointA, startPointB, endPointB);
|
const result = segmentsIntr(startPointA, endPointA, startPointB, endPointB);
|
||||||
// this.cross = new Polyline({
|
// this.cross = new Polyline({
|
||||||
// zlevel: this.zlevel,
|
// zlevel: this.zlevel,
|
||||||
@ -167,10 +167,11 @@ export default class ELines extends Group {
|
|||||||
createLine() {
|
createLine() {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
|
const computedPoints = this.model.computedPoints; // 30
|
||||||
|
|
||||||
const Z = model.type == '02' ? this.z + 1 : this.z;
|
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;
|
const isCurve = model.curve;
|
||||||
/** 创建区段*/
|
/** 创建区段*/
|
||||||
if (model && modelPoints.length > 1) {
|
if (model && modelPoints.length > 1) {
|
||||||
|
@ -77,23 +77,24 @@ class EMouse extends Group {
|
|||||||
this.lineBorder.hide();
|
this.lineBorder.hide();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const model = this.device.model;
|
// const model = this.device.model;
|
||||||
|
const computedPoints = this.device.computedPoints;
|
||||||
let points = [];
|
let points = [];
|
||||||
const pointsReverse = [];
|
const pointsReverse = [];
|
||||||
model.points.forEach((ele, index) => {
|
computedPoints.forEach((ele, index) => {
|
||||||
let flag = false;
|
let flag = false;
|
||||||
if (index == model.points.length - 1) {
|
if (index == computedPoints.length - 1) {
|
||||||
this.triangle = new JTriangle(model.points[index - 1], ele);
|
this.triangle = new JTriangle(computedPoints[index - 1], ele);
|
||||||
} else {
|
} else {
|
||||||
this.triangle = new JTriangle(ele, model.points[index + 1]);
|
this.triangle = new JTriangle(ele, computedPoints[index + 1]);
|
||||||
}
|
}
|
||||||
const directy = this.triangle.dricty;
|
const directy = this.triangle.dricty;
|
||||||
if (index > 0) {
|
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;
|
flag = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (model.points[index + 1].y == ele.y) {
|
if (computedPoints[index + 1].y == ele.y) {
|
||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -152,7 +153,7 @@ class EMouse extends Group {
|
|||||||
this.TextName && this.TextName.show();
|
this.TextName && this.TextName.show();
|
||||||
this.sectionTextBorder && this.sectionTextBorder.show();
|
this.sectionTextBorder && this.sectionTextBorder.show();
|
||||||
if (this.device.model.type != '03') {
|
if (this.device.model.type != '03') {
|
||||||
this.lineBorder && this.lineBorder.show();
|
this.lineBorder && this.lineBorder.show();
|
||||||
}
|
}
|
||||||
const instance = this.getInstanceByCode(this.device.model.trainWindowCode);
|
const instance = this.getInstanceByCode(this.device.model.trainWindowCode);
|
||||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseEnter) {
|
if (instance && instance.mouseEvent && instance.mouseEvent.mouseEnter) {
|
||||||
|
@ -23,15 +23,16 @@ export default class ESeparator extends Group {
|
|||||||
create() {
|
create() {
|
||||||
/** 创建区段*/
|
/** 创建区段*/
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
|
const computedPoints = this.model.computedPoints;
|
||||||
const style = this.model.style;
|
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({
|
this.lPartition = this.setType({
|
||||||
traingle: traingleLeft,
|
traingle: traingleLeft,
|
||||||
point: {
|
point: {
|
||||||
x: model.points[0].x,
|
x: computedPoints[0].x,
|
||||||
y: model.points[0].y
|
y: computedPoints[0].y
|
||||||
},
|
},
|
||||||
sepType: model.sepTypeLeft,
|
sepType: model.sepTypeLeft,
|
||||||
drict: -1, // 方向
|
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({
|
this.rPartition = this.setType({
|
||||||
traingle: traingleRight,
|
traingle: traingleRight,
|
||||||
point: {
|
point: {
|
||||||
x: model.points[model.points.length - 1].x,
|
x: computedPoints[computedPoints.length - 1].x,
|
||||||
y: model.points[model.points.length - 1].y
|
y: computedPoints[computedPoints.length - 1].y
|
||||||
},
|
},
|
||||||
sepType: model.sepTypeRight,
|
sepType: model.sepTypeRight,
|
||||||
drict: 1, // 方向
|
drict: 1, // 方向
|
||||||
|
@ -16,7 +16,7 @@ export default class EStopRouteImg extends Group {
|
|||||||
create() {
|
create() {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
const modelPoints = model.points;
|
const modelPoints = this.model.computedPoints;
|
||||||
if (model.type !== '04') {
|
if (model.type !== '04') {
|
||||||
const image = new Image(5, 8);
|
const image = new Image(5, 8);
|
||||||
image.src = Stop_Route;
|
image.src = Stop_Route;
|
||||||
|
@ -13,15 +13,16 @@ class ETextName extends Group {
|
|||||||
create() {
|
create() {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
const styleModel = this.model.style.Section[this.model.type];
|
const styleModel = this.model.style.Section[this.model.type];
|
||||||
|
const computedPoints = this.model.computedPoints;
|
||||||
let styleX = '';
|
let styleX = '';
|
||||||
let styleY = '';
|
let styleY = '';
|
||||||
let styleName = '';
|
let styleName = '';
|
||||||
let isCreate = false;
|
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 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(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 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(model.points[0], model.points[model.points.length - 1]);
|
const traingle = new JTriangle(computedPoints[0], computedPoints[computedPoints.length - 1]);
|
||||||
const drict = model.trainPosType != '01' ? 1 : -1;
|
const drict = model.trainPosType != '01' ? 1 : -1;
|
||||||
if (this.model.type == 'name') {
|
if (this.model.type == 'name') {
|
||||||
if (model.type == '01' && !model.parentCode) { // 物理区段名称
|
if (model.type == '01' && !model.parentCode) { // 物理区段名称
|
||||||
|
@ -26,20 +26,20 @@ export default class ELines extends Group {
|
|||||||
/** 创建区段*/
|
/** 创建区段*/
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
|
const computedPoints = this.model.computedPoints;
|
||||||
const isCurve = model.curve;
|
const isCurve = model.curve;
|
||||||
if (model && model.points.length > 1) {
|
if (computedPoints.length > 1) {
|
||||||
if (isCurve) { // 曲线 用贝塞尔曲线绘图 封锁 必须4个点来绘图
|
if (isCurve) { // 曲线 用贝塞尔曲线绘图 封锁 必须4个点来绘图
|
||||||
const shape = {};
|
const shape = {};
|
||||||
for (let i = 1; i < (model.points.length - 1); i++) {
|
for (let i = 1; i < (computedPoints.length - 1); i++) {
|
||||||
shape[`cpx${i}`] = model.points[i].x;
|
shape[`cpx${i}`] = computedPoints[i].x;
|
||||||
shape[`cpy${i}`] = model.points[i].y;
|
shape[`cpy${i}`] = computedPoints[i].y;
|
||||||
}
|
}
|
||||||
|
|
||||||
shape[`x1`] = model.points[0].x;
|
shape[`x1`] = computedPoints[0].x;
|
||||||
shape[`y1`] = model.points[0].y;
|
shape[`y1`] = computedPoints[0].y;
|
||||||
shape[`x2`] = model.points[model.points.length - 1].x;
|
shape[`x2`] = computedPoints[computedPoints.length - 1].x;
|
||||||
shape[`y2`] = model.points[model.points.length - 1].y;
|
shape[`y2`] = computedPoints[computedPoints.length - 1].y;
|
||||||
this.section = new BezierCurve({
|
this.section = new BezierCurve({
|
||||||
isLine: true,
|
isLine: true,
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
@ -55,19 +55,19 @@ export default class ELines extends Group {
|
|||||||
});
|
});
|
||||||
this.add(this.section);
|
this.add(this.section);
|
||||||
} else {
|
} else {
|
||||||
if (model.points.length == 2) {
|
if (computedPoints.length == 2) {
|
||||||
const spaceX = (model.points[1].x - model.points[0].x) / 3;
|
const spaceX = (computedPoints[1].x - computedPoints[0].x) / 3;
|
||||||
const spaceY = (model.points[1].y - model.points[0].y) / 3;
|
const spaceY = (computedPoints[1].y - computedPoints[0].y) / 3;
|
||||||
this.sectionM = new Line({
|
this.sectionM = new Line({
|
||||||
isLine: true,
|
isLine: true,
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
progressive: model.progressive,
|
progressive: model.progressive,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
shape: {
|
shape: {
|
||||||
x1: model.points[0].x + spaceX,
|
x1: computedPoints[0].x + spaceX,
|
||||||
y1: model.points[0].y + spaceY,
|
y1: computedPoints[0].y + spaceY,
|
||||||
x2: model.points[0].x + spaceX + spaceX,
|
x2: computedPoints[0].x + spaceX + spaceX,
|
||||||
y2: model.points[0].y + spaceY + spaceY
|
y2: computedPoints[0].y + spaceY + spaceY
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
lineWidth: style.Section.line.width,
|
lineWidth: style.Section.line.width,
|
||||||
|
@ -58,8 +58,19 @@ export default class Section extends Group {
|
|||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
this.zlevel = model.zlevel;
|
||||||
const amendData = store.getters['map/amendPoints'](this._code);
|
const amendData = store.getters['map/amendPoints'](this._code);
|
||||||
|
const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
|
||||||
if (amendData) {
|
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.z = 5 + parseInt(model.layer || 0);
|
||||||
this.model = model;
|
this.model = model;
|
||||||
@ -116,6 +127,7 @@ export default class Section extends Group {
|
|||||||
z: this.z + elementZ,
|
z: this.z + elementZ,
|
||||||
style: style,
|
style: style,
|
||||||
type: element,
|
type: element,
|
||||||
|
computedPoints: this.computedPoints,
|
||||||
modelData: model
|
modelData: model
|
||||||
});
|
});
|
||||||
this.add(this[element]);
|
this.add(this[element]);
|
||||||
@ -530,8 +542,8 @@ export default class Section extends Group {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 分路不良
|
// 分路不良
|
||||||
// model.shuntingTypeList.length > 0 &&
|
// model.shuntingTypeList.length > 0 &&
|
||||||
model.badShunt&& this.badShuntStatus();
|
model.badShunt && this.badShuntStatus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -557,7 +569,11 @@ export default class Section extends Group {
|
|||||||
return this.name.getBoundingRect();
|
return this.name.getBoundingRect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
getNameBoundingRect() {
|
||||||
|
if (this.name && this.name.getBoundingRect()) {
|
||||||
|
return this.name.getBoundingRect();
|
||||||
|
} else { return {}; }
|
||||||
|
}
|
||||||
createMouseEvent() { // 鼠标事件
|
createMouseEvent() { // 鼠标事件
|
||||||
if (this.style.Section.mouseOverStyle) {
|
if (this.style.Section.mouseOverStyle) {
|
||||||
this.mouseEvent = new EMouse(this, this.model.relSwitchCode);
|
this.mouseEvent = new EMouse(this, this.model.relSwitchCode);
|
||||||
|
@ -190,9 +190,14 @@ class Signal extends Group {
|
|||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
const amendData = store.getters['map/amendPoints'](this._code);
|
const amendData = store.getters['map/amendPoints'](this._code);
|
||||||
|
const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
|
||||||
if (amendData) {
|
if (amendData) {
|
||||||
model.position = amendData.position;
|
|
||||||
model.rotate = amendData.rotate;
|
model.rotate = amendData.rotate;
|
||||||
|
this.computedPosition = amendData.position;
|
||||||
|
} else if (pictureDevice) {
|
||||||
|
this.computedPosition = pictureDevice.position;
|
||||||
|
} else {
|
||||||
|
this.computedPosition = model.position;
|
||||||
}
|
}
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.mapDevice = mapDevice;
|
this.mapDevice = mapDevice;
|
||||||
@ -223,18 +228,19 @@ class Signal extends Group {
|
|||||||
create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.style;
|
const style = this.style;
|
||||||
|
const computedPosition = this.computedPosition;
|
||||||
const drict = this.model.showRight ? 1 : -1; // 朝向 左:右
|
const drict = this.model.showRight ? 1 : -1; // 朝向 左:右
|
||||||
const posit = this.model.positionType == '01' ? -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({
|
this.sigPost = new ESigPost({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
style: style,
|
style: style,
|
||||||
drict: drict,
|
drict: drict,
|
||||||
type: model.lampPostType,
|
type: model.lampPostType,
|
||||||
x: model.position.x + model.positionPoint.x,
|
x: computedPosition.x + model.positionPoint.x,
|
||||||
y: sigPostY
|
y: sigPostY
|
||||||
});
|
});
|
||||||
if (style.Signal.ciConfirm) {
|
if (style.Signal.ciConfirm) {
|
||||||
@ -245,7 +251,7 @@ class Signal extends Group {
|
|||||||
silent: false,
|
silent: false,
|
||||||
_subType: 'enabled', // 标识
|
_subType: 'enabled', // 标识
|
||||||
style: {
|
style: {
|
||||||
x: model.position.x + model.positionPoint.x - drict * 25,
|
x: computedPosition.x + model.positionPoint.x - drict * 25,
|
||||||
y: sigPostY + posit * 11,
|
y: sigPostY + posit * 11,
|
||||||
fontSize: style.Signal.ciConfirm.fontSize,
|
fontSize: style.Signal.ciConfirm.fontSize,
|
||||||
text: style.Signal.ciConfirm.defaultText,
|
text: style.Signal.ciConfirm.defaultText,
|
||||||
@ -271,8 +277,8 @@ class Signal extends Group {
|
|||||||
drict: drict,
|
drict: drict,
|
||||||
x: endPoint.x + i * drict * style.Signal.lamp.radiusR * 2.3,
|
x: endPoint.x + i * drict * style.Signal.lamp.radiusR * 2.3,
|
||||||
y: endPoint.y,
|
y: endPoint.y,
|
||||||
originX: model.position.x + model.positionPoint.x,
|
originX: computedPosition.x + model.positionPoint.x,
|
||||||
originY: model.position.y + model.positionPoint.y
|
originY: computedPosition.y + model.positionPoint.y
|
||||||
});
|
});
|
||||||
this.lamps.push(lamp);
|
this.lamps.push(lamp);
|
||||||
}
|
}
|
||||||
@ -348,8 +354,8 @@ class Signal extends Group {
|
|||||||
this.sigBack.hide();
|
this.sigBack.hide();
|
||||||
}
|
}
|
||||||
// 信号机名称
|
// 信号机名称
|
||||||
const sigNameX = model.position.x + model.positionPoint.x - drict * (style.Signal.post.standardVerticalWidth) + model.namePosition.x;
|
const sigNameX = computedPosition.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 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 textAlign = style.Signal.text.isAlignCenter ? 'middle' : this.model.showRight ? 'left' : 'right';
|
||||||
const textVerticalAlign = posit == 1 ? 'top' : 'bottom';
|
const textVerticalAlign = posit == 1 ? 'top' : 'bottom';
|
||||||
this.sigName = new ESigName({
|
this.sigName = new ESigName({
|
||||||
@ -368,7 +374,7 @@ class Signal extends Group {
|
|||||||
textVerticalAlign: textVerticalAlign
|
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({
|
this.remainTimeName = new ESigName({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
@ -473,8 +479,8 @@ class Signal extends Group {
|
|||||||
drict: drict,
|
drict: drict,
|
||||||
x: endPoint.x,
|
x: endPoint.x,
|
||||||
y: endPoint.y,
|
y: endPoint.y,
|
||||||
originX: model.position.x + model.positionPoint.x,
|
originX: computedPosition.x + model.positionPoint.x,
|
||||||
originY: model.position.y + model.positionPoint.y
|
originY: computedPosition.y + model.positionPoint.y
|
||||||
});
|
});
|
||||||
this.add(this.virtualSignal); // 虚拟信号机 (哈尔滨线路)
|
this.add(this.virtualSignal); // 虚拟信号机 (哈尔滨线路)
|
||||||
} else {
|
} else {
|
||||||
@ -484,12 +490,13 @@ class Signal extends Group {
|
|||||||
createTransmission() {
|
createTransmission() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.style;
|
const style = this.style;
|
||||||
|
const computedPosition = this.computedPosition;
|
||||||
const drict = this.model.showRight ? 1 : -1; // 朝向 左:右
|
const drict = this.model.showRight ? 1 : -1; // 朝向 左:右
|
||||||
const posit = this.model.positionType == '01' ? -1 : 1; // 位置 上:下
|
const posit = this.model.positionType == '01' ? -1 : 1; // 位置 上:下
|
||||||
// 信号机名称
|
// 信号机名称
|
||||||
const actual = this.mapDevice[model.linkSignalCode];
|
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 sigNameX = computedPosition.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 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 textAlign = style.Signal.text.isAlignCenter ? 'middle' : this.model.showRight ? 'left' : 'right';
|
||||||
const textVerticalAlign = posit == 1 ? 'top' : 'bottom';
|
const textVerticalAlign = posit == 1 ? 'top' : 'bottom';
|
||||||
const fillColor = actual.virtual ? style.Signal.transmission.fillColorVirtual : style.Signal.transmission.fillColor;
|
const fillColor = actual.virtual ? style.Signal.transmission.fillColorVirtual : style.Signal.transmission.fillColor;
|
||||||
@ -509,15 +516,15 @@ class Signal extends Group {
|
|||||||
textVerticalAlign: textVerticalAlign
|
textVerticalAlign: textVerticalAlign
|
||||||
});
|
});
|
||||||
if (style.Signal.transmission) {
|
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({
|
this.transmission = new Polygon({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
shape: {
|
shape: {
|
||||||
points: [
|
points: [
|
||||||
[model.position.x + model.positionPoint.x, sigPostY + style.Signal.transmission.sideLength / 2],
|
[computedPosition.x + model.positionPoint.x, sigPostY + style.Signal.transmission.sideLength / 2],
|
||||||
[model.position.x + model.positionPoint.x, sigPostY - style.Signal.transmission.sideLength / 2],
|
[computedPosition.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 + drict * 0.866 * style.Signal.transmission.sideLength, sigPostY]
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
@ -547,7 +554,7 @@ class Signal extends Group {
|
|||||||
this.transformRotation(item);
|
this.transformRotation(item);
|
||||||
} else if (item) {
|
} else if (item) {
|
||||||
if (item._subType !== 'SignalName' || this.model.nameRotated) {
|
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.rotation = -Math.PI / 180 * Number(this.model.rotate);
|
||||||
item.dirty();
|
item.dirty();
|
||||||
}
|
}
|
||||||
@ -696,11 +703,11 @@ class Signal extends Group {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 双黄灯
|
// 双黄灯
|
||||||
doubleYellow() {
|
doubleYellow() {
|
||||||
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
|
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
|
||||||
this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.yellowColor);
|
this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.yellowColor);
|
||||||
}
|
}
|
||||||
redWhite() {
|
redWhite() {
|
||||||
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.whiteColor);
|
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.whiteColor);
|
||||||
this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.redColor);
|
this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.redColor);
|
||||||
}
|
}
|
||||||
@ -942,7 +949,7 @@ class Signal extends Group {
|
|||||||
recover() {
|
recover() {
|
||||||
this.sigName && this.sigName.show();
|
this.sigName && this.sigName.show();
|
||||||
this.sigName && this.sigName.setAnimationEnd();
|
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.setStyle({ textBorderWidth: 0 });
|
||||||
this.sigName.setColor(this.style.Signal.text.defaultColor);
|
this.sigName.setColor(this.style.Signal.text.defaultColor);
|
||||||
this.remainTimeName && this.remainTimeName.hide();
|
this.remainTimeName && this.remainTimeName.hide();
|
||||||
@ -1021,46 +1028,46 @@ class Signal extends Group {
|
|||||||
|
|
||||||
/** 设置灯的颜色 */
|
/** 设置灯的颜色 */
|
||||||
switch (model.aspect) {
|
switch (model.aspect) {
|
||||||
// 红
|
// 红
|
||||||
case 'R': {
|
case 'R': {
|
||||||
this.close(model.logicLight); // 信号关闭
|
this.close(model.logicLight); // 信号关闭
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// 绿
|
// 绿
|
||||||
case 'G': {
|
case 'G': {
|
||||||
this.openPositive(model.logicLight); // 信号正向开放
|
this.openPositive(model.logicLight); // 信号正向开放
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// 黄
|
// 黄
|
||||||
case 'Y': {
|
case 'Y': {
|
||||||
this.openLateral(model.logicLight); // 信号侧向开放
|
this.openLateral(model.logicLight); // 信号侧向开放
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// 红黄
|
// 红黄
|
||||||
case 'RY': {
|
case 'RY': {
|
||||||
this.guid(); // 引导信号显示
|
this.guid(); // 引导信号显示
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'W': {
|
case 'W': {
|
||||||
this.lampWhite();
|
this.lampWhite();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'B': {
|
case 'B': {
|
||||||
this.lampBlue();
|
this.lampBlue();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'YY': {
|
case 'YY': {
|
||||||
this.doubleYellow();
|
this.doubleYellow();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'RW': {
|
case 'RW': {
|
||||||
this.redWhite();
|
this.redWhite();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
this.close(model.logicLight); // 信号关闭
|
this.close(model.logicLight); // 信号关闭
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (model.remainTime) {
|
if (model.remainTime) {
|
||||||
@ -1285,8 +1292,8 @@ class Signal extends Group {
|
|||||||
}
|
}
|
||||||
getAnchorPoint() {
|
getAnchorPoint() {
|
||||||
return {
|
return {
|
||||||
x:this.model.position.x + this.model.positionPoint.x,
|
x:this.computedPosition.x + this.model.positionPoint.x,
|
||||||
y:this.model.position.y + this.model.positionPoint.y
|
y:this.computedPosition.y + this.model.positionPoint.y
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,12 @@ export default class SignalButton extends Group {
|
|||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
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.z = 0;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
@ -22,11 +28,12 @@ export default class SignalButton extends Group {
|
|||||||
|
|
||||||
create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
|
const computedPosition = this.computedPosition;
|
||||||
const fillColor = this.getTypeColor();
|
const fillColor = this.getTypeColor();
|
||||||
const queryList = window.location.search.substring(1).split('&');
|
const queryList = window.location.search.substring(1).split('&');
|
||||||
const queryCtc = queryList.find(item => {
|
const queryCtc = queryList.find(item => {
|
||||||
return item.includes('ctc');
|
return item.includes('ctc');
|
||||||
});
|
});
|
||||||
const ctcArcList = ['OCCLUSION', 'RECOVERY', 'CHANGE_DIRECTION', 'ACCIDENT', 'DEPART_ASSIST', 'PICK_ASSIST', 'ASSIST'];
|
const ctcArcList = ['OCCLUSION', 'RECOVERY', 'CHANGE_DIRECTION', 'ACCIDENT', 'DEPART_ASSIST', 'PICK_ASSIST', 'ASSIST'];
|
||||||
if (queryCtc && ctcArcList.includes(model.type)){
|
if (queryCtc && ctcArcList.includes(model.type)){
|
||||||
this.arcShape = new Arc({
|
this.arcShape = new Arc({
|
||||||
@ -108,10 +115,10 @@ export default class SignalButton extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z + 1,
|
z: this.z + 1,
|
||||||
shape: {
|
shape: {
|
||||||
x1: model.position.x + 1,
|
x1: computedPosition.x + 1,
|
||||||
y1: model.position.y + 1,
|
y1: computedPosition.y + 1,
|
||||||
x2: model.position.x + 13,
|
x2: computedPosition.x + 13,
|
||||||
y2: model.position.y + 13
|
y2: computedPosition.y + 13
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
lineWidth: 2,
|
lineWidth: 2,
|
||||||
@ -124,10 +131,10 @@ export default class SignalButton extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z + 1,
|
z: this.z + 1,
|
||||||
shape: {
|
shape: {
|
||||||
x1: model.position.x + 13,
|
x1: computedPosition.x + 13,
|
||||||
y1: model.position.y + 1,
|
y1: computedPosition.y + 1,
|
||||||
x2: model.position.x + 1,
|
x2: computedPosition.x + 1,
|
||||||
y2: model.position.y + 13
|
y2: computedPosition.y + 13
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
lineWidth: 2,
|
lineWidth: 2,
|
||||||
@ -140,10 +147,10 @@ export default class SignalButton extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z + 1,
|
z: this.z + 1,
|
||||||
shape: {
|
shape: {
|
||||||
x1: model.position.x - 1,
|
x1: computedPosition.x - 1,
|
||||||
y1: model.position.y - 1,
|
y1: computedPosition.y - 1,
|
||||||
x2: model.position.x - 1,
|
x2: computedPosition.x - 1,
|
||||||
y2: model.position.y + 15
|
y2: computedPosition.y + 15
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
lineWidth: 2,
|
lineWidth: 2,
|
||||||
@ -156,10 +163,10 @@ export default class SignalButton extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z + 1,
|
z: this.z + 1,
|
||||||
shape: {
|
shape: {
|
||||||
x1: model.position.x - 1,
|
x1: computedPosition.x - 1,
|
||||||
y1: model.position.y - 1,
|
y1: computedPosition.y - 1,
|
||||||
x2: model.position.x + 15,
|
x2: computedPosition.x + 15,
|
||||||
y2: model.position.y - 1
|
y2: computedPosition.y - 1
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
lineWidth: 2,
|
lineWidth: 2,
|
||||||
@ -172,10 +179,10 @@ export default class SignalButton extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z + 1,
|
z: this.z + 1,
|
||||||
shape: {
|
shape: {
|
||||||
x1: model.position.x + 15,
|
x1: computedPosition.x + 15,
|
||||||
y1: model.position.y - 1,
|
y1: computedPosition.y - 1,
|
||||||
x2: model.position.x + 15,
|
x2: computedPosition.x + 15,
|
||||||
y2: model.position.y + 15
|
y2: computedPosition.y + 15
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
lineWidth: 2,
|
lineWidth: 2,
|
||||||
@ -188,10 +195,10 @@ export default class SignalButton extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z + 1,
|
z: this.z + 1,
|
||||||
shape: {
|
shape: {
|
||||||
x1: model.position.x - 1,
|
x1: computedPosition.x - 1,
|
||||||
y1: model.position.y + 15,
|
y1: computedPosition.y + 15,
|
||||||
x2: model.position.x + 15,
|
x2: computedPosition.x + 15,
|
||||||
y2: model.position.y + 15
|
y2: computedPosition.y + 15
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
lineWidth: 2,
|
lineWidth: 2,
|
||||||
@ -206,8 +213,8 @@ export default class SignalButton extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
style: {
|
style: {
|
||||||
x: model.position.x + model.nameOffset.x,
|
x: computedPosition.x + model.nameOffset.x,
|
||||||
y: model.position.y + model.nameOffset.y,
|
y: computedPosition.y + model.nameOffset.y,
|
||||||
fontWeight: '400',
|
fontWeight: '400',
|
||||||
fontSize: 10,
|
fontSize: 10,
|
||||||
fontFamily: '',
|
fontFamily: '',
|
||||||
@ -256,7 +263,7 @@ export default class SignalButton extends Group {
|
|||||||
} else if (this.model.type === 'GUIDE') {
|
} else if (this.model.type === 'GUIDE') {
|
||||||
color = '#5050E1';
|
color = '#5050E1';
|
||||||
} else if (list.includes(this.model.type)) {
|
} else if (list.includes(this.model.type)) {
|
||||||
color = '#ccc';
|
color = '#ccc';
|
||||||
} else {
|
} else {
|
||||||
color = '#008000';
|
color = '#008000';
|
||||||
}
|
}
|
||||||
@ -265,11 +272,11 @@ export default class SignalButton extends Group {
|
|||||||
recover() {
|
recover() {
|
||||||
this.stopAnimation();
|
this.stopAnimation();
|
||||||
this.rectButton && this.rectButton.setStyle({ fill:this.getTypeColor() });
|
this.rectButton && this.rectButton.setStyle({ fill:this.getTypeColor() });
|
||||||
this.arcShape && this.arcShape.setStyle({ fill:this.getTypeColor() });
|
this.arcShape && this.arcShape.setStyle({ fill:this.getTypeColor() });
|
||||||
this.rightLine && this.rightLine.hide();
|
this.rightLine && this.rightLine.hide();
|
||||||
this.leftLine && this.leftLine.hide();
|
this.leftLine && this.leftLine.hide();
|
||||||
this.rectButton && this.rectButton.show();
|
this.rectButton && this.rectButton.show();
|
||||||
this.arcShape && this.arcShape.show();
|
this.arcShape && this.arcShape.show();
|
||||||
this.buttonText && this.buttonText.show();
|
this.buttonText && this.buttonText.show();
|
||||||
this.leftBoard && this.leftBoard.hide();
|
this.leftBoard && this.leftBoard.hide();
|
||||||
this.rightBoard && this.rightBoard.hide();
|
this.rightBoard && this.rightBoard.hide();
|
||||||
|
@ -11,6 +11,12 @@ export default class SplitStation extends Group {
|
|||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
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.model = model;
|
||||||
this.isBigScreen = false;
|
this.isBigScreen = false;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
@ -19,6 +25,7 @@ export default class SplitStation extends Group {
|
|||||||
create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.style;
|
const style = this.style;
|
||||||
|
const computedPosition = this.computedPosition;
|
||||||
if (!style.SplitStation) {
|
if (!style.SplitStation) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -26,10 +33,10 @@ export default class SplitStation extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
shape: {
|
shape: {
|
||||||
x1: model.position.x,
|
x1: computedPosition.x,
|
||||||
y1: model.position.y,
|
y1: computedPosition.y,
|
||||||
x2: model.position.x,
|
x2: computedPosition.x,
|
||||||
y2: model.position.y + style.SplitStation.height
|
y2: computedPosition.y + style.SplitStation.height
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
lineWidth: style.SplitStation.lineWidth,
|
lineWidth: style.SplitStation.lineWidth,
|
||||||
@ -41,17 +48,17 @@ export default class SplitStation extends Group {
|
|||||||
z: this.z,
|
z: this.z,
|
||||||
shape: {
|
shape: {
|
||||||
points: [
|
points: [
|
||||||
[model.position.x, model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2],
|
[computedPosition.x, computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2],
|
||||||
[model.position.x - style.SplitStation.horizontalDistance, model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance],
|
[computedPosition.x - style.SplitStation.horizontalDistance, computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance],
|
||||||
[model.position.x - style.SplitStation.horizontalDistance,
|
[computedPosition.x - style.SplitStation.horizontalDistance,
|
||||||
model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 - style.SplitStation.lineWidth / 2],
|
computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 - style.SplitStation.lineWidth / 2],
|
||||||
[model.position.x - style.SplitStation.horizontalDistance - style.SplitStation.lineLength,
|
[computedPosition.x - style.SplitStation.horizontalDistance - style.SplitStation.lineLength,
|
||||||
model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 - style.SplitStation.lineWidth / 2],
|
computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 - style.SplitStation.lineWidth / 2],
|
||||||
[model.position.x - style.SplitStation.horizontalDistance - style.SplitStation.lineLength,
|
[computedPosition.x - style.SplitStation.horizontalDistance - style.SplitStation.lineLength,
|
||||||
model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 + style.SplitStation.lineWidth / 2],
|
computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 + style.SplitStation.lineWidth / 2],
|
||||||
[model.position.x - style.SplitStation.horizontalDistance,
|
[computedPosition.x - style.SplitStation.horizontalDistance,
|
||||||
model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 + style.SplitStation.lineWidth / 2],
|
computedPosition.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 - style.SplitStation.horizontalDistance, computedPosition.y + style.SplitStation.height]
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
@ -63,17 +70,17 @@ export default class SplitStation extends Group {
|
|||||||
z: this.z,
|
z: this.z,
|
||||||
shape: {
|
shape: {
|
||||||
points: [
|
points: [
|
||||||
[model.position.x, model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2],
|
[computedPosition.x, computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2],
|
||||||
[model.position.x + style.SplitStation.horizontalDistance, model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance],
|
[computedPosition.x + style.SplitStation.horizontalDistance, computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance],
|
||||||
[model.position.x + style.SplitStation.horizontalDistance,
|
[computedPosition.x + style.SplitStation.horizontalDistance,
|
||||||
model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 - style.SplitStation.lineWidth / 2],
|
computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 - style.SplitStation.lineWidth / 2],
|
||||||
[model.position.x + style.SplitStation.horizontalDistance + style.SplitStation.lineLength,
|
[computedPosition.x + style.SplitStation.horizontalDistance + style.SplitStation.lineLength,
|
||||||
model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 - style.SplitStation.lineWidth / 2],
|
computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 - style.SplitStation.lineWidth / 2],
|
||||||
[model.position.x + style.SplitStation.horizontalDistance + style.SplitStation.lineLength,
|
[computedPosition.x + style.SplitStation.horizontalDistance + style.SplitStation.lineLength,
|
||||||
model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 + style.SplitStation.lineWidth / 2],
|
computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 + style.SplitStation.lineWidth / 2],
|
||||||
[model.position.x + style.SplitStation.horizontalDistance,
|
[computedPosition.x + style.SplitStation.horizontalDistance,
|
||||||
model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 + style.SplitStation.lineWidth / 2],
|
computedPosition.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 + style.SplitStation.horizontalDistance, computedPosition.y + style.SplitStation.height]
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
@ -85,7 +92,7 @@ export default class SplitStation extends Group {
|
|||||||
z: this.z,
|
z: this.z,
|
||||||
style: {
|
style: {
|
||||||
x: model.x,
|
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,
|
fontWeight: style.textStyle.fontWeight,
|
||||||
fontSize: style.SplitStation.fontSize,
|
fontSize: style.SplitStation.fontSize,
|
||||||
fontFamily: style.fontFamily,
|
fontFamily: style.fontFamily,
|
||||||
@ -99,8 +106,8 @@ export default class SplitStation extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
style: {
|
style: {
|
||||||
x: model.position.x + style.SplitStation.horizontalDistance + style.SplitStation.lineLength,
|
x: computedPosition.x + style.SplitStation.horizontalDistance + style.SplitStation.lineLength,
|
||||||
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,
|
fontWeight: style.textStyle.fontWeight,
|
||||||
fontSize: style.SplitStation.fontSize,
|
fontSize: style.SplitStation.fontSize,
|
||||||
fontFamily: style.fontFamily,
|
fontFamily: style.fontFamily,
|
||||||
@ -112,8 +119,8 @@ export default class SplitStation extends Group {
|
|||||||
});
|
});
|
||||||
const leftTextWidth = this.leftText.getBoundingRect().width;
|
const leftTextWidth = this.leftText.getBoundingRect().width;
|
||||||
const rightTextWidth = this.rightText.getBoundingRect().width;
|
const rightTextWidth = this.rightText.getBoundingRect().width;
|
||||||
this.leftText.setStyle('x', model.position.x - style.SplitStation.horizontalDistance - style.SplitStation.lineLength - leftTextWidth / 2);
|
this.leftText.setStyle('x', computedPosition.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.rightText.setStyle('x', computedPosition.x + style.SplitStation.horizontalDistance + style.SplitStation.lineLength + rightTextWidth / 2);
|
||||||
this.add(this.verticalLine);
|
this.add(this.verticalLine);
|
||||||
this.add(this.arrowLeft);
|
this.add(this.arrowLeft);
|
||||||
this.add(this.arrowRight);
|
this.add(this.arrowRight);
|
||||||
@ -145,6 +152,6 @@ export default class SplitStation extends Group {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
getAnchorPoint() {
|
getAnchorPoint() {
|
||||||
return this.model.position;
|
return this.computedPosition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ export default class EMouse extends Group {
|
|||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: 0,
|
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,
|
fontWeight: this.device.style.Station.StationControl.mouseOverStyle.fontWeight,
|
||||||
fontSize: this.device.style.Station.StationControl.mouseOverStyle.fontSize,
|
fontSize: this.device.style.Station.StationControl.mouseOverStyle.fontSize,
|
||||||
fontFamily: this.device.style.fontFamily,
|
fontFamily: this.device.style.fontFamily,
|
||||||
@ -32,7 +32,7 @@ export default class EMouse extends Group {
|
|||||||
if (e.target &&
|
if (e.target &&
|
||||||
e.target.type == 'text' &&
|
e.target.type == 'text' &&
|
||||||
e.target._subType == 'ControlSignal') {
|
e.target._subType == 'ControlSignal') {
|
||||||
this.text.setStyle({x: e.target.style.x});
|
this.text.setStyle({x: e.target.style.x});
|
||||||
this.text.show();
|
this.text.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,8 @@ class EStationText extends Group {
|
|||||||
z: this.model.z,
|
z: this.model.z,
|
||||||
silent: !model.visible || false,
|
silent: !model.visible || false,
|
||||||
style: {
|
style: {
|
||||||
x: model.position.x,
|
x: model.computedPosition.x,
|
||||||
y: model.position.y,
|
y: model.computedPosition.y,
|
||||||
fontWeight: style.Station.stationText.fontWeight,
|
fontWeight: style.Station.stationText.fontWeight,
|
||||||
fontSize: isNaN(Number(model.nameFont)) ? 20 : Number(model.nameFont),
|
fontSize: isNaN(Number(model.nameFont)) ? 20 : Number(model.nameFont),
|
||||||
fontFamily: style.fontFamily,
|
fontFamily: style.fontFamily,
|
||||||
|
@ -42,41 +42,41 @@ export default class EThreeLamp extends Group {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.control2 = new Arc({
|
this.control2 = new Arc({
|
||||||
pop: model.pop,
|
pop: model.pop,
|
||||||
_subType: _subType,
|
_subType: _subType,
|
||||||
_nameType: _nameType,
|
_nameType: _nameType,
|
||||||
_val: _val,
|
_val: _val,
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
shape: {
|
shape: {
|
||||||
cx: model.point.x,
|
cx: model.point.x,
|
||||||
cy: model.point.y,
|
cy: model.point.y,
|
||||||
r: model.style.Station.StationControl.lamp.radiusR
|
r: model.style.Station.StationControl.lamp.radiusR
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
lineWidth: model.style.Station.StationControl.lamp.lineWidth || 0,
|
lineWidth: model.style.Station.StationControl.lamp.lineWidth || 0,
|
||||||
fill: model.style.Station.StationControl.lamp.grayColor,
|
fill: model.style.Station.StationControl.lamp.grayColor,
|
||||||
stroke: model.style.Station.StationControl.lamp.strokeColor
|
stroke: model.style.Station.StationControl.lamp.strokeColor
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.control3 = new Arc({
|
this.control3 = new Arc({
|
||||||
pop: model.pop,
|
pop: model.pop,
|
||||||
_subType: _subType,
|
_subType: _subType,
|
||||||
_nameType: _nameType,
|
_nameType: _nameType,
|
||||||
_val: _val,
|
_val: _val,
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
shape: {
|
shape: {
|
||||||
cx: model.point.x + model.style.Station.StationControl.lamp.radiusR * 3,
|
cx: model.point.x + model.style.Station.StationControl.lamp.radiusR * 3,
|
||||||
cy: model.point.y,
|
cy: model.point.y,
|
||||||
r: model.style.Station.StationControl.lamp.radiusR
|
r: model.style.Station.StationControl.lamp.radiusR
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
lineWidth: model.style.Station.StationControl.lamp.lineWidth || 0,
|
lineWidth: model.style.Station.StationControl.lamp.lineWidth || 0,
|
||||||
fill: model.style.Station.StationControl.lamp.grayColor,
|
fill: model.style.Station.StationControl.lamp.grayColor,
|
||||||
stroke: model.style.Station.StationControl.lamp.strokeColor
|
stroke: model.style.Station.StationControl.lamp.strokeColor
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.text = new Text({
|
this.text = new Text({
|
||||||
pop: model.pop,
|
pop: model.pop,
|
||||||
|
@ -25,6 +25,18 @@ export default class Station extends Group {
|
|||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
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.z = 40;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
@ -44,11 +56,12 @@ export default class Station extends Group {
|
|||||||
const elementTypeList = {
|
const elementTypeList = {
|
||||||
'stationText': EStationText // 车站名称 (普通站台样式)
|
'stationText': EStationText // 车站名称 (普通站台样式)
|
||||||
};
|
};
|
||||||
|
model.computedPosition = this.computedPosition;
|
||||||
// 遍历当前线路下的绘图元素 组合模式
|
// 遍历当前线路下的绘图元素 组合模式
|
||||||
traverseLineElements(style.Station, elementTypeList, model, style, this);
|
traverseLineElements(style.Station, elementTypeList, model, style, this);
|
||||||
|
|
||||||
const path = window.location.href;
|
const path = window.location.href;
|
||||||
|
const computedPosition = this.computedPosition;
|
||||||
if (style.Station.kmPostShow || path.includes('/map/draw')) { // 公里标是否显示
|
if (style.Station.kmPostShow || path.includes('/map/draw')) { // 公里标是否显示
|
||||||
let direction = 1;
|
let direction = 1;
|
||||||
if (this.style.Station.kilometerPosition == 'up') {
|
if (this.style.Station.kilometerPosition == 'up') {
|
||||||
@ -63,8 +76,8 @@ export default class Station extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
x: model.position.x + offset.x,
|
x: computedPosition.x + offset.x,
|
||||||
y: model.position.y + ((parseInt(model.nameFont) + 2) * direction) + offset.y,
|
y: computedPosition.y + ((parseInt(model.nameFont) + 2) * direction) + offset.y,
|
||||||
fontWeight: model.fontWeight,
|
fontWeight: model.fontWeight,
|
||||||
fontSize: model.kmPostFont || 18,
|
fontSize: model.kmPostFont || 18,
|
||||||
fontFamily: style.fontFamily,
|
fontFamily: style.fontFamily,
|
||||||
@ -87,6 +100,7 @@ export default class Station extends Group {
|
|||||||
}
|
}
|
||||||
createTurnBack() { // 创建按图折返
|
createTurnBack() { // 创建按图折返
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
|
const computedTurnBackPoint = this.computedTurnBackPoint;
|
||||||
const style = this.style;
|
const style = this.style;
|
||||||
if (model.visible && model.createTurnBack) {
|
if (model.visible && model.createTurnBack) {
|
||||||
this.turnBacks = [];
|
this.turnBacks = [];
|
||||||
@ -96,8 +110,8 @@ export default class Station extends Group {
|
|||||||
z: this.z,
|
z: this.z,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: model.turnBackPoint.x,
|
x: computedTurnBackPoint.x,
|
||||||
y: model.turnBackPoint.y - style.Station.lamp.radiusR - style.Station.turnBack.toptextDistance,
|
y: computedTurnBackPoint.y - style.Station.lamp.radiusR - style.Station.turnBack.toptextDistance,
|
||||||
fontWeight: style.Station.text.fontWeight,
|
fontWeight: style.Station.text.fontWeight,
|
||||||
fontSize: style.Station.text.fontSize,
|
fontSize: style.Station.text.fontSize,
|
||||||
fontFamily: style.fontFamily,
|
fontFamily: style.fontFamily,
|
||||||
@ -115,8 +129,8 @@ export default class Station extends Group {
|
|||||||
z: this.z,
|
z: this.z,
|
||||||
arc: {
|
arc: {
|
||||||
shape: {
|
shape: {
|
||||||
cx: model.turnBackPoint.x + style.Station.turnBack.lampSpace * index,
|
cx: computedTurnBackPoint.x + style.Station.turnBack.lampSpace * index,
|
||||||
cy: model.turnBackPoint.y,
|
cy: computedTurnBackPoint.y,
|
||||||
r: style.Station.lamp.radiusR
|
r: style.Station.lamp.radiusR
|
||||||
},
|
},
|
||||||
lineWidth: 0,
|
lineWidth: 0,
|
||||||
@ -125,8 +139,8 @@ export default class Station extends Group {
|
|||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
x: model.turnBackPoint.x + style.Station.turnBack.lampSpace * index,
|
x: computedTurnBackPoint.x + style.Station.turnBack.lampSpace * index,
|
||||||
y: model.turnBackPoint.y + style.Station.lamp.radiusR + style.Station.StationControl.text.distance,
|
y: computedTurnBackPoint.y + style.Station.lamp.radiusR + style.Station.StationControl.text.distance,
|
||||||
fontWeight: style.Station.text.fontWeight,
|
fontWeight: style.Station.text.fontWeight,
|
||||||
fontSize: style.Station.text.fontSize,
|
fontSize: style.Station.text.fontSize,
|
||||||
fontFamily: style.fontFamily,
|
fontFamily: style.fontFamily,
|
||||||
@ -176,8 +190,9 @@ export default class Station extends Group {
|
|||||||
this.setState(model);
|
this.setState(model);
|
||||||
}
|
}
|
||||||
createCtcControlMode() { // 大铁
|
createCtcControlMode() { // 大铁
|
||||||
// 非常站控
|
// 非常站控
|
||||||
const model = this.model;
|
// const model = this.model;
|
||||||
|
const computedControlModePoint = this.computedControlModePoint;
|
||||||
// 分散自律
|
// 分散自律
|
||||||
this.selfDisciplineThree = new EThreeLamp({
|
this.selfDisciplineThree = new EThreeLamp({
|
||||||
_subType: 'veryControl',
|
_subType: 'veryControl',
|
||||||
@ -185,8 +200,8 @@ export default class Station extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.selfDisciplineThree.offset.x,
|
x: computedControlModePoint.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
|
y: computedControlModePoint.y + this.style.Station.StationControl.selfDisciplineThree.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.selfDisciplineThree.text,
|
context: this.style.Station.StationControl.selfDisciplineThree.text,
|
||||||
pop: false
|
pop: false
|
||||||
@ -199,8 +214,8 @@ export default class Station extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.veryControl.offset.x,
|
x: computedControlModePoint.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
|
y: computedControlModePoint.y + this.style.Station.StationControl.veryControl.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.veryControl.text,
|
context: this.style.Station.StationControl.veryControl.text,
|
||||||
pop: false
|
pop: false
|
||||||
@ -213,8 +228,8 @@ export default class Station extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.graphRoad.offset.x,
|
x: computedControlModePoint.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
|
y: computedControlModePoint.y + this.style.Station.StationControl.graphRoad.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.graphRoad.text,
|
context: this.style.Station.StationControl.graphRoad.text,
|
||||||
pop: false
|
pop: false
|
||||||
@ -227,8 +242,8 @@ export default class Station extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.planControl.offset.x,
|
x: computedControlModePoint.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
|
y: computedControlModePoint.y + this.style.Station.StationControl.planControl.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.planControl.text,
|
context: this.style.Station.StationControl.planControl.text,
|
||||||
pop: false
|
pop: false
|
||||||
@ -241,8 +256,8 @@ export default class Station extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.centerCommunication.offset.x,
|
x: computedControlModePoint.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
|
y: computedControlModePoint.y + this.style.Station.StationControl.centerCommunication.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.centerCommunication.text,
|
context: this.style.Station.StationControl.centerCommunication.text,
|
||||||
pop: false
|
pop: false
|
||||||
@ -255,8 +270,8 @@ export default class Station extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.selfDisciplineCommunication.offset.x,
|
x: computedControlModePoint.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
|
y: computedControlModePoint.y + this.style.Station.StationControl.selfDisciplineCommunication.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.selfDisciplineCommunication.text,
|
context: this.style.Station.StationControl.selfDisciplineCommunication.text,
|
||||||
pop: false
|
pop: false
|
||||||
@ -269,8 +284,8 @@ export default class Station extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.allowedTurnBack.offset.x,
|
x: computedControlModePoint.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
|
y: computedControlModePoint.y + this.style.Station.StationControl.allowedTurnBack.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.allowedTurnBack.text,
|
context: this.style.Station.StationControl.allowedTurnBack.text,
|
||||||
pop: false
|
pop: false
|
||||||
@ -283,8 +298,8 @@ export default class Station extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.trainControl.offset.x,
|
x: computedControlModePoint.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
|
y: computedControlModePoint.y + this.style.Station.StationControl.trainControl.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.trainControl.text,
|
context: this.style.Station.StationControl.trainControl.text,
|
||||||
pop: false
|
pop: false
|
||||||
@ -292,13 +307,14 @@ export default class Station extends Group {
|
|||||||
this.add(this.trainControl);
|
this.add(this.trainControl);
|
||||||
}
|
}
|
||||||
createControlModeAU() { // 西安二
|
createControlModeAU() { // 西安二
|
||||||
const model = this.model;
|
// const model = this.model;
|
||||||
|
const computedControlModePoint = this.computedControlModePoint;
|
||||||
this.stationControlAU = new Text({
|
this.stationControlAU = new Text({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
style: {
|
style: {
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.text.offsetX * -1,
|
x: computedControlModePoint.x + this.style.Station.StationControl.text.offsetX * -1,
|
||||||
y: model.controlModePoint.y + this.style.Station.StationControl.text.offsetY,
|
y: computedControlModePoint.y + this.style.Station.StationControl.text.offsetY,
|
||||||
fontWeight: this.style.Station.StationControl.text.fontWeight,
|
fontWeight: this.style.Station.StationControl.text.fontWeight,
|
||||||
fontSize: this.style.Station.StationControl.text.fontSize,
|
fontSize: this.style.Station.StationControl.text.fontSize,
|
||||||
fontFamily: this.style.fontFamily,
|
fontFamily: this.style.fontFamily,
|
||||||
@ -311,15 +327,16 @@ export default class Station extends Group {
|
|||||||
this.add(this.stationControlAU);
|
this.add(this.stationControlAU);
|
||||||
}
|
}
|
||||||
createTroButton() {
|
createTroButton() {
|
||||||
const model = this.model;
|
// const model = this.model;
|
||||||
|
const computedPosition = this.computedPosition;
|
||||||
const rect = this.stationText.getBoundingRect();
|
const rect = this.stationText.getBoundingRect();
|
||||||
this.troButton = new Rect({
|
this.troButton = new Rect({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
_subType: 'troButton',
|
_subType: 'troButton',
|
||||||
shape: {
|
shape: {
|
||||||
x: model.position.x + rect.width / 2 + 5,
|
x: computedPosition.x + rect.width / 2 + 5,
|
||||||
y: model.position.y,
|
y: computedPosition.y,
|
||||||
width: 25,
|
width: 25,
|
||||||
height: 25
|
height: 25
|
||||||
},
|
},
|
||||||
@ -332,13 +349,14 @@ export default class Station extends Group {
|
|||||||
this.add(this.troButton);
|
this.add(this.troButton);
|
||||||
}
|
}
|
||||||
createControlModeCC() { // 西安二
|
createControlModeCC() { // 西安二
|
||||||
const model = this.model;
|
// const model = this.model;
|
||||||
|
const computedControlModePoint = this.computedControlModePoint;
|
||||||
this.stationControlCC = new Text({
|
this.stationControlCC = new Text({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
style: {
|
style: {
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.text.offsetX * 0,
|
x: computedControlModePoint.x + this.style.Station.StationControl.text.offsetX * 0,
|
||||||
y: model.controlModePoint.y + this.style.Station.StationControl.text.offsetY,
|
y: computedControlModePoint.y + this.style.Station.StationControl.text.offsetY,
|
||||||
fontWeight: this.style.Station.StationControl.text.fontWeight,
|
fontWeight: this.style.Station.StationControl.text.fontWeight,
|
||||||
fontSize: this.style.Station.StationControl.text.fontSize,
|
fontSize: this.style.Station.StationControl.text.fontSize,
|
||||||
fontFamily: this.style.fontFamily,
|
fontFamily: this.style.fontFamily,
|
||||||
@ -352,13 +370,14 @@ export default class Station extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
createControlModeCL() { // 西安二
|
createControlModeCL() { // 西安二
|
||||||
const model = this.model;
|
// const model = this.model;
|
||||||
|
const computedControlModePoint = this.computedControlModePoint;
|
||||||
this.stationControlCL = new Text({
|
this.stationControlCL = new Text({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
style: {
|
style: {
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.text.offsetX * 1,
|
x: computedControlModePoint.x + this.style.Station.StationControl.text.offsetX * 1,
|
||||||
y: model.controlModePoint.y + this.style.Station.StationControl.text.offsetY,
|
y: computedControlModePoint.y + this.style.Station.StationControl.text.offsetY,
|
||||||
fontWeight: this.style.Station.StationControl.text.fontWeight,
|
fontWeight: this.style.Station.StationControl.text.fontWeight,
|
||||||
fontSize: this.style.Station.StationControl.text.fontSize,
|
fontSize: this.style.Station.StationControl.text.fontSize,
|
||||||
fontFamily: this.style.fontFamily,
|
fontFamily: this.style.fontFamily,
|
||||||
@ -372,13 +391,14 @@ export default class Station extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
createControlModeVA() { // 西安二
|
createControlModeVA() { // 西安二
|
||||||
const model = this.model;
|
// const model = this.model;
|
||||||
|
const computedControlModePoint = this.computedControlModePoint;
|
||||||
this.stationControlVA = new Text({
|
this.stationControlVA = new Text({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
style: {
|
style: {
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.text.offsetX * 2,
|
x: computedControlModePoint.x + this.style.Station.StationControl.text.offsetX * 2,
|
||||||
y: model.controlModePoint.y + this.style.Station.StationControl.text.offsetY,
|
y: computedControlModePoint.y + this.style.Station.StationControl.text.offsetY,
|
||||||
fontWeight: this.style.Station.StationControl.text.fontWeight,
|
fontWeight: this.style.Station.StationControl.text.fontWeight,
|
||||||
fontSize: this.style.Station.StationControl.text.fontSize,
|
fontSize: this.style.Station.StationControl.text.fontSize,
|
||||||
fontFamily: this.style.fontFamily,
|
fontFamily: this.style.fontFamily,
|
||||||
@ -392,7 +412,8 @@ export default class Station extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
createEmergencyControl() { // 紧急站控
|
createEmergencyControl() { // 紧急站控
|
||||||
const model = this.model;
|
// const model = this.model;
|
||||||
|
const computedControlModePoint = this.computedControlModePoint;
|
||||||
if (this.style.Station.StationControl.emergencyControl.show) {
|
if (this.style.Station.StationControl.emergencyControl.show) {
|
||||||
this.emergencyControl = new ESingleControl({
|
this.emergencyControl = new ESingleControl({
|
||||||
_subType: 'emergency',
|
_subType: 'emergency',
|
||||||
@ -400,16 +421,16 @@ export default class Station extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.emergencyControl.offset.x,
|
x: computedControlModePoint.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
|
y: computedControlModePoint.y + this.style.Station.StationControl.emergencyControl.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.emergencyControl.text,
|
context: this.style.Station.StationControl.emergencyControl.text,
|
||||||
pop: false
|
pop: false
|
||||||
});
|
});
|
||||||
this.add(this.emergencyControl);
|
this.add(this.emergencyControl);
|
||||||
if (this.style.Station.StationControl.emergencyControl.arrowShow) {
|
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 x = computedControlModePoint.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 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);
|
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({
|
this.emergencyArrowsControl = new EArrow({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
@ -418,8 +439,8 @@ export default class Station extends Group {
|
|||||||
count: this.count,
|
count: this.count,
|
||||||
drict: 1,
|
drict: 1,
|
||||||
point: point,
|
point: point,
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.offset.x,
|
x: computedControlModePoint.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,
|
y: computedControlModePoint.y + this.style.Station.StationControl.lamp.radiusR / 2 + this.style.Station.StationControl.lamp.offset.y,
|
||||||
fill: this.style.Station.StationControl.emergencyControl.grayColor,
|
fill: this.style.Station.StationControl.emergencyControl.grayColor,
|
||||||
lineWidth: 1,
|
lineWidth: 1,
|
||||||
stroke: this.style.sidelineColor
|
stroke: this.style.sidelineColor
|
||||||
@ -429,63 +450,65 @@ export default class Station extends Group {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
createSelfDiscipline() {
|
createSelfDiscipline() {
|
||||||
const model = this.model;
|
// const model = this.model;
|
||||||
if (this.style.Station.StationControl.selfDiscipline) {
|
const computedControlModePoint = this.computedControlModePoint;
|
||||||
this.selfDiscipline = new ESingleControl({
|
if (this.style.Station.StationControl.selfDiscipline) {
|
||||||
|
this.selfDiscipline = new ESingleControl({
|
||||||
_subType: 'self_discipline',
|
_subType: 'self_discipline',
|
||||||
style: this.style,
|
style: this.style,
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.selfDiscipline.offset.x,
|
x: computedControlModePoint.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
|
y: computedControlModePoint.y + this.style.Station.StationControl.selfDiscipline.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.selfDiscipline.text,
|
context: this.style.Station.StationControl.selfDiscipline.text,
|
||||||
pop: false
|
pop: false
|
||||||
});
|
});
|
||||||
this.add(this.selfDiscipline);
|
this.add(this.selfDiscipline);
|
||||||
}
|
}
|
||||||
if (this.style.Station.StationControl.selfDisciplineControl) {
|
if (this.style.Station.StationControl.selfDisciplineControl) {
|
||||||
this.selfDisciplineControl = new ESingleControl({
|
this.selfDisciplineControl = new ESingleControl({
|
||||||
_subType: 'self_discipline_control',
|
_subType: 'self_discipline_control',
|
||||||
style: this.style,
|
style: this.style,
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.selfDisciplineControl.offset.x,
|
x: computedControlModePoint.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
|
y: computedControlModePoint.y + this.style.Station.StationControl.selfDisciplineControl.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.selfDisciplineControl.text,
|
context: this.style.Station.StationControl.selfDisciplineControl.text,
|
||||||
pop: false
|
pop: false
|
||||||
});
|
});
|
||||||
this.add(this.selfDisciplineControl);
|
this.add(this.selfDisciplineControl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
createVeryControl() {
|
createVeryControl() {
|
||||||
const model = this.model;
|
// const model = this.model;
|
||||||
if (this.style.Station.StationControl.veryControl) {
|
const computedControlModePoint = this.computedControlModePoint;
|
||||||
this.veryControl = new ESingleControl({
|
if (this.style.Station.StationControl.veryControl) {
|
||||||
|
this.veryControl = new ESingleControl({
|
||||||
_subType: 'very',
|
_subType: 'very',
|
||||||
style: this.style,
|
style: this.style,
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.veryControl.offset.x,
|
x: computedControlModePoint.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
|
y: computedControlModePoint.y + this.style.Station.StationControl.centerControl.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.veryControl.text,
|
context: this.style.Station.StationControl.veryControl.text,
|
||||||
pop: false
|
pop: false
|
||||||
});
|
});
|
||||||
this.add(this.veryControl);
|
this.add(this.veryControl);
|
||||||
}
|
}
|
||||||
if (this.style.Station.StationControl.veryControlButton) {
|
if (this.style.Station.StationControl.veryControlButton) {
|
||||||
this.veryControlButton = new Rect({
|
this.veryControlButton = new Rect({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
_subType: 'veryControlButton',
|
_subType: 'veryControlButton',
|
||||||
shape: {
|
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,
|
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: model.controlModePoint.y + this.style.Station.StationControl.veryControlButton.offset.y - 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,
|
width: this.style.Station.StationControl.lamp.radiusR * 2,
|
||||||
height: this.style.Station.StationControl.lamp.radiusR * 2
|
height: this.style.Station.StationControl.lamp.radiusR * 2
|
||||||
},
|
},
|
||||||
@ -495,15 +518,15 @@ export default class Station extends Group {
|
|||||||
fill: this.style.Station.StationControl.veryControlButton.defaultColor
|
fill: this.style.Station.StationControl.veryControlButton.defaultColor
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.add(this.veryControlButton);
|
this.add(this.veryControlButton);
|
||||||
this.veryControlButtonText = new Text({
|
this.veryControlButtonText = new Text({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
_subType: 'veryControlButtonText',
|
_subType: 'veryControlButtonText',
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.veryControlButton.offset.y,
|
x: computedControlModePoint.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,
|
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,
|
fontWeight: this.style.Station.StationControl.text.fontWeight,
|
||||||
fontSize: this.style.Station.StationControl.text.fontSize,
|
fontSize: this.style.Station.StationControl.text.fontSize,
|
||||||
fontFamily: this.style.fontFamily,
|
fontFamily: this.style.fontFamily,
|
||||||
@ -514,11 +537,12 @@ export default class Station extends Group {
|
|||||||
},
|
},
|
||||||
pop: false
|
pop: false
|
||||||
});
|
});
|
||||||
this.add(this.veryControlButtonText);
|
this.add(this.veryControlButtonText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
createCenterControl() { // 中控按钮
|
createCenterControl() { // 中控按钮
|
||||||
const model = this.model;
|
// const model = this.model;
|
||||||
|
const computedControlModePoint = this.computedControlModePoint;
|
||||||
if (this.style.Station.StationControl.centerControl.show) {
|
if (this.style.Station.StationControl.centerControl.show) {
|
||||||
this.centerControl = new ESingleControl({
|
this.centerControl = new ESingleControl({
|
||||||
_subType: 'center',
|
_subType: 'center',
|
||||||
@ -526,16 +550,16 @@ export default class Station extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.centerControl.offset.x,
|
x: computedControlModePoint.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
|
y: computedControlModePoint.y + this.style.Station.StationControl.centerControl.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.centerControl.text,
|
context: this.style.Station.StationControl.centerControl.text,
|
||||||
pop: false
|
pop: false
|
||||||
});
|
});
|
||||||
this.add(this.centerControl);
|
this.add(this.centerControl);
|
||||||
if (this.style.Station.StationControl.centerControl.arrowShow) {
|
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 x = computedControlModePoint.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 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);
|
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({
|
this.centerArrowsControl = new EArrow({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
@ -544,8 +568,8 @@ export default class Station extends Group {
|
|||||||
count: this.count,
|
count: this.count,
|
||||||
drict: 1,
|
drict: 1,
|
||||||
point: point,
|
point: point,
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.offset.x,
|
x: computedControlModePoint.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,
|
y: computedControlModePoint.y + this.style.Station.StationControl.lamp.radiusR / 2 + this.style.Station.StationControl.lamp.offset.y,
|
||||||
fill: this.style.Station.StationControl.centerControl.grayColor,
|
fill: this.style.Station.StationControl.centerControl.grayColor,
|
||||||
lineWidth: 1,
|
lineWidth: 1,
|
||||||
stroke: this.style.sidelineColor
|
stroke: this.style.sidelineColor
|
||||||
@ -561,8 +585,8 @@ export default class Station extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z + 1,
|
z: this.z + 1,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.lamp.offset.x,
|
x: computedControlModePoint.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
|
y: computedControlModePoint.y + this.style.Station.StationControl.lamp.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.centerControl.buttonText,
|
context: this.style.Station.StationControl.centerControl.buttonText,
|
||||||
pop: false
|
pop: false
|
||||||
@ -589,8 +613,8 @@ export default class Station extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z + 1,
|
z: this.z + 1,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 9 / 2 + this.style.Station.StationControl.lamp.offset.x,
|
x: computedControlModePoint.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
|
y: computedControlModePoint.y + this.style.Station.StationControl.lamp.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.centerControl.lightText,
|
context: this.style.Station.StationControl.centerControl.lightText,
|
||||||
pop: false
|
pop: false
|
||||||
@ -617,8 +641,8 @@ export default class Station extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z + 1,
|
z: this.z + 1,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 + this.style.Station.StationControl.lamp.offset.x,
|
x: computedControlModePoint.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
|
y: computedControlModePoint.y + this.style.Station.StationControl.lamp.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.centerControl.preResetText,
|
context: this.style.Station.StationControl.centerControl.preResetText,
|
||||||
pop: false
|
pop: false
|
||||||
@ -641,7 +665,8 @@ export default class Station extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
createSubstationControl() { // 站控按钮
|
createSubstationControl() { // 站控按钮
|
||||||
const model = this.model;
|
// const model = this.model;
|
||||||
|
const computedControlModePoint = this.computedControlModePoint;
|
||||||
if (this.style.Station.StationControl.substationControl.show) {
|
if (this.style.Station.StationControl.substationControl.show) {
|
||||||
this.substationControl = new ESingleControl({
|
this.substationControl = new ESingleControl({
|
||||||
_subType: 'substation',
|
_subType: 'substation',
|
||||||
@ -649,16 +674,16 @@ export default class Station extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.substationControl.offset.x,
|
x: computedControlModePoint.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
|
y: computedControlModePoint.y + this.style.Station.StationControl.substationControl.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.substationControl.text,
|
context: this.style.Station.StationControl.substationControl.text,
|
||||||
pop: false
|
pop: false
|
||||||
});
|
});
|
||||||
this.add(this.substationControl);
|
this.add(this.substationControl);
|
||||||
if (this.style.Station.StationControl.substationControl.arrowShow) {
|
if (this.style.Station.StationControl.substationControl.arrowShow) {
|
||||||
const x = this.model.controlModePoint.x + this.style.Station.StationControl.substationControl.offset.x;
|
const x = computedControlModePoint.x + this.style.Station.StationControl.substationControl.offset.x;
|
||||||
const y = this.model.controlModePoint.y + this.style.Station.StationControl.substationControl.offset.y;
|
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);
|
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({
|
this.substationArrowsControl = new EArrow({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
@ -667,8 +692,8 @@ export default class Station extends Group {
|
|||||||
count: this.count,
|
count: this.count,
|
||||||
drict: 1,
|
drict: 1,
|
||||||
point: point,
|
point: point,
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.offset.x,
|
x: computedControlModePoint.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,
|
y: computedControlModePoint.y + this.style.Station.StationControl.lamp.radiusR / 2 + this.style.Station.StationControl.lamp.offset.y,
|
||||||
fill: this.style.Station.StationControl.substationControl.grayColor,
|
fill: this.style.Station.StationControl.substationControl.grayColor,
|
||||||
lineWidth: 1,
|
lineWidth: 1,
|
||||||
stroke: this.style.sidelineColor
|
stroke: this.style.sidelineColor
|
||||||
@ -679,7 +704,8 @@ export default class Station extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
createInterconnectedControl() { // 联锁控
|
createInterconnectedControl() { // 联锁控
|
||||||
const model = this.model;
|
// const model = this.model;
|
||||||
|
const computedControlModePoint = this.computedControlModePoint;
|
||||||
if (this.style.Station.StationControl.interconnectedControl.show) { // 成都三会显示
|
if (this.style.Station.StationControl.interconnectedControl.show) { // 成都三会显示
|
||||||
this.interconnectedControl = new ESingleControl({
|
this.interconnectedControl = new ESingleControl({
|
||||||
_subType: 'interconnected',
|
_subType: 'interconnected',
|
||||||
@ -687,8 +713,8 @@ export default class Station extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.interconnectedControl.offset.x,
|
x: computedControlModePoint.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
|
y: computedControlModePoint.y + this.style.Station.StationControl.interconnectedControl.offset.y
|
||||||
},
|
},
|
||||||
context: this.style.Station.StationControl.interconnectedControl.text || '联锁控',
|
context: this.style.Station.StationControl.interconnectedControl.text || '联锁控',
|
||||||
pop: false
|
pop: false
|
||||||
@ -821,7 +847,7 @@ export default class Station extends Group {
|
|||||||
} else if (!store.getters['map/checkDeviceShow'](this._code)) {
|
} else if (!store.getters['map/checkDeviceShow'](this._code)) {
|
||||||
this.eachChild(item => { item.hide(); });
|
this.eachChild(item => { item.hide(); });
|
||||||
} else {
|
} else {
|
||||||
store.getters['map/checkStationGuideMaster'](this._code, model.sguideMasterLock, model.xguideMasterLock);
|
store.getters['map/checkStationGuideMaster'](this._code, model.sguideMasterLock, model.xguideMasterLock);
|
||||||
model.controlMode && this['handle' + model.controlMode]();
|
model.controlMode && this['handle' + model.controlMode]();
|
||||||
model.preResetValidDuration && this.handlePreResetLamp();
|
model.preResetValidDuration && this.handlePreResetLamp();
|
||||||
model.controller && this.handleComplexControl(model.controller);
|
model.controller && this.handleComplexControl(model.controller);
|
||||||
@ -1003,6 +1029,6 @@ export default class Station extends Group {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
getAnchorPoint() {
|
getAnchorPoint() {
|
||||||
return this.model.position;
|
return this.computedPosition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,12 @@ export default class StationCounter extends Group {
|
|||||||
super();
|
super();
|
||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
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.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.zlevel = model.zlevel;
|
this.zlevel = model.zlevel;
|
||||||
@ -21,14 +27,15 @@ export default class StationCounter extends Group {
|
|||||||
|
|
||||||
create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
|
const computedPosition = this.computedPosition;
|
||||||
const style = this.style;
|
const style = this.style;
|
||||||
this.counter = new Text({
|
this.counter = new Text({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: model.position.x,
|
x: computedPosition.x,
|
||||||
y: model.position.y,
|
y: computedPosition.y,
|
||||||
fontWeight: 'normal',
|
fontWeight: 'normal',
|
||||||
fontSize: style.textFontSize,
|
fontSize: style.textFontSize,
|
||||||
fontFamily: style.fontFamily,
|
fontFamily: style.fontFamily,
|
||||||
@ -64,8 +71,8 @@ export default class StationCounter extends Group {
|
|||||||
z: this.z,
|
z: this.z,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: model.position.x,
|
x: computedPosition.x,
|
||||||
y: model.position.y + this.rect.width + this.vPadding + style.textFontSize + style.StationCounter.text.distance,
|
y: computedPosition.y + this.rect.width + this.vPadding + style.textFontSize + style.StationCounter.text.distance,
|
||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
fontSize: style.textFontSize,
|
fontSize: style.textFontSize,
|
||||||
fontFamily: style.fontFamily,
|
fontFamily: style.fontFamily,
|
||||||
@ -99,7 +106,7 @@ export default class StationCounter extends Group {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
getAnchorPoint() {
|
getAnchorPoint() {
|
||||||
return this.model.position;
|
return this.computedPosition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,12 @@ export default class StationDelayUnlock extends Group {
|
|||||||
super();
|
super();
|
||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
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.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.zlevel = model.zlevel;
|
this.zlevel = model.zlevel;
|
||||||
@ -21,14 +27,15 @@ export default class StationDelayUnlock extends Group {
|
|||||||
|
|
||||||
create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
|
const computedPosition = this.computedPosition;
|
||||||
const style = this.style;
|
const style = this.style;
|
||||||
this.text = new Text({
|
this.text = new Text({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: model.position.x,
|
x: computedPosition.x,
|
||||||
y: model.position.y,
|
y: computedPosition.y,
|
||||||
fontWeight: 'normal',
|
fontWeight: 'normal',
|
||||||
fontSize: model.textFont,
|
fontSize: model.textFont,
|
||||||
fontFamily: style.fontFamily,
|
fontFamily: style.fontFamily,
|
||||||
@ -45,8 +52,8 @@ export default class StationDelayUnlock extends Group {
|
|||||||
z: this.z,
|
z: this.z,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: model.position.x,
|
x: computedPosition.x,
|
||||||
y: model.position.y + fontSize + style.StationDelayUnlock.text.distance,
|
y: computedPosition.y + fontSize + style.StationDelayUnlock.text.distance,
|
||||||
fontWeight: 'normal',
|
fontWeight: 'normal',
|
||||||
fontSize: model.textFont,
|
fontSize: model.textFont,
|
||||||
fontFamily: style.fontFamily,
|
fontFamily: style.fontFamily,
|
||||||
@ -69,8 +76,8 @@ export default class StationDelayUnlock extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z - 1,
|
z: this.z - 1,
|
||||||
shape: {
|
shape: {
|
||||||
x: model.position.x - this.lPadding,
|
x: computedPosition.x - this.lPadding,
|
||||||
y: model.position.y - this.vPadding,
|
y: computedPosition.y - this.vPadding,
|
||||||
width: this.rect.width + this.lPadding * 2,
|
width: this.rect.width + this.lPadding * 2,
|
||||||
height: this.rect.height + this.vPadding * 2
|
height: this.rect.height + this.vPadding * 2
|
||||||
},
|
},
|
||||||
@ -119,6 +126,6 @@ export default class StationDelayUnlock extends Group {
|
|||||||
this.time && this.time.show();
|
this.time && this.time.show();
|
||||||
}
|
}
|
||||||
getAnchorPoint() {
|
getAnchorPoint() {
|
||||||
return this.model.position;
|
return this.computedPosition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,13 +12,14 @@ class EEarlyStart extends Group {
|
|||||||
create(deviceParam) {
|
create(deviceParam) {
|
||||||
if (!this.isNew) {
|
if (!this.isNew) {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
|
const computedPosition = this.model.modelData.computedPosition;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
this.isNew = true;
|
this.isNew = true;
|
||||||
|
|
||||||
/** 提前发车*/
|
/** 提前发车*/
|
||||||
const startD = model.right ? 1 : -1;
|
const startD = model.right ? 1 : -1;
|
||||||
const startX = model.position.x - startD * (deviceParam.offset.x - model.width / 2);
|
const startX = computedPosition.x - startD * (deviceParam.offset.x - model.width / 2);
|
||||||
const startY = model.position.y + startD * (deviceParam.offset.y - model.height / 2);
|
const startY = computedPosition.y + startD * (deviceParam.offset.y - model.height / 2);
|
||||||
|
|
||||||
this.earlyStart = new Text({
|
this.earlyStart = new Text({
|
||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
|
@ -12,13 +12,14 @@ class ELevel extends Group {
|
|||||||
create() {
|
create() {
|
||||||
if (!this.isNew) {
|
if (!this.isNew) {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
|
const computedPosition = this.model.modelData.computedPosition;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
|
|
||||||
this.isNew = true;
|
this.isNew = true;
|
||||||
|
|
||||||
const levelDrict = model.right ? 1 : -1;
|
const levelDrict = model.right ? 1 : -1;
|
||||||
const levelX = model.position.x - levelDrict * (style.StationStand.level.offset.x - model.width / 2);
|
const levelX = computedPosition.x - levelDrict * (style.StationStand.level.offset.x - model.width / 2);
|
||||||
const levelY = model.position.y + levelDrict * (style.StationStand.level.offset.y);
|
const levelY = computedPosition.y + levelDrict * (style.StationStand.level.offset.y);
|
||||||
|
|
||||||
this.level = new Text({
|
this.level = new Text({
|
||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
|
@ -15,12 +15,12 @@ export default class EMouse extends Group {
|
|||||||
silent: true,
|
silent: true,
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: 0,
|
z: 0,
|
||||||
shape: {
|
shape: {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 0,
|
y: 0,
|
||||||
width: 0,
|
width: 0,
|
||||||
height: 0
|
height: 0
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
lineDash: this.style.StationStand.mouseOverStyle.borderLineDash,
|
lineDash: this.style.StationStand.mouseOverStyle.borderLineDash,
|
||||||
stroke: this.style.StationStand.mouseOverStyle.borderLineColor,
|
stroke: this.style.StationStand.mouseOverStyle.borderLineColor,
|
||||||
@ -33,34 +33,34 @@ export default class EMouse extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mouseover(e) {
|
mouseover(e) {
|
||||||
const model = this.device.model;
|
const model = this.device.model;
|
||||||
const mapDevice = this.device.mapDevice;
|
const mapDevice = this.device.mapDevice;
|
||||||
const psdModel = mapDevice[model.psdCode];
|
const psdModel = mapDevice[model.psdCode];
|
||||||
const rect = this.device.getBoundingRect().clone();
|
const rect = this.device.getBoundingRect().clone();
|
||||||
|
|
||||||
if (psdModel && psdModel.instance) {
|
if (psdModel && psdModel.instance) {
|
||||||
rect.union( psdModel.instance.getBoundingRect());
|
rect.union( psdModel.instance.getBoundingRect());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.style.StationStand.mouseOverStyle.standBackgroundColor) {
|
if (this.style.StationStand.mouseOverStyle.standBackgroundColor) {
|
||||||
this.device.solidStand && this.device.solidStand.removeHover();
|
this.device.solidStand && this.device.solidStand.removeHover();
|
||||||
this.device.solidStand && this.device.solidStand.addHover({
|
this.device.solidStand && this.device.solidStand.addHover({
|
||||||
fill: this.device.__over
|
fill: this.device.__over
|
||||||
? this.style.StationStand.mouseOverStyle.standBackgroundColorOver
|
? this.style.StationStand.mouseOverStyle.standBackgroundColorOver
|
||||||
: this.style.StationStand.mouseOverStyle.standBackgroundColor
|
: this.style.StationStand.mouseOverStyle.standBackgroundColor
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.border.setShape(rect);
|
this.border.setShape(rect);
|
||||||
this.border.show();
|
this.border.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
mouseout(e) {
|
mouseout(e) {
|
||||||
if (!this.device.__down) {
|
if (!this.device.__down) {
|
||||||
if (this.style.StationStand.mouseOverStyle.standBackgroundColor) {
|
if (this.style.StationStand.mouseOverStyle.standBackgroundColor) {
|
||||||
this.device.solidStand && this.device.solidStand.removeHover();
|
this.device.solidStand && this.device.solidStand.removeHover();
|
||||||
}
|
}
|
||||||
this.border.hide();
|
this.border.hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ class EPatternFilter extends Group {
|
|||||||
|
|
||||||
create() {
|
create() {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
|
const computedPosition = this.model.modelData.computedPosition;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
let direction = -1;
|
let direction = -1;
|
||||||
if ((model.right && model.inside) || (!model.right && !model.inside)) {
|
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 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({
|
this.patternFilter1 = new Polygon({
|
||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
z: this.model.z,
|
z: this.model.z,
|
||||||
shape: {
|
shape: {
|
||||||
points:[
|
points:[
|
||||||
[model.position.x - startX, startY],
|
[computedPosition.x - startX, startY],
|
||||||
[model.position.x - startX, startY - 14],
|
[computedPosition.x - startX, startY - 14],
|
||||||
[model.position.x - startX - 14, startY - 14],
|
[computedPosition.x - startX - 14, startY - 14],
|
||||||
[model.position.x - startX - 14 - 10 * 0.866, startY - 7],
|
[computedPosition.x - startX - 14 - 10 * 0.866, startY - 7],
|
||||||
[model.position.x - startX - 14, startY]
|
[computedPosition.x - startX - 14, startY]
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
@ -39,11 +40,11 @@ class EPatternFilter extends Group {
|
|||||||
z: this.model.z,
|
z: this.model.z,
|
||||||
shape: {
|
shape: {
|
||||||
points:[
|
points:[
|
||||||
[model.position.x + startX, startY],
|
[computedPosition.x + startX, startY],
|
||||||
[model.position.x + startX, startY - 14],
|
[computedPosition.x + startX, startY - 14],
|
||||||
[model.position.x + startX + 14, startY - 14],
|
[computedPosition.x + startX + 14, startY - 14],
|
||||||
[model.position.x + startX + 14 + 10 * 0.866, startY - 7],
|
[computedPosition.x + startX + 14 + 10 * 0.866, startY - 7],
|
||||||
[model.position.x + startX + 14, startY]
|
[computedPosition.x + startX + 14, startY]
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
|
@ -12,13 +12,14 @@ class EReentry extends Group {
|
|||||||
create() {
|
create() {
|
||||||
if (!this.isNew) {
|
if (!this.isNew) {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
|
const computedPosition = this.model.modelData.computedPosition;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
this.isNew = true;
|
this.isNew = true;
|
||||||
|
|
||||||
const reentryH = style.StationStand.reentry.mergentR;
|
const reentryH = style.StationStand.reentry.mergentR;
|
||||||
const isRight = model.right ? -1 : 1;
|
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 reentryX = computedPosition.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 reentryY = computedPosition.y + (style.StationStand.reentry.position || isRight) * (style.StationStand.reentry.offset.y) + isRight * reentryH;
|
||||||
|
|
||||||
this.reentry = new Polygon({
|
this.reentry = new Polygon({
|
||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
|
@ -11,13 +11,14 @@ class EStationPlatform extends Group {
|
|||||||
|
|
||||||
create() {
|
create() {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
|
const computedPosition = this.model.modelData.computedPosition;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
|
|
||||||
const buttonD = model.right ? 1 : -1;
|
const buttonD = model.right ? 1 : -1;
|
||||||
const platFormOffset = model.inside ? style.StationStand.stationPlatform.insideOffset : style.StationStand.stationPlatform.outsideOffset;
|
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 -
|
// 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({
|
this.stationPlatform = new Polygon({
|
||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
z: this.model.z,
|
z: this.model.z,
|
||||||
|
@ -11,11 +11,12 @@ class ETime extends Group {
|
|||||||
create() {
|
create() {
|
||||||
if (!this.isNew) {
|
if (!this.isNew) {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
|
const computedPosition = this.model.modelData.computedPosition;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
|
|
||||||
const timeDrict = model.right ? 1 : -1;
|
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 timeX = computedPosition.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 timeY = computedPosition.y + timeDrict * (style.StationStand.stopTime.offset.y - model.height / 2);
|
||||||
|
|
||||||
this.isNew = true;
|
this.isNew = true;
|
||||||
this.time = new Text({
|
this.time = new Text({
|
||||||
|
@ -10,12 +10,13 @@ class ETrainDepart extends Group {
|
|||||||
|
|
||||||
create() {
|
create() {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
|
const computedPosition = this.model.modelData.computedPosition;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
|
|
||||||
const trainDepartOffset = model.inside ? style.StationStand.trainDepart.insideOffset : style.StationStand.trainDepart.outsideOffset;
|
const trainDepartOffset = model.inside ? style.StationStand.trainDepart.insideOffset : style.StationStand.trainDepart.outsideOffset;
|
||||||
const trainDepartH = model.right ? 1 : -1;
|
const trainDepartH = model.right ? 1 : -1;
|
||||||
const departX = model.position.x + trainDepartH * trainDepartOffset.x;
|
const departX = computedPosition.x + trainDepartH * trainDepartOffset.x;
|
||||||
const departY = model.position.y + trainDepartH * trainDepartOffset.y;
|
const departY = computedPosition.y + trainDepartH * trainDepartOffset.y;
|
||||||
|
|
||||||
this.trainDepart = new Text({
|
this.trainDepart = new Text({
|
||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
|
@ -11,11 +11,12 @@ class ETrainSetButton extends Group {
|
|||||||
|
|
||||||
create() {
|
create() {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
|
const computedPosition = this.model.modelData.computedPosition;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
|
|
||||||
const buttonD = model.right ? 1 : -1;
|
const buttonD = model.right ? 1 : -1;
|
||||||
const buttonX = model.position.x - buttonD * (style.StationStand.trainSetButton.offset.x - model.width / 2);
|
const buttonX = computedPosition.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 buttonY = computedPosition.y + buttonD * (style.StationStand.trainSetButton.offset.y - model.height / 2);
|
||||||
|
|
||||||
this.trainSetButton = new Text({
|
this.trainSetButton = new Text({
|
||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
|
@ -11,13 +11,14 @@ class ETrainStop extends Group {
|
|||||||
create() {
|
create() {
|
||||||
if (!this.isNew) {
|
if (!this.isNew) {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
|
const computedPosition = this.model.modelData.computedPosition;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
this.isNew = true;
|
this.isNew = true;
|
||||||
|
|
||||||
const stopTrainOffset = model.inside ? style.StationStand.trainStop.insideOffset : style.StationStand.trainStop.outsideOffset;
|
const stopTrainOffset = model.inside ? style.StationStand.trainStop.insideOffset : style.StationStand.trainStop.outsideOffset;
|
||||||
const stopTrainH = model.right ? 1 : -1;
|
const stopTrainH = model.right ? 1 : -1;
|
||||||
const stopX = model.position.x + stopTrainH * stopTrainOffset.x;
|
const stopX = computedPosition.x + stopTrainH * stopTrainOffset.x;
|
||||||
const stopY = model.position.y + stopTrainH * stopTrainOffset.y;
|
const stopY = computedPosition.y + stopTrainH * stopTrainOffset.y;
|
||||||
|
|
||||||
this.trainStop = new Arc({
|
this.trainStop = new Arc({
|
||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
|
@ -12,14 +12,15 @@ class EDetain extends Group {
|
|||||||
create(deviceParam) {
|
create(deviceParam) {
|
||||||
if (!this.isNew) {
|
if (!this.isNew) {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
|
const computedPosition = this.model.modelData.computedPosition;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
this.isNew = true;
|
this.isNew = true;
|
||||||
|
|
||||||
/** 站台扣车*/
|
/** 站台扣车*/
|
||||||
const detainOffset = model.inside ? deviceParam.insideOffset : deviceParam.outsideOffset;
|
const detainOffset = model.inside ? deviceParam.insideOffset : deviceParam.outsideOffset;
|
||||||
const detainD = model.right ? 1 : -1;
|
const detainD = model.right ? 1 : -1;
|
||||||
const detainX = model.position.x - detainD * (detainOffset.x - model.width / 2);
|
const detainX = computedPosition.x - detainD * (detainOffset.x - model.width / 2);
|
||||||
const detainY = model.position.y + detainD * (detainOffset.y - model.height / 2);
|
const detainY = computedPosition.y + detainD * (detainOffset.y - model.height / 2);
|
||||||
|
|
||||||
this.detain = new Text({
|
this.detain = new Text({
|
||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
@ -43,7 +44,7 @@ class EDetain extends Group {
|
|||||||
|
|
||||||
if (deviceParam.special) {
|
if (deviceParam.special) {
|
||||||
//, 'textPadding':[1, 3], 'textBorderColor':'#fff', 'textBorderWidth':1
|
//, '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});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,11 +12,11 @@ class EDetainCircle extends Group {
|
|||||||
create() {
|
create() {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
|
const computedPosition = this.model.modelData.computedPosition;
|
||||||
const detainD = model.right ? 1 : -1;
|
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 x = computedPosition.x + (model.width / 2) * detainD + detainD * style.StationStand.detainCircle.offset.x + detainD * style.StationStand.detainCircle.circleWidth / 2;
|
||||||
const y = model.position.y;
|
const y = computedPosition.y;
|
||||||
const radius = style.StationStand.detainCircle.circleWidth / 2;
|
const radius = style.StationStand.detainCircle.circleWidth / 2;
|
||||||
|
|
||||||
this.detainCircle = new Circle({
|
this.detainCircle = new Circle({
|
||||||
|
@ -10,12 +10,13 @@ class EDetainHollow extends EDetain {
|
|||||||
|
|
||||||
create() {
|
create() {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
|
const computedPosition = this.model.modelData.computedPosition;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
/** 站台扣车*/
|
/** 站台扣车*/
|
||||||
const detainOffset = model.inside ? style.StationStand.detainHollow.insideOffset : style.StationStand.detainHollow.outsideOffset;
|
const detainOffset = model.inside ? style.StationStand.detainHollow.insideOffset : style.StationStand.detainHollow.outsideOffset;
|
||||||
const detainD = model.right ? 1 : -1;
|
const detainD = model.right ? 1 : -1;
|
||||||
const detainX = model.position.x - detainD * (detainOffset.x - model.width / 2);
|
const detainX = computedPosition.x - detainD * (detainOffset.x - model.width / 2);
|
||||||
const detainY = model.position.y + detainD * (detainOffset.y - model.height / 2);
|
const detainY = computedPosition.y + detainD * (detainOffset.y - model.height / 2);
|
||||||
if (!this.isNew) {
|
if (!this.isNew) {
|
||||||
super.create(style.StationStand.detainHollow);
|
super.create(style.StationStand.detainHollow);
|
||||||
const offsetX = model.right ? 8 : -8;
|
const offsetX = model.right ? 8 : -8;
|
||||||
|
@ -10,10 +10,11 @@ class EDetainCircle extends Group {
|
|||||||
|
|
||||||
create() {
|
create() {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
|
const computedPosition = this.model.modelData.computedPosition;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
|
|
||||||
const standX = model.position.x - model.width / 2;
|
const standX = computedPosition.x - model.width / 2;
|
||||||
const standY = model.position.y - model.height / 2;
|
const standY = computedPosition.y - model.height / 2;
|
||||||
|
|
||||||
let y1;
|
let y1;
|
||||||
let y2;
|
let y2;
|
||||||
|
@ -13,12 +13,13 @@ class EEmergentArrow extends Group {
|
|||||||
create() {
|
create() {
|
||||||
if (!this.isNew) {
|
if (!this.isNew) {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
|
const computedPosition = this.model.modelData.computedPosition;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
|
|
||||||
const emergentOffset = model.inside ? style.StationStand.emergentArrow.insideOffset : style.StationStand.emergentArrow.outsideOffset;
|
const emergentOffset = model.inside ? style.StationStand.emergentArrow.insideOffset : style.StationStand.emergentArrow.outsideOffset;
|
||||||
const emergentH = model.right ? 1 : -1;
|
const emergentH = model.right ? 1 : -1;
|
||||||
const emergentX = model.position.x + emergentH * emergentOffset.x;
|
const emergentX = computedPosition.x + emergentH * emergentOffset.x;
|
||||||
const emergentY = model.position.y + emergentH * emergentOffset.y;
|
const emergentY = computedPosition.y + emergentH * emergentOffset.y;
|
||||||
|
|
||||||
const rotation = model.right == 1 ? Math.PI / 2 : Math.PI * 3 / 2;
|
const rotation = model.right == 1 ? Math.PI / 2 : Math.PI * 3 / 2;
|
||||||
this.emergent = new Polygon({
|
this.emergent = new Polygon({
|
||||||
|
@ -12,12 +12,13 @@ class EEmergentCross extends Group {
|
|||||||
|
|
||||||
create() {
|
create() {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
|
const computedPosition = this.model.modelData.computedPosition;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
|
|
||||||
const emergentOffset = model.inside ? style.StationStand.emergentCross.insideOffset : style.StationStand.emergentCross.outsideOffset;
|
const emergentOffset = model.inside ? style.StationStand.emergentCross.insideOffset : style.StationStand.emergentCross.outsideOffset;
|
||||||
const emergentH = model.right ? 1 : -1;
|
const emergentH = model.right ? 1 : -1;
|
||||||
const emergentX = model.position.x + emergentH * emergentOffset.x;
|
const emergentX = computedPosition.x + emergentH * emergentOffset.x;
|
||||||
const emergentY = model.position.y + emergentH * emergentOffset.y;
|
const emergentY = computedPosition.y + emergentH * emergentOffset.y;
|
||||||
|
|
||||||
model.r = style.StationStand.emergentCross.mergentR;
|
model.r = style.StationStand.emergentCross.mergentR;
|
||||||
model.n = style.StationStand.emergentCross.mergentN;
|
model.n = style.StationStand.emergentCross.mergentN;
|
||||||
|
@ -11,12 +11,13 @@ class EEmergentRhombus extends Group {
|
|||||||
create() {
|
create() {
|
||||||
if (!this.isNew) {
|
if (!this.isNew) {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
|
const computedPosition = this.model.modelData.computedPosition;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
|
|
||||||
const emergentOffset = model.inside ? style.StationStand.emergentRhombus.insideOffset : style.StationStand.emergentRhombus.outsideOffset;
|
const emergentOffset = model.inside ? style.StationStand.emergentRhombus.insideOffset : style.StationStand.emergentRhombus.outsideOffset;
|
||||||
const emergentH = model.right ? 1 : -1;
|
const emergentH = model.right ? 1 : -1;
|
||||||
const emergentX = model.position.x + emergentH * emergentOffset.x;
|
const emergentX = computedPosition.x + emergentH * emergentOffset.x;
|
||||||
const emergentY = model.position.y + emergentH * emergentOffset.y;
|
const emergentY = computedPosition.y + emergentH * emergentOffset.y;
|
||||||
|
|
||||||
model.r = style.StationStand.emergentRhombus.mergentR;
|
model.r = style.StationStand.emergentRhombus.mergentR;
|
||||||
model.n = style.StationStand.emergentRhombus.mergentN;
|
model.n = style.StationStand.emergentRhombus.mergentN;
|
||||||
|
@ -45,6 +45,12 @@ class StationStand extends Group {
|
|||||||
super();
|
super();
|
||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
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.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.zlevel = model.zlevel;
|
this.zlevel = model.zlevel;
|
||||||
@ -59,7 +65,7 @@ class StationStand extends Group {
|
|||||||
// 加载皮肤控制的元素
|
// 加载皮肤控制的元素
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.style;
|
const style = this.style;
|
||||||
|
model.computedPosition = this.computedPosition;
|
||||||
// // 站台所有的绘图元素
|
// // 站台所有的绘图元素
|
||||||
const elementTypeList = {
|
const elementTypeList = {
|
||||||
'solidStand':ESolidStand, // 矩形实心站台 (普通站台样式)
|
'solidStand':ESolidStand, // 矩形实心站台 (普通站台样式)
|
||||||
@ -248,7 +254,7 @@ class StationStand extends Group {
|
|||||||
this.highlight && this.highlight.drawSelected(selected);
|
this.highlight && this.highlight.drawSelected(selected);
|
||||||
}
|
}
|
||||||
getAnchorPoint() {
|
getAnchorPoint() {
|
||||||
return this.model.position;
|
return this.computedPosition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export default StationStand;
|
export default StationStand;
|
||||||
|
@ -10,13 +10,14 @@ class EJump extends Group {
|
|||||||
create(deviceParam) {
|
create(deviceParam) {
|
||||||
if (!this.isNew) {
|
if (!this.isNew) {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
|
const computedPosition = this.model.modelData.computedPosition;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
this.isNew = true;
|
this.isNew = true;
|
||||||
|
|
||||||
const jumpDirct = model.right ? -1 : 1;
|
const jumpDirct = model.right ? -1 : 1;
|
||||||
const jumpOffsetY = model.inside ? -1 : 1;
|
const jumpOffsetY = model.inside ? -1 : 1;
|
||||||
const jumpX = model.position.x - jumpDirct * (deviceParam.offset.x - model.width / 2);
|
const jumpX = computedPosition.x - jumpDirct * (deviceParam.offset.x - model.width / 2);
|
||||||
const jumpY = model.position.y + jumpDirct * jumpOffsetY * deviceParam.offset.y;
|
const jumpY = computedPosition.y + jumpDirct * jumpOffsetY * deviceParam.offset.y;
|
||||||
|
|
||||||
if (deviceParam.special) {
|
if (deviceParam.special) {
|
||||||
this.jump = new Text({
|
this.jump = new Text({
|
||||||
@ -24,7 +25,7 @@ class EJump extends Group {
|
|||||||
z: this.model.z,
|
z: this.model.z,
|
||||||
style: {
|
style: {
|
||||||
x: jumpX,
|
x: jumpX,
|
||||||
y: model.position.y + jumpDirct * jumpOffsetY * deviceParam.offset.y,
|
y: computedPosition.y + jumpDirct * jumpOffsetY * deviceParam.offset.y,
|
||||||
fontWeight: deviceParam.fontWeight,
|
fontWeight: deviceParam.fontWeight,
|
||||||
fontSize: deviceParam.fontSize,
|
fontSize: deviceParam.fontSize,
|
||||||
fontFamily: style.fontFamily,
|
fontFamily: style.fontFamily,
|
||||||
|
@ -9,11 +9,12 @@ class EJumpCircle extends EJump {
|
|||||||
}
|
}
|
||||||
create() {
|
create() {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
|
const computedPosition = this.model.modelData.computedPosition;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
|
|
||||||
const jumpDirct = model.right ? -1 : 1;
|
const jumpDirct = model.right ? -1 : 1;
|
||||||
const jumpCX = model.position.x - jumpDirct * (style.StationStand.jumpCircle.offset.x - model.width / 2);
|
const jumpCX = computedPosition.x - jumpDirct * (style.StationStand.jumpCircle.offset.x - model.width / 2);
|
||||||
const jumpCY = model.position.y + jumpDirct * style.StationStand.jumpCircle.offset.y;
|
const jumpCY = computedPosition.y + jumpDirct * style.StationStand.jumpCircle.offset.y;
|
||||||
|
|
||||||
if (!this.isNew) {
|
if (!this.isNew) {
|
||||||
super.create(style.StationStand.jumpCircle);
|
super.create(style.StationStand.jumpCircle);
|
||||||
|
@ -12,9 +12,10 @@ class EGapStand extends Group {
|
|||||||
|
|
||||||
create() {
|
create() {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
|
const computedPosition = this.model.modelData.computedPosition;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
const standX = model.position.x - model.width / 2;
|
const standX = computedPosition.x - model.width / 2;
|
||||||
const standY = model.position.y - model.height / 2;
|
const standY = computedPosition.y - model.height / 2;
|
||||||
|
|
||||||
this.stand1 = new Rect({
|
this.stand1 = new Rect({
|
||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
|
@ -10,9 +10,10 @@ class EHollowStand extends Group {
|
|||||||
|
|
||||||
create() {
|
create() {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
|
const computedPosition = this.model.modelData.computedPosition;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
const standX = model.position.x - model.width / 2;
|
const standX = computedPosition.x - model.width / 2;
|
||||||
const standY = model.position.y - model.height / 2;
|
const standY = computedPosition.y - model.height / 2;
|
||||||
|
|
||||||
this.stand = new Rect({
|
this.stand = new Rect({
|
||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
|
@ -12,9 +12,10 @@ class ESolidStand extends Group {
|
|||||||
|
|
||||||
create() {
|
create() {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
|
const computedPosition = this.model.modelData.computedPosition;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
const standX = model.position.x - model.width / 2;
|
const standX = computedPosition.x - model.width / 2;
|
||||||
const standY = model.position.y - model.height / 2;
|
const standY = computedPosition.y - model.height / 2;
|
||||||
const direction = model.right ? 1 : -1;
|
const direction = model.right ? 1 : -1;
|
||||||
|
|
||||||
this.stand = new Polyline({
|
this.stand = new Polyline({
|
||||||
|
@ -11,9 +11,10 @@ class ESolidStand extends Group {
|
|||||||
|
|
||||||
create() {
|
create() {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
|
const computedPosition = this.model.modelData.computedPosition;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
const standX = model.position.x - model.width / 2;
|
const standX = computedPosition.x - model.width / 2;
|
||||||
const standY = model.position.y - model.height / 2;
|
const standY = computedPosition.y - model.height / 2;
|
||||||
|
|
||||||
this.stand = new Rect({
|
this.stand = new Rect({
|
||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
@ -58,8 +59,8 @@ class ESolidStand extends Group {
|
|||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
z: this.model.z + 10,
|
z: this.model.z + 10,
|
||||||
style: {
|
style: {
|
||||||
x: model.position.x + 35,
|
x: computedPosition.x + 35,
|
||||||
y: model.position.y - 20,
|
y: computedPosition.y - 20,
|
||||||
text: `${'站台人数: ' + model.num ? model.num : 0}`,
|
text: `${'站台人数: ' + model.num ? model.num : 0}`,
|
||||||
textFill: '#000',
|
textFill: '#000',
|
||||||
textAlign: 'left',
|
textAlign: 'left',
|
||||||
|
@ -13,8 +13,8 @@ export default class EMouse extends Group {
|
|||||||
z: this.device.z + 1,
|
z: this.device.z + 1,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: this.device.model.position.x,
|
x: this.device.computedPosition.x,
|
||||||
y: this.device.model.position.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30,
|
y: this.device.computedPosition.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30,
|
||||||
fontWeight: 'normal',
|
fontWeight: 'normal',
|
||||||
fontSize: this.device.style.LcControl.mouseOverStyle.fontSize,
|
fontSize: this.device.style.LcControl.mouseOverStyle.fontSize,
|
||||||
fontFamily: this.device.style.fontFamily,
|
fontFamily: this.device.style.fontFamily,
|
||||||
|
@ -12,6 +12,12 @@ export default class StationTurnBack extends Group {
|
|||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
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.z = 40;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
@ -23,14 +29,15 @@ export default class StationTurnBack extends Group {
|
|||||||
create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.style;
|
const style = this.style;
|
||||||
|
const computedPosition = this.computedPosition;
|
||||||
|
|
||||||
if (model.show && !style.StationTurnBack.spliceShow) {
|
if (model.show && !style.StationTurnBack.spliceShow) {
|
||||||
this.control = new Circle({
|
this.control = new Circle({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
shape: {
|
shape: {
|
||||||
cx: model.position.x,
|
cx: computedPosition.x,
|
||||||
cy: model.position.y,
|
cy: computedPosition.y,
|
||||||
r: style.StationTurnBack.lamp.radiusR
|
r: style.StationTurnBack.lamp.radiusR
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
@ -43,8 +50,8 @@ export default class StationTurnBack extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
shape: {
|
shape: {
|
||||||
x: model.position.x - style.StationTurnBack.lamp.radiusR - style.StationTurnBack.rect.padding / 2,
|
x: computedPosition.x - style.StationTurnBack.lamp.radiusR - style.StationTurnBack.rect.padding / 2,
|
||||||
y: model.position.y - 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,
|
width: style.StationTurnBack.lamp.radiusR * 2 + style.StationTurnBack.rect.padding,
|
||||||
height: 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,
|
z: this.z,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: model.position.x,
|
x: computedPosition.x,
|
||||||
y: model.position.y - style.StationTurnBack.lamp.radiusR - style.StationTurnBack.text.distance,
|
y: computedPosition.y - style.StationTurnBack.lamp.radiusR - style.StationTurnBack.text.distance,
|
||||||
fontWeight: style.StationTurnBack.text.fontWeight,
|
fontWeight: style.StationTurnBack.text.fontWeight,
|
||||||
fontSize: style.StationTurnBack.text.fontSize,
|
fontSize: style.StationTurnBack.text.fontSize,
|
||||||
fontFamily: style.fontFamily,
|
fontFamily: style.fontFamily,
|
||||||
@ -86,8 +93,8 @@ export default class StationTurnBack extends Group {
|
|||||||
z: this.z,
|
z: this.z,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: model.position.x,
|
x: computedPosition.x,
|
||||||
y: model.position.y + style.StationTurnBack.lamp.radiusR + style.StationTurnBack.text.distance,
|
y: computedPosition.y + style.StationTurnBack.lamp.radiusR + style.StationTurnBack.text.distance,
|
||||||
fontWeight: style.StationTurnBack.text.fontWeight,
|
fontWeight: style.StationTurnBack.text.fontWeight,
|
||||||
fontSize: style.StationTurnBack.text.fontSize,
|
fontSize: style.StationTurnBack.text.fontSize,
|
||||||
fontFamily: style.fontFamily,
|
fontFamily: style.fontFamily,
|
||||||
@ -104,8 +111,8 @@ export default class StationTurnBack extends Group {
|
|||||||
this.control = new EFoldbackMode({
|
this.control = new EFoldbackMode({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
x: model.position.x,
|
x: computedPosition.x,
|
||||||
y: model.position.y,
|
y: computedPosition.y,
|
||||||
width: style.ReturnModeGroup.rectWidth,
|
width: style.ReturnModeGroup.rectWidth,
|
||||||
style: style
|
style: style
|
||||||
});
|
});
|
||||||
@ -196,7 +203,7 @@ export default class StationTurnBack extends Group {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
getAnchorPoint() {
|
getAnchorPoint() {
|
||||||
return this.model.position;
|
return this.computedPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
getBoundingRect() {
|
getBoundingRect() {
|
||||||
|
@ -54,34 +54,36 @@ export default class Switch extends Group {
|
|||||||
const directx = this.triangle.drictx;
|
const directx = this.triangle.drictx;
|
||||||
const directy = this.triangle.dricty;
|
const directy = this.triangle.dricty;
|
||||||
const switchWidth1 = style.Section.line.width / 2;
|
const switchWidth1 = style.Section.line.width / 2;
|
||||||
|
|
||||||
let directxA = 1;
|
let directxA = 1;
|
||||||
let sectionATriangle = new JTriangle(sectionAModel.points[0], sectionAModel.points[1]);
|
const sectionAPoints = sectionAModel.instance ? sectionAModel.instance.computedPoints : sectionAModel.points;
|
||||||
let sectionBTriangle = new JTriangle(sectionBModel.points[0], sectionBModel.points[1]);
|
const sectionBPoints = sectionBModel.instance ? sectionBModel.instance.computedPoints : sectionBModel.points;
|
||||||
let sectionCTriangle = new JTriangle(sectionCModel.points[0], sectionCModel.points[1]);
|
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 };
|
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) {
|
if (sectionAPoints[0].x == model.intersection.x && sectionAPoints[0].y == model.intersection.y) {
|
||||||
sectionATriangle = new JTriangle(sectionAModel.points[0], sectionAModel.points[1]);
|
sectionATriangle = new JTriangle(sectionAPoints[0], sectionAPoints[1]);
|
||||||
directxA = 1;
|
directxA = 1;
|
||||||
}
|
}
|
||||||
if (sectionAModel.points[sectionAModel.points.length - 1].x == model.intersection.x && sectionAModel.points[sectionAModel.points.length - 1].y == model.intersection.y) {
|
if (sectionAPoints[sectionAPoints.length - 1].x == model.intersection.x && sectionAPoints[sectionAPoints.length - 1].y == model.intersection.y) {
|
||||||
sectionATriangle = new JTriangle(sectionAModel.points[sectionAModel.points.length - 2], sectionAModel.points[sectionAModel.points.length - 1]);
|
sectionATriangle = new JTriangle(sectionAPoints[sectionAPoints.length - 2], sectionAPoints[sectionAPoints.length - 1]);
|
||||||
directxA = -1;
|
directxA = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sectionBModel.points[0].x == model.intersection.x && sectionBModel.points[0].y == model.intersection.y) {
|
if (sectionBPoints[0].x == model.intersection.x && sectionBPoints[0].y == model.intersection.y) {
|
||||||
sectionBTriangle = new JTriangle(sectionBModel.points[0], sectionBModel.points[1]);
|
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) {
|
if (sectionBPoints[sectionBPoints.length - 1].x == model.intersection.x && sectionBPoints[sectionBPoints.length - 1].y == model.intersection.y) {
|
||||||
sectionBTriangle = new JTriangle(sectionBModel.points[sectionBModel.points.length - 2], sectionBModel.points[sectionBModel.points.length - 1]);
|
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) {
|
if (sectionCPoints[0].x == model.intersection.x && sectionCPoints[0].y == model.intersection.y) {
|
||||||
sectionCTriangle = new JTriangle(sectionCModel.points[0], sectionCModel.points[1]);
|
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) {
|
if (sectionCPoints[sectionCPoints.length - 1].x == model.intersection.x && sectionCPoints[sectionCPoints.length - 1].y == model.intersection.y) {
|
||||||
sectionCTriangle = new JTriangle(sectionCModel.points[sectionCModel.points.length - 2], sectionCModel.points[sectionCModel.points.length - 1]);
|
sectionCTriangle = new JTriangle(sectionCPoints[sectionCPoints.length - 2], sectionCPoints[sectionCPoints.length - 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const swPadding = rateOpen
|
const swPadding = rateOpen
|
||||||
@ -212,11 +214,11 @@ export default class Switch extends Group {
|
|||||||
textFill: 'yellow'
|
textFill: 'yellow'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.style.Switch.switchDot && this.style.Switch.switchDot.show) {
|
if (this.style.Switch.switchDot && this.style.Switch.switchDot.show) {
|
||||||
const { drictx, dricty } = this.triangle
|
const { drictx, dricty } = this.triangle;
|
||||||
this.dot = new ESwDot(model, drictx, dricty)
|
this.dot = new ESwDot(model, drictx, dricty);
|
||||||
this.add(this.dot)
|
this.add(this.dot);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.add(this.shapeModelA);
|
this.add(this.shapeModelA);
|
||||||
@ -350,7 +352,7 @@ export default class Switch extends Group {
|
|||||||
this.artificialArc && this.artificialArc.hide();
|
this.artificialArc && this.artificialArc.hide();
|
||||||
this.name && this.name.show();
|
this.name && this.name.show();
|
||||||
this.limitName && this.limitName.show();
|
this.limitName && this.limitName.show();
|
||||||
this.dot && this.dot.hide()
|
this.dot && this.dot.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 定位*/
|
/** 定位*/
|
||||||
@ -515,8 +517,8 @@ export default class Switch extends Group {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.style.Switch.switchDot && this.style.Switch.switchDot.show) {
|
if (this.style.Switch.switchDot && this.style.Switch.switchDot.show) {
|
||||||
this.dot.show()
|
this.dot.show();
|
||||||
this.dot.setColor(this.style.Switch.switchDot.monoLockColor)
|
this.dot.setColor(this.style.Switch.switchDot.monoLockColor);
|
||||||
}
|
}
|
||||||
this.setTextColor(this.style.Switch.text.monolockLocationColor);
|
this.setTextColor(this.style.Switch.text.monolockLocationColor);
|
||||||
}
|
}
|
||||||
@ -572,8 +574,8 @@ export default class Switch extends Group {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.style.Switch.switchDot && this.style.Switch.switchDot.show) {
|
if (this.style.Switch.switchDot && this.style.Switch.switchDot.show) {
|
||||||
this.dot.show()
|
this.dot.show();
|
||||||
this.dot.setColor(this.style.Switch.switchDot.lockColor)
|
this.dot.setColor(this.style.Switch.switchDot.lockColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (this.style.Switch.coverBlock && this.style.Switch.coverBlock.show) {
|
// if (this.style.Switch.coverBlock && this.style.Switch.coverBlock.show) {
|
||||||
@ -726,9 +728,9 @@ export default class Switch extends Group {
|
|||||||
this.switchPosition = 'reverse';
|
this.switchPosition = 'reverse';
|
||||||
this.setInversionAction(model); /** 反位*/
|
this.setInversionAction(model); /** 反位*/
|
||||||
} else if (model.pos == 'NO') {
|
} else if (model.pos == 'NO') {
|
||||||
//宁波线失表
|
// 宁波线失表
|
||||||
if (this.style.Switch.jointImg.faultStatus && model.fault) {
|
if (this.style.Switch.jointImg.faultStatus && model.fault) {
|
||||||
this.setForkAction(model.fault)
|
this.setForkAction(model.fault);
|
||||||
} else if (this.style.Switch.faultNoHandle) {
|
} else if (this.style.Switch.faultNoHandle) {
|
||||||
this.shapeModelA.hide();
|
this.shapeModelA.hide();
|
||||||
this.shapeModelB.hide();
|
this.shapeModelB.hide();
|
||||||
@ -742,7 +744,7 @@ export default class Switch extends Group {
|
|||||||
model.isCiConfirm && this.setCiConfirm(); // 道岔使能显示
|
model.isCiConfirm && this.setCiConfirm(); // 道岔使能显示
|
||||||
|
|
||||||
model.singleLock && this.setMonolock(model.pos); // 道岔单锁
|
model.singleLock && this.setMonolock(model.pos); // 道岔单锁
|
||||||
model.guideMasterLock && this.setMonolock(model.pos); // 引导总锁
|
model.guideMasterLock && this.setMonolock(model.pos); // 引导总锁
|
||||||
model.blockade && this.block(model.pos); // 道岔封锁
|
model.blockade && this.block(model.pos); // 道岔封锁
|
||||||
model.singleLock && model.blockade && this.blockMonolock(); // 单锁&锁闭状态
|
model.singleLock && model.blockade && this.blockMonolock(); // 单锁&锁闭状态
|
||||||
const path = window.location.href;
|
const path = window.location.href;
|
||||||
|
@ -10,6 +10,12 @@ export default class Text2 extends Group {
|
|||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.name = model.code;
|
this.name = model.code;
|
||||||
this.zlevel = model.zlevel;
|
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.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.z = 6;
|
this.z = 6;
|
||||||
@ -21,6 +27,7 @@ export default class Text2 extends Group {
|
|||||||
|
|
||||||
create() {
|
create() {
|
||||||
var model = this.model;
|
var model = this.model;
|
||||||
|
const computedPosition = this.computedPosition;
|
||||||
var [direction, content] = model.content.split('::');
|
var [direction, content] = model.content.split('::');
|
||||||
if (direction == 'V') {
|
if (direction == 'V') {
|
||||||
content = content.split('').join('\n');
|
content = content.split('').join('\n');
|
||||||
@ -32,8 +39,8 @@ export default class Text2 extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
style: {
|
style: {
|
||||||
x: model.position.x,
|
x: computedPosition.x,
|
||||||
y: model.position.y,
|
y: computedPosition.y,
|
||||||
text: content,
|
text: content,
|
||||||
fontFamily: this.style.fontFamily,
|
fontFamily: this.style.fontFamily,
|
||||||
fontSize: Number(model.font),
|
fontSize: Number(model.font),
|
||||||
@ -58,7 +65,7 @@ export default class Text2 extends Group {
|
|||||||
if (this.text) {
|
if (this.text) {
|
||||||
return this.text.getBoundingRect().clone();
|
return this.text.getBoundingRect().clone();
|
||||||
} else {
|
} 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() {
|
screenShow() {
|
||||||
@ -70,6 +77,6 @@ export default class Text2 extends Group {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
getAnchorPoint() {
|
getAnchorPoint() {
|
||||||
return this.model.position;
|
return this.computedPosition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,12 +41,12 @@ export default class Train extends Group {
|
|||||||
if (model.trainWindowModel) {
|
if (model.trainWindowModel) {
|
||||||
const amendData = store.getters['map/amendPoints'](model.trainWindowModel.code);
|
const amendData = store.getters['map/amendPoints'](model.trainWindowModel.code);
|
||||||
if (amendData) {
|
if (amendData) {
|
||||||
model.trainWindowModel.point = amendData.position;
|
model.trainWindowModel.instance.computedPoint = amendData.position;
|
||||||
model.trainWindowModel.reversal = amendData.reversal;
|
model.trainWindowModel.reversal = amendData.reversal;
|
||||||
}
|
}
|
||||||
this.point = {
|
this.point = {
|
||||||
x: model.trainWindowModel.point.x,
|
x: model.trainWindowModel.instance.computedPoint.x,
|
||||||
y: model.trainWindowModel.point.y
|
y: model.trainWindowModel.instance.computedPoint.y
|
||||||
};
|
};
|
||||||
if (model.right) {
|
if (model.right) {
|
||||||
this.point.x = this.point.x - style.Train.trainHead.trainConntWidth * this.newScale - style.Train.common.trainWidth / 2;
|
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)
|
if (style.Train.directionArrow.hasArrow) { // 列车运行上下方箭头(eg:宁波yi)
|
||||||
const arrowPoint = { x: 0, y: 0 };
|
const arrowPoint = { x: 0, y: 0 };
|
||||||
if (model.trainWindowModel) {
|
if (model.trainWindowModel) {
|
||||||
arrowPoint.x = model.trainWindowModel.point.x;
|
arrowPoint.x = model.trainWindowModel.instance.computedPoint.x;
|
||||||
arrowPoint.y = model.right ? model.trainWindowModel.point.y + style.Train.directionArrow.distanceBottom : model.trainWindowModel.point.y - style.Train.directionArrow.distanceTop;
|
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({
|
this.directionArrow = new EDirection({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
|
@ -11,9 +11,14 @@ class TrainWindow extends Group {
|
|||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
this.zlevel = model.zlevel;
|
||||||
const amendData = store.getters['map/amendPoints'](this._code);
|
const amendData = store.getters['map/amendPoints'](this._code);
|
||||||
|
const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
|
||||||
if (amendData) {
|
if (amendData) {
|
||||||
model.point = amendData.position;
|
|
||||||
model.reversal = amendData.reversal;
|
model.reversal = amendData.reversal;
|
||||||
|
this.computedPoint = amendData.position;
|
||||||
|
} else if (pictureDevice) {
|
||||||
|
this.computedPoint = pictureDevice.position;
|
||||||
|
} else {
|
||||||
|
this.computedPoint = model.point;
|
||||||
}
|
}
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
@ -40,7 +45,7 @@ class TrainWindow extends Group {
|
|||||||
/** 创建车次窗*/
|
/** 创建车次窗*/
|
||||||
createTrainWindow() {
|
createTrainWindow() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const point = model.point || model.position;
|
const point = this.computedPoint;
|
||||||
this.trainRect = new Polygon({
|
this.trainRect = new Polygon({
|
||||||
_subType: 'TrainWindow',
|
_subType: 'TrainWindow',
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
@ -94,7 +99,7 @@ class TrainWindow extends Group {
|
|||||||
return (store.getters['map/getDeviceByCode'](code) || {}).instance;
|
return (store.getters['map/getDeviceByCode'](code) || {}).instance;
|
||||||
}
|
}
|
||||||
getAnchorPoint() {
|
getAnchorPoint() {
|
||||||
return this.model.point || this.model.position;
|
return this.computedPoint;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,8 +14,8 @@ export default class EMouse extends Group {
|
|||||||
z: this.device.z + 1,
|
z: this.device.z + 1,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: this.device.model.position.x,
|
x: this.device.computedPosition.x,
|
||||||
y: this.device.model.position.y + this.device.style.ZcControl.lamp.radiusR + this.device.style.ZcControl.text.distance - 30,
|
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,
|
fontWeight: this.device.style.ZcControl.mouseOverStyle.fontWeight,
|
||||||
fontSize: this.device.style.ZcControl.mouseOverStyle.fontSize,
|
fontSize: this.device.style.ZcControl.mouseOverStyle.fontSize,
|
||||||
fontFamily: this.device.style.fontFamily,
|
fontFamily: this.device.style.fontFamily,
|
||||||
|
@ -13,6 +13,12 @@ export default class ZcControl extends Group {
|
|||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
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.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.isShowShape = true;
|
this.isShowShape = true;
|
||||||
@ -29,8 +35,8 @@ export default class ZcControl extends Group {
|
|||||||
z: this.z,
|
z: this.z,
|
||||||
arc: {
|
arc: {
|
||||||
shape: {
|
shape: {
|
||||||
cx: model.position.x,
|
cx: this.computedPosition.x,
|
||||||
cy: model.position.y,
|
cy: this.computedPosition.y,
|
||||||
r: this.style.ZcControl.lamp.radiusR
|
r: this.style.ZcControl.lamp.radiusR
|
||||||
},
|
},
|
||||||
subType: 'Control',
|
subType: 'Control',
|
||||||
@ -41,8 +47,8 @@ export default class ZcControl extends Group {
|
|||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
x: model.position.x,
|
x: this.computedPosition.x,
|
||||||
y: model.position.y + this.style.ZcControl.lamp.radiusR + this.style.ZcControl.text.distance,
|
y: this.computedPosition.y + this.style.ZcControl.lamp.radiusR + this.style.ZcControl.text.distance,
|
||||||
fontWeight: this.style.ZcControl.text.fontWeight,
|
fontWeight: this.style.ZcControl.text.fontWeight,
|
||||||
fontSize: this.style.ZcControl.text.fontSize,
|
fontSize: this.style.ZcControl.text.fontSize,
|
||||||
fontFamily: this.style.fontFamily,
|
fontFamily: this.style.fontFamily,
|
||||||
|
@ -30,4 +30,5 @@ export default class checkBox extends Group {
|
|||||||
});
|
});
|
||||||
this.add(this.box);
|
this.add(this.box);
|
||||||
}
|
}
|
||||||
|
setState() {}
|
||||||
}
|
}
|
||||||
|
@ -584,10 +584,25 @@ export const menuOperate = {
|
|||||||
operation: OperationEvent.CTCCommand.stationCancleTwinkle.menu.operation,
|
operation: OperationEvent.CTCCommand.stationCancleTwinkle.menu.operation,
|
||||||
cmdType: CMD.CTC.CTC_CANCEL_TWINKLE
|
cmdType: CMD.CTC.CTC_CANCEL_TWINKLE
|
||||||
},
|
},
|
||||||
// 移除行车日志
|
// // 移除行车日志
|
||||||
deleteRunplan:{
|
// deleteRunplan:{
|
||||||
operation: OperationEvent.CTCCommand.deleteRunplan.menu.operation,
|
// operation: OperationEvent.CTCCommand.deleteRunplan.menu.operation,
|
||||||
cmdType: CMD.CTC.CTC_REMOVE_RUN_PLAN
|
// 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:{
|
modifyAdjacentStation:{
|
||||||
|
@ -46,7 +46,8 @@ export default {
|
|||||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||||
},
|
},
|
||||||
domIdConfirm() {
|
domIdConfirm() {
|
||||||
return this.dialogShow ? OperationEvent.CTCCommand.deleteRunplan.menu.domId : '';
|
// deleteRunplan
|
||||||
|
return this.dialogShow ? OperationEvent.CTCCommand.setDeleteRunplanLabel.menu.domId : '';
|
||||||
},
|
},
|
||||||
title() {
|
title() {
|
||||||
return '警告';
|
return '警告';
|
||||||
@ -69,7 +70,9 @@ export default {
|
|||||||
},
|
},
|
||||||
commit() {
|
commit() {
|
||||||
this.loading = true;
|
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.loading = false;
|
||||||
this.$emit('clearRpRow');
|
this.$emit('clearRpRow');
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
width="105"
|
width="105"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div v-if="scope.row.arriveRunPlan" :title="scope.row.arriveRunPlan.accessName">{{ scope.row.arriveRunPlan.accessName }}</div>
|
<div v-if="scope.row.arriveRunPlan" :title="mapStationDirectionData[scope.row.arriveRunPlan.accessName].name">{{ mapStationDirectionData[scope.row.arriveRunPlan.accessName].name }}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
@ -60,7 +60,7 @@
|
|||||||
width="105"
|
width="105"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div v-if="scope.row.departRunPlan" :title="scope.row.departRunPlan.accessName">{{ scope.row.departRunPlan.accessName }}</div>
|
<div v-if="scope.row.departRunPlan" :title="mapStationDirectionData[scope.row.departRunPlan.accessName].name">{{ mapStationDirectionData[scope.row.departRunPlan.accessName].name }}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
@ -152,6 +152,9 @@ export default {
|
|||||||
},
|
},
|
||||||
title() {
|
title() {
|
||||||
return '发送计划';
|
return '发送计划';
|
||||||
|
},
|
||||||
|
mapStationDirectionData() {
|
||||||
|
return this.$store.state.map.mapStationDirectionData;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
|
445
src/jmapNew/theme/datie_02/menus/dialog/trainRunplan.vue
Normal file
445
src/jmapNew/theme/datie_02/menus/dialog/trainRunplan.vue
Normal file
@ -0,0 +1,445 @@
|
|||||||
|
<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;
|
||||||
|
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.sectionCode;
|
||||||
|
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>
|
@ -4,8 +4,8 @@
|
|||||||
<menu-bar v-if="isShowBar" ref="menuBar" :date-strin="dateString1" :selected="selected" />
|
<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 v-if="isCtc" style="position: absolute; top: 64px;z-index: 10;background: #F0F0F0;padding: 2px;height: 65px;width: 100%;">
|
||||||
<div style="display: flex;">
|
<div style="display: flex;">
|
||||||
<img :src="ctcBarIcon1" class="img-box">
|
<img :src="ctcBarIcon1" class="img-box" @click="zhanjiantouming">
|
||||||
<img :src="ctcBarIcon2" class="img-box">
|
<img :src="ctcBarIcon2" class="img-box" @click="danzhanxianshi">
|
||||||
<img :src="ctcBarIcon3" class="img-box">
|
<img :src="ctcBarIcon3" class="img-box">
|
||||||
<img :src="ctcBarIcon4" class="img-box">
|
<img :src="ctcBarIcon4" class="img-box">
|
||||||
<img :src="ctcBarIcon5" class="img-box">
|
<img :src="ctcBarIcon5" class="img-box">
|
||||||
@ -140,6 +140,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
currentRailwaySimulationRunplan:{},
|
currentRailwaySimulationRunplan:{},
|
||||||
|
showCentralizedStationCode: '',
|
||||||
alarmMessages: [
|
alarmMessages: [
|
||||||
{ id: 1, message: '这是告警信息一' },
|
{ id: 1, message: '这是告警信息一' },
|
||||||
{ id: 2, message: '这是告警信息二' },
|
{ id: 2, message: '这是告警信息二' },
|
||||||
@ -244,6 +245,7 @@ export default {
|
|||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
window.onclick = function (e) {};
|
window.onclick = function (e) {};
|
||||||
|
this.$store.dispatch('map/setPictureDeviceMap', {});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeSignedStatus(info) {
|
changeSignedStatus(info) {
|
||||||
@ -260,6 +262,41 @@ export default {
|
|||||||
this.$refs.cmdManage.doShow();
|
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() {
|
getRailwaySimulationRunplanSend() {
|
||||||
const stationCode = this.$store.state.training.roleDeviceCode;
|
const stationCode = this.$store.state.training.roleDeviceCode;
|
||||||
const railwaySimulationRunplanSendMap = this.$store.state.socket.railwaySimulationRunplanSendMap;
|
const railwaySimulationRunplanSendMap = this.$store.state.socket.railwaySimulationRunplanSendMap;
|
||||||
|
@ -396,6 +396,8 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
buttonDown(operation, commandTypeList) {
|
buttonDown(operation, commandTypeList) {
|
||||||
|
const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.map.showCentralizedStationCode);
|
||||||
|
if (station.controlMode === 'Interlock') { return; }
|
||||||
this.clearOperate();
|
this.clearOperate();
|
||||||
if (operation != this.Command.cancel.clearMbm.operation) {
|
if (operation != this.Command.cancel.clearMbm.operation) {
|
||||||
const operate = {
|
const operate = {
|
||||||
|
@ -145,6 +145,10 @@ export default {
|
|||||||
if (this.selected.type != '04') {
|
if (this.selected.type != '04') {
|
||||||
// this.menu = MenuContextHandler.covert(this.menuNormal);
|
// this.menu = MenuContextHandler.covert(this.menuNormal);
|
||||||
this.menu = this.menuNormal.Local;
|
this.menu = this.menuNormal.Local;
|
||||||
|
const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.map.showCentralizedStationCode);
|
||||||
|
if (station.controlMode === 'Interlock' && this.$route.query.ctc) {
|
||||||
|
this.menu.forEach(item => { item.disabled = true; });
|
||||||
|
} else { this.menu.forEach(item => { item.disabled = false; }); }
|
||||||
} else {
|
} else {
|
||||||
this.menu = [];
|
this.menu = [];
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
|
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
|
||||||
<password-box ref="passwordBox" pop-class="chengdou-03__systerm" @checkOver="passWordCommit" />
|
<password-box ref="passwordBox" pop-class="chengdou-03__systerm" @checkOver="passWordCommit" />
|
||||||
<draw-select ref="drawSelect" />
|
<draw-select ref="drawSelect" />
|
||||||
<route-cancel ref="routeCancel" />
|
<route-cancel ref="routeCancel" />
|
||||||
<set-fault ref="setFault" pop-class="chengdou-03__systerm" />
|
<set-fault ref="setFault" pop-class="chengdou-03__systerm" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -46,7 +46,7 @@ export default {
|
|||||||
PasswordBox,
|
PasswordBox,
|
||||||
SetFault,
|
SetFault,
|
||||||
DrawSelect,
|
DrawSelect,
|
||||||
RouteCancel
|
RouteCancel
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
selected: {
|
selected: {
|
||||||
@ -61,52 +61,52 @@ export default {
|
|||||||
menu: [],
|
menu: [],
|
||||||
menuNormal: {
|
menuNormal: {
|
||||||
Local: [
|
Local: [
|
||||||
{
|
{
|
||||||
label: '办理 通过进路',
|
label: '办理 通过进路',
|
||||||
handler: this.arrangementRoute,
|
handler: this.arrangementRoute,
|
||||||
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
|
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'separator'
|
type: 'separator'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '列车 办理进路',
|
label: '列车 办理进路',
|
||||||
handler: this.arrangementRoute,
|
handler: this.arrangementRoute,
|
||||||
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
|
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '取消进路',
|
label: '取消进路',
|
||||||
handler: this.cancelTrainRoute,
|
handler: this.cancelTrainRoute,
|
||||||
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
|
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '信号重开',
|
label: '信号重开',
|
||||||
handler: this.reopenSignal,
|
handler: this.reopenSignal,
|
||||||
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
|
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '封锁/解封',
|
label: '封锁/解封',
|
||||||
handler: '',
|
handler: '',
|
||||||
cmdType: ''
|
cmdType: ''
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '总人解',
|
label: '总人解',
|
||||||
handler: this.humanTrainRoute,
|
handler: this.humanTrainRoute,
|
||||||
cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE
|
cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'separator'
|
type: 'separator'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '引导',
|
label: '引导',
|
||||||
handler: this.guide,
|
handler: this.guide,
|
||||||
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
|
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '坡道解锁',
|
label: '坡道解锁',
|
||||||
handler: '',
|
handler: '',
|
||||||
cmdType: ''
|
cmdType: ''
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
Center: [
|
Center: [
|
||||||
// {
|
// {
|
||||||
@ -197,7 +197,6 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$store.state.menuOperation.menuCount': function (val) {
|
'$store.state.menuOperation.menuCount': function (val) {
|
||||||
console.log(DeviceMenu.Signal, val, this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Signal), this.buttonOperation);
|
|
||||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Signal) && (!this.buttonOperation || this.$route.query.ctc)) {
|
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Signal) && (!this.buttonOperation || this.$route.query.ctc)) {
|
||||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||||
} else {
|
} else {
|
||||||
@ -210,6 +209,10 @@ export default {
|
|||||||
// 编辑模式菜单列表
|
// 编辑模式菜单列表
|
||||||
// this.menu = MenuContextHandler.covert(this.menuNormal);
|
// this.menu = MenuContextHandler.covert(this.menuNormal);
|
||||||
this.menu = this.menuNormal.Local;
|
this.menu = this.menuNormal.Local;
|
||||||
|
const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.map.showCentralizedStationCode);
|
||||||
|
if (station.controlMode === 'Interlock' && this.$route.query.ctc) {
|
||||||
|
this.menu.forEach(item => { item.disabled = true; });
|
||||||
|
} else { this.menu.forEach(item => { item.disabled = false; }); }
|
||||||
// 故障模式菜单列表
|
// 故障模式菜单列表
|
||||||
if (this.operatemode === OperateMode.FAULT) {
|
if (this.operatemode === OperateMode.FAULT) {
|
||||||
this.menu = this.menuForce;
|
this.menu = this.menuForce;
|
||||||
@ -271,7 +274,7 @@ export default {
|
|||||||
commitOperate(menuOperate.Signal.arrangementRoute, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
|
commitOperate(menuOperate.Signal.arrangementRoute, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
// this.$refs.routeSelection.doShow(operate, this.selected, this.getRouteList(this.selected));
|
// this.$refs.routeSelection.doShow(operate, this.selected, this.getRouteList(this.selected));
|
||||||
EventBus.$emit('arrangementRouteMenu', this.selected);
|
EventBus.$emit('arrangementRouteMenu', this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -280,7 +283,7 @@ export default {
|
|||||||
commitOperate(menuOperate.Signal.guide, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
|
commitOperate(menuOperate.Signal.guide, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
// this.$refs.passwordBox.doShow({...operate, ...{selected: this.selected}, ...{routesList: this.getRouteList(this.selected)}});
|
// this.$refs.passwordBox.doShow({...operate, ...{selected: this.selected}, ...{routesList: this.getRouteList(this.selected)}});
|
||||||
this.$refs.routeCancel.doShow(operate, this.selected)
|
this.$refs.routeCancel.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -308,21 +311,21 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
lockOrUnlock() {
|
lockOrUnlock() {
|
||||||
if (this.selected.lock) {
|
if (this.selected.lock) {
|
||||||
commitOperate(menuOperate.Signal.lock, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
|
commitOperate(menuOperate.Signal.lock, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$refs.routeControl.doShow(operate, this.selected);
|
this.$refs.routeControl.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
} else {
|
} else {
|
||||||
commitOperate(menuOperate.Signal.unlock, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
|
commitOperate(menuOperate.Signal.unlock, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$refs.routeControl.doShow(operate, this.selected);
|
this.$refs.routeControl.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 信号封锁
|
// 信号封锁
|
||||||
lock() {
|
lock() {
|
||||||
commitOperate(menuOperate.Signal.lock, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
|
commitOperate(menuOperate.Signal.lock, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<switch-hook-lock ref="switchHookLock" pop-class="chengdou-03__systerm" />
|
<switch-hook-lock ref="switchHookLock" pop-class="chengdou-03__systerm" />
|
||||||
<set-fault ref="setFault" pop-class="datie-02__systerm" />
|
<set-fault ref="setFault" pop-class="datie-02__systerm" />
|
||||||
<draw-select ref="drawSelect" />
|
<draw-select ref="drawSelect" />
|
||||||
<route-cancel ref="routeCancel" />
|
<route-cancel ref="routeCancel" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ export default {
|
|||||||
SetFault,
|
SetFault,
|
||||||
SwitchHookLock,
|
SwitchHookLock,
|
||||||
DrawSelect,
|
DrawSelect,
|
||||||
RouteCancel
|
RouteCancel
|
||||||
},
|
},
|
||||||
mixins: [
|
mixins: [
|
||||||
CancelMouseState
|
CancelMouseState
|
||||||
@ -54,66 +54,66 @@ export default {
|
|||||||
menu: [],
|
menu: [],
|
||||||
menuNormal: {
|
menuNormal: {
|
||||||
Local: [
|
Local: [
|
||||||
{
|
{
|
||||||
label: '定操',
|
label: '定操',
|
||||||
handler: this.locate,
|
handler: this.locate,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
|
cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '反操',
|
label: '反操',
|
||||||
handler: this.reverse,
|
handler: this.reverse,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
|
cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '单锁',
|
label: '单锁',
|
||||||
handler: this.lock,
|
handler: this.lock,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
|
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '单解',
|
label: '单解',
|
||||||
handler: this.unlock,
|
handler: this.unlock,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
|
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '封锁/解封',
|
label: '封锁/解封',
|
||||||
handle: ''
|
handle: ''
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '区故解',
|
label: '区故解',
|
||||||
handle: ''
|
handle: ''
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '岔前 分路不良',
|
label: '岔前 分路不良',
|
||||||
handle: ''
|
handle: ''
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '定位 分路不良',
|
label: '定位 分路不良',
|
||||||
handle: ''
|
handle: ''
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '反位 分路不良',
|
label: '反位 分路不良',
|
||||||
handle: ''
|
handle: ''
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '接触网定位无电',
|
label: '接触网定位无电',
|
||||||
handle: ''
|
handle: ''
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '接触网反位无电',
|
label: '接触网反位无电',
|
||||||
handle: ''
|
handle: ''
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '添加调机号',
|
label: '添加调机号',
|
||||||
handle: ''
|
handle: ''
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '删除调机号',
|
label: '删除调机号',
|
||||||
handle: ''
|
handle: ''
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '修改调机号',
|
label: '修改调机号',
|
||||||
handle: ''
|
handle: ''
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
Center: [
|
Center: [
|
||||||
// {
|
// {
|
||||||
@ -187,7 +187,7 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$store.state.menuOperation.menuCount': function (val) {
|
'$store.state.menuOperation.menuCount': function (val) {
|
||||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Switch) && (!this.buttonOperation || this.$route.query.ctc)) {
|
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Switch) && (!this.buttonOperation || this.$route.query.ctc)) {
|
||||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||||
} else {
|
} else {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
@ -199,6 +199,10 @@ export default {
|
|||||||
// 编辑模式菜单列表
|
// 编辑模式菜单列表
|
||||||
// this.menu = MenuContextHandler.covert(this.menuNormal);
|
// this.menu = MenuContextHandler.covert(this.menuNormal);
|
||||||
this.menu = this.menuNormal.Local;
|
this.menu = this.menuNormal.Local;
|
||||||
|
const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.map.showCentralizedStationCode);
|
||||||
|
if (station.controlMode === 'Interlock' && this.$route.query.ctc) {
|
||||||
|
this.menu.forEach(item => { item.disabled = true; });
|
||||||
|
} else { this.menu.forEach(item => { item.disabled = false; }); }
|
||||||
// 故障模式菜单列表
|
// 故障模式菜单列表
|
||||||
if (this.operatemode === OperateMode.FAULT) {
|
if (this.operatemode === OperateMode.FAULT) {
|
||||||
if (!this.$store.state.scriptRecord.bgSet) {
|
if (!this.$store.state.scriptRecord.bgSet) {
|
||||||
@ -299,7 +303,7 @@ export default {
|
|||||||
commitOperate(menuOperate.Switch.locate, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
|
commitOperate(menuOperate.Switch.locate, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||||
if (valid) {
|
if (valid) {
|
||||||
// this.$refs.switchControl.doShow(operate, this.selected);
|
// this.$refs.switchControl.doShow(operate, this.selected);
|
||||||
this.$refs.routeCancel.doShow(operate, this.selected);
|
this.$refs.routeCancel.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -308,7 +312,7 @@ export default {
|
|||||||
commitOperate(menuOperate.Switch.reverse, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
|
commitOperate(menuOperate.Switch.reverse, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||||
if (valid) {
|
if (valid) {
|
||||||
// this.$refs.switchControl.doShow(operate, this.selected);
|
// this.$refs.switchControl.doShow(operate, this.selected);
|
||||||
this.$refs.routeCancel.doShow(operate, this.selected);
|
this.$refs.routeCancel.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -238,7 +238,10 @@ export default {
|
|||||||
initMenu() {
|
initMenu() {
|
||||||
// 编辑模式菜单列表
|
// 编辑模式菜单列表
|
||||||
this.menu = MenuContextHandler.covert(this.menuNormal);
|
this.menu = MenuContextHandler.covert(this.menuNormal);
|
||||||
console.log(this.menu, '================');
|
const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.map.showCentralizedStationCode);
|
||||||
|
if (station.controlMode === 'Interlock' && this.$route.query.ctc) {
|
||||||
|
this.menu.forEach(item => { item.disabled = true; });
|
||||||
|
} else { this.menu.forEach(item => { item.disabled = false; }); }
|
||||||
// 故障模式菜单列表
|
// 故障模式菜单列表
|
||||||
if (this.operatemode === OperateMode.FAULT) {
|
if (this.operatemode === OperateMode.FAULT) {
|
||||||
if (!this.$store.state.scriptRecord.bgSet) {
|
if (!this.$store.state.scriptRecord.bgSet) {
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user