Commit 3f6af11d by zhaochengxiang

bug fix

parent 9acce670
......@@ -130,8 +130,8 @@ const Statistic = ({ type = 'dataAsset' }) => {
const [loadingStatisticsObject, setLoadingStatisticsObject] = React.useState(false)
const [statisticsObject, setStatisticsObject] = React.useState()
const [currentStatisticObject, setCurrentStatisticObject] = React.useState()
const [startTime, setStartTime] = React.useState()
const [endTime, setEndTime] = React.useState()
const [startTime, setStartTime] = React.useState(new Date().getTime() - 7 * 24 * 60 * 60 * 1000)
const [endTime, setEndTime] = React.useState(new Date().getTime() - 24 * 60 * 60 * 1000)
const [operationType, setOperationType] = React.useState()
const [data, setData] = React.useState()
......@@ -199,8 +199,6 @@ const Statistic = ({ type = 'dataAsset' }) => {
})
}
var today = new Date(); // 获取当前日期
var beforeYesterday = new Date(new Date().getTime() - 2 * 24 * 60 * 60 * 1000); //
return (
<Card size='small'>
<Header title={type==='dataAsset'?'数据资产统计':'数据资源统计'} />
......@@ -229,7 +227,7 @@ const Statistic = ({ type = 'dataAsset' }) => {
<DatePicker.RangePicker
allowClear={false}
format="YYYY-MM-DD"
defaultValue={[moment(new Date(new Date().getTime() - 7 * 24 * 60 * 60 * 1000)), moment(new Date(new Date().getTime() - 24 * 60 * 60 * 1000))]}
defaultValue={[moment(new Date(startTime)), moment(new Date(endTime))]}
onChange={(values) => {
setStartTime((values??[]).length>0?values[0].valueOf():'')
setEndTime((values??[]).length>1?values[1].valueOf():'')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment