mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-01 18:52:20 +08:00
fix: support blockTemplate appends
This commit is contained in:
parent
f65ff99068
commit
aa69973a90
@ -21,6 +21,7 @@ import { useBlockRequestContext, useFilterByTk } from '../BlockProvider';
|
|||||||
import { useDetailsBlockContext } from '../DetailsBlockProvider';
|
import { useDetailsBlockContext } from '../DetailsBlockProvider';
|
||||||
import { mergeFilter } from '../SharedFilterProvider';
|
import { mergeFilter } from '../SharedFilterProvider';
|
||||||
import { TableFieldResource } from '../TableFieldProvider';
|
import { TableFieldResource } from '../TableFieldProvider';
|
||||||
|
import { useSchemaTemplateManager } from '../../schema-templates';
|
||||||
|
|
||||||
export const usePickActionProps = () => {
|
export const usePickActionProps = () => {
|
||||||
const form = useForm();
|
const form = useForm();
|
||||||
@ -1074,6 +1075,8 @@ export const useAssociationFilterBlockProps = () => {
|
|||||||
|
|
||||||
export const useAssociationNames = (collection) => {
|
export const useAssociationNames = (collection) => {
|
||||||
const { getCollectionJoinField } = useCollectionManager();
|
const { getCollectionJoinField } = useCollectionManager();
|
||||||
|
const { getTemplateById } = useSchemaTemplateManager();
|
||||||
|
|
||||||
const fieldSchema = useFieldSchema();
|
const fieldSchema = useFieldSchema();
|
||||||
const associationValues = [];
|
const associationValues = [];
|
||||||
const formSchema = fieldSchema.reduceProperties((buf, schema) => {
|
const formSchema = fieldSchema.reduceProperties((buf, schema) => {
|
||||||
@ -1103,6 +1106,9 @@ export const useAssociationNames = (collection) => {
|
|||||||
if (s['x-component'] === 'Grid.Row') {
|
if (s['x-component'] === 'Grid.Row') {
|
||||||
const kk = buf?.concat?.();
|
const kk = buf?.concat?.();
|
||||||
return getNesterAppends(s, kk || []);
|
return getNesterAppends(s, kk || []);
|
||||||
|
} else if (s['x-component'] === 'BlockTemplate') {
|
||||||
|
const templateSchema = getTemplateById(s['x-component-props']?.templateId);
|
||||||
|
return getAssociationAppends(templateSchema, buf);
|
||||||
} else {
|
} else {
|
||||||
return !s['x-component']?.includes('Action.') && s['x-component'] !== 'TableField'
|
return !s['x-component']?.includes('Action.') && s['x-component'] !== 'TableField'
|
||||||
? getAssociationAppends(s, buf)
|
? getAssociationAppends(s, buf)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user