Merge branch 'master' of git.cloud.tencent.com:joylink/jl-nclient

This commit is contained in:
sunzhenyu 2019-08-07 11:29:03 +08:00
commit e86be938f3
41 changed files with 406 additions and 537 deletions

View File

@ -308,7 +308,7 @@ class SkinStyle extends defaultStyle {
monolockColor: '#870E10' // 道岔单锁颜色 monolockColor: '#870E10' // 道岔单锁颜色
}, },
core: { core: {
legnth: 6 // 道岔单边长度 length: 6 // 道岔单边长度
}, },
monolock: { // 道岔单锁配置 monolock: { // 道岔单锁配置
locationColor: '#870E10', // 道岔单锁定位颜色 (红色) locationColor: '#870E10', // 道岔单锁定位颜色 (红色)

View File

@ -302,7 +302,7 @@ class SkinStyle extends defaultStyle {
monolockColor: '#FFFFFF' // 道岔单锁颜色 monolockColor: '#FFFFFF' // 道岔单锁颜色
}, },
core: { core: {
legnth: 6 // 道岔单边长度 length: 6 // 道岔单边长度
}, },
monolock: { // 道岔单锁配置 monolock: { // 道岔单锁配置
locationColor: '#00FF00', // 道岔单锁'定位'颜色 (绿色) locationColor: '#00FF00', // 道岔单锁'定位'颜色 (绿色)

View File

@ -281,7 +281,7 @@ class SkinStyle extends defaultStyle {
monolockColor: '#870E10' // 道岔单锁颜色 monolockColor: '#870E10' // 道岔单锁颜色
}, },
core: { core: {
legnth: 6 // 道岔单边长度 length: 6 // 道岔单边长度
}, },
block: { // 道岔封锁配置 block: { // 道岔封锁配置
nameBorderShow: true, // 道岔名称是否有包围框 显示 nameBorderShow: true, // 道岔名称是否有包围框 显示

View File

@ -166,7 +166,7 @@ class Jlmap {
} }
// 中间处理 // 中间处理
hookHandle(elem) { hookHandle(oDevice, elem) {
const code = elem.code; const code = elem.code;
const type = elem._type; const type = elem._type;
// 如果是延时计时,需要保存计数值到全局 // 如果是延时计时,需要保存计数值到全局
@ -179,7 +179,14 @@ class Jlmap {
localStore(code, val); localStore(code, val);
} }
return elem; for (var prop in elem) {
if (elem[prop] != oDevice[prop]) {
Object.assign(oDevice, elem);
return true;
}
}
return false;
} }
// 后处理 // 后处理
@ -213,6 +220,7 @@ class Jlmap {
const sectionB = this.mapDevice[swch.sectionBCode]; const sectionB = this.mapDevice[swch.sectionBCode];
const sectionC = this.mapDevice[swch.sectionCCode]; const sectionC = this.mapDevice[swch.sectionCCode];
if (sectionA && sectionB && sectionC) { if (sectionA && sectionB && sectionC) {
swch['cutOff'] = sectionA.cutOff;
swch['sectionAstatus'] = sectionA.status; swch['sectionAstatus'] = sectionA.status;
swch['sectionBstatus'] = sectionB.status; swch['sectionBstatus'] = sectionB.status;
swch['sectionCstatus'] = sectionC.status; swch['sectionCstatus'] = sectionC.status;
@ -233,17 +241,14 @@ class Jlmap {
if (elem.dispose) { if (elem.dispose) {
this.$painter.delete(oDevice); this.$painter.delete(oDevice);
} else { } else {
const nDevice = Object.assign(oDevice, this.hookHandle(elem)); if (this.hookHandle(oDevice, elem)) {
if (nDevice.id == '5888') { this.$painter.update(oDevice);
console.log(oDevice, nDevice);
debugger;
} }
this.$painter.update(nDevice);
} }
}); });
// 状态后处理 // 状态后处理
// this.postHandle(list); this.postHandle(list);
if (this.methods.stateUpdate instanceof Function) { this.methods.stateUpdate(list); } if (this.methods.stateUpdate instanceof Function) { this.methods.stateUpdate(list); }
} }

View File

@ -1,6 +1,7 @@
import deviceType from './constant/deviceType'; import deviceType from './constant/deviceType';
import Eventful from 'zrender/src/mixin/Eventful'; import Eventful from 'zrender/src/mixin/Eventful';
import * as eventTool from 'zrender/src/core/event'; import * as eventTool from 'zrender/src/core/event';
import store from '@/store';
class EventModel { class EventModel {
constructor(e) { constructor(e) {
@ -149,7 +150,14 @@ class MouseController extends Eventful {
} }
moveEvent(e) { moveEvent(e) {
return new EventModel(e); const newEm = new EventModel(e);
const trainDetails = store.state.map.trainDetails;
if (trainDetails) {
if (newEm.deviceType != deviceType.Train || trainDetails.code != newEm.deviceCode) {
var instance = (this.$jmap.getDeviceByCode(trainDetails.code) || {} ).instance;
instance && instance.removeTrainDetail && instance.removeTrainDetail();
}
}
} }
checkEvent(e) { checkEvent(e) {
@ -157,22 +165,24 @@ class MouseController extends Eventful {
var newEm = new EventModel(e); var newEm = new EventModel(e);
if ([1, 3].includes(e.which)) { if ([1, 3].includes(e.which)) {
// 查找之前和当前鼠标选中的实例 // 查找之前和当前鼠标选中的实例
var oldDevice = (this.$jmap.getDeviceByCode(oldEm.deviceCode) || {}).instance || {}; var oldDevice = this.$jmap.getDeviceByCode(oldEm.deviceCode) || {};
var newDevice = (this.$jmap.getDeviceByCode(newEm.deviceCode) || {}).instance || {}; var newDevice = this.$jmap.getDeviceByCode(newEm.deviceCode) || {};
var oldInstance = (this.$jmap.getDeviceByCode(oldEm.deviceCode) || {}).instance || {};
var newInstance = (this.$jmap.getDeviceByCode(newEm.deviceCode) || {}).instance || {};
// 如果之前和当前选中的实例不一致 // 如果之前和当前选中的实例不一致
if (oldDevice != newDevice) { if (oldInstance != newInstance) {
// 如果实例有取消选择函数并且被点击,则执行取消选中函数 // 如果实例有取消选择函数并且被点击,则执行取消选中函数
if (oldDevice.mouseEvent && oldDevice.mouseEvent.mouseout) { if (oldInstance.mouseEvent && oldInstance.mouseEvent.mouseout) {
// 视图数据设置点击标志,同步执行 // 视图数据设置点击标志,同步执行
oldDevice.mouseEvent['down'] = false; oldDevice['down'] = false;
oldDevice.mouseEvent['mouseout'](e); oldInstance.mouseEvent['mouseout'](e);
} }
// 如果实例有选中函数并且被点击,则执行选中函数 // 如果实例有选中函数并且被点击,则执行选中函数
if (e.which == 3 && newDevice.mouseEvent && newDevice.mouseEvent.mouseover) { if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) {
newDevice.mouseEvent['down'] = true; newDevice['down'] = true;
newDevice.mouseEvent['mouseover'](e); newInstance.mouseEvent['mouseover'](e);
} }
} }

View File

@ -5,12 +5,10 @@ export default class EMouse extends Group {
constructor(device) { constructor(device) {
super(); super();
this.device = device; this.device = device;
this.down = false;
this.create(); this.create();
} }
create() { create() {
this.text = new Text({ this.text = new Text({
_subType: 'Text',
zlevel: this.device.zlevel, zlevel: this.device.zlevel,
z: this.device.z+1, z: this.device.z+1,
position: [0, 0], position: [0, 0],
@ -29,32 +27,27 @@ export default class EMouse extends Group {
this.add(this.text); this.add(this.text);
this.text.hide(); this.text.hide();
} }
mouseoverText(e) { mouseover(e) {
this.text.show(); if (e.target && e.target._subType == 'Text') {
} this.text.show();
} else {
mouseoutText(e) { this.device.control.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor);
if (!this.down) { this.device.control.setTextColor(this.device.style.LcControl.mouseOverStyle.textColor);
this.text.hide(); this.device.control.setTextBorder(true);
this.device.control.setArcBorder(true);
} }
} }
mouseoverArc(e) {
this.device.control.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor);
this.device.control.setTextColor(this.device.style.LcControl.mouseOverStyle.textColor);
this.device.control.setTextBorder(true);
this.device.control.setArcBorder(true);
}
mouseoutArc(e) {
if (!this.down) {
this.device.control.setControlColor(this.device.style.LcControl.lamp.controlColor);
this.device.control.setTextColor('#FFFFFF');
this.device.control.setTextBorder(false);
this.device.control.setArcBorder(false);
}
}
mouseout(e) { mouseout(e) {
this.mouseoutText(e); if (!this.device.model.down) {
this.mouseoutArc(e); if (e.target && e.target._subType == 'Text') {
this.text.hide();
} else {
this.device.control.setControlColor(this.device.style.LcControl.lamp.controlColor);
this.device.control.setTextColor('#FFFFFF');
this.device.control.setTextBorder(false);
this.device.control.setArcBorder(false);
}
}
} }
} }

View File

@ -14,8 +14,9 @@ export default class LcControl extends Group {
this.zlevel = model.zlevel; this.zlevel = model.zlevel;
this.model = model; this.model = model;
this.style = style; this.style = style;
this.createMouseEvent();
this.create(); this.create();
this.createMouseEvent();
this.setState(model);
} }
create() { create() {
@ -30,9 +31,7 @@ export default class LcControl extends Group {
r: this.style.LcControl.lamp.radiusR r: this.style.LcControl.lamp.radiusR
}, },
lineWidth: 0, lineWidth: 0,
fill: this.style.LcControl.lamp.controlColor, fill: this.style.LcControl.lamp.controlColor
mouseover: this.mouseoverArc,
mouseout: this.mouseoutArc
}, },
text: { text: {
position: [0, 0], position: [0, 0],
@ -44,15 +43,12 @@ export default class LcControl extends Group {
text: model.name, text: model.name,
textFill: '#fff', textFill: '#fff',
textAlign: 'middle', textAlign: 'middle',
textVerticalAlign: 'top', textVerticalAlign: 'top'
mouseover: this.mouseoverText,
mouseout: this.mouseoutText
}, },
style: this.style style: this.style
}); });
this.add(this.control); this.add(this.control);
this.setState(model);
} }
// 设置状态 // 设置状态
@ -63,18 +59,8 @@ export default class LcControl extends Group {
if (this.style.LcControl.mouseOverStyle) { if (this.style.LcControl.mouseOverStyle) {
this.mouseEvent = new EMouse(this); this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent); this.add(this.mouseEvent);
this.mouseoverText = (e) => { this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
this.mouseEvent.mouseoverText(e); this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
};
this.mouseoutText = (e) => {
this.mouseEvent.mouseoutText(e);
};
this.mouseoverArc = (e) => {
this.mouseEvent.mouseoverArc(e);
};
this.mouseoutArc = (e) => {
this.mouseEvent.mouseoutArc(e);
};
} }
} }

