fix(移动端): 大屏移动端查看日期范围过去提示异常

This commit is contained in:
dataeaseShu
2025-04-09 14:54:47 +08:00
committed by xuwei-fit2cloud
parent 6f85a2abad
commit 1eceeef35b
2 changed files with 5 additions and 3 deletions

View File

@@ -145,6 +145,7 @@ watch(
)
const handleValueChange = () => {
selectValue.value = selectValue.value.map(ele => dayjs(ele).format('YYYY/MM/DD HH:mm:ss'))
const value = Array.isArray(selectValue.value) ? [...selectValue.value] : selectValue.value
if (!props.isConfig) {
config.value.selectValue = Array.isArray(selectValue.value)
@@ -412,8 +413,9 @@ 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
const timeFormat = [1, 2].includes(currentDate.value.length)
? currentDate.value.concat(Array([0, 2, 1][currentDate.value.length]).fill('01'))
: currentDate.value
if (isRange.value) {
const [start, end] = selectValue.value || []
if (selectSecond.value) {

View File

@@ -9,7 +9,7 @@ const { componentData, canvasStyleData } = storeToRefs(dvMainStore)
const getDynamicRangeTime = (type: number, selectValue: any, timeGranularityMultiple: string) => {
const timeType = (timeGranularityMultiple || '').split('range')[0]
if (timeGranularityMultiple === 'datetimerange' || type === 1 || !timeType) {
if (['datetimerange', 'yearrange'].includes(timeGranularityMultiple) || type === 1 || !timeType) {
return selectValue.map(ele => +new Date(ele))
}