修改 设置设备名称的设置方法

This commit is contained in:
ival 2019-08-06 17:46:41 +08:00
parent 167e483b10
commit b6baa2e420
14 changed files with 166 additions and 274 deletions

View File

@ -234,16 +234,12 @@ class Jlmap {
this.$painter.delete(oDevice); this.$painter.delete(oDevice);
} else { } else {
const nDevice = Object.assign(oDevice, this.hookHandle(elem)); const nDevice = Object.assign(oDevice, this.hookHandle(elem));
if (nDevice.id == '5888') {
console.log(oDevice, nDevice);
debugger;
}
this.$painter.update(nDevice); 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

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

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