jù​qíng​bàn​lǐ

to handle according to circumstances