运行图代码调整

This commit is contained in:
joylink_cuiweidong 2020-10-21 17:19:47 +08:00
parent 14f54eeb85
commit 8fd587ac13
2 changed files with 74 additions and 63 deletions

View File

@ -95,16 +95,8 @@ export default {
formatName(code) {
return formatName(code);
},
loadInitData(params) {
this.isNew = params.isNew;
this.model.planId = this.$route.query.planId;
this.model.serviceNumber = params.serviceNumber;
this.model.tripConfigList = [];
if (!this.isNew) {
const editData = this.$store.state.runPlan.editData[params.serviceNumber];
if (editData) {
const tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex; });
tripNumberList.forEach(tripNumber => {
getEachTripNumber(editData, tripNumberList, index) {
const tripNumber = tripNumberList[index];
const trainInfo = editData.trainMap[tripNumber];
const lastIndex = trainInfo.stationTimeList.length - 1;
const model = {
@ -141,8 +133,8 @@ export default {
sectionCode:resp.data.parkSectionCodeList[index].sectionCode,
stationCode:newstationTime.stationCode,
speedLevel:'默认',
arriveTime: formatTime(newstationTime.arriveTime),
departureTime: formatTime(newstationTime.departureTime),
arriveTime: formatTime(newstationTime.arriveTime + 7200),
departureTime: formatTime(newstationTime.departureTime + 7200),
stopTime:newstationTime.departureTime - newstationTime.arriveTime
};
if (index < newstationTimeList.length - 1) {
@ -154,9 +146,24 @@ export default {
// departureTime: "07:00:00"
// speedLevel: "()"
this.model.tripConfigList.push(taskObj);
index++;
if (index <= tripNumberList.length - 1) {
this.getEachTripNumber(editData, tripNumberList, index);
}
});
});
},
loadInitData(params) {
this.isNew = params.isNew;
this.model.planId = this.$route.query.planId;
this.model.serviceNumber = params.serviceNumber;
this.model.tripConfigList = [];
if (!this.isNew) {
const editData = this.$store.state.runPlan.editData[params.serviceNumber];
if (editData) {
const tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex; });
if (tripNumberList.length > 0) {
this.getEachTripNumber(editData, tripNumberList, 0);
}
}
}
},

View File

@ -379,11 +379,12 @@ export default {
}
},
loadInitData(params) {
debugger;
const lineCode = this.$route.query.lineCode;
const mapId = this.$route.query.mapId;
this.isPlan = params.isPlan;
this.tripNumber = params.serviceNumber;
this.serviceNumber = params.tripNumber;
this.tripNumber = params.tripNumber;
this.serviceNumber = params.serviceNumber;
this.planId = this.$route.query.planId;
this.PlanConvert = this.$theme.loadPlanConvert(lineCode);
@ -403,12 +404,6 @@ export default {
});
}
// this.routingList
// const editData = this.$store.state.runPlan.editData[this.editModel.serviceNumber];
// if (editData) {
// const tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex; });
// const trainInfo = editData.trainMap[tripNumberList[0]];
// this.editModel.startTime = formatTime(trainInfo.stationTimeList[0].secondTime + this.PlanConvert.TranslationTime);
// }
if (params.rowData && params.rowData.arriveConfigList.length > 0) {
this.editModel.arriveConfigList = params.rowData.arriveConfigList;
this.editModel.routingCode = params.rowData.routingCode;
@ -418,6 +413,7 @@ export default {
this.editModel.endTime = params.rowData.endTime;
this.editModel.endSectionCode = params.rowData.endSectionCode;
this.editModel.startSectionCode = params.rowData.startSectionCode;
this.routingList = [];
this.routingList.push({
code:params.rowData.routingCode,
startStationCode:params.rowData.startStationCode,
@ -430,7 +426,7 @@ export default {
} else {
const model = {
planId: this.$route.query.planId || this.loadRunPlanId,
SDTNumber: `${this.editModel.serviceNumber}${this.editModel.tripNumber}`
SDTNumber: `${this.serviceNumber}${this.tripNumber}`
};
this.editModel.routingList = [];
getRoutingBySDTNumber(model).then(resp => { //
@ -440,8 +436,16 @@ export default {
// const data = editData.trainMap[this.editModel.tripNumber].stationTimeList;
// this.editModel.defaultSpeedLevel
this.editModel.routingCode = routingObj.code;
// const editData = this.$store.state.runPlan.editData[this.editModel.serviceNumber];
// if (editData) {
// const tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex; });
// const trainInfo = editData.trainMap[tripNumberList[0]];
// this.editModel.startTime = formatTime(trainInfo.stationTimeList[0].secondTime + this.PlanConvert.TranslationTime);
// }
// this.editModel.routingList[]
this.editModel.routingList.push(routingObj);
// this.editModel.routingList.push(routingObj);
this.computedDetailList();
});
}