View File

@ -5,7 +5,6 @@ export default class EMouse extends Group {
constructor(device) { constructor(device) {
super(); super();
this.device = device; this.device = device;
this.down = false;
this.create(); this.create();
} }
create() { create() {
@ -29,32 +28,27 @@ export default class EMouse extends Group {
this.add(this.text); this.add(this.text);
this.text.hide(); this.text.hide();
} }
mouseoverText(e) { mouseover(e) {
this.text.show(); if (e.target && e.target._subType == 'Text') {
} this.text.show();
} else {
mouseoutText(e) { this.device.control.setControlColor(this.device.style.LimitControl.mouseOverStyle.arcColor);
if (!this.down) { this.device.control.setTextColor(this.device.style.LimitControl.mouseOverStyle.textColor);
this.text.hide(); this.device.control.setTextBorder(true);
this.device.control.setArcBorder(true);
} }
} }
mouseoverArc(e) {
this.device.control.setControlColor(this.device.style.LimitControl.mouseOverStyle.arcColor);
this.device.control.setTextColor(this.device.style.LimitControl.mouseOverStyle.textColor);
this.device.control.setTextBorder(true);
this.device.control.setArcBorder(true);
}
mouseoutArc(e) {
if (!this.down) {
this.device.control.setControlColor(this.device.style.LimitControl.lamp.controlColor);
this.device.control.setTextColor('#FFFFFF');
this.device.control.setTextBorder(false);
this.device.control.setArcBorder(false);
}
}
mouseout(e) { mouseout(e) {
this.mouseoutText(e); if (!this.device.model.down) {
this.mouseoutArc(e); if (e.target && e.target._subType == 'Text') {
this.text.hide();
} else {
this.device.control.setControlColor(this.device.style.LimitControl.lamp.controlColor);
this.device.control.setTextColor('#FFFFFF');
this.device.control.setTextBorder(false);
this.device.control.setArcBorder(false);
}
}
} }
} }

View File

@ -15,8 +15,9 @@ export default class LimitControl extends Group {
this.model = model; this.model = model;
this.style = style; this.style = style;
this.z = 20; this.z = 20;
this.createMouseEvent();
this.create(model); this.create(model);
this.createMouseEvent();
this.setState(model);
} }
create(model) { create(model) {
@ -52,7 +53,6 @@ export default class LimitControl extends Group {
}); });
this.add(this.control); this.add(this.control);
this.setState(this.model);
} }
// 设置状态 // 设置状态
@ -63,18 +63,8 @@ export default class LimitControl extends Group {
if (this.style.LimitControl.mouseOverStyle) { if (this.style.LimitControl.mouseOverStyle) {
this.mouseEvent = new EMouse(this); this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent); this.add(this.mouseEvent);
this.mouseoverText = (e) => { this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
this.mouseEvent.mouseoverText(e); this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
};
this.mouseoutText = (e) => {
this.mouseEvent.mouseoutText(e);
};
this.mouseoverArc = (e) => {
this.mouseEvent.mouseoverArc(e);
};
this.mouseoutArc = (e) => {
this.mouseEvent.mouseoutArc(e);
};
} }
} }

View File

