mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 10:17:00 +00:00
fix: add associatedKey support for drawerSelect component
This commit is contained in:
parent
b050e4ce5d
commit
9bd79cf082
@ -28,7 +28,7 @@ function transform({value, multiple, labelField, valueField = 'id'}) {
|
||||
}
|
||||
|
||||
function DrawerSelectComponent(props) {
|
||||
const { disabled, target, multiple, filter, associatedName, labelField, valueField = 'id', value, onChange } = props;
|
||||
const { disabled, target, multiple, filter, resourceName, associatedKey, labelField, valueField = 'id', value, onChange } = props;
|
||||
const [selectedKeys, selectedValue] = transform({value, multiple, labelField, valueField });
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [selectedRowKeys, setSelectedRowKeys] = useState(multiple ? selectedKeys : [selectedKeys]);
|
||||
@ -98,7 +98,9 @@ function DrawerSelectComponent(props) {
|
||||
<ViewFactory
|
||||
defaultFilter={filter}
|
||||
multiple={multiple}
|
||||
resourceName={target}
|
||||
resourceTarget={target}
|
||||
resourceName={associatedKey ? resourceName : target}
|
||||
associatedKey={associatedKey}
|
||||
isFieldComponent={true}
|
||||
selectedRowKeys={selectedRowKeys}
|
||||
onSelected={(values) => {
|
||||
|
Loading…
Reference in New Issue
Block a user