I agree with @drunkpenguin.
Depending on what Dahua Starlights you are using 8 HDW5231-Z with junction box made for that camera would be $1464.
Depending on what OptiPlex you choose. I got an I5-6500 for around $300, 6TB WD Purple (refurb) $100, and Blue Iris off E-bay for $45 = Around $450...