In the text, rational solutions to a (3+1)-dimensional variable-coefficient Kadomtsev-Petviashvili equation in determinant form are solved by means of the Kadomtsev-Petviashvili hierarchy reduction method and Hirota’s bilinear form. The first-order, higher-order, multi-lump waves and multi-rogue waves on the basis of the solution in Gramian are presented in graphs. Periodic and parabolic line rogue waves are obtained by choosing different dispersion coefficient functions. The second-order rogue waves are also depicted, which can be seen as the composition of two first-order rogue waves. For multiple rogue waves, taking the periodic and parabolic line rogue waves as examples, it can be observed the change tendency of amplitudes of the intersection region is different from that in branches of line rogue waves. Besides, propagation of the first-order lump wave, interaction between one-lump-soliton and one-rogue-wave, and two kinds of collisions of two lump waves, i.e., elastic and inelastic, are also shown in the x - t plane.