西安三站台状态管理显示调整

This commit is contained in:
fan 2021-06-17 18:03:03 +08:00
parent 82f38c349b
commit 544ba5af63

View File

@ -891,15 +891,16 @@ const map = {
updateStationStand: (state, status) => { updateStationStand: (state, status) => {
const holdIndex = state.holdStandList.indexOf(status.code); const holdIndex = state.holdStandList.indexOf(status.code);
const jumpIndex = state.jumpStandList.indexOf(status.code); const jumpIndex = state.jumpStandList.indexOf(status.code);
if ((status.stationHoldTrain || status.centerHoldTrain) && holdIndex < 0) { const device = state.mapDevice[status.code];
state.holdStandList.push(status.code); if ((device.stationHoldTrain || device.centerHoldTrain) && holdIndex < 0) {
} else if (!(status.stationHoldTrain && status.centerHoldTrain) && holdIndex > -1) { state.holdStandList.push(device.code);
} else if (!(device.stationHoldTrain && device.centerHoldTrain) && holdIndex > -1) {
state.holdStandList.splice(holdIndex, 1); state.holdStandList.splice(holdIndex, 1);
} }
state.holdStatus = state.holdStandList.length > 0; state.holdStatus = state.holdStandList.length > 0;
if ((status.assignSkip || status.allSkip) && jumpIndex < 0) { if ((device.assignSkip || device.allSkip) && jumpIndex < 0) {
state.jumpStandList.push(status.code); state.jumpStandList.push(device.code);
} else if (!(status.assignSkip && status.allSkip) && jumpIndex > -1) { } else if (!(device.assignSkip && device.allSkip) && jumpIndex > -1) {
state.jumpStandList.splice(jumpIndex, 1); state.jumpStandList.splice(jumpIndex, 1);
} }
state.jumpStatus = state.jumpStandList.length > 0; state.jumpStatus = state.jumpStandList.length > 0;