修改软件控制权限页脚跳转问题

This commit is contained in:
lq1405 2024-12-29 22:04:38 +08:00
parent 7781c6c95c
commit 8b1ccfed47
2 changed files with 8 additions and 14 deletions

View File

@ -187,7 +187,7 @@ const SoftwareControlManagement: FC<SoftwareControlManagementProps> = () => {
setLoading(true);
await SoftwareControl.AddSoftwareControlExpirationTime(id, 0, false);
// 重新查询
await QueryUserSoftwareControlCollection();
await QueryUserSoftwareControlCollection(tableParams, form.getFieldsValue());
messageApi.success("停用成功");
} else {
messageApi.info("取消停用");
@ -209,7 +209,7 @@ const SoftwareControlManagement: FC<SoftwareControlManagementProps> = () => {
setLoading(true);
await SoftwareControl.AddSoftwareControlExpirationTime(id, days, days == 0);
// 重新查询
await QueryUserSoftwareControlCollection();
await QueryUserSoftwareControlCollection(tableParams, form.getFieldsValue());
if (days == 0) {
messageApi.success("添加永久成功");
} else {
@ -225,7 +225,7 @@ const SoftwareControlManagement: FC<SoftwareControlManagementProps> = () => {
}
}
async function QueryUserSoftwareControlCollection(options?: SoftwareModel.SoftwareControlQueryParams) {
async function QueryUserSoftwareControlCollection(tableParams: TableModel.TableParams, options?: SoftwareModel.SoftwareControlQueryParams) {
try {
setLoading(true);
let res = await SoftwareControl.GetUserSoftwareControlCollection(tableParams, options ?? {});
@ -235,7 +235,7 @@ const SoftwareControlManagement: FC<SoftwareControlManagementProps> = () => {
...tableParams.pagination,
total: res.total
}
});
})
} catch (error: any) {
messageApi.error(error.message);
} finally {
@ -244,7 +244,7 @@ const SoftwareControlManagement: FC<SoftwareControlManagementProps> = () => {
}
useEffect(() => {
QueryUserSoftwareControlCollection().then();
QueryUserSoftwareControlCollection(tableParams, form.getFieldsValue()).then();
Software.GetSoftwareBaseCollection().then((res) => {
setSoftwareBasicInfo(res);
let options = []
@ -263,14 +263,14 @@ const SoftwareControlManagement: FC<SoftwareControlManagementProps> = () => {
}, []);
async function TableChangeHandle(pagination: TablePaginationConfig, filters: Record<string, FilterValue | null>, sorter: SorterResult<SoftwareModel.SoftwareControlBase> | SorterResult<SoftwareModel.SoftwareControlBase>[], extra: TableCurrentDataSource<SoftwareModel.SoftwareControlBase>): Promise<void> {
await QueryUserSoftwareControlCollection();
await QueryUserSoftwareControlCollection({ pagination }, form.getFieldsValue());
setTableParams({
pagination: {
...tableParams.pagination,
current: pagination.current,
pageSize: pagination.pageSize,
pageSize: pagination.pageSize
}
});
})
}

View File

@ -64,12 +64,6 @@ const UserSoftwareInfo: React.FC<UserSoftwareInfoProps> = ({ userId }) => {
userId: userId
});
setData(res.collection);
setTableParams({
pagination: {
...tableParams.pagination,
total: res.total
}
})
} catch (error: any) {
messageApi.error(error.message);
} finally {