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

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);
} else {
const nDevice = Object.assign(oDevice, this.hookHandle(elem));
if (nDevice.id == '5888') {
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); }
}

View File

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

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