fix(查询组件): 移动端布局-时间筛选组件 #12396

This commit is contained in:
dataeaseShu
2025-03-05 14:28:45 +08:00
committed by 王嘉豪
parent 472e5b5dce
commit c5708b269a

View File

@@ -388,21 +388,23 @@ const selectSecond = ref(false)
const setArrValue = () => {
currentDate.value = currentDate.value.slice(0, getIndex() + 1)
const timeFormat =
currentDate.value.length === 2 ? currentDate.value.concat(['01']) : currentDate.value
if (isRange.value) {
const [start, end] = selectValue.value || []
if (selectSecond.value) {
selectValue.value = [
start ? start : new Date(`${currentDate.value.join('/')} ${currentTime.value.join(':')}`),
new Date(`${currentDate.value.join('/')} ${currentTime.value.join(':')}`)
start ? start : new Date(`${timeFormat.join('/')} ${currentTime.value.join(':')}`),
new Date(`${timeFormat.join('/')} ${currentTime.value.join(':')}`)
]
} else {
selectValue.value = [
new Date(`${currentDate.value.join('/')} ${currentTime.value.join(':')}`),
end ? end : new Date(`${currentDate.value.join('/')} ${currentTime.value.join(':')}`)
new Date(`${timeFormat.join('/')} ${currentTime.value.join(':')}`),
end ? end : new Date(`${timeFormat.join('/')} ${currentTime.value.join(':')}`)
]
}
} else {
selectValue.value = new Date(`${currentDate.value.join('/')} ${currentTime.value.join(':')}`)
selectValue.value = new Date(`${timeFormat.join('/')} ${currentTime.value.join(':')}`)
}
}