A man has pleaded guilty to killing seven people when he opened fire on an Independence Day parade in Chicago in 2022.