From dcafbb10c8616d86b16690b6ca1678489b1e03ce Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Mon, 14 Aug 2023 15:53:28 +0800 Subject: [PATCH] fix(findSchema): table operation action and detail operation action interact with each other (#2446) * fix: table operation action and detail operation action interact with each other * refactor: code imrove --- packages/core/client/src/schema-initializer/utils.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/core/client/src/schema-initializer/utils.ts b/packages/core/client/src/schema-initializer/utils.ts index 9780f2ed4..df3d4d428 100644 --- a/packages/core/client/src/schema-initializer/utils.ts +++ b/packages/core/client/src/schema-initializer/utils.ts @@ -563,10 +563,10 @@ export const useFilterInheritsFormItemInitializerFields = (options?) => { const { getInterface, getInheritCollections, getCollection, getParentCollectionFields } = useCollectionManager(); const inherits = getInheritCollections(name); const { snapshot } = useActionContext(); + const form = useForm(); return inherits?.map((v) => { const fields = getParentCollectionFields(v, name); - const form = useForm(); const { readPretty = form.readPretty, block = 'Form' } = options || {}; const targetCollection = getCollection(v); return { @@ -710,10 +710,13 @@ const findSchema = (schema: Schema, key: string, action: string) => { if (s[key] === action) { return s; } - const c = findSchema(s, key, action); - if (c) { - return c; + if (s['x-component'] !== 'Action.Container') { + const c = findSchema(s, key, action); + if (c) { + return c; + } } + return buf; }); }; @@ -741,7 +744,6 @@ export const useCurrentSchema = (action: string, key: string, find = findSchema, const { remove } = useDesignable(); const schema = find(fieldSchema, key, action); const ctx = useContext(BlockRequestContext); - return { schema, exists: !!schema,