From 8b1ccfed47eb4da3d685d911d0e6a5cbc8d7eb37 Mon Sep 17 00:00:00 2001 From: lq1405 <2769838458@qq.com> Date: Sun, 29 Dec 2024 22:04:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BD=AF=E4=BB=B6=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E6=9D=83=E9=99=90=E9=A1=B5=E8=84=9A=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SofrwareControlManagement.tsx | 16 ++++++++-------- src/pages/User/UserCenter/UserSoftwareInfo.tsx | 6 ------ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/pages/Software/SofrwareControl/SofrwareControlManagement.tsx b/src/pages/Software/SofrwareControl/SofrwareControlManagement.tsx index cf8bdb0..aa22d22 100644 --- a/src/pages/Software/SofrwareControl/SofrwareControlManagement.tsx +++ b/src/pages/Software/SofrwareControl/SofrwareControlManagement.tsx @@ -187,7 +187,7 @@ const SoftwareControlManagement: FC = () => { 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 = () => { 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 = () => { } } - 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 = () => { ...tableParams.pagination, total: res.total } - }); + }) } catch (error: any) { messageApi.error(error.message); } finally { @@ -244,7 +244,7 @@ const SoftwareControlManagement: FC = () => { } useEffect(() => { - QueryUserSoftwareControlCollection().then(); + QueryUserSoftwareControlCollection(tableParams, form.getFieldsValue()).then(); Software.GetSoftwareBaseCollection().then((res) => { setSoftwareBasicInfo(res); let options = [] @@ -263,14 +263,14 @@ const SoftwareControlManagement: FC = () => { }, []); async function TableChangeHandle(pagination: TablePaginationConfig, filters: Record, sorter: SorterResult | SorterResult[], extra: TableCurrentDataSource): Promise { - await QueryUserSoftwareControlCollection(); + await QueryUserSoftwareControlCollection({ pagination }, form.getFieldsValue()); setTableParams({ pagination: { ...tableParams.pagination, current: pagination.current, - pageSize: pagination.pageSize, + pageSize: pagination.pageSize } - }); + }) } diff --git a/src/pages/User/UserCenter/UserSoftwareInfo.tsx b/src/pages/User/UserCenter/UserSoftwareInfo.tsx index 3d411ac..3b51923 100644 --- a/src/pages/User/UserCenter/UserSoftwareInfo.tsx +++ b/src/pages/User/UserCenter/UserSoftwareInfo.tsx @@ -64,12 +64,6 @@ const UserSoftwareInfo: React.FC = ({ userId }) => { userId: userId }); setData(res.collection); - setTableParams({ - pagination: { - ...tableParams.pagination, - total: res.total - } - }) } catch (error: any) { messageApi.error(error.message); } finally {