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