运行图 代码调整

This commit is contained in:
joylink_cuiweidong 2021-03-18 18:46:52 +08:00
parent e603837d9c
commit 1383dfbee3
2 changed files with 33 additions and 4 deletions

View File

@ -107,15 +107,27 @@ export default {
id:index + 1,
tripNumber: tripNumber,
startStationCode: resp.data.startStationCode,
startTime: formatTime(trainInfo.stationTimeList[1].secondTime + 7200),
startTime: formatTime(trainInfo.stationTimeList[0].secondTime + 7200),
endStationCode: resp.data.endStationCode,
endTime: formatTime(trainInfo.stationTimeList[lastIndex - 1].secondTime + 7200),
routingCode : resp.data.code,
endSectionCode:resp.data.endSectionCode,
startSectionCode:resp.data.startSectionCode,
arriveConfigList: []
arriveConfigList: [],
endTbFront:resp.data.endTbFront,
startTbFront:resp.data.startTbFront
};
if (resp.data.startTbFront == false) {
const newModel = {
sectionCode:resp.data.parkSectionCodeList[0].sectionCode,
stationCode:resp.data.startStationCode,
// // speedLevel:'',
departureTime: formatTime(trainInfo.stationTimeList[0].secondTime + 7200),
arriveTime: formatTime(trainInfo.stationTimeList[0].secondTime + 7200),
stopTime:0
};
taskObj.arriveConfigList.push(newModel);
}
const newstationTimeList = [];
let current = {};
trainInfo.stationTimeList.forEach((stationTime, index)=>{
@ -130,19 +142,35 @@ export default {
});
newstationTimeList.forEach((newstationTime, index)=>{
const newModel = {
sectionCode:resp.data.parkSectionCodeList[index].sectionCode,
stationCode:newstationTime.stationCode,
// speedLevel:'',
arriveTime: formatTime(newstationTime.arriveTime + 7200),
departureTime: formatTime(newstationTime.departureTime + 7200),
stopTime:newstationTime.departureTime - newstationTime.arriveTime
};
if (resp.data.startTbFront == false) {
newModel.sectionCode = resp.data.parkSectionCodeList[index + 1].sectionCode;
} else {
newModel.sectionCode = resp.data.parkSectionCodeList[index].sectionCode;
}
if (index < newstationTimeList.length - 1) {
newModel.speedLevelTime = newstationTimeList[index + 1].arriveTime - newstationTime.departureTime;
// newModel.speedLevel=
}
taskObj.arriveConfigList.push(newModel);
});
if (resp.data.endTbFront == false) {
const length = resp.data.parkSectionCodeList.length - 1;
const newModel = {
sectionCode:resp.data.parkSectionCodeList[length].sectionCode,
stationCode:resp.data.startStationCode,
// // speedLevel:'',
departureTime: formatTime(trainInfo.stationTimeList[length].secondTime + 7200),
arriveTime: formatTime(trainInfo.stationTimeList[length].secondTime + 7200),
stopTime:0
};
taskObj.arriveConfigList.push(newModel);
}
// arriveTime: ""
// departureTime: "07:00:00"
// speedLevel: "()"

View File

@ -388,6 +388,7 @@ export default {
if (editData) {
const trainInfo = editData.trainMap[this.tripNumber];
const lastIndex = trainInfo.stationTimeList.length - 1;
debugger;
this.routingList.push({
code:resp.data.code,
startStationCode:resp.data.startStationCode,