A class of spectral self-affine measures with four-element digit sets