SLAM-Former: Putting SLAM into One Transformer