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 = () => {
|
const handleTimeTypeChange = () => {
|
||||||
timeGranularityChange(curComponent.value.timeGranularity)
|
if (curComponent.value.displayType === '1') {
|
||||||
timeGranularityMultipleChange(curComponent.value.timeGranularityMultiple)
|
timeGranularityChange(curComponent.value.timeGranularity)
|
||||||
|
} else {
|
||||||
|
timeGranularityMultipleChange(curComponent.value.timeGranularityMultiple)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const timeGranularityMultipleChange = (val: string) => {
|
const timeGranularityMultipleChange = (val: string) => {
|
||||||
|
@ -17,9 +17,12 @@ function getThisMonth() {
|
|||||||
return new Date(`${date.getFullYear()}/${date.getMonth() + 1}`)
|
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() {
|
function getLastMonth() {
|
||||||
const date = new Date()
|
return getLastStart()
|
||||||
return new Date(`${date.getFullYear()}/${date.getMonth()}`)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNextMonth() {
|
function getNextMonth() {
|
||||||
|
Loading…
Reference in New Issue
Block a user