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' // 道岔单锁颜色
},
core: {
legnth: 6 // 道岔单边长度
length: 6 // 道岔单边长度
},
monolock: { // 道岔单锁配置
locationColor: '#870E10', // 道岔单锁定位颜色 (红色)

View File

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

View File

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

View File

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

View File

@ -1,6 +1,7 @@
import deviceType from './constant/deviceType';
import Eventful from 'zrender/src/mixin/Eventful';
import * as eventTool from 'zrender/src/core/event';
import store from '@/store';
class EventModel {
constructor(e) {
@ -149,7 +150,14 @@ class MouseController extends Eventful {
}
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) {
@ -157,22 +165,24 @@ class MouseController extends Eventful {
var newEm = new EventModel(e);
if ([1, 3].includes(e.which)) {
// 查找之前和当前鼠标选中的实例
var oldDevice = (this.$jmap.getDeviceByCode(oldEm.deviceCode) || {}).instance || {};
var newDevice = (this.$jmap.getDeviceByCode(newEm.deviceCode) || {}).instance || {};
var oldDevice = this.$jmap.getDeviceByCode(oldEm.deviceCode) || {};
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.mouseEvent['mouseout'](e);
oldDevice['down'] = false;
oldInstance.mouseEvent['mouseout'](e);
}
// 如果实例有选中函数并且被点击,则执行选中函数
if (e.which == 3 && newDevice.mouseEvent && newDevice.mouseEvent.mouseover) {
newDevice.mouseEvent['down'] = true;
newDevice.mouseEvent['mouseover'](e);
if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) {
newDevice['down'] = true;
newInstance.mouseEvent['mouseover'](e);
}
}

View File

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

View File

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

View File

@ -5,7 +5,6 @@ export default class EMouse extends Group {
constructor(device) {
super();
this.device = device;
this.down = false;
this.create();
}
create() {
@ -29,32 +28,27 @@ export default class EMouse extends Group {
this.add(this.text);
this.text.hide();
}
mouseoverText(e) {
this.text.show();
}
mouseoutText(e) {
if (!this.down) {
this.text.hide();
mouseover(e) {
if (e.target && e.target._subType == 'Text') {
this.text.show();
} else {
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);
}
}
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) {
this.mouseoutText(e);
this.mouseoutArc(e);
if (!this.device.model.down) {
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.style = style;
this.z = 20;
this.createMouseEvent();
this.create(model);
this.createMouseEvent();
this.setState(model);
}
create(model) {
@ -52,7 +53,6 @@ export default class LimitControl extends Group {
});
this.add(this.control);
this.setState(this.model);
}
// 设置状态
@ -63,18 +63,8 @@ export default class LimitControl extends Group {
if (this.style.LimitControl.mouseOverStyle) {
this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent);
this.mouseoverText = (e) => {
this.mouseEvent.mouseoverText(e);
};
this.mouseoutText = (e) => {
this.mouseEvent.mouseoutText(e);
};
this.mouseoverArc = (e) => {
this.mouseEvent.mouseoverArc(e);
};
this.mouseoutArc = (e) => {
this.mouseEvent.mouseoutArc(e);
};
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
this.on('mouseover', (e) => { this.mouseEvent.mouseover(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`]);
// }
// } 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; // 道岔宽度
// const beg = Object.assign({}, model.points[0]);
// 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 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; // 道岔宽度
const beg = Object.assign({}, model.points[0]);
const end = Object.assign({}, model.points[model.points.length - 1]);

View File

@ -6,7 +6,6 @@ import store from '@/store';
class EMouse extends Group {
constructor(device, code) {
super();
this.down = false;
this.device = device;
this.code = code;
this.create();
@ -90,7 +89,6 @@ class EMouse extends Group {
}
mouseover(e) {
debugger;
if (this.device.model.isSwitchSection && this.device.model.relSwitchCode) {
const instance = this.getInstanceByCode(this.device.model.relSwitchCode);
if (instance && instance.mouseEvent && instance.mouseEvent.mouseover) {
@ -108,7 +106,7 @@ class EMouse extends Group {
}
mouseout(e) {
if (!this.down) {
if (!this.device.model.down) {
this.sectionTextShadow && this.sectionTextShadow.hide();
if (this.device.model.isSwitchSection && 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.zlevel = device.zlevel;
this.style = device.style;
this.down = false;
this.create();
}
@ -52,7 +51,7 @@ export default class EMouse extends Group {
}
mouseout(e) {
if (!this.down) {
if (!this.device.model.down) {
this.nameRect.hide();
this.lampRect.hide();
this.device.lamps.forEach(elem => {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -44,7 +44,7 @@ export default class Switch extends Group {
let halfWidth = style.Section.line.width / 2;
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 directy = 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.name.getNameText().stopAnimation(false);
this.swCore.stopAnimation(false);
this.relocShelter.stopAnimation(false);
this.relocShelter.hide();
if (!this.model.cutOff) {
this.relocShelter.stopAnimation(false);
this.relocShelter.hide();
}
this.releaseBackground.hide();
this.setHasTextBorder(0);
}
@ -235,7 +237,7 @@ export default class Switch extends Group {
this.locShelter.hide();
this.relocShelter.show();
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) {
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 '01': /** 空闲*/
section.setStyle(style, this.style.Section.line.spareColor);
@ -347,6 +360,10 @@ export default class Switch extends Group {
break;
}
}
if (state.cutOff && !section.animators.length ) {
this.sectionCutOff(section);
}
}
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 ArrowText from './ArrowText';
import Train from './Train';
import '../../StationStand/EDetain';
import TextHSDA from './TextHSDA';
@ -7,12 +6,35 @@ import TextTrainServer from './TextTrainServer';
import TextTrainTarget from './TextTrainTarget';
import TextTrainNumber from './TextTrainNumber';
import TextTrainTargetNumber from './TextTrainTargetNumber';
import EMouse from './EMouse';
import store from '@/store';
/** 车身*/
export default class TrainBody extends Group {
constructor(model) {
super();
this.model = model;
this.deviceModel = model.model;
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() {
@ -21,28 +43,6 @@ export default class TrainBody extends Group {
const textFont = model.fontSize + '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({
zlevel: model.zlevel,
z: model.z,
@ -57,10 +57,7 @@ export default class TrainBody extends Group {
stroke: style.trainSidelineColor,
fill: style.Train.trainBody.trainBodyFillColor
},
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():''; }
cursor: 'pointer'
});
const beginX = (model.point.x + style.Train.trainBody.lrPadding);
@ -93,9 +90,7 @@ export default class TrainBody extends Group {
style: style,
serviceNumber: serviceNumber,
trainBrownColor: style.trainTextColor,
textFont: textFont,
onmouseover: () => { style.Train.trainBody.trainBodyOnMouseOver.textTrainServer?this.arrowText.getArrowText().show():''; },
onmouseout: () => { style.Train.trainBody.trainBodyOnMouseOut.textTrainServer?this.arrowText.getArrowText().hide():''; }
textFont: textFont
});
this.textTrainTarget = new TextTrainTarget({
@ -106,9 +101,7 @@ export default class TrainBody extends Group {
style: style,
tripNumber: tripNumber,
trainYellowColor: style.trainTextColor,
textFont: textFont,
onmouseover: () => { style.Train.trainBody.trainBodyOnMouseOver.textTrainTarget?this.arrowText.getArrowText().show():''; },
onmouseout: () => { style.Train.trainBody.trainBodyOnMouseOut.textTrainTarget?this.arrowText.getArrowText().hide():''; }
textFont: textFont
});
this.textTrainNumber = new TextTrainNumber({
@ -119,9 +112,7 @@ export default class TrainBody extends Group {
upPadding: style.Train.trainBody.upPadding,
targetCode: targetCode,
trainTextColor: style.trainTextColor,
textFont: textFont,
onmouseover: () => { style.Train.trainBody.trainBodyOnMouseOver.textTrainNumber?this.arrowText.getArrowText().show():''; },
onmouseout: () => { style.Train.trainBody.trainBodyOnMouseOut.textTrainNumber?this.arrowText.getArrowText().hide():''; }
textFont: textFont
});
this.textTrainTargetNumber = new TextTrainTargetNumber({
@ -132,9 +123,7 @@ export default class TrainBody extends Group {
upPadding: style.Train.upPadding,
groupNumber: groupNumber,
trainTextColor: style.trainTextColor,
textFont: textFont,
onmouseover: () => { style.Train.trainBody.trainBodyOnMouseOver.textTrainTargetNumber?this.arrowText.getArrowText().show():''; },
onmouseout: () => { style.Train.trainBody.trainBodyOnMouseOut.textTrainTargetNumber?this.arrowText.getArrowText().hide():''; }
textFont: textFont
});
// 根据列车类型设置显示格式
if ( style.Train.trainBody.specialTrainType.length > 0) {
@ -153,7 +142,9 @@ export default class TrainBody extends Group {
}
removeTrainDetail() {
this.remove(this.arrowText);
this.mouseEvent.mouseout();
store.dispatch('map/setTrainDetails', null);
this.deviceModel.down = false;
}
setTrainColor(color) {
this.train && this.train.setColor('fill', color);

View File

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

View File

@ -5,7 +5,6 @@ export default class EMouse extends Group {
constructor(device) {
super();
this.device = device;
this.down = false;
this.create();
}
create() {
@ -29,32 +28,27 @@ export default class EMouse extends Group {
this.add(this.text);
this.text.hide();
}
mouseoverText(e) {
this.text.show();
}
mouseoutText(e) {
if (!this.down) {
this.text.hide();
mouseover(e) {
if (e.target && e.target._subType == 'Text') {
this.text.show();
} else {
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);
}
}
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) {
this.mouseoutText(e);
this.mouseoutArc(e);
if (!this.device.model.down) {
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.model = model;
this.style = style;
this.createMouseEvent();
this.create(model);
this.createMouseEvent();
this.setState(model);
}
@ -62,18 +62,8 @@ export default class ZcControl extends Group {
if (this.style.ZcControl.mouseOverStyle) {
this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent);
this.mouseoverText = (e) => {
this.mouseEvent.mouseoverText(e);
};
this.mouseoutText = (e) => {
this.mouseEvent.mouseoutText(e);
};
this.mouseoverArc = (e) => {
this.mouseEvent.mouseoverArc(e);
};
this.mouseoutArc = (e) => {
this.mouseEvent.mouseoutArc(e);
};
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
}
}
getShapeTipPoint() {

View File

@ -124,43 +124,33 @@ export default {
},
setDeviceDisplay() {
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) {
sectionList.forEach(elem => {
//
show = this.deviceLevels.indexOf(2) !== -1;
elem.borderBorderShow = show;
elem.type = deviceType.Section;
deviceList.push(elem);
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { borderBorderShow })); //
});
}
//
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) {
trainWindowList.forEach(elem => {
//
show = this.deviceLevels.indexOf(1) !== -1;
elem.type = deviceType.Section;
elem.trainWindowShow = show;
deviceList.push(elem);
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { trainWindowShow })); //
});
}
// 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) {
signalList.forEach(elem => {
//
show = this.deviceLevels.indexOf(3) !== -1;
elem.linkageAutoRouteShow = show;
// ATS
show = this.deviceLevels.indexOf(4) !== -1;
elem.atsAutoTriggerShow = show;
deviceList.push(elem);
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { linkageAutoRouteShow, atsAutoTriggerShow }));
});
}

View File

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

View File

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

View File

@ -125,44 +125,33 @@ export default {
},
setDeviceDisplay() {
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) {
sectionList.forEach(elem => {
//
show = this.deviceLevels.indexOf(2) !== -1;
elem._type = deviceType.Section;
elem.borderBorderShow = show;
deviceList.push(elem);
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { borderBorderShow })); //
});
}
//
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) {
trainWindowList.forEach(elem => {
//
show = this.deviceLevels.indexOf(1) !== -1;
elem._type = deviceType.TrainWindow;
elem.trainWindowShow = show;
deviceList.push(elem);
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { trainWindowShow })); //
});
}
// 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) {
signalList.forEach(elem => {
elem._type = deviceType.Signal;
//
show = this.deviceLevels.indexOf(3) !== -1;
elem.linkageAutoRouteShow = show;
// ATS
show = this.deviceLevels.indexOf(4) !== -1;
elem.atsAutoTriggerShow = show;
deviceList.push(elem);
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { linkageAutoRouteShow, atsAutoTriggerShow }));
});
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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