完善了用户配置
parent
abe3bc4af0
commit
c88426f575
|
@ -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 {
|
||||
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)
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue