Performance analysis and ecological optimization of an irreversible quantum heat engine with spin-1/2 system