mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
fix: time field operator set to between in filter form, component didn't change to time range picker (#6170)
This commit is contained in:
parent
ab6b43745f
commit
474c0421c6
@ -55,9 +55,9 @@ export const FilterCollectionFieldInternalField: React.FC = (props: Props) => {
|
|||||||
const { uiSchema: uiSchemaOrigin, defaultValue, interface: collectionInterface } = useCollectionField();
|
const { uiSchema: uiSchemaOrigin, defaultValue, interface: collectionInterface } = useCollectionField();
|
||||||
const { isAllowToSetDefaultValue } = useIsAllowToSetDefaultValue();
|
const { isAllowToSetDefaultValue } = useIsAllowToSetDefaultValue();
|
||||||
const targetInterface = getInterface(collectionInterface);
|
const targetInterface = getInterface(collectionInterface);
|
||||||
const operator = targetInterface?.filterable?.operators?.find(
|
const operator =
|
||||||
(v, index) => v.value === fieldSchema['x-filter-operator'] || index === 0,
|
targetInterface?.filterable?.operators?.find((v, index) => v.value === fieldSchema?.['x-filter-operator']) ||
|
||||||
);
|
targetInterface?.filterable?.operators?.[0];
|
||||||
const Component = useComponent(
|
const Component = useComponent(
|
||||||
operator?.schema?.['x-component'] ||
|
operator?.schema?.['x-component'] ||
|
||||||
fieldSchema['x-component-props']?.['component'] ||
|
fieldSchema['x-component-props']?.['component'] ||
|
||||||
|
@ -289,7 +289,7 @@ DatePicker.FilterWithPicker = function FilterWithPicker(props: any) {
|
|||||||
const field: any = useField();
|
const field: any = useField();
|
||||||
const [stateProps, setStateProps] = useState(newProps);
|
const [stateProps, setStateProps] = useState(newProps);
|
||||||
return (
|
return (
|
||||||
<Space.Compact>
|
<Space.Compact style={{ width: '100%' }}>
|
||||||
<Select
|
<Select
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
role="button"
|
role="button"
|
||||||
|
@ -192,7 +192,6 @@ export const removeNullCondition = (filter, customFlat = flat) => {
|
|||||||
export const useFilterActionProps = () => {
|
export const useFilterActionProps = () => {
|
||||||
const collection = useCollection();
|
const collection = useCollection();
|
||||||
const options = useFilterOptions(collection?.name);
|
const options = useFilterOptions(collection?.name);
|
||||||
console.log(options);
|
|
||||||
const props = useDataBlockProps();
|
const props = useDataBlockProps();
|
||||||
return useFilterFieldProps({ options, params: props?.params });
|
return useFilterFieldProps({ options, params: props?.params });
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user