From b9f4c48ea6c2807cb7e84b1202b2c75ddcde4861 Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Tue, 20 May 2025 09:31:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BD=8D=E4=BA=8E=E5=A4=A7=E4=BA=8E?= =?UTF-8?q?=E7=AD=9B=E9=80=89=E7=BB=93=E6=9E=9C=E7=9A=84=E9=A1=B5=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E7=82=B9=E5=87=BB=E5=B7=A6=E4=BE=A7=E8=BE=B9=E6=A0=8F?= =?UTF-8?q?=E7=AD=9B=E9=80=89=EF=BC=8C=E9=A1=B5=E9=9D=A2=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E6=9A=82=E6=97=A0=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/Dataset/components/ResourceList/index.tsx | 7 +++++++ .../src/pages/Dataset/components/ResourcePage/index.tsx | 2 ++ 2 files changed, 9 insertions(+) diff --git a/react-ui/src/pages/Dataset/components/ResourceList/index.tsx b/react-ui/src/pages/Dataset/components/ResourceList/index.tsx index 2f1e8d4e..450a5c11 100644 --- a/react-ui/src/pages/Dataset/components/ResourceList/index.tsx +++ b/react-ui/src/pages/Dataset/components/ResourceList/index.tsx @@ -16,6 +16,7 @@ import styles from './index.less'; export type ResourceListRef = { reset: () => void; + resetPage: () => void; }; type ResourceListProps = { @@ -97,6 +98,12 @@ function ResourceList( setDataList(undefined); setTotal(0); }, + resetPage: () => { + setPagination((prev) => ({ + ...prev, + current: 1, + })); + }, }; }, [], diff --git a/react-ui/src/pages/Dataset/components/ResourcePage/index.tsx b/react-ui/src/pages/Dataset/components/ResourcePage/index.tsx index fce95046..c21984ac 100644 --- a/react-ui/src/pages/Dataset/components/ResourcePage/index.tsx +++ b/react-ui/src/pages/Dataset/components/ResourcePage/index.tsx @@ -56,11 +56,13 @@ function ResourcePage({ resourceType }: ResourcePageProps) { // 选择类型 const chooseType = (record: CategoryData) => { + dataListRef.current?.resetPage(); setActiveType((prev) => (prev === record.name ? undefined : record.name)); }; // 选择 Tag const chooseTag = (record: CategoryData) => { + dataListRef.current?.resetPage(); setActiveTag((prev) => (prev === record.name ? undefined : record.name)); };