From 18ec9ee48c005f5683e83bc4b6a186604e7d1636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A6=BA=E7=8B=A8?= <18119604035@163.com> Date: Tue, 7 Mar 2023 14:19:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E9=97=A8=E5=88=97=E8=A1=A8=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=B1=95=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/department/index.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pages/department/index.tsx b/src/pages/department/index.tsx index 374dda6..8153ac6 100644 --- a/src/pages/department/index.tsx +++ b/src/pages/department/index.tsx @@ -27,6 +27,7 @@ export const DepartmentPage: React.FC = () => { const [loading, setLoading] = useState(true); const [list, setList] = useState([]); const [refresh, setRefresh] = useState(false); + const [tableKey, setTableKey] = useState(0); const columns: ColumnsType = [ { @@ -89,9 +90,11 @@ export const DepartmentPage: React.FC = () => { department.departmentList().then((res: any) => { const departments = res.data.departments; const new_arr: Option[] = checkArr(departments, 0); + let num = tableKey; setList(new_arr); setTimeout(() => { setLoading(false); + setTableKey(num + 1); }, 1000); }); }; @@ -158,10 +161,12 @@ export const DepartmentPage: React.FC = () => {
record.id} + defaultExpandAllRows={true} />