动态列车list数据处理调整
This commit is contained in:
parent
3eba44aa67
commit
0f6af4d835
@ -874,11 +874,10 @@ const map = {
|
||||
let isExist = false;
|
||||
state.activeTrainList.forEach(elem => {
|
||||
if (elem == data.code) {
|
||||
isExist = true;
|
||||
if (data.dispose) {
|
||||
state.activeTrainList.splice(state.activeTrainList.indexOf(data.code), 1);
|
||||
state.activeTrainListChange += 1;
|
||||
} else {
|
||||
isExist = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -22,36 +22,6 @@ const runPlan = {
|
||||
},
|
||||
draftStations: (state) => {
|
||||
return state.draftStations || [];
|
||||
},
|
||||
convertPlanData: (state) => () => {
|
||||
const data = { serviceNumberDataList: [] };
|
||||
const serviceNumberList = Object.keys(state.editData).sort((a, b) => {
|
||||
return state.editData[a].oldIndex - state.editData[b].oldIndex;
|
||||
});
|
||||
|
||||
serviceNumberList.forEach(serviceNumber => {
|
||||
const serviceObj = {
|
||||
serviceNumber: serviceNumber,
|
||||
tripNumberDataList: []
|
||||
};
|
||||
|
||||
if (state.editData[serviceNumber].backup) {
|
||||
serviceObj['backup'] = state.editData[serviceNumber].backup;
|
||||
}
|
||||
|
||||
const trainMap = state.editData[serviceNumber].trainMap;
|
||||
const tripNumberList = Object.keys(trainMap).sort((a, b) => {
|
||||
return trainMap[a].oldIndex - trainMap[b].oldIndex;
|
||||
});
|
||||
|
||||
tripNumberList.forEach(tripNumber => {
|
||||
serviceObj.tripNumberDataList.push(trainMap[tripNumber]);
|
||||
});
|
||||
|
||||
data.serviceNumberDataList.push(serviceObj);
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
@ -77,7 +47,6 @@ const runPlan = {
|
||||
const trainList = service.tripNumberDataList;
|
||||
state.initialPlanData[service.serviceNumber] = { oldIndex: i, serviceNumber: service.serviceNumber, backup: service.backup, trainMap: {} };
|
||||
trainList.forEach((train, j) => {
|
||||
// ${train.directionCode}
|
||||
state.initialPlanData[service.serviceNumber].trainMap[`${train.tripNumber}`] = { oldIndex: j, tripNumber: train.tripNumber, directionCode: train.directionCode, reentry: train.reentry, stationTimeList: train.stationTimeList };
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user