Both the charge- and spin-transport properties of a topological Dirac semimetal (TDSM) nanowire with two lateral gates and a perpendicular magnetic field are investigated by using the Green function method in combination with the Landauer-B\uttiker formula. A fully spin-polarized surface current can be generated in the considered system and it can be turned on or off by varying the electron energy and magnetic field strength. The underlying physics of this transport phenomenon originates from the quantum anomalous Hall-like insulator state of the TDSM nanowire caused by the magnetic field. Further studies indicate the spin-polarized current with a strong robustness against disorder, displaying the feasibility of designing a topological spin filtering and switch device based on the considered system.