Provided in the present invention are a compound for treating tumours and a use thereof, and also provided are a compound as shown in formula I or a pharmaceutically acceptable salt thereof. The compound provided in the present invention has a high medicine peak concentration, a high medicine absorption and a long elimination half life, and can improve the efficacy of the medicine in clinical use and reduce the frequency of the dosages. The compound or the pharmaceutically acceptable salt thereof prepared by the present invention can act as a PARP inhibitor medicine, have a certain anti-tumour activity, and especially have a good therapeutic activity on triple negative, primary or metastatic breast cancer, colon cancer, uterine cancer, pancreatic cancer, lung cancer, stomach cancer, leukemia, melanoma, solid tumors or intracranial tumors, and provide a new choice for clinical medication.