mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 11:56:29 +00:00
fix(filter-form): avoid error
This commit is contained in:
parent
7b550ce5aa
commit
c8c081eba5
@ -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();
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user