mirror of
https://github.com/dataease/dataease.git
synced 2025-02-24 11:32:57 +08:00
fix(查询组件): 时间查询组件设置动态日期本月的默认值则查询报错 #14445
This commit is contained in:
parent
c430323f88
commit
73e80dfc94
@ -2062,8 +2062,11 @@ const timeGranularityChange = (val: string) => {
|
||||
}
|
||||
|
||||
const handleTimeTypeChange = () => {
|
||||
timeGranularityChange(curComponent.value.timeGranularity)
|
||||
timeGranularityMultipleChange(curComponent.value.timeGranularityMultiple)
|
||||
if (curComponent.value.displayType === '1') {
|
||||
timeGranularityChange(curComponent.value.timeGranularity)
|
||||
} else {
|
||||
timeGranularityMultipleChange(curComponent.value.timeGranularityMultiple)
|
||||
}
|
||||
}
|
||||
|
||||
const timeGranularityMultipleChange = (val: string) => {
|
||||
|
@ -17,9 +17,12 @@ function getThisMonth() {
|
||||
return new Date(`${date.getFullYear()}/${date.getMonth() + 1}`)
|
||||
}
|
||||
|
||||
function getLastStart(val = 'month' as ManipulateType) {
|
||||
return new Date(dayjs().subtract(1, val).startOf(val).format('YYYY/MM/DD HH:mm:ss'))
|
||||
}
|
||||
|
||||
function getLastMonth() {
|
||||
const date = new Date()
|
||||
return new Date(`${date.getFullYear()}/${date.getMonth()}`)
|
||||
return getLastStart()
|
||||
}
|
||||
|
||||
function getNextMonth() {
|
||||
|
Loading…
Reference in New Issue
Block a user