From 0f6af4d8353b43e340d7417472fde9c342087471 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Tue, 10 Nov 2020 18:18:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=88=97=E8=BD=A6list?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A4=84=E7=90=86=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/map.js | 3 +-- src/store/modules/runplan.js | 31 ------------------------------- 2 files changed, 1 insertion(+), 33 deletions(-) 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 }; }); });