fix(移动端): 查询组件,日期查询条件选择日期的范围太小,只能选前后 10 年的日期

This commit is contained in:
dataeaseShu 2024-03-05 16:33:41 +08:00
parent 5a217e8896
commit db2456db86
2 changed files with 17 additions and 3 deletions

View File

@ -49,7 +49,8 @@ const multiple = ref(false)
const dvMainStore = dvMainStoreWithOut()
const { config } = toRefs(props)
const minDate = new Date('1970/1/1')
const maxDate = new Date('2100/1/1')
watch(
() => config.value.defaultValue,
val => {
@ -280,7 +281,12 @@ const formatDate = computed(() => {
:tabs="['选择日期', '选择时间']"
next-step-text="下一步"
>
<van-date-picker :columns-type="columnsType" v-model="currentDate" />
<van-date-picker
:min-date="minDate"
:max-date="maxDate"
:columns-type="columnsType"
v-model="currentDate"
/>
<van-time-picker :columns-type="['hour', 'minute', 'second']" v-model="currentTime" />
</van-picker-group>
<van-date-picker
@ -288,6 +294,8 @@ const formatDate = computed(() => {
:columns-type="columnsType"
@confirm="onConfirm"
@cancel="onCancel"
:min-date="minDate"
:max-date="maxDate"
v-if="!showTimePick"
v-model="currentDate"
/>

View File

@ -60,7 +60,13 @@ onMounted(() => {
<template>
<el-header class="header-flex" :class="{ 'header-light': navigateBg && navigateBg === 'light' }">
<img class="logo" v-if="navigate" :src="navigate" alt="" />
<Icon v-else @click="handleIconClick" className="logo" name="logo"></Icon>
<Icon
style="cursor: pointer"
v-else
@click="handleIconClick"
className="logo"
name="logo"
></Icon>
<el-menu
:default-active="activeIndex"
class="el-menu-demo"