@ -32,7 +32,7 @@ import JTriangle from '../../utils/JTriangle';
// ctx.bezierCurveTo(shape[`cpx1`], shape[`cpy1`], shape[`cpx2`], shape[`cpy2`], shape[`x2`], shape[`y2`]); // ctx.bezierCurveTo(shape[`cpx1`], shape[`cpy1`], shape[`cpx2`], shape[`cpy2`], shape[`x2`], shape[`y2`]);
// } // }
// } else { // } else {
// const swPadding = model.style.Switch.core.legnth; // 定位和反位时区段距离岔芯的距离 // const swPadding = model.style.Switch.core.length; // 定位和反位时区段距离岔芯的距离
// var switchWidth = model.style.Section.line.width + model.style.Section.line.beyondWidth; // 道岔宽度 // var switchWidth = model.style.Section.line.width + model.style.Section.line.beyondWidth; // 道岔宽度
// const beg = Object.assign({}, model.points[0]); // const beg = Object.assign({}, model.points[0]);
// const end = Object.assign({}, model.points[model.points.length - 1]); // const end = Object.assign({}, model.points[model.points.length - 1]);
@ -117,7 +117,7 @@ export default class ELimitLines extends Group {
// const beg = Object.assign({}, model.points[0]); // const beg = Object.assign({}, model.points[0]);
// const end = Object.assign({}, model.points[model.points.length - 1]); // const end = Object.assign({}, model.points[model.points.length - 1]);
const swPadding = model.style.Switch.core.legnth; // 定位和反位时区段距离岔芯的距离 const swPadding = model.style.Switch.core.length; // 定位和反位时区段距离岔芯的距离
var switchWidth = model.style.Section.line.width + model.style.Section.line.beyondWidth; // 道岔宽度 var switchWidth = model.style.Section.line.width + model.style.Section.line.beyondWidth; // 道岔宽度
const beg = Object.assign({}, model.points[0]); const beg = Object.assign({}, model.points[0]);
const end = Object.assign({}, model.points[model.points.length - 1]); const end = Object.assign({}, model.points[model.points.length - 1]);

View File

@ -6,7 +6,6 @@ import store from '@/store';
class EMouse extends Group { class EMouse extends Group {
constructor(device, code) { constructor(device, code) {
super(); super();
this.down = false;
this.device = device; this.device = device;
this.code = code; this.code = code;
this.create(); this.create();
@ -90,7 +89,6 @@ class EMouse extends Group {
} }
mouseover(e) { mouseover(e) {
debugger;
if (this.device.model.isSwitchSection && this.device.model.relSwitchCode) { if (this.device.model.isSwitchSection && this.device.model.relSwitchCode) {
const instance = this.getInstanceByCode(this.device.model.relSwitchCode); const instance = this.getInstanceByCode(this.device.model.relSwitchCode);
if (instance && instance.mouseEvent && instance.mouseEvent.mouseover) { if (instance && instance.mouseEvent && instance.mouseEvent.mouseover) {
@ -108,7 +106,7 @@ class EMouse extends Group {
} }
mouseout(e) { mouseout(e) {
if (!this.down) { if (!this.device.model.down) {
this.sectionTextShadow && this.sectionTextShadow.hide(); this.sectionTextShadow && this.sectionTextShadow.hide();
if (this.device.model.isSwitchSection && this.device.model.relSwitchCode) { if (this.device.model.isSwitchSection && this.device.model.relSwitchCode) {
const instance = this.getInstanceByCode(this.device.model.relSwitchCode); const instance = this.getInstanceByCode(this.device.model.relSwitchCode);

View File

@ -7,7 +7,6 @@ export default class EMouse extends Group {
this.device = device; this.device = device;
this.zlevel = device.zlevel; this.zlevel = device.zlevel;
this.style = device.style; this.style = device.style;
this.down = false;
this.create(); this.create();
} }
@ -52,7 +51,7 @@ export default class EMouse extends Group {
} }
mouseout(e) { mouseout(e) {
if (!this.down) { if (!this.device.model.down) {
this.nameRect.hide(); this.nameRect.hide();
this.lampRect.hide(); this.lampRect.hide();
this.device.lamps.forEach(elem => { this.device.lamps.forEach(elem => {

View File

@ -162,12 +162,8 @@ class Signal extends Group {
if (this.style.Signal.mouseOverStyle) { if (this.style.Signal.mouseOverStyle) {
this.mouseEvent = new EMouse(this); this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent); this.add(this.mouseEvent);
this.onmouseover = (e) => { this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
this.mouseEvent.mouseover(e); this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
};
this.onmouseout = (e) => {
this.mouseEvent.mouseout(e);
};
} }
} }

View File

@ -5,7 +5,6 @@ export default class EMouse extends Group {
constructor(device) { constructor(device) {
super(); super();
this.device = device; this.device = device;
this.down = false;
this.create(); this.create();
} }
create() { create() {
@ -36,25 +35,27 @@ export default class EMouse extends Group {
} }
} }
mouseover(e) { mouseover(e) {
let name = ''; if (e.target) {
switch (e.target.parent._subType) { let name = '';
case 'emergency': switch (e.target.parent._subType) {
name = '紧急站控'; case 'emergency':
break; name = '紧急站控';
case 'center': break;
name = '中控'; case 'center':
break; name = '中控';
case 'substation': break;
name = '站控'; case 'substation':
break; name = '站控';
break;
}
// debugger;
this.setTextContext(name);
this.text.show();
} }
// debugger;
this.setTextContext(name);
this.text.show();
} }
mouseout(e) { mouseout(e) {
if (!this.down) { if (!this.device.model.down) {
this.text.hide(); this.text.hide();
} }
} }

View File

@ -142,8 +142,8 @@ export default class StationControl extends Group {
if (this.style.ZcControl.mouseOverStyle) { if (this.style.ZcControl.mouseOverStyle) {
this.mouseEvent = new EMouse(this); this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent); this.add(this.mouseEvent);
this.onmouseover = (e) => { this.mouseEvent.mouseover(e); }; this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
this.onmouseout = (e) => { this.mouseEvent.mouseout(e); }; this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
} }
} }
getShapeTipPoint() { getShapeTipPoint() {

View File

@ -7,7 +7,6 @@ export default class EMouse extends Group {
this.device = device; this.device = device;
this.zlevel = device.zlevel; this.zlevel = device.zlevel;
this.style = device.style; this.style = device.style;
this.down = false;
this.create(); this.create();
} }
@ -32,7 +31,7 @@ export default class EMouse extends Group {
} }
mouseout(e) { mouseout(e) {
if (!this.down) { if (!this.device.model.down) {
this.border.hide(); this.border.hide();
} }
} }

View File

@ -169,12 +169,8 @@ class StationStand extends Group {
if (this.style.StationStand.mouseOverStyle) { if (this.style.StationStand.mouseOverStyle) {
this.mouseEvent = new EMouse(this); this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent); this.add(this.mouseEvent);
this.onmouseover = (e) => { this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
this.mouseEvent.mouseover(e); this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
};
this.onmouseout = (e) => {
this.mouseEvent.mouseout(e);
};
} }
} }

View File

@ -4,7 +4,6 @@ import store from '@/store';
class EMouse extends Group { class EMouse extends Group {
constructor(device) { constructor(device) {
super(); super();
this.down = false;
this.device = device; this.device = device;
this.create(); this.create();
this.craeteSwitchBorder(); this.craeteSwitchBorder();
@ -73,7 +72,7 @@ class EMouse extends Group {
} }
mouseout(e) { mouseout(e) {
if (!this.down) { if (!this.device.model.down) {
this.switchBorder && this.switchBorder.hide(); this.switchBorder && this.switchBorder.hide();
this.device.setTextStyle({ this.device.setTextStyle({
textFill: this.device.style.backgroundColor textFill: this.device.style.backgroundColor

View File

@ -44,7 +44,7 @@ export default class Switch extends Group {
let halfWidth = style.Section.line.width / 2; let halfWidth = style.Section.line.width / 2;
const switchWidth = style.Section.line.width + style.Section.line.beyondWidth*2 + 0.8; const switchWidth = style.Section.line.width + style.Section.line.beyondWidth*2 + 0.8;
const swPadding = style.Switch.core.legnth; const swPadding = style.Switch.core.length;
const directx = this.triangle.drictx; const directx = this.triangle.drictx;
const directy = this.triangle.dricty; const directy = this.triangle.dricty;
const direct = -this.triangle.drictx * this.triangle.dricty; const direct = -this.triangle.drictx * this.triangle.dricty;
@ -213,8 +213,10 @@ export default class Switch extends Group {
this.setSwitchCoreColor(this.style.backgroundColor); this.setSwitchCoreColor(this.style.backgroundColor);
this.name.getNameText().stopAnimation(false); this.name.getNameText().stopAnimation(false);
this.swCore.stopAnimation(false); this.swCore.stopAnimation(false);
this.relocShelter.stopAnimation(false); if (!this.model.cutOff) {
this.relocShelter.hide(); this.relocShelter.stopAnimation(false);
this.relocShelter.hide();
}
this.releaseBackground.hide(); this.releaseBackground.hide();
this.setHasTextBorder(0); this.setHasTextBorder(0);
} }
@ -235,7 +237,7 @@ export default class Switch extends Group {
this.locShelter.hide(); this.locShelter.hide();
this.relocShelter.show(); this.relocShelter.show();
this.setTextColor(this.style.Switch.text.inversionColor); this.setTextColor(this.style.Switch.text.inversionColor);
this.setSectionState(this.relocShelter.getSection(), 'fill', this.model.sectionAstatus); this.setSectionState(this.relocShelter.getSection(), 'fill', this.model);
} }
/** 失去*/ /** 失去*/
@ -310,9 +312,20 @@ export default class Switch extends Group {
} }
} }
setSectionState(section, style, model) { sectionCutOff(section) {
const lineWidth = this.style.Section.line.width + (this.model.sectionAstatus != '01' ? this.style.Section.line.beyondWidth : 0);
if (section) { if (section) {
switch (model) { section.animateStyle(true, [
{ time: 0, styles: { lineWidth: lineWidth } },
{ time: 1000, styles: { stroke: this.style.backgroundColor } },
{ time: 2000, styles: { lineWidth: lineWidth } }
]);
}
}
setSectionState(section, style, state) {
if (section) {
switch (state.sectionAstatus) {
case '00': break; case '00': break;
case '01': /** 空闲*/ case '01': /** 空闲*/
section.setStyle(style, this.style.Section.line.spareColor); section.setStyle(style, this.style.Section.line.spareColor);
@ -347,6 +360,10 @@ export default class Switch extends Group {
break; break;
} }
} }
if (state.cutOff && !section.animators.length ) {
this.sectionCutOff(section);
}
} }
setLocateType(model) { setLocateType(model) {

View File

@ -1,36 +0,0 @@
import Group from 'zrender/src/container/Group';
import Text from 'zrender/src/graphic/Text';
/** 文字描述 */
class ArrowText extends Group {
constructor(model) {
super();
this.model = model;
this.create();
}
create() {
this.arrowText = new Text({
zlevel: this.model.zlevel,
z: this.model.z+1,
position: [0, 0],
style: {
x: this.model.x,
y: this.model.y,
text: this.model.text,
textFill: this.model.textFill,
textAlign: this.model.textAlign,
textFont: this.model.textFont,
textPadding: this.model.textPadding,
textBackgroundColor: '#FFFF00'
}
});
this.add(this.arrowText);
this.arrowText.hide();
}
setShapeStyle(key, style) {
this.arrowText.setStyle(key, style);
}
getArrowText() {
return this.arrowText;
}
}
export default ArrowText;

View File

@ -0,0 +1,52 @@
import Group from 'zrender/src/container/Group';
import Text from 'zrender/src/graphic/Text';
class EMouse extends Group {
constructor(device) {
super();
this.device = device;
this.create();
}
create() {
let destinationText = '';
switch (this.device.model.destinationStatus) {
case '01': destinationText = '准点'; break;
case '02': destinationText = '早点'; break;
case '03': destinationText = '严重早点'; break;
case '04': destinationText = '晚点'; break;
case '05': destinationText = '严重晚点'; break;
default: destinationText = '未知'; break;
}
// 文字描述
this.arrowText = new Text({
zlevel: this.device.model.zlevel,
z: this.device.model.z,
style: {
x: this.device.model.point.x + 50,
y: this.device.model.point.y + 25,
text: `列车类型: 计划车\n\0\0\0\0号: ${this.device.model.serviceNumber}\n\0\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.targetCode ? this.device.model.targetCode : ''}\n\0\0号: ${this.device.model.groupNumber}\n\0\0点: ${destinationText}\n运行方向: ${this.device.model.directionType == '02' ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.trackName : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${this.device.model.runControlStatus == '01' ? '正常' : this.device.model.runControlStatus == '03' ? '跳停' : '扣车'}\n停稳状态: ${this.device.model.runStatus == '02' ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${this.device.model.speed || 0} km/h\n列车移动授权距离: ${this.device.model.maLen || 0} m`,
textFill: '#000',
textAlign: 'letf',
textFont: 10 + 'px consolas',
textPadding: 3,
textBackgroundColor: this.device.model.style.tipBackgroundColor
}
});
this.add(this.arrowText);
this.arrowText.hide();
}
mouseover() {
this.device.deviceModel.down = true;
this.arrowText.show();
}
mouseout() {
if (this.device.deviceModel.down) {
this.arrowText.hide();
this.device.deviceModel.down = false;
}
}
}
export default EMouse;

View File

@ -1,5 +1,4 @@
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
import ArrowText from './ArrowText';
import Train from './Train'; import Train from './Train';
import '../../StationStand/EDetain'; import '../../StationStand/EDetain';
import TextHSDA from './TextHSDA'; import TextHSDA from './TextHSDA';
@ -7,12 +6,35 @@ import TextTrainServer from './TextTrainServer';
import TextTrainTarget from './TextTrainTarget'; import TextTrainTarget from './TextTrainTarget';
import TextTrainNumber from './TextTrainNumber'; import TextTrainNumber from './TextTrainNumber';
import TextTrainTargetNumber from './TextTrainTargetNumber'; import TextTrainTargetNumber from './TextTrainTargetNumber';
import EMouse from './EMouse';
import store from '@/store';
/** 车身*/ /** 车身*/
export default class TrainBody extends Group { export default class TrainBody extends Group {
constructor(model) { constructor(model) {
super(); super();
this.model = model; this.model = model;
this.deviceModel = model.model;
this.create(); this.create();
this.createMouse(); // 鼠标事件
}
createMouse() {
this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent);
if (this.deviceModel.down) {
store.dispatch('map/setTrainDetails', this.deviceModel);
this.mouseEvent.mouseover();
}
this.on('mouseover', () => {
store.dispatch('map/setTrainDetails', this.deviceModel);
this.mouseEvent.mouseover();
});
this.on('mouseout', () => {
store.dispatch('map/setTrainDetails', null);
this.mouseEvent.mouseout();
});
} }
create() { create() {
@ -21,28 +43,6 @@ export default class TrainBody extends Group {
const textFont = model.fontSize + 'px ' + style.Train.common.fontFamily; const textFont = model.fontSize + 'px ' + style.Train.common.fontFamily;
const TextFontHSDA = style.Train.hsda.trainHSDATextFontSize + 'px ' + style.Train.common.fontFamily; const TextFontHSDA = style.Train.hsda.trainHSDATextFontSize + 'px ' + style.Train.common.fontFamily;
let destinationText = '';
switch (model.destinationStatus) {
case '01': destinationText = '准点'; break;
case '02': destinationText = '早点'; break;
case '03': destinationText = '严重早点'; break;
case '04': destinationText = '晚点'; break;
case '05': destinationText = '严重晚点'; break;
default: destinationText = '未知'; break;
}
const textContain = `列车类型: 计划车\n\0\0\0\0号: ${model.serviceNumber}\n\0\0号: ${model.tripNumber}\n目的地号: ${model.targetCode ? model.targetCode : ''}\n\0\0号: ${model.groupNumber}\n\0\0点: ${destinationText}\n运行方向: ${model.directionType == '02' ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${model.sectionModel ? model.sectionModel.name : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${model.runControlStatus == '01' ? '正常' : model.runControlStatus == '03' ? '跳停' : '扣车'}\n停稳状态: ${model.runStatus == '02' ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${model.speed || 0} km/h\n列车移动授权距离: ${model.maLen || 0} m`;
this.arrowText = style.Train.common.haveArrowText ? new ArrowText({
zlevel: model.zlevel,
z: model.z,
x: model.point.x+50,
y: model.point.y+25,
text: textContain,
textFill: '#000',
textAlign: 'left',
textFont: style.arrowFontSize + 'px consolas',
textPadding: 3,
textBackgroundColor: style.tipBackgroundColor
}) : '';
this.train = new Train({ this.train = new Train({
zlevel: model.zlevel, zlevel: model.zlevel,
z: model.z, z: model.z,
@ -57,10 +57,7 @@ export default class TrainBody extends Group {
stroke: style.trainSidelineColor, stroke: style.trainSidelineColor,
fill: style.Train.trainBody.trainBodyFillColor fill: style.Train.trainBody.trainBodyFillColor
}, },
cursor: 'pointer', cursor: 'pointer'
arrowText: this.arrowText,
onmouseover: () => { style.Train.trainBody.trainBodyOnMouseOver.train?this.arrowText.getArrowText().show():''; },
onmouseout: () => { style.Train.trainBody.trainBodyOnMouseOut.train?this.arrowText.getArrowText().hide():''; }
}); });
const beginX = (model.point.x + style.Train.trainBody.lrPadding); const beginX = (model.point.x + style.Train.trainBody.lrPadding);
@ -93,9 +90,7 @@ export default class TrainBody extends Group {
style: style, style: style,
serviceNumber: serviceNumber, serviceNumber: serviceNumber,
trainBrownColor: style.trainTextColor, trainBrownColor: style.trainTextColor,
textFont: textFont, textFont: textFont
onmouseover: () => { style.Train.trainBody.trainBodyOnMouseOver.textTrainServer?this.arrowText.getArrowText().show():''; },
onmouseout: () => { style.Train.trainBody.trainBodyOnMouseOut.textTrainServer?this.arrowText.getArrowText().hide():''; }
}); });
this.textTrainTarget = new TextTrainTarget({ this.textTrainTarget = new TextTrainTarget({
@ -106,9 +101,7 @@ export default class TrainBody extends Group {
style: style, style: style,
tripNumber: tripNumber, tripNumber: tripNumber,
trainYellowColor: style.trainTextColor, trainYellowColor: style.trainTextColor,
textFont: textFont, textFont: textFont
onmouseover: () => { style.Train.trainBody.trainBodyOnMouseOver.textTrainTarget?this.arrowText.getArrowText().show():''; },
onmouseout: () => { style.Train.trainBody.trainBodyOnMouseOut.textTrainTarget?this.arrowText.getArrowText().hide():''; }
}); });
this.textTrainNumber = new TextTrainNumber({ this.textTrainNumber = new TextTrainNumber({
@ -119,9 +112,7 @@ export default class TrainBody extends Group {
upPadding: style.Train.trainBody.upPadding, upPadding: style.Train.trainBody.upPadding,
targetCode: targetCode, targetCode: targetCode,
trainTextColor: style.trainTextColor, trainTextColor: style.trainTextColor,
textFont: textFont, textFont: textFont
onmouseover: () => { style.Train.trainBody.trainBodyOnMouseOver.textTrainNumber?this.arrowText.getArrowText().show():''; },
onmouseout: () => { style.Train.trainBody.trainBodyOnMouseOut.textTrainNumber?this.arrowText.getArrowText().hide():''; }
}); });
this.textTrainTargetNumber = new TextTrainTargetNumber({ this.textTrainTargetNumber = new TextTrainTargetNumber({
@ -132,9 +123,7 @@ export default class TrainBody extends Group {
upPadding: style.Train.upPadding, upPadding: style.Train.upPadding,
groupNumber: groupNumber, groupNumber: groupNumber,
trainTextColor: style.trainTextColor, trainTextColor: style.trainTextColor,
textFont: textFont, textFont: textFont
onmouseover: () => { style.Train.trainBody.trainBodyOnMouseOver.textTrainTargetNumber?this.arrowText.getArrowText().show():''; },
onmouseout: () => { style.Train.trainBody.trainBodyOnMouseOut.textTrainTargetNumber?this.arrowText.getArrowText().hide():''; }
}); });
// 根据列车类型设置显示格式 // 根据列车类型设置显示格式
if ( style.Train.trainBody.specialTrainType.length > 0) { if ( style.Train.trainBody.specialTrainType.length > 0) {
@ -153,7 +142,9 @@ export default class TrainBody extends Group {
} }
removeTrainDetail() { removeTrainDetail() {
this.remove(this.arrowText); this.mouseEvent.mouseout();
store.dispatch('map/setTrainDetails', null);
this.deviceModel.down = false;
} }
setTrainColor(color) { setTrainColor(color) {
this.train && this.train.setColor('fill', color); this.train && this.train.setColor('fill', color);

View File

@ -69,7 +69,8 @@ export default class Train extends Group {
fontSize: this.fontSize, fontSize: this.fontSize,
type: model.type, type: model.type,
speed: model.speed, speed: model.speed,
maLen: model.maLen maLen: model.maLen,
model: model
}); });
this.trainL = new TrainHead({ this.trainL = new TrainHead({
style: style, style: style,

View File

@ -5,7 +5,6 @@ export default class EMouse extends Group {
constructor(device) { constructor(device) {
super(); super();
this.device = device; this.device = device;
this.down = false;
this.create(); this.create();
} }
create() { create() {
@ -29,32 +28,27 @@ export default class EMouse extends Group {
this.add(this.text); this.add(this.text);
this.text.hide(); this.text.hide();
} }
mouseoverText(e) { mouseover(e) {
this.text.show(); if (e.target && e.target._subType == 'Text') {
} this.text.show();
} else {
mouseoutText(e) { this.device.control.setControlColor(this.device.style.ZcControl.mouseOverStyle.arcColor);
if (!this.down) { this.device.control.setTextColor(this.device.style.ZcControl.mouseOverStyle.textColor);
this.text.hide(); this.device.control.setTextBorder(true);
this.device.control.setArcBorder(true);
} }
} }
mouseoverArc(e) {
this.device.control.setControlColor(this.device.style.ZcControl.mouseOverStyle.arcColor);
this.device.control.setTextColor(this.device.style.ZcControl.mouseOverStyle.textColor);
this.device.control.setTextBorder(true);
this.device.control.setArcBorder(true);
}
mouseoutArc(e) {
if (!this.down) {
this.device.control.setControlColor(this.device.style.ZcControl.lamp.controlColor);
this.device.control.setTextColor('#FFFFFF');
this.device.control.setTextBorder(false);
this.device.control.setArcBorder(false);
}
}
mouseout(e) { mouseout(e) {
this.mouseoutText(e); if (!this.device.model.down) {
this.mouseoutArc(e); if (e.target && e.target._subType == 'Text') {
this.text.hide();
} else {
this.device.control.setControlColor(this.device.style.ZcControl.lamp.controlColor);
this.device.control.setTextColor('#FFFFFF');
this.device.control.setTextBorder(false);
this.device.control.setArcBorder(false);
}
}
} }
} }

View File

@ -14,8 +14,8 @@ export default class ZcControl extends Group {
this.zlevel = model.zlevel; this.zlevel = model.zlevel;
this.model = model; this.model = model;
this.style = style; this.style = style;
this.createMouseEvent();
this.create(model); this.create(model);
this.createMouseEvent();
this.setState(model); this.setState(model);
} }
@ -62,18 +62,8 @@ export default class ZcControl extends Group {
if (this.style.ZcControl.mouseOverStyle) { if (this.style.ZcControl.mouseOverStyle) {
this.mouseEvent = new EMouse(this); this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent); this.add(this.mouseEvent);
this.mouseoverText = (e) => { this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
this.mouseEvent.mouseoverText(e); this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
};
this.mouseoutText = (e) => {
this.mouseEvent.mouseoutText(e);
};
this.mouseoverArc = (e) => {
this.mouseEvent.mouseoverArc(e);
};
this.mouseoutArc = (e) => {
this.mouseEvent.mouseoutArc(e);
};
} }
} }
getShapeTipPoint() { getShapeTipPoint() {

View File

@ -124,43 +124,33 @@ export default {
}, },
setDeviceDisplay() { setDeviceDisplay() {
let show = false; let show = false;
const deviceList = []; let deviceList = [];
// //
const sectionList = this.$store.getters['map/sectionList']; let borderBorderShow = this.deviceLevels.indexOf(2) !== -1;
let sectionList = this.$store.getters['map/sectionList'];
if (sectionList && sectionList.length > 0) { if (sectionList && sectionList.length > 0) {
sectionList.forEach(elem => { sectionList.forEach(elem => {
// deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { borderBorderShow })); //
show = this.deviceLevels.indexOf(2) !== -1;
elem.borderBorderShow = show;
elem.type = deviceType.Section;
deviceList.push(elem);
}); });
} }
// //
const trainWindowList = this.$store.getters['map/trainWindowList']; let trainWindowShow = this.deviceLevels.indexOf(1) !== -1;
let trainWindowList = this.$store.getters['map/trainWindowList'];
if (trainWindowList && trainWindowList.length > 0) { if (trainWindowList && trainWindowList.length > 0) {
trainWindowList.forEach(elem => { trainWindowList.forEach(elem => {
// deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { trainWindowShow })); //
show = this.deviceLevels.indexOf(1) !== -1;
elem.type = deviceType.Section;
elem.trainWindowShow = show;
deviceList.push(elem);
}); });
} }
// ATS // ATS
const signalList = this.$store.getters['map/signalList']; let linkageAutoRouteShow = this.deviceLevels.indexOf(3) !== -1;//
let atsAutoTriggerShow = this.deviceLevels.indexOf(4) !== -1;// ATS
let signalList = this.$store.getters['map/signalList'];
if (signalList && signalList.length > 0) { if (signalList && signalList.length > 0) {
signalList.forEach(elem => { signalList.forEach(elem => {
// deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { linkageAutoRouteShow, atsAutoTriggerShow }));
show = this.deviceLevels.indexOf(3) !== -1;
elem.linkageAutoRouteShow = show;
// ATS
show = this.deviceLevels.indexOf(4) !== -1;
elem.atsAutoTriggerShow = show;
deviceList.push(elem);
}); });
} }

View File

@ -147,111 +147,97 @@
}) })
}, },
setNameDisplay() { setNameDisplay() {
let show = false;
let deviceList = []; let deviceList = [];
// //
show = this.nameLevels.indexOf(1) !== -1 ? true : false; let nameShow = this.nameLevels.indexOf(1) !== -1 ? true : false;
let signalList = this.$store.getters['map/signalList']; let signalList = this.$store.getters['map/signalList'];
if (signalList && signalList.length > 0) { if (signalList && signalList.length > 0) {
signalList.forEach(elem => { signalList.forEach(elem => {
elem.nameShow = show; deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow }));
deviceList.push(elem);
}) })
} }
// //
show = this.nameLevels.indexOf(3) !== -1 ? true : false; nameShow = this.nameLevels.indexOf(3) !== -1 ? true : false;
// //
nameShow = this.nameLevels.indexOf(7) !== -1 ? true : false; //
let switchSectionNameShow = this.nameLevels.indexOf(9) !== -1 ? true : false; //
let switchList = this.$store.getters['map/switchList']; let switchList = this.$store.getters['map/switchList'];
if (switchList && switchList.length > 0) { if (switchList && switchList.length > 0) {
switchList.forEach(elem => { switchList.forEach(elem => {
// deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, switchSectionNameShow }));
show = this.nameLevels.indexOf(7) !== -1 ? true : false;
elem.nameShow = show;
//
show = this.nameLevels.indexOf(9) !== -1 ? true : false;
elem.switchSectionNameShow = show;
deviceList.push(elem);
}) })
} }
// //
show = this.nameLevels.indexOf(8) !== -1 ? true : false; let indicatorShow = this.nameLevels.indexOf(8) !== -1 ? true : false;
let control = this.$store.getters['map/stationControlList']; let control = this.$store.getters['map/stationControlList'];
if (control && control.length > 0) { if (control && control.length > 0) {
control.forEach(elem => { control.forEach(elem => {
// deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { indicatorShow })); //
elem.indicatorShow = show;
deviceList.push(elem);
}) })
} }
// //
nameShow = false;
let standTrackNameShow = false;
let reentryTrackNameShow = false;
let transferTrackNameShow = false;
let sectionList = this.$store.getters['map/sectionList']; let sectionList = this.$store.getters['map/sectionList'];
if (sectionList && sectionList.length > 0) { if (sectionList && sectionList.length > 0) {
sectionList.forEach(elem => { sectionList.forEach(elem => {
if (elem.isSwitchSection && elem.parentCode) { if (elem.isSwitchSection && elem.parentCode) {
// //
elem.nameShow = false; nameShow = false;
} else { } else {
if (elem.type === '01') { if (elem.type === '01') {
show = this.nameLevels.indexOf(11) !== -1 ? true : false; nameShow = this.nameLevels.indexOf(11) !== -1 ? true : false;
elem.nameShow = show;
} else if (elem.type === '02') { } else if (elem.type === '02') {
// //
show = this.nameLevels.indexOf(5) !== -1 ? true : false; nameShow = this.nameLevels.indexOf(5) !== -1 ? true : false;
elem.nameShow = show;
} else if (elem.type === '03') { } else if (elem.type === '03') {
// //
show = this.nameLevels.indexOf(9) !== -1 ? true : false; nameShow = this.nameLevels.indexOf(9) !== -1 ? true : false;
elem.nameShow = show;
} }
} }
// //
if (elem.isStandTrack) { if (elem.isStandTrack) {
show = this.nameLevels.indexOf(2) !== -1 ? true : false; standTrackNameShow = this.nameLevels.indexOf(2) !== -1 ? true : false;
elem.standTrackNameShow = show;
} }
// //
if (elem.isReentryTrack) { if (elem.isReentryTrack) {
show = this.nameLevels.indexOf(4) !== -1 ? true : false; reentryTrackNameShow = this.nameLevels.indexOf(4) !== -1 ? true : false;
elem.reentryTrackNameShow = show;
} }
// //
if (elem.isTransferTrack) { if (elem.isTransferTrack) {
show = this.nameLevels.indexOf(6) !== -1 ? true : false; transferTrackNameShow = this.nameLevels.indexOf(6) !== -1 ? true : false;
elem.transferTrackNameShow = show;
} }
deviceList.push(elem); deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, standTrackNameShow, reentryTrackNameShow, transferTrackNameShow }));
}) })
} }
// //
show = this.nameLevels.indexOf(10) !== -1 ? true : false; let destCodeShow = this.nameLevels.indexOf(10) !== -1 ? true : false;
let stopPointList = this.$store.getters['map/stopPointList']; let stopPointList = this.$store.getters['map/stopPointList'];
if (stopPointList && stopPointList.length > 0) { if (stopPointList && stopPointList.length > 0) {
stopPointList.forEach(elem => { stopPointList.forEach(elem => {
// deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { destCodeShow }));
elem.destCodeShow = show;
deviceList.push(elem);
}) })
} }
// //
show = this.nameLevels.indexOf(12) !== -1 ? true : false; let kmPostShow = this.nameLevels.indexOf(12) !== -1 ? true : false;
let stationList = this.$store.getters['map/stationList']; let stationList = this.$store.getters['map/stationList'];
if (stationList && stationList.length > 0) { if (stationList && stationList.length > 0) {
stationList.forEach(elem => { stationList.forEach(elem => {
// deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { kmPostShow })); //
elem.kmPostShow = show;
deviceList.push(elem);
}) })
} }

View File

@ -155,16 +155,16 @@
}) })
}, },
setTrainDispaly() { setTrainDispaly() {
let updatList = [];
let trainList = this.$store.getters['training/viewTrainList']; let trainList = this.$store.getters['training/viewTrainList'];
if (trainList && trainList.length > 0) { if (trainList && trainList.length > 0) {
let planFormat = this.trainNameFormatBy(this.planMode); let nameFormat = this.trainNameFormatBy(this.planMode);
let nameFontSize = this.fontSize; let nameFontSize = this.fontSize;
trainList.forEach(elem => { updatList.forEach(elem => {
elem.nameFormat = planFormat; deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameFormat, nameFontSize })); //
elem.nameFontSize = nameFontSize;
}); });
this.$store.dispatch('map/updateMapDevices', trainList); this.$store.dispatch('map/updateMapDevices', updatList);
} }
}, },
trainNameFormatBy(mode) { trainNameFormatBy(mode) {

View File

@ -125,44 +125,33 @@ export default {
}, },
setDeviceDisplay() { setDeviceDisplay() {
let show = false; let show = false;
const deviceList = []; let deviceList = [];
// //
const sectionList = this.$store.getters['map/sectionList']; let borderBorderShow = this.deviceLevels.indexOf(2) !== -1;
let sectionList = this.$store.getters['map/sectionList'];
if (sectionList && sectionList.length > 0) { if (sectionList && sectionList.length > 0) {
sectionList.forEach(elem => { sectionList.forEach(elem => {
// deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { borderBorderShow })); //
show = this.deviceLevels.indexOf(2) !== -1;
elem._type = deviceType.Section;
elem.borderBorderShow = show;
deviceList.push(elem);
}); });
} }
// //
const trainWindowList = this.$store.getters['map/trainWindowList']; let trainWindowShow = this.deviceLevels.indexOf(1) !== -1;
let trainWindowList = this.$store.getters['map/trainWindowList'];
if (trainWindowList && trainWindowList.length > 0) { if (trainWindowList && trainWindowList.length > 0) {
trainWindowList.forEach(elem => { trainWindowList.forEach(elem => {
// deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { trainWindowShow })); //
show = this.deviceLevels.indexOf(1) !== -1;
elem._type = deviceType.TrainWindow;
elem.trainWindowShow = show;
deviceList.push(elem);
}); });
} }
// ATS // ATS
const signalList = this.$store.getters['map/signalList']; let linkageAutoRouteShow = this.deviceLevels.indexOf(3) !== -1;//
let atsAutoTriggerShow = this.deviceLevels.indexOf(4) !== -1;// ATS
let signalList = this.$store.getters['map/signalList'];
if (signalList && signalList.length > 0) { if (signalList && signalList.length > 0) {
signalList.forEach(elem => { signalList.forEach(elem => {
elem._type = deviceType.Signal; deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { linkageAutoRouteShow, atsAutoTriggerShow }));
//
show = this.deviceLevels.indexOf(3) !== -1;
elem.linkageAutoRouteShow = show;
// ATS
show = this.deviceLevels.indexOf(4) !== -1;
elem.atsAutoTriggerShow = show;
deviceList.push(elem);
}); });
} }

View File

@ -147,112 +147,97 @@
}) })
}, },
setNameDisplay() { setNameDisplay() {
let show = false;
let deviceList = []; let deviceList = [];
// //
show = this.nameLevels.indexOf(1) !== -1 ? true : false; let nameShow = this.nameLevels.indexOf(1) !== -1 ? true : false;
let signalList = this.$store.getters['map/signalList']; let signalList = this.$store.getters['map/signalList'];
if (signalList && signalList.length > 0) { if (signalList && signalList.length > 0) {
signalList.forEach(elem => { signalList.forEach(elem => {
elem.nameShow = show; deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow }));
deviceList.push(elem);
}) })
} }
// //
show = this.nameLevels.indexOf(3) !== -1 ? true : false; nameShow = this.nameLevels.indexOf(3) !== -1 ? true : false;
// //
nameShow = this.nameLevels.indexOf(7) !== -1 ? true : false; //
let switchSectionNameShow = this.nameLevels.indexOf(9) !== -1 ? true : false; //
let switchList = this.$store.getters['map/switchList']; let switchList = this.$store.getters['map/switchList'];
if (switchList && switchList.length > 0) { if (switchList && switchList.length > 0) {
switchList.forEach(elem => { switchList.forEach(elem => {
// deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, switchSectionNameShow }));
show = this.nameLevels.indexOf(7) !== -1 ? true : false;
elem.nameShow = show;
//
show = this.nameLevels.indexOf(9) !== -1 ? true : false;
elem.switchSectionNameShow = show;
deviceList.push(elem);
}) })
} }
// //
show = this.nameLevels.indexOf(8) !== -1 ? true : false; let indicatorShow = this.nameLevels.indexOf(8) !== -1 ? true : false;
let control = this.$store.getters['map/stationControlList']; let control = this.$store.getters['map/stationControlList'];
if (control && control.length > 0) { if (control && control.length > 0) {
control.forEach(elem => { control.forEach(elem => {
// deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { indicatorShow })); //
elem.indicatorShow = show;
deviceList.push(elem);
}) })
} }
// //
nameShow = false;
let standTrackNameShow = false;
let reentryTrackNameShow = false;
let transferTrackNameShow = false;
let sectionList = this.$store.getters['map/sectionList']; let sectionList = this.$store.getters['map/sectionList'];
if (sectionList && sectionList.length > 0) { if (sectionList && sectionList.length > 0) {
sectionList.forEach(elem => { sectionList.forEach(elem => {
if (elem.isSwitchSection && elem.parentCode) { if (elem.isSwitchSection && elem.parentCode) {
// //
elem.nameShow = false; nameShow = false;
} else { } else {
if (elem.type === '01') { if (elem.type === '01') {
show = this.nameLevels.indexOf(11) !== -1 ? true : false; nameShow = this.nameLevels.indexOf(11) !== -1 ? true : false;
elem.nameShow = show;
} else if (elem.type === '02') { } else if (elem.type === '02') {
// //
show = this.nameLevels.indexOf(5) !== -1 ? true : false; nameShow = this.nameLevels.indexOf(5) !== -1 ? true : false;
elem.nameShow = show;
} else if (elem.type === '03') { } else if (elem.type === '03') {
// //
show = this.nameLevels.indexOf(9) !== -1 ? true : false; nameShow = this.nameLevels.indexOf(9) !== -1 ? true : false;
elem.nameShow = show;
} }
} }
// //
if (elem.isStandTrack) { if (elem.isStandTrack) {
show = this.nameLevels.indexOf(2) !== -1 ? true : false; standTrackNameShow = this.nameLevels.indexOf(2) !== -1 ? true : false;
elem.standTrackNameShow = show;
} }
// //
if (elem.isReentryTrack) { if (elem.isReentryTrack) {
show = this.nameLevels.indexOf(4) !== -1 ? true : false; reentryTrackNameShow = this.nameLevels.indexOf(4) !== -1 ? true : false;
elem.reentryTrackNameShow = show;
} }
// //
if (elem.isTransferTrack) { if (elem.isTransferTrack) {
show = this.nameLevels.indexOf(6) !== -1 ? true : false; transferTrackNameShow = this.nameLevels.indexOf(6) !== -1 ? true : false;
elem.transferTrackNameShow = show;
} }
deviceList.push(elem); deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, standTrackNameShow, reentryTrackNameShow, transferTrackNameShow }));
}) })
} }
// //
show = this.nameLevels.indexOf(10) !== -1 ? true : false; let destCodeShow = this.nameLevels.indexOf(10) !== -1 ? true : false;
let stopPointList = this.$store.getters['map/stopPointList']; let stopPointList = this.$store.getters['map/stopPointList'];
if (stopPointList && stopPointList.length > 0) { if (stopPointList && stopPointList.length > 0) {
stopPointList.forEach(elem => { stopPointList.forEach(elem => {
// deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { destCodeShow }));
elem.destCodeShow = show;
deviceList.push(elem);
}) })
} }
// //
show = this.nameLevels.indexOf(12) !== -1 ? true : false; let kmPostShow = this.nameLevels.indexOf(12) !== -1 ? true : false;
let stationList = this.$store.getters['map/stationList']; let stationList = this.$store.getters['map/stationList'];
if (stationList && stationList.length > 0) { if (stationList && stationList.length > 0) {
stationList.forEach(elem => { stationList.forEach(elem => {
// deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { kmPostShow })); //
elem.kmPostShow = show;
deviceList.push(elem);
}) })
} }

View File

@ -155,16 +155,16 @@
}) })
}, },
setTrainDispaly() { setTrainDispaly() {
let updatList = [];
let trainList = this.$store.getters['training/viewTrainList']; let trainList = this.$store.getters['training/viewTrainList'];
if (trainList && trainList.length > 0) { if (trainList && trainList.length > 0) {
let planFormat = this.trainNameFormatBy(this.planMode); let nameFormat = this.trainNameFormatBy(this.planMode);
let nameFontSize = this.fontSize; let nameFontSize = this.fontSize;
trainList.forEach(elem => { updatList.forEach(elem => {
elem.nameFormat = planFormat; deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameFormat, nameFontSize })); //
elem.nameFontSize = nameFontSize;
}); });
this.$store.dispatch('map/updateMapDevices', trainList); this.$store.dispatch('map/updateMapDevices', updatList);
} }
}, },
trainNameFormatBy(mode) { trainNameFormatBy(mode) {

View File

@ -93,7 +93,7 @@ export default {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
cancel() { cancel() {
const operate = { let operate = {
type: this.operate.type, type: this.operate.type,
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
@ -105,7 +105,7 @@ export default {
}); });
}, },
commit() { commit() {
const operate = { let operate = {
over: true, over: true,
type: this.operate.type, type: this.operate.type,
operation: OperationEvent.Command.close.confirm.operation, operation: OperationEvent.Command.close.confirm.operation,
@ -125,44 +125,33 @@ export default {
}, },
setDeviceDisplay() { setDeviceDisplay() {
let show = false; let show = false;
const deviceList = []; let deviceList = [];
// //
const sectionList = this.$store.getters['map/sectionList']; let borderBorderShow = this.deviceLevels.indexOf(2) !== -1;
let sectionList = this.$store.getters['map/sectionList'];
if (sectionList && sectionList.length > 0) { if (sectionList && sectionList.length > 0) {
sectionList.forEach(elem => { sectionList.forEach(elem => {
// deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { borderBorderShow })); //
show = this.deviceLevels.indexOf(2) !== -1;
elem._type = deviceType.Section;
elem.borderBorderShow = show;
deviceList.push(elem);
}); });
} }
// //
const trainWindowList = this.$store.getters['map/trainWindowList']; let trainWindowShow = this.deviceLevels.indexOf(1) !== -1;
let trainWindowList = this.$store.getters['map/trainWindowList'];
if (trainWindowList && trainWindowList.length > 0) { if (trainWindowList && trainWindowList.length > 0) {
trainWindowList.forEach(elem => { trainWindowList.forEach(elem => {
// deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { trainWindowShow })); //
show = this.deviceLevels.indexOf(1) !== -1;
elem._type = deviceType.TrainWindow;
elem.trainWindowShow = show;
deviceList.push(elem);
}); });
} }
// ATS // ATS
const signalList = this.$store.getters['map/signalList']; let linkageAutoRouteShow = this.deviceLevels.indexOf(3) !== -1;//
let atsAutoTriggerShow = this.deviceLevels.indexOf(4) !== -1;// ATS
let signalList = this.$store.getters['map/signalList'];
if (signalList && signalList.length > 0) { if (signalList && signalList.length > 0) {
signalList.forEach(elem => { signalList.forEach(elem => {
elem._type = deviceType.Signal; deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { linkageAutoRouteShow, atsAutoTriggerShow }));
//
show = this.deviceLevels.indexOf(3) !== -1;
elem.linkageAutoRouteShow = show;
// ATS
show = this.deviceLevels.indexOf(4) !== -1;
elem.atsAutoTriggerShow = show;
deviceList.push(elem);
}); });
} }

View File

@ -147,112 +147,97 @@
}) })
}, },
setNameDisplay() { setNameDisplay() {
let show = false;
let deviceList = []; let deviceList = [];
// //
show = this.nameLevels.indexOf(1) !== -1 ? true : false; let nameShow = this.nameLevels.indexOf(1) !== -1 ? true : false;
let signalList = this.$store.getters['map/signalList']; let signalList = this.$store.getters['map/signalList'];
if (signalList && signalList.length > 0) { if (signalList && signalList.length > 0) {
signalList.forEach(elem => { signalList.forEach(elem => {
elem.nameShow = show; deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow }));
deviceList.push(elem);
}) })
} }
// //
show = this.nameLevels.indexOf(3) !== -1 ? true : false; nameShow = this.nameLevels.indexOf(3) !== -1 ? true : false;
// //
nameShow = this.nameLevels.indexOf(7) !== -1 ? true : false; //
let switchSectionNameShow = this.nameLevels.indexOf(9) !== -1 ? true : false; //
let switchList = this.$store.getters['map/switchList']; let switchList = this.$store.getters['map/switchList'];
if (switchList && switchList.length > 0) { if (switchList && switchList.length > 0) {
switchList.forEach(elem => { switchList.forEach(elem => {
// deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, switchSectionNameShow }));
show = this.nameLevels.indexOf(7) !== -1 ? true : false;
elem.nameShow = show;
//
show = this.nameLevels.indexOf(9) !== -1 ? true : false;
elem.switchSectionNameShow = show;
deviceList.push(elem);
}) })
} }
// //
show = this.nameLevels.indexOf(8) !== -1 ? true : false; let indicatorShow = this.nameLevels.indexOf(8) !== -1 ? true : false;
let control = this.$store.getters['map/stationControlList']; let control = this.$store.getters['map/stationControlList'];
if (control && control.length > 0) { if (control && control.length > 0) {
control.forEach(elem => { control.forEach(elem => {
// deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { indicatorShow })); //
elem.indicatorShow = show;
deviceList.push(elem);
}) })
} }
// //
nameShow = false;
let standTrackNameShow = false;
let reentryTrackNameShow = false;
let transferTrackNameShow = false;
let sectionList = this.$store.getters['map/sectionList']; let sectionList = this.$store.getters['map/sectionList'];
if (sectionList && sectionList.length > 0) { if (sectionList && sectionList.length > 0) {
sectionList.forEach(elem => { sectionList.forEach(elem => {
if (elem.isSwitchSection && elem.parentCode) { if (elem.isSwitchSection && elem.parentCode) {
// //
elem.nameShow = false; nameShow = false;
} else { } else {
if (elem.type === '01') { if (elem.type === '01') {
show = this.nameLevels.indexOf(11) !== -1 ? true : false; nameShow = this.nameLevels.indexOf(11) !== -1 ? true : false;
elem.nameShow = show;
} else if (elem.type === '02') { } else if (elem.type === '02') {
// //
show = this.nameLevels.indexOf(5) !== -1 ? true : false; nameShow = this.nameLevels.indexOf(5) !== -1 ? true : false;
elem.nameShow = show;
} else if (elem.type === '03') { } else if (elem.type === '03') {
// //
show = this.nameLevels.indexOf(9) !== -1 ? true : false; nameShow = this.nameLevels.indexOf(9) !== -1 ? true : false;
elem.nameShow = show;
} }
} }
// //
if (elem.isStandTrack) { if (elem.isStandTrack) {
show = this.nameLevels.indexOf(2) !== -1 ? true : false; standTrackNameShow = this.nameLevels.indexOf(2) !== -1 ? true : false;
elem.standTrackNameShow = show;
} }
// //
if (elem.isReentryTrack) { if (elem.isReentryTrack) {
show = this.nameLevels.indexOf(4) !== -1 ? true : false; reentryTrackNameShow = this.nameLevels.indexOf(4) !== -1 ? true : false;
elem.reentryTrackNameShow = show;
} }
// //
if (elem.isTransferTrack) { if (elem.isTransferTrack) {
show = this.nameLevels.indexOf(6) !== -1 ? true : false; transferTrackNameShow = this.nameLevels.indexOf(6) !== -1 ? true : false;
elem.transferTrackNameShow = show;
} }
deviceList.push(elem); deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, standTrackNameShow, reentryTrackNameShow, transferTrackNameShow }));
}) })
} }
// //
show = this.nameLevels.indexOf(10) !== -1 ? true : false; let destCodeShow = this.nameLevels.indexOf(10) !== -1 ? true : false;
let stopPointList = this.$store.getters['map/stopPointList']; let stopPointList = this.$store.getters['map/stopPointList'];
if (stopPointList && stopPointList.length > 0) { if (stopPointList && stopPointList.length > 0) {
stopPointList.forEach(elem => { stopPointList.forEach(elem => {
// deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { destCodeShow }));
elem.destCodeShow = show;
deviceList.push(elem);
}) })
} }
// //
show = this.nameLevels.indexOf(12) !== -1 ? true : false; let kmPostShow = this.nameLevels.indexOf(12) !== -1 ? true : false;
let stationList = this.$store.getters['map/stationList']; let stationList = this.$store.getters['map/stationList'];
if (stationList && stationList.length > 0) { if (stationList && stationList.length > 0) {
stationList.forEach(elem => { stationList.forEach(elem => {
// deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { kmPostShow })); //
elem.kmPostShow = show;
deviceList.push(elem);
}) })
} }

