fix(filter-form): avoid error

This commit is contained in:
Rairn 2023-05-08 07:25:54 +08:00
parent 7b550ce5aa
commit c8c081eba5
2 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@ import { useCollection, useCollectionManager } from '../../../collection-manager
* *
* @returns * @returns
*/ */
export const useOperatorList = () => { export const useOperatorList = (): any[] => {
const schema = useFieldSchema(); const schema = useFieldSchema();
const fieldInterface = schema['x-designer-props']?.interface; const fieldInterface = schema['x-designer-props']?.interface;
const { name } = useCollection(); const { name } = useCollection();

View File

@ -522,7 +522,7 @@ export const EditOperator = () => {
const { t } = useTranslation(); const { t } = useTranslation();
const { dn } = useDesignable(); const { dn } = useDesignable();
const operatorList = useOperatorList(); const operatorList = useOperatorList();
const { operators: storedOperators, uid } = findFilterOperators(fieldSchema); const { operators: storedOperators = {}, uid } = findFilterOperators(fieldSchema);
if (operatorList.length && !storedOperators[fieldSchema.name]) { if (operatorList.length && !storedOperators[fieldSchema.name]) {
storedOperators[fieldSchema.name] = operatorList[0].value; storedOperators[fieldSchema.name] = operatorList[0].value;