diff --git a/src/store/modules/map.js b/src/store/modules/map.js index 1da1932c6..3b232efa2 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -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; } } }); diff --git a/src/store/modules/runplan.js b/src/store/modules/runplan.js index 32fd26060..cd9f13a54 100644 --- a/src/store/modules/runplan.js +++ b/src/store/modules/runplan.js @@ -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 }; }); });