View File

@ -155,16 +155,16 @@
}) })
}, },
setTrainDispaly() { setTrainDispaly() {
let updatList = [];
let trainList = this.$store.getters['training/viewTrainList']; let trainList = this.$store.getters['training/viewTrainList'];
if (trainList && trainList.length > 0) { if (trainList && trainList.length > 0) {
let planFormat = this.trainNameFormatBy(this.planMode); let nameFormat = this.trainNameFormatBy(this.planMode);
let nameFontSize = this.fontSize; let nameFontSize = this.fontSize;
trainList.forEach(elem => { trainList.forEach(elem => {
elem.nameFormat = planFormat; updatList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameFormat, nameFontSize }));
elem.nameFontSize = nameFontSize;
}); });
this.$store.dispatch('map/updateMapDevices', trainList); this.$store.dispatch('map/updateMapDevices', updatList);
} }
}, },
trainNameFormatBy(mode) { trainNameFormatBy(mode) {

View File

@ -115,45 +115,35 @@
}) })
}, },
setDeviceDisplay() { setDeviceDisplay() {
let show = false;
let deviceList = []; let deviceList = [];
// //
let borderBorderShow = this.deviceLevels.indexOf(2) !== -1 ? true : false;
let sectionList = this.$store.getters['map/sectionList']; let sectionList = this.$store.getters['map/sectionList'];
if (sectionList && sectionList.length > 0) { if (sectionList && sectionList.length > 0) {
sectionList.forEach(elem => { sectionList.forEach(elem => {
elem._type = deviceType.Section;
// //
show = this.deviceLevels.indexOf(2) !== -1 ? true : false; deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), {borderBorderShow }));
elem.borderBorderShow = show;
deviceList.push(elem);
}); });
} }
// //
let trainWindowShow = this.deviceLevels.indexOf(1) !== -1 ? true : false;
let trainWindowList = this.$store.getters['map/trainWindowList']; let trainWindowList = this.$store.getters['map/trainWindowList'];
if (trainWindowList && trainWindowList.length > 0) { if (trainWindowList && trainWindowList.length > 0) {
trainWindowList.forEach(elem => { trainWindowList.forEach(elem => {
elem._type = deviceType.TrainWindow;
// //
show = this.deviceLevels.indexOf(1) !== -1 ? true : false; deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), {trainWindowShow }));
elem.trainWindowShow = show;
deviceList.push(elem);
}); });
} }
//ATS //ATS
let linkageAutoRouteShow = this.deviceLevels.indexOf(3) !== -1 ? true : false; //
let atsAutoTriggerShow = this.deviceLevels.indexOf(4) !== -1 ? true : false; //ATS
let signalList = this.$store.getters['map/signalList']; let signalList = this.$store.getters['map/signalList'];
if (signalList && signalList.length > 0) { if (signalList && signalList.length > 0) {
signalList.forEach(elem => { signalList.forEach(elem => {
elem._type = deviceType.Signal; deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { linkageAutoRouteShow, atsAutoTriggerShow }));
//
show = this.deviceLevels.indexOf(3) !== -1 ? true : false;
elem.linkageAutoRouteShow = show;
//ATS
show = this.deviceLevels.indexOf(4) !== -1 ? true : false;
elem.atsAutoTriggerShow = show;
deviceList.push(elem);
}) })
} }

