From 0a792a54067be52e1a34022ff2a3a6fe3c778959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E8=80=81=E7=99=BD=E5=85=94?= Date: Tue, 19 Aug 2025 10:35:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=87=AA=E5=8B=95=E5=BB=BA?= =?UTF-8?q?=E7=BE=A4=E8=A1=A8=E5=96=AE=EF=BC=8C=E6=96=B0=E5=A2=9E=E7=8D=B2?= =?UTF-8?q?=E5=8F=96=E7=BE=A4=E7=B5=84=E8=A9=B3=E6=83=85=E7=9A=84=20API=20?= =?UTF-8?q?=E8=AA=BF=E7=94=A8=E4=BB=A5=E5=9B=9E=E5=A1=AB=E8=A1=A8=E5=96=AE?= =?UTF-8?q?=E6=95=B8=E6=93=9A=EF=BC=8C=E4=B8=A6=E8=AA=BF=E6=95=B4=E8=A1=A8?= =?UTF-8?q?=E5=96=AE=E7=B5=90=E6=A7=8B=E4=BB=A5=E6=94=AF=E6=8C=81=E5=8B=95?= =?UTF-8?q?=E6=85=8B=E6=95=B8=E6=93=9A=E9=A1=AF=E7=A4=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workspace/auto-group/list/index.tsx | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/Cunkebao/src/pages/mobile/workspace/auto-group/list/index.tsx b/Cunkebao/src/pages/mobile/workspace/auto-group/list/index.tsx index 806a3553..61a35bad 100644 --- a/Cunkebao/src/pages/mobile/workspace/auto-group/list/index.tsx +++ b/Cunkebao/src/pages/mobile/workspace/auto-group/list/index.tsx @@ -38,9 +38,6 @@ interface GroupTask { groupDescription?: string; } -// 初始空列表;真实数据由接口返回 -const mockTasks: GroupTask[] = []; - const getStatusColor = (status: number) => { switch (status) { case 1: @@ -70,8 +67,10 @@ const AutoGroupList: React.FC = () => { const [page, setPage] = useState(1); const [pageSize, setPageSize] = useState(10); const [total, setTotal] = useState(0); + const [loading, setLoading] = useState(false); const refreshTasks = async (p = page, ps = pageSize) => { + setLoading(true); try { const res: any = await getAutoGroupList({ type: 4, page: p, limit: ps }); // 兼容不同返回结构 @@ -101,6 +100,8 @@ const AutoGroupList: React.FC = () => { setTotal(totalCount); } catch (e) { Toast.show({ content: "获取列表失败" }); + } finally { + setLoading(false); } }; @@ -197,6 +198,23 @@ const AutoGroupList: React.FC = () => { } + footer={ +
+ { + setPage(p); + setPageSize(ps); + refreshTasks(p, ps); + }} + showSizeChanger + showTotal={t => `共 ${t} 条`} + /> +
+ } + loading={loading} >
@@ -295,21 +313,6 @@ const AutoGroupList: React.FC = () => { )) )}
- {/* 分页 */} -
- { - setPage(p); - setPageSize(ps); - refreshTasks(p, ps); - }} - showSizeChanger - showTotal={t => `共 ${t} 条`} - /> -
);