运行图 代码调整

This commit is contained in:
joylink_cuiweidong 2021-03-05 13:06:06 +08:00
parent e9997a2f7f
commit c785523699

View File

@ -186,8 +186,8 @@ export default {
stationCode: '',
sectionCode: '',
DirectionCodeList: [{label: '右行', value: true}, {label: '左行', value: false}],
oldStartSectionCode: '',
oldEndSectionCode: '',
oldStartSectionCode: '',
oldEndSectionCode: '',
addModel: {
name: '',
mapId: '',
@ -220,7 +220,7 @@ export default {
{ required: true, message: '请选择终到区段', trigger: 'change' }
]
},
oldsection: []
oldsection: []
};
},
computed: {
@ -235,13 +235,13 @@ export default {
return [];
}
},
filterEndSectionList() {
filterEndSectionList() {
if (this.sectionList) {
return this.sectionList.filter(elem => { return elem.reentryTrack; });
return this.sectionList.filter(elem => { return elem.reentryTrack || elem.transferTrack; });
} else {
return [];
}
},
},
filterStandSection() {
if (this.sectionList) {
return this.sectionList.filter(elem => { return elem.standTrack; });
@ -349,21 +349,21 @@ export default {
this.judgeAllowSelected();
this.addEndSectionData(true);
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'startSectionCode'.toUpperCase()) {
if (selected.code != this.addModel.endSectionCode && (selected.reentryTrack || selected.transferTrack)) {
this.popSection(this.addModel, 'startSectionCode');
if (selected.code != this.addModel.endSectionCode && (selected.reentryTrack || selected.transferTrack)) {
this.popSection(this.addModel, 'startSectionCode');
if (selected.belongStation) {
this.addModel.startStationCode = selected.belongStation;
}
this.addModel.startSectionCode = selected.code;
this.judgeAllowSelected();
this.addStartSectionData(false);
this.oldStartSectionCode = selected.code;
this.oldStartSectionCode = selected.code;
} else {
this.$message.error('请选择正确的起始区段');
}
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'endSectionCode'.toUpperCase()) {
if (selected.code != this.addModel.startSectionCode && selected.reentryTrack) {
this.popSection(this.addModel, 'endSectionCode');
if (selected.code != this.addModel.startSectionCode && (selected.reentryTrack || selected.transferTrack)) {
this.popSection(this.addModel, 'endSectionCode');
if (this.addModel.startSectionCode == selected.code) {
this.$message.error('起始区段和终到区段不能相同');
return false;
@ -374,13 +374,13 @@ export default {
this.addModel.endSectionCode = selected.code;
this.judgeAllowSelected();
this.addEndSectionData(false);
this.oldEndSectionCode = selected.code;
this.oldEndSectionCode = selected.code;
this.addModel.destinationCode = selected.destinationCode || '';
} else {
this.$message.error('请选择正确的终到区段');
}
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() == 'routingSection'.toUpperCase()) {
if (selected.standTrack) {
if (selected.standTrack) {
this.sectionCode = selected.code;
} else {
this.$message.error('请选择正确的区段');
@ -396,13 +396,13 @@ export default {
}
},
changeSectionSelected(selectedList, flag) {
if (this.oldsection && this.oldsection.length > 0) {
this.oldsection.forEach((section)=>{
section.instance.drawBatchSelected(section, '');
});
}
if (this.oldsection && this.oldsection.length > 0) {
this.oldsection.forEach((section)=>{
section.instance.drawBatchSelected(section, '');
});
}
this.oldsection = [];
this.oldsection = [];
if (this.addModel.parkSectionCodeList && this.addModel.parkSectionCodeList.length > 0) {
if (flag) {
selectedList.forEach(each=>{
@ -412,11 +412,11 @@ export default {
list.forEach(logicSectionCode=>{
const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode);
logicSection.instance.drawBatchSelected(logicSection, 'routingSection');
this.oldsection && this.oldsection.push(logicSection);
this.oldsection && this.oldsection.push(logicSection);
});
} else {
section.instance.drawBatchSelected(section, 'routingSection');
this.oldsection && this.oldsection.push(section);
this.oldsection && this.oldsection.push(section);
}
});
} else {
@ -440,26 +440,26 @@ export default {
this.addStartSectionData(true);
},
changeStartSection(code) {
if (code) {
if (this.addModel.endSectionCode != code) {
const section = this.$store.getters['map/getDeviceByCode'](code);
if (section &&
if (code) {
if (this.addModel.endSectionCode != code) {
const section = this.$store.getters['map/getDeviceByCode'](code);
if (section &&
section.belongStation) {
this.addModel.startStationCode = section.belongStation;
}
this.popSection({startSectionCode: this.oldStartSectionCode}, 'startSectionCode');
this.judgeAllowSelected();
this.addStartSectionData(false);
this.oldStartSectionCode = code;
} else {
this.addModel.startSectionCode = this.oldStartSectionCode;
this.$message.error('请选择正确的起始区段');
}
} else {
this.popSection({startSectionCode: this.oldStartSectionCode}, 'startSectionCode');
this.addModel.startStationCode = section.belongStation;
}
this.popSection({startSectionCode: this.oldStartSectionCode}, 'startSectionCode');
this.judgeAllowSelected();
this.addStartSectionData(false);
this.oldStartSectionCode = code;
} else {
this.addModel.startSectionCode = this.oldStartSectionCode;
this.$message.error('请选择正确的起始区段');
}
} else {
this.popSection({startSectionCode: this.oldStartSectionCode}, 'startSectionCode');
this.addModel.startStationCode = '';
this.addModel.startSectionCode = '';
this.oldStartSectionCode = '';
this.oldStartSectionCode = '';
}
},
changeEndStation() {
@ -468,26 +468,26 @@ export default {
},
changeEndSection(code) {
if (code) {
if (this.addModel.startSectionCode != code) {
const section = this.$store.getters['map/getDeviceByCode'](code);
if (section &&
if (this.addModel.startSectionCode != code) {
const section = this.$store.getters['map/getDeviceByCode'](code);
if (section &&
section.belongStation) {
this.addModel.endStationCode = section.belongStation;
}
this.addModel.destinationCode = section.destinationCode || '';
this.popSection({endSectionCode: this.oldEndSectionCode}, 'endSectionCode');
this.judgeAllowSelected();
this.addEndSectionData(false);
this.oldEndSectionCode = code;
} else {
this.addModel.endSectionCode = this.oldEndSectionCode;
this.$message.error('请选择正确的终到区段');
}
this.addModel.endStationCode = section.belongStation;
}
this.addModel.destinationCode = section.destinationCode || '';
this.popSection({endSectionCode: this.oldEndSectionCode}, 'endSectionCode');
this.judgeAllowSelected();
this.addEndSectionData(false);
this.oldEndSectionCode = code;
} else {
this.addModel.endSectionCode = this.oldEndSectionCode;
this.$message.error('请选择正确的终到区段');
}
} else {
this.popSection({endSectionCode: this.oldEndSectionCode}, 'endSectionCode');
this.popSection({endSectionCode: this.oldEndSectionCode}, 'endSectionCode');
this.addModel.endStationCode = '';
this.addModel.endSectionCode = '';
this.oldEndSectionCode = '';
this.oldEndSectionCode = '';
}
},
judgeAllowSelected() {
@ -665,13 +665,13 @@ export default {
this.stationCode = '';
}
},
popSection(data, type) {
const list = this.addModel.parkSectionCodeList;
const index = list.findIndex(el => { return el.sectionCode == data[type]});
if (index >= 0) {
this.deleteSection(list, index);
}
},
popSection(data, type) {
const list = this.addModel.parkSectionCodeList;
const index = list.findIndex(el => { return el.sectionCode == data[type]; });
if (index >= 0) {
this.deleteSection(list, index);
}
},
generateParkSection() {
this.$refs.form.validate((valid) => {
if (valid) {