View File

@ -126,7 +126,7 @@ export default {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
cancel() { cancel() {
const operate = { let operate = {
type: this.operate.type, type: this.operate.type,
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
@ -138,7 +138,7 @@ export default {
}); });
}, },
commit() { commit() {
const operate = { let operate = {
over: true, over: true,
type: this.operate.type, type: this.operate.type,
operation: OperationEvent.Command.close.confirm.operation, operation: OperationEvent.Command.close.confirm.operation,
@ -157,106 +157,90 @@ export default {
}); });
}, },
setNameDisplay() { setNameDisplay() {
let show = false; let deviceList = [];
const deviceList = [];
// //
show = this.nameLevels.indexOf(1) !== -1; let nameShow = this.nameLevels.indexOf(1) !== -1;
const signalList = this.$store.getters['map/signalList']; let signalList = this.$store.getters['map/signalList'];
if (signalList && signalList.length > 0) { if (signalList && signalList.length > 0) {
signalList.forEach(elem => { signalList.forEach(elem => {
elem._type = deviceType.Signal; deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow }));
elem.nameShow = show;
deviceList.push(elem);
}); });
} }
// //
show = this.nameLevels.indexOf(3) !== -1; let show = this.nameLevels.indexOf(3) !== -1;
// //
const switchList = this.$store.getters['map/switchList']; nameShow = this.nameLevels.indexOf(7) !== -1; //
let switchSectionNameShow = this.nameLevels.indexOf(9) !== -1; //
let switchList = this.$store.getters['map/switchList'];
if (switchList && switchList.length > 0) { if (switchList && switchList.length > 0) {
switchList.forEach(elem => { switchList.forEach(elem => {
elem._type = deviceType.Switch; deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), {nameShow, switchSectionNameShow }));
//
show = this.nameLevels.indexOf(7) !== -1;
elem.nameShow = show;
//
show = this.nameLevels.indexOf(9) !== -1;
elem.switchSectionNameShow = show;
deviceList.push(elem);
}); });
} }
// //
show = this.nameLevels.indexOf(8) !== -1; let indicatorShow = this.nameLevels.indexOf(8) !== -1;
const control = this.$store.getters['map/stationControlList']; let control = this.$store.getters['map/stationControlList'];
if (control && control.length > 0) { if (control && control.length > 0) {
control.forEach(elem => { control.forEach(elem => {
elem._type = deviceType.StationControl;
// //
elem.indicatorShow = show; deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { indicatorShow }));
deviceList.push(elem);
}); });
} }
// //
const sectionList = this.$store.getters['map/sectionList']; nameShow = false;
let standTrackNameShow = false;
let reentryTrackNameShow = false;
let transferTrackNameShow = false;
let sectionList = this.$store.getters['map/sectionList'];
if (sectionList && sectionList.length > 0) { if (sectionList && sectionList.length > 0) {
sectionList.forEach(elem => { sectionList.forEach(elem => {
elem._type = deviceType.Section; elem._type = deviceType.Section;
if (elem.isSwitchSection && elem.parentCode) { if (elem.isSwitchSection && elem.parentCode) {
// //
elem.nameShow = false; nameShow = false;
} else { } else {
if (elem.type === '01') { if (elem.type === '01') {
// //
show = this.nameLevels.indexOf(11) !== -1; nameShow = this.nameLevels.indexOf(11) !== -1;
elem.nameShow = show;
} else if (elem.type === '02') { } else if (elem.type === '02') {
// //
show = this.nameLevels.indexOf(5) !== -1; nameShow = this.nameLevels.indexOf(5) !== -1;
elem.nameShow = show;
} else if (elem.type === '03') { } else if (elem.type === '03') {
// //
show = this.nameLevels.indexOf(9) !== -1; nameShow = this.nameLevels.indexOf(9) !== -1;
elem.nameShow = show;
} }
} }
// //
if (elem.isStandTrack) { if (elem.isStandTrack) {
show = this.nameLevels.indexOf(2) !== -1; standTrackNameShow = this.nameLevels.indexOf(2) !== -1;
elem.standTrackNameShow = show;
} }
// //
if (elem.isReentryTrack) { if (elem.isReentryTrack) {
show = this.nameLevels.indexOf(4) !== -1; reentryTrackNameShow = this.nameLevels.indexOf(4) !== -1;
elem.reentryTrackNameShow = show;
} }
// //
if (elem.isTransferTrack) { if (elem.isTransferTrack) {
show = this.nameLevels.indexOf(6) !== -1; transferTrackNameShow = this.nameLevels.indexOf(6) !== -1;
elem.transferTrackNameShow = show;
} }
deviceList.push(elem); deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, standTrackNameShow, reentryTrackNameShow, transferTrackNameShow }));
}); });
} }
// //
show = this.nameLevels.indexOf(12) !== -1; let kmPostShow = this.nameLevels.indexOf(12) !== -1;
const stationList = this.$store.getters['map/stationList']; let stationList = this.$store.getters['map/stationList'];
if (stationList && stationList.length > 0) { if (stationList && stationList.length > 0) {
stationList.forEach(elem => { stationList.forEach(elem => {
elem._type = deviceType.Station; deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { kmPostShow })); //
//
elem.kmPostShow = show;
deviceList.push(elem);
}); });
} }

