diff --git a/demo/version-history.json b/demo/version-history.json index db38be4..28b755e 100644 --- a/demo/version-history.json +++ b/demo/version-history.json @@ -180,5 +180,15 @@ "SonarQube代码质量检查问题修改", "SonarQube code quality inspection issue modification" ] + }, + { + "version": "1.3.2", + "date": "2025-09-24", + "notes": [ + "Bugfix", + "Bugfix", + "SonarQube代码质量检查问题修改", + "SonarQube code quality inspection issue modification" + ] } ] diff --git a/package.json b/package.json index fd411b1..0582cbd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jordium-gantt-vue3", - "version": "1.3.0", + "version": "1.3.2", "type": "module", "main": "dist/jordium-gantt-vue3.cjs.js", "module": "dist/jordium-gantt-vue3.es.js", diff --git a/packageDemo/version-history.json b/packageDemo/version-history.json index db38be4..47d0d58 100644 --- a/packageDemo/version-history.json +++ b/packageDemo/version-history.json @@ -180,5 +180,15 @@ "SonarQube代码质量检查问题修改", "SonarQube code quality inspection issue modification" ] + }, + { + "version": "1.3.2", + "date": "2025-09-24", + "notes": [ + "修复缺陷", + "Bugfix", + "SonarQube代码质量检查问题修改", + "SonarQube code quality inspection issue modification" + ] } ] diff --git a/src/components/DatePicker.vue b/src/components/DatePicker.vue index f843f7a..b788ced 100644 --- a/src/components/DatePicker.vue +++ b/src/components/DatePicker.vue @@ -365,18 +365,16 @@ const confirmDate = () => { emit('update:modelValue', newValue) emit('change', newValue) } - } else { - if (singleValue.value) { - // 格式化日期和时间 - const date = new Date(singleValue.value) - const dateFormat = `${date.getFullYear()}/${String(date.getMonth() + 1).padStart(2, '0')}/${String(date.getDate()).padStart(2, '0')}` - const formattedDateTime = selectedTime.value - ? `${dateFormat} ${selectedTime.value}` - : dateFormat + } else if (singleValue.value) { + // 格式化日期和时间 + const date = new Date(singleValue.value) + const dateFormat = `${date.getFullYear()}/${String(date.getMonth() + 1).padStart(2, '0')}/${String(date.getDate()).padStart(2, '0')}` + const formattedDateTime = selectedTime.value + ? `${dateFormat} ${selectedTime.value}` + : dateFormat - emit('update:modelValue', formattedDateTime) - emit('change', formattedDateTime) - } + emit('update:modelValue', formattedDateTime) + emit('change', formattedDateTime) } // 确认后关闭面板 @@ -746,14 +744,6 @@ const handlePickerBlur = () => { } } -// 时间选择器获得焦点时取消关闭 -const handleTimePickerFocus = () => { - if (blurTimer.value) { - clearTimeout(blurTimer.value) - blurTimer.value = null - } -} - // 时间选择器失去焦点时关闭 const handleTimePickerBlur = () => { blurTimer.value = setTimeout(() => { @@ -972,7 +962,7 @@ const timePickerStyle = computed(() => { tabindex="-1" @click.stop @mousedown.prevent - @focus="handleTimePickerFocus" + @focus="handlePickerFocus" @blur="handleTimePickerBlur" >