fix(association-select): data scope

This commit is contained in:
chenos 2023-02-23 16:23:25 +08:00
parent e18bccd00a
commit fa0951171a
3 changed files with 4 additions and 3 deletions

View File

@ -4,7 +4,8 @@ import { useCollection, useCollectionManager } from '../../../collection-manager
import { useRecord } from '../../../record-provider';
export default function useServiceOptions(props) {
const { action = 'list', service, params, value } = props;
const { action = 'list', service, value } = props;
const params = service?.params || {};
const fieldSchema = useFieldSchema();
const { getField } = useCollection();
const { getCollectionFields } = useCollectionManager();

View File

@ -1,7 +1,6 @@
import { LoadingOutlined } from '@ant-design/icons';
import { connect, mapProps, mapReadPretty } from '@formily/react';
import { SelectProps } from 'antd';
import _ from 'lodash';
import React, { useMemo } from 'react';
import { ResourceActionOptions, useRequest } from '../../../api-client';
import { useCompile } from '../../hooks';

View File

@ -77,8 +77,9 @@ const InternalSelect = connect(
}
return v;
};
console.log('props', props);
if (objectValue) {
return <ObjectSelect {...others} mode={mode} />;
return <ObjectSelect {...others} value={toValue(value)} mode={mode} />;
}
return (
<AntdSelect