Browse Source

完善路政分页

dev
dengyinhuan 1 year ago
parent
commit
cd731a579a
  1. 8
      web/client/src/sections/fillion/containers/luzheng.js

8
web/client/src/sections/fillion/containers/luzheng.js

@ -38,6 +38,7 @@ function Assess(props) {
const [datasource,setdatasource] = useState([])
const [dateRange, setDateRange] = useState(['1970-1-1', '2099-12-31']);
const { RangePicker } = DatePicker
const [total,settotal]= useState(0)
const [editAble, setEditAble] = useState(user?.username !== 'SuperAdmin' && user?.userResources?.find(i => i.resourceId === 'ASSESSMANAGE')?.isshow === "true" ? true : '')
useEffect(() => {
@ -53,6 +54,7 @@ function Assess(props) {
dispatch(getRoadadministration(query)).then(res => {
if(res?.success){
setdatasource(res?.payload?.data?.rows)
settotal(res?.payload?.data?.count)
setLoading(false)
}
})
@ -63,8 +65,8 @@ function Assess(props) {
<div style={{ marginBottom: '20px', display: 'flex', justifyContent: 'space-between' }}>
<Form layout="inline" onFinish={(v) => {
setQuery({ ...query, unit: v.unit,startTime : moment(v?.time[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss'),
endTime :moment(v?.time[1]).add(1, 'days').endOf('day').format('YYYY-MM-DD HH:mm:ss') })
setQuery({ ...query, page:1,unit: v.unit,startTime : v?.time && moment(v?.time[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss'),
endTime : v?.time && moment(v?.time[1]).add(1, 'days').endOf('day').format('YYYY-MM-DD HH:mm:ss') })
}}>
@ -158,7 +160,7 @@ function Assess(props) {
dataSource={datasource || []}
loading={loading}
pagination={{
total: assess?.count || 0,
total: total || 0,
pageSize: 10,
defaultPageSize: 10,
showSizeChanger: false,

Loading…
Cancel
Save