mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-09 07:29:24 +08:00
fix: associationSelect
This commit is contained in:
parent
9864292029
commit
dba550803a
@ -14,7 +14,7 @@ import {
|
||||
TableSelectorParamsProvider,
|
||||
useTableSelectorProps as useTsp,
|
||||
} from '../../../block-provider/TableSelectorProvider';
|
||||
import { CollectionProvider, useCollection } from '../../../collection-manager';
|
||||
import { CollectionProvider, useCollection, useCollectionManager } from '../../../collection-manager';
|
||||
import { useCompile } from '../../hooks';
|
||||
import { ActionContext } from '../action';
|
||||
import { useFieldNames, useInsertSchema } from './hooks';
|
||||
@ -71,7 +71,8 @@ export const InternalPicker = observer((props: any) => {
|
||||
const insertSelector = useInsertSchema('Selector');
|
||||
const { getField } = useCollection();
|
||||
const { t } = useTranslation();
|
||||
const collectionField = getField(field.props.name);
|
||||
const { getCollectionJoinField } = useCollectionManager();
|
||||
const collectionField = getField(field.props.name) || getCollectionJoinField(fieldSchema?.['x-collection-field']);
|
||||
const addbuttonClick = () => {
|
||||
insertAddNewer(schema.AddNewer);
|
||||
setVisibleAddNewer(true);
|
||||
|
@ -37,8 +37,8 @@ export default function useServiceOptions(props) {
|
||||
const { action = 'list', service, fieldNames } = props;
|
||||
const params = service?.params || {};
|
||||
const fieldSchema = useFieldSchema();
|
||||
const { getField, fields } = useCollection();
|
||||
const { getCollectionFields } = useCollectionManager();
|
||||
const { getField } = useCollection();
|
||||
const { getCollectionFields, getCollectionJoinField } = useCollectionManager();
|
||||
const record = useRecord();
|
||||
|
||||
const normalizeValues = useCallback(
|
||||
@ -63,8 +63,9 @@ export default function useServiceOptions(props) {
|
||||
}, [props.value, normalizeValues]);
|
||||
|
||||
const collectionField = useMemo(() => {
|
||||
return getField(fieldSchema.name);
|
||||
return getField(fieldSchema.name) || getCollectionJoinField(fieldSchema?.['x-collection-field']);
|
||||
}, [fieldSchema.name]);
|
||||
|
||||
const sourceValue = record?.[collectionField?.sourceKey];
|
||||
const filter = useMemo(() => {
|
||||
const isOToAny = ['oho', 'o2m'].includes(collectionField?.interface);
|
||||
|
Loading…
x
Reference in New Issue
Block a user