From c88426f575dc0a94e42bb2ab5515b1b21a6ef33e Mon Sep 17 00:00:00 2001 From: wuyize Date: Mon, 9 Jan 2023 11:57:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=86=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../configuration/subpage/UserConfig.tsx | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/pages/configuration/subpage/UserConfig.tsx b/src/pages/configuration/subpage/UserConfig.tsx index 16cd80e..7b85f89 100644 --- a/src/pages/configuration/subpage/UserConfig.tsx +++ b/src/pages/configuration/subpage/UserConfig.tsx @@ -18,6 +18,8 @@ function UserConfig(props: any) { const [createStaffLoading, setCreateStaffLoading] = useState(false) const [placeOptions, setPlaceOptions] = useState<{ value: string; label: string; }[]>([]) const [form] = Form.useForm() + const [pageNum, setPageNum] = useState(1) + const [pageSize, setPageSize] = useState(10) const departmentToString = (staff: Staff) => { if (staff.staffId === 'manager') @@ -88,6 +90,8 @@ function UserConfig(props: any) { } const onChange = (pageCurrentNum: number, pageCurrentSize: number) => { + setPageNum(pageCurrentNum) + setPageSize(pageCurrentSize) getStaffList(pageCurrentNum, pageCurrentSize) } @@ -111,6 +115,7 @@ function UserConfig(props: any) { }).then(response => { setCreateStaffLoading(false) setCreateStaffModalOpen(false) + getStaffList(pageNum, pageSize) }).catch(function (error) { console.log(error) setCreateStaffLoading(false) @@ -123,13 +128,17 @@ function UserConfig(props: any) { url: 'common/place', method: 'get' }).then(response => { - const data:{placeName: string, subsidyPerDay: number}[] = response.data - setPlaceOptions(data.map((value, index, array) => { - return { - value: value.placeName, - label: value.placeName - } - })) + const data:{placeName: string, subsidyPerDay: number, base: boolean}[] = response.data + let options = [] + for(const value of data) + { + if(value.base) + options.push( { + value: value.placeName, + label: value.placeName + }) + } + setPlaceOptions(options) }).catch(function (error) { console.log(error) })