优化运行图代码,防止报错

This commit is contained in:
ival 2021-03-09 10:03:21 +08:00
parent 1a1fbbfd69
commit a62248d4a6
4 changed files with 24 additions and 26 deletions

View File

@ -377,12 +377,12 @@ export default {
let fronTime = 0;
if (index == 0 &&
String(this.frontModel.startTbFront) == 'false') {
fronTime = this.reentryData[elem.stationCode].tbTo
} else if (index == list.length - 2 &&
String(this.frontModel.endTbFront) == 'false') {
fronTime = this.reentryData[list[index+1].stationCode].tbTo
if (index == 0 && String(this.frontModel.startTbFront) == 'false') {
const data = this.reentryData[elem.stationCode]||{};
fronTime = data.tbTo || 0;
} else if (index == list.length - 2 && String(this.frontModel.endTbFront) == 'false') {
const data = this.reentryData[list[index+1].stationCode]||{};
fronTime = data.tbTo || 0;
}
tempTime = tempTime + fronTime + elem.stopTime + elem.speedLevelTime;
@ -404,7 +404,6 @@ export default {
this.addModel.routingCode = row.code;
this.frontModel.startTbFront = row.startTbFront;
this.frontModel.endTbFront = row.endTbFront;
console.log(row);
this.computedDetailList('routingCode');
},
handleCommit() {

View File

@ -413,12 +413,12 @@ export default {
let fronTime = 0;
if (index == 0 &&
String(this.frontModel.startTbFront) == 'false') {
fronTime = this.reentryData[elem.stationCode].tbTo
} else if (index == list.length - 2 &&
String(this.frontModel.endTbFront) == 'false') {
fronTime = this.reentryData[list[index+1].stationCode].tbTo
if (index == 0 && String(this.frontModel.startTbFront) == 'false') {
const data = this.reentryData[elem.stationCode]||{};
fronTime = data.tbTo || 0;
} else if (index == list.length - 2 && String(this.frontModel.endTbFront) == 'false') {
const data = this.reentryData[list[index+1].stationCode]||{};
fronTime = data.tbTo || 0;
}
tempTime = tempTime + fronTime + elem.stopTime + elem.speedLevelTime;

View File

@ -377,12 +377,12 @@ export default {
let fronTime = 0;
if (index == 0 &&
String(this.frontModel.startTbFront) == 'false') {
fronTime = this.reentryData[elem.stationCode].tbTo
} else if (index == list.length - 2 &&
String(this.frontModel.endTbFront) == 'false') {
fronTime = this.reentryData[list[index+1].stationCode].tbTo
if (index == 0 && String(this.frontModel.startTbFront) == 'false') {
const data = this.reentryData[elem.stationCode]||{};
fronTime = data.tbTo || 0;
} else if (index == list.length - 2 && String(this.frontModel.endTbFront) == 'false') {
const data = this.reentryData[list[index+1].stationCode]||{};
fronTime = data.tbTo || 0;
}
tempTime = tempTime + fronTime + elem.stopTime + elem.speedLevelTime;
@ -404,7 +404,6 @@ export default {
this.addModel.routingCode = row.code;
this.frontModel.startTbFront = row.startTbFront;
this.frontModel.endTbFront = row.endTbFront;
console.log(row);
this.computedDetailList('routingCode');
},
handleCommit() {

View File

@ -413,12 +413,12 @@ export default {
let fronTime = 0;
if (index == 0 &&
String(this.frontModel.startTbFront) == 'false') {
fronTime = this.reentryData[elem.stationCode].tbTo
} else if (index == list.length - 2 &&
String(this.frontModel.endTbFront) == 'false') {
fronTime = this.reentryData[list[index+1].stationCode].tbTo
if (index == 0 && String(this.frontModel.startTbFront) == 'false') {
const data = this.reentryData[elem.stationCode]||{};
fronTime = data.tbTo || 0;
} else if (index == list.length - 2 && String(this.frontModel.endTbFront) == 'false') {
const data = this.reentryData[list[index+1].stationCode]||{};
fronTime = data.tbTo || 0;
}
tempTime = tempTime + fronTime + elem.stopTime + elem.speedLevelTime;