mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
fix: refreshing the page after switching operators causes an error (#6781)
* fix: clear default value when switching operators to prevent filtering API errors * fix: update EditOperator to set default value to null and assign componentProps to x-component-props * fix: set field value and initialValue to null in EditOperator to ensure proper state management
This commit is contained in:
parent
4f1e3df663
commit
6808620a3d
@ -535,11 +535,19 @@ export const EditOperator = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
field.componentProps = componentProps;
|
field.componentProps = componentProps;
|
||||||
|
fieldSchema['x-component-props'] = componentProps;
|
||||||
|
fieldSchema.default = null;
|
||||||
|
field.value = null;
|
||||||
|
field.initialValue = null;
|
||||||
|
|
||||||
dn.emit('patch', {
|
dn.emit('patch', {
|
||||||
schema: {
|
schema: {
|
||||||
['x-uid']: fieldSchema['x-uid'],
|
['x-uid']: fieldSchema['x-uid'],
|
||||||
['x-component-props']: componentProps,
|
['x-component-props']: componentProps,
|
||||||
['x-filter-operator']: v,
|
['x-filter-operator']: v,
|
||||||
|
// Clear default value when switching operators. Some operators require the default value to be an array,
|
||||||
|
// while others don't. Without clearing it, the filtering API would throw an error
|
||||||
|
default: null,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
dn.refresh();
|
dn.refresh();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user