Skip to content

Commit

Permalink
fix: the value was not cleared correctly when cleaning the range picker
Browse files Browse the repository at this point in the history
  • Loading branch information
imdap committed Nov 15, 2024
1 parent b87d41b commit 46a4622
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/@core/ui-kit/form-ui/src/components/form-actions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ function handleRangeTimeValue(values: Record<string, any>) {
fieldMappingTime.forEach(
([field, [startTimeKey, endTimeKey], format = 'YYYY-MM-DD']) => {
/**
* 时间字段为空 但是映射的start/end不为空 说明已经清理了组件的时间(组件右边的x)
* 需要删除对应的start/end字段 否则会被保留
*/
if (!values[field] && values[startTimeKey] && values[endTimeKey]) {
delete values[startTimeKey];
delete values[endTimeKey];
return;
}
if (!values[field]) {
delete values[field];
return;
Expand Down

0 comments on commit 46a4622

Please sign in to comment.