mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 17:06:01 +00:00
fix: asociationSelect support multiple
This commit is contained in:
parent
d7be145fd5
commit
6dafc85242
@ -1,9 +1,9 @@
|
||||
import { LoadingOutlined } from '@ant-design/icons';
|
||||
import { connect, mapProps, RecursionField, useFieldSchema, useField, observer } from '@formily/react';
|
||||
import { connect, mapProps, RecursionField, useFieldSchema, useField } from '@formily/react';
|
||||
import { Button, Input } from 'antd';
|
||||
import _ from 'lodash';
|
||||
import { ActionContext } from '../action';
|
||||
import React, { memo, useCallback, useMemo, useState } from 'react';
|
||||
import React, { memo, useCallback, useMemo, useState, useEffect } from 'react';
|
||||
import { useFieldTitle } from '../../hooks';
|
||||
import { RemoteSelect, RemoteSelectProps } from '../remote-select';
|
||||
import { useInsertSchema } from './hooks';
|
||||
@ -50,7 +50,9 @@ const InternalAssociationSelect = memo((props: AssociationSelectProps) => {
|
||||
return normalizeValues(props.value);
|
||||
}
|
||||
}, [props.value, normalizeValues]);
|
||||
field.value = value;
|
||||
useEffect(() => {
|
||||
field.value = value;
|
||||
}, []);
|
||||
return (
|
||||
<div key={fieldSchema.name}>
|
||||
<Input.Group compact style={{ display: 'flex' }}>
|
||||
|
@ -82,7 +82,7 @@ export const InternalPicker = observer((props: any) => {
|
||||
const pickerProps = {
|
||||
size: 'small',
|
||||
fieldNames,
|
||||
multiple: ['o2m', 'm2m'].includes(collectionField?.interface),
|
||||
multiple: multiple !== false && ['o2m', 'm2m'].includes(collectionField?.interface),
|
||||
association: {
|
||||
target: collectionField?.target,
|
||||
},
|
||||
|
@ -75,7 +75,7 @@ export const InternalSubTable: any = observer((props: any) => {
|
||||
const [tableData, setTableData] = useState(field.value);
|
||||
const pickerProps = {
|
||||
size: 'small',
|
||||
multiple: ['o2m', 'm2m'].includes(collectionField?.interface),
|
||||
multiple: props.multiple !== false && ['o2m', 'm2m'].includes(collectionField?.interface),
|
||||
association: {
|
||||
target: collectionField?.target,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user