View File

@ -156,17 +156,16 @@
}) })
}, },
setTrainDispaly() { setTrainDispaly() {
let updatlist = [];
let trainList = this.$store.getters['training/viewTrainList']; let trainList = this.$store.getters['training/viewTrainList'];
if (trainList && trainList.length > 0) { if (trainList && trainList.length > 0) {
let planFormat = this.trainNameFormatBy(this.planMode); let nameFormat = this.trainNameFormatBy(this.planMode);
let nameFontSize = this.fontSize; let nameFontSize = this.fontSize;
trainList.forEach(elem => { trainList.forEach(elem => {
elem._type = deviceType.Train; updatlist.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), {nameFormat, nameFontSize }));
elem.nameFormat = planFormat;
elem.nameFontSize = nameFontSize;
}); });
this.$store.dispatch('map/updateMapDevices', trainList); this.$store.dispatch('map/updateMapDevices', updatlist);
} }
}, },
trainNameFormatBy(mode) { trainNameFormatBy(mode) {

View File

@ -193,7 +193,7 @@ const map = {
mapList: {}, // 地图数据列表 mapList: {}, // 地图数据列表
mapViewLoadedCount: 0, // 地图视图加载完成标识 mapViewLoadedCount: 0, // 地图视图加载完成标识
mapDataLoadedCount: 0, // 地图数据加载完成标识 mapDataLoadedCount: 0, // 地图数据加载完成标识
trainDetails: null // 列车详情显示 trainDetails: null // 地图'列车详情'显示
}, },
getters: { getters: {

View File

@ -137,7 +137,6 @@ export default {
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'sectionList', 'sectionList',
'trainList',
'trainModelList', 'trainModelList',
'lcList', 'lcList',
'skinStyle' 'skinStyle'

View File

@ -137,7 +137,6 @@ export default {
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'sectionList', 'sectionList',
'trainList',
'trainModelList', 'trainModelList',
'tempSpeedLimitList', 'tempSpeedLimitList',
'skinStyle' 'skinStyle'

View File

@ -88,7 +88,6 @@ export default {
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'sectionList', 'sectionList',
'trainList',
'trainModelList', 'trainModelList',
'zcList', 'zcList',
'skinStyle' 'skinStyle'