mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-03 12:47:44 +08:00
fix(client): meet undefined error after clear filter cascader value (#267)
This commit is contained in:
parent
d2e5cf9651
commit
31e95e3dec
@ -24,7 +24,7 @@ export const useValues = () => {
|
|||||||
const { options } = useContext(FilterContext);
|
const { options } = useContext(FilterContext);
|
||||||
const data2value = () => {
|
const data2value = () => {
|
||||||
field.value = flat.unflatten({
|
field.value = flat.unflatten({
|
||||||
[`${field.data.dataIndex.join('.')}.${field.data?.operator?.value}`]: field.data?.value,
|
[`${field.data.dataIndex?.join('.')}.${field.data?.operator?.value}`]: field.data?.value,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const value2data = () => {
|
const value2data = () => {
|
||||||
@ -63,9 +63,9 @@ export const useValues = () => {
|
|||||||
const option = findOption(dataIndex, options);
|
const option = findOption(dataIndex, options);
|
||||||
const operator = option?.operators?.[0];
|
const operator = option?.operators?.[0];
|
||||||
field.data = field.data || {};
|
field.data = field.data || {};
|
||||||
field.data.operators = option.operators;
|
field.data.operators = option?.operators;
|
||||||
field.data.operator = operator;
|
field.data.operator = operator;
|
||||||
field.data.schema = merge(option.schema, operator.schema);
|
field.data.schema = merge(option?.schema, operator?.schema);
|
||||||
field.data.dataIndex = dataIndex;
|
field.data.dataIndex = dataIndex;
|
||||||
field.data.value = null;
|
field.data.value = null;
|
||||||
data2value();
|
data2value();
|
||||||
|
Loading…
Reference in New Issue
Block a user