|
@@ -18,7 +18,7 @@ const SearchModal = ({ clientId, onSelect }) => {
|
|
|
customer: [],
|
|
customer: [],
|
|
|
searchVal: '',
|
|
searchVal: '',
|
|
|
current: 1,
|
|
current: 1,
|
|
|
- pageSize: 10,
|
|
|
|
|
|
|
+ pageSize: 7,
|
|
|
total: 0
|
|
total: 0
|
|
|
})
|
|
})
|
|
|
const initData = async params => {
|
|
const initData = async params => {
|
|
@@ -34,14 +34,14 @@ const SearchModal = ({ clientId, onSelect }) => {
|
|
|
customer: state.customer.concat(customer),
|
|
customer: state.customer.concat(customer),
|
|
|
total,
|
|
total,
|
|
|
laoding: false,
|
|
laoding: false,
|
|
|
- pageSize: params?.pageSize || 1
|
|
|
|
|
|
|
+ current: params?.current || 1
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
- initData({ current: 1, pageSize: 10 })
|
|
|
|
|
|
|
+ initData({ current: 1, pageSize: 7 })
|
|
|
}, [])
|
|
}, [])
|
|
|
const onChange = e => {
|
|
const onChange = e => {
|
|
|
const { value = '' } = e.target || e.currentTarget
|
|
const { value = '' } = e.target || e.currentTarget
|
|
@@ -86,7 +86,9 @@ const SearchModal = ({ clientId, onSelect }) => {
|
|
|
scrollRef.current.scrollTop
|
|
scrollRef.current.scrollTop
|
|
|
) {
|
|
) {
|
|
|
// 已到底部
|
|
// 已到底部
|
|
|
- initData({ current: state.current + 1, pageSize: state.pageSize })
|
|
|
|
|
|
|
+
|
|
|
|
|
+ state.current * state.pageSize < state.total &&
|
|
|
|
|
+ initData({ current: state.current + 1, pageSize: state.pageSize })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
// const { run: listScroller } = useThrottleFn(handleListScroll)
|
|
// const { run: listScroller } = useThrottleFn(handleListScroll)
|