From 7ac00f45dcdcb6e52c423a12079145553012039a Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Mon, 22 Mar 2021 15:12:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=90=E8=A1=8C=E5=9B=BE=E7=BC=96=E5=88=B6?= =?UTF-8?q?=20=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../planMonitor/components/menus/addTask.vue | 42 +++++++++++-------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/src/views/planMonitor/components/menus/addTask.vue b/src/views/planMonitor/components/menus/addTask.vue index c944d13b0..907f943cd 100644 --- a/src/views/planMonitor/components/menus/addTask.vue +++ b/src/views/planMonitor/components/menus/addTask.vue @@ -213,7 +213,7 @@ export default { tripNumber: '', planId: '', serviceNumber: '', - startTbFront: false, + startTbFront: false, endTbFront: false }, tripNumberList: [{ value: '', label: this.$t('planMonitor.automatic') }], @@ -281,8 +281,16 @@ export default { endStationFilterMap[routing.endStationCode] = {text:formatName(routing.endStationCode), value:routing.endStationCode}; } }); - this.startStationFilters = Object.values(startStationFilterMap); - this.endStationFilters = Object.values(endStationFilterMap); + this.startStationFilters = Object.values(startStationFilterMap).sort((a, b)=>{ + const startStationA = this.$store.getters['map/getDeviceByCode'](a.value); + const startStationB = this.$store.getters['map/getDeviceByCode'](b.value); + return startStationA.kmRange - startStationB.kmRange; + }); + this.endStationFilters = Object.values(endStationFilterMap).sort((a, b)=>{ + const endStationA = this.$store.getters['map/getDeviceByCode'](a.value); + const endStationB = this.$store.getters['map/getDeviceByCode'](b.value); + return endStationA.kmRange - endStationB.kmRange; + }); }); getMapStationRunUser(mapId).then(resp =>{ @@ -324,10 +332,10 @@ export default { compuntedRunTime(list, index, runLevel) { let runTime = 0; - if ((index == 0 && String(this.addModel.startTbFront) != 'undefined') || - (index == list.length-1 && String(this.addModel.endTbFront) != 'undefined')) { - return 0 - } + if ((index == 0 && String(this.addModel.startTbFront) != 'undefined') || + (index == list.length - 1 && String(this.addModel.endTbFront) != 'undefined')) { + return 0; + } if (index < list.length - 1) { const stopStationObj = this.stopStationMap[[list[index].sectionCode, list[index + 1].sectionCode].toString()]; @@ -371,14 +379,14 @@ export default { elem.speedLevelTime = realRunlevel; elem.speedLevel = runLevelObj.label; - let fronTime = 0; - if (index == 0 && String(this.addModel.startTbFront) == 'false') { - const data = this.reentryData[elem.stationCode]||{}; - fronTime = data.tbTo || 0; - } else if (index == list.length - 2 && String(this.addModel.endTbFront) == 'false') { - const data = this.reentryData[list[index+1].stationCode]||{}; - fronTime = data.tbTo || 0; - } + let fronTime = 0; + if (index == 0 && String(this.addModel.startTbFront) == 'false') { + const data = this.reentryData[elem.stationCode] || {}; + fronTime = data.tbTo || 0; + } else if (index == list.length - 2 && String(this.addModel.endTbFront) == 'false') { + const data = this.reentryData[list[index + 1].stationCode] || {}; + fronTime = data.tbTo || 0; + } tempTime = tempTime + fronTime + elem.stopTime + elem.speedLevelTime; }); @@ -397,8 +405,8 @@ export default { this.addModel.endSectionCode = row.endSectionCode; this.addModel.startSectionCode = row.startSectionCode; this.addModel.routingCode = row.code; - this.addModel.startTbFront = row.startTbFront; - this.addModel.endTbFront = row.endTbFront; + this.addModel.startTbFront = row.startTbFront; + this.addModel.endTbFront = row.endTbFront; this.computedDetailList('routingCode'); }, handleCommit() {