  In this paper, the centrality dependent $\Zn$ and $\Wpm$ production and the
isospin effect in $\Wpm$ production are investigated with a parton and hadron
cascade model PACIAE in Pb--Pb collisions at $\sNN=5.02$~TeV. ALICE data of
$\Zn$ production in Pb--Pb collisions at $\sNN=5.02$~TeV are found to be
reproduced fairly well. The prediction on $\Wpm$ production in the same
collision system is given as well. An interesting isospin effect is observed in
exploring the charge asymmetry between $\Wp$ and $\Wm$ as a function of the
asymmetry between number of valence $u$- and $d$-quarks varied from small to
large collision systems at center-of-mass energy 5.02 TeV. The results serve as
a important benchmarks for understanding the initial conditions of heavy-ion
collisions.
