From c7855236991e1758909f33c575ada32f42253e90 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Fri, 5 Mar 2021 13:06:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=90=E8=A1=8C=E5=9B=BE=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editTool/routingoperate/routeConfig.vue | 122 +++++++++--------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/src/views/planMonitor/editTool/routingoperate/routeConfig.vue b/src/views/planMonitor/editTool/routingoperate/routeConfig.vue index 2c676f77a..3c944fcfc 100644 --- a/src/views/planMonitor/editTool/routingoperate/routeConfig.vue +++ b/src/views/planMonitor/editTool/routingoperate/routeConfig.vue @@ -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) {