Disclosed are benzoheterocyclic alkylamine compounds, or a pharmaceutically acceptable salt thereof, or a stereoisomer thereof, and a preparation method thereof, and use of the same in the manufacture of an antibacterial drug as an inhibitor of staphyloxanthin synthesis in Staphylococcus aureus.