This commit is contained in:
fan 2021-03-30 15:23:48 +08:00
commit 28d092401e
2 changed files with 23 additions and 6 deletions

View File

@ -337,8 +337,8 @@ export default {
compuntedRunTime(list, index, runLevel) { compuntedRunTime(list, index, runLevel) {
let runTime = 0; let runTime = 0;
if ((index == 0 && String(this.addModel.startTbFront) != 'undefined') || if ((index == 0 && String(this.addModel.startTbFront) == false) ||
(index == list.length - 1 && String(this.addModel.endTbFront) != 'undefined')) { (index == list.length - 1 && String(this.addModel.endTbFront) == false)) {
return 0; return 0;
} }
@ -376,7 +376,12 @@ export default {
tempTime = tempTime || this.computedTimeByString('23:59:59') / 1000 + 1; tempTime = tempTime || this.computedTimeByString('23:59:59') / 1000 + 1;
elem.arriveTime = formatTime(tempTime); elem.arriveTime = formatTime(tempTime);
if (index == list.length - 1 && String(this.addModel.endTbFront) == 'true') {
const data = this.reentryData[list[index].stationCode] || {};
elem.departureTime = formatTime(tempTime + elem.stopTime + data.tbFront || 0);
} else {
elem.departureTime = formatTime(tempTime + elem.stopTime); elem.departureTime = formatTime(tempTime + elem.stopTime);
}
const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; }); const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; });
const realRunlevel = this.compuntedRunTime(list, index, runLevel); const realRunlevel = this.compuntedRunTime(list, index, runLevel);
@ -391,6 +396,9 @@ export default {
} else if (index == list.length - 2 && String(this.addModel.endTbFront) == 'false') { } else if (index == list.length - 2 && String(this.addModel.endTbFront) == 'false') {
const data = this.reentryData[list[index + 1].stationCode] || {}; const data = this.reentryData[list[index + 1].stationCode] || {};
fronTime = data.tbTo || 0; fronTime = data.tbTo || 0;
} else if (index == list.length - 1 && String(this.addModel.endTbFront) == 'true') {
const data = this.reentryData[list[index].stationCode] || {};
fronTime = data.tbFront || 0;
} }
tempTime = tempTime + fronTime + elem.stopTime + elem.speedLevelTime; tempTime = tempTime + fronTime + elem.stopTime + elem.speedLevelTime;

View File

@ -257,8 +257,8 @@ export default {
compuntedRunTime(list, index, runLevel) { compuntedRunTime(list, index, runLevel) {
let runTime = 0; let runTime = 0;
if ((index == 0 && String(this.editModel.startTbFront) != 'undefined') || if ((index == 0 && String(this.editModel.startTbFront) == false) ||
(index == list.length - 1 && String(this.editModel.endTbFront) != 'undefined')) { (index == list.length - 1 && String(this.editModel.endTbFront) == false)) {
return 0; return 0;
} }
@ -296,7 +296,13 @@ export default {
tempTime = tempTime || this.computedTimeByString('23:59:59') / 1000 + 1; tempTime = tempTime || this.computedTimeByString('23:59:59') / 1000 + 1;
elem.arriveTime = formatTime(tempTime); elem.arriveTime = formatTime(tempTime);
if (index == list.length - 1 && String(this.editModel.endTbFront) == 'true') {
const data = this.reentryData[list[index].stationCode] || {};
elem.departureTime = formatTime(tempTime + elem.stopTime + data.tbFront || 0);
} else {
elem.departureTime = formatTime(tempTime + elem.stopTime); elem.departureTime = formatTime(tempTime + elem.stopTime);
}
const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; }); const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; });
const realRunlevel = this.compuntedRunTime(list, index, runLevel); const realRunlevel = this.compuntedRunTime(list, index, runLevel);
@ -311,6 +317,9 @@ export default {
} else if (index == list.length - 2 && String(this.editModel.endTbFront) == 'false') { } else if (index == list.length - 2 && String(this.editModel.endTbFront) == 'false') {
const data = this.reentryData[list[index + 1].stationCode] || {}; const data = this.reentryData[list[index + 1].stationCode] || {};
fronTime = data.tbTo || 0; fronTime = data.tbTo || 0;
} else if (index == list.length - 1 && String(this.editModel.endTbFront) == 'true') {
const data = this.reentryData[list[index].stationCode] || {};
fronTime = data.tbFront || 0;
} }
tempTime = tempTime + fronTime + elem.stopTime + elem.speedLevelTime; tempTime = tempTime + fronTime + elem.stopTime + elem.speedLevelTime;