DiAD: A Diffusion-based Framework for Multi-class Anomaly Detection