运行图 代码调整
This commit is contained in:
parent
e603837d9c
commit
1383dfbee3
@ -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: "默认(等级三)"
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user