|
@@ -96,6 +96,14 @@ function DutyRecord() {
|
|
function delRecord() {
|
|
function delRecord() {
|
|
post(api.delOfficialCapacityPage, { id: selectedRowKeys }).then((res) => {
|
|
post(api.delOfficialCapacityPage, { id: selectedRowKeys }).then((res) => {
|
|
if (res.data.code === 200) {
|
|
if (res.data.code === 200) {
|
|
|
|
+ //刷新列表
|
|
|
|
+ const totalPage = Math.ceil((total - selectedRowKeys.length) / size);
|
|
|
|
+ //将当前页码与删除数据之后的总页数进行比较,避免当前页码不存在
|
|
|
|
+ const pagenum =
|
|
|
|
+ params.current > totalPage ? totalPage : params.current;
|
|
|
|
+ //避免pagenum变为0
|
|
|
|
+ params.current = pagenum < 1 ? 1 : pagenum;
|
|
|
|
+ setParams(params)
|
|
//刷新列表
|
|
//刷新列表
|
|
getDutyRecord()
|
|
getDutyRecord()
|
|
} else {
|
|
} else {
|