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) })