Merge pull request #7882 from dataease/pr@dev-v2_dzz

fix(查询组件): 时间范围年月不显示
This commit is contained in:
dataeaseShu 2024-01-29 17:39:14 +08:00 committed by GitHub
commit 4ed0c88530
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { toRefs, PropType, ref, onBeforeMount, watch, computed } from 'vue' import { toRefs, nextTick, PropType, ref, onBeforeMount, watch, computed } from 'vue'
import { Calendar } from '@element-plus/icons-vue' import { Calendar } from '@element-plus/icons-vue'
import { type DatePickType } from 'element-plus-secondary' import { type DatePickType } from 'element-plus-secondary'
import { getCustomTime } from './time-format' import { getCustomTime } from './time-format'
@ -98,10 +98,16 @@ watch(
watch( watch(
() => config.value.id, () => config.value.id,
() => { () => {
init() rendering.value = false
nextTick(() => {
init()
rendering.value = true
})
} }
) )
const rendering = ref(true)
const init = () => { const init = () => {
const { const {
timeNum, timeNum,
@ -155,6 +161,7 @@ const formatDate = computed(() => {
<template> <template>
<el-date-picker <el-date-picker
disabled disabled
v-if="rendering"
v-model="selectValue" v-model="selectValue"
:type="config.timeGranularityMultiple" :type="config.timeGranularityMultiple"
:prefix-icon="Calendar" :prefix-icon="Calendar"