fix(app): unable to associate a record
This commit is contained in:
parent
9fcf6fbd59
commit
89650750b1
@ -85,7 +85,8 @@ function DrawerSelectComponent(props) {
|
|||||||
isFieldComponent={true}
|
isFieldComponent={true}
|
||||||
selectedRowKeys={selectedRowKeys}
|
selectedRowKeys={selectedRowKeys}
|
||||||
onSelected={(values) => {
|
onSelected={(values) => {
|
||||||
const [selectedKeys, selectedValue] = transform({value: values, multiple, labelField, valueField });
|
// 需要返回的是 array
|
||||||
|
const [selectedKeys, selectedValue] = transform({value: values, multiple: true, labelField, valueField });
|
||||||
setSelectedRows(selectedValue);
|
setSelectedRows(selectedValue);
|
||||||
setSelectedRowKeys(selectedKeys);
|
setSelectedRowKeys(selectedKeys);
|
||||||
// console.log('valuevaluevaluevaluevaluevalue', {values, selectedKeys, selectedValue});
|
// console.log('valuevaluevaluevaluevaluevalue', {values, selectedKeys, selectedValue});
|
||||||
|
@ -27,6 +27,7 @@ export function Table(props: TableProps) {
|
|||||||
associatedKey,
|
associatedKey,
|
||||||
isFieldComponent,
|
isFieldComponent,
|
||||||
onSelected,
|
onSelected,
|
||||||
|
multiple,
|
||||||
selectedRowKeys: srk,
|
selectedRowKeys: srk,
|
||||||
} = props;
|
} = props;
|
||||||
const { name: viewName, fields, actionDefaultParams = {}, defaultTabName, rowKey = 'id', actions = [], paginated = true, defaultPerPage = 10 } = schema;
|
const { name: viewName, fields, actionDefaultParams = {}, defaultTabName, rowKey = 'id', actions = [], paginated = true, defaultPerPage = 10 } = schema;
|
||||||
@ -74,6 +75,7 @@ export function Table(props: TableProps) {
|
|||||||
const tableProps: any = {};
|
const tableProps: any = {};
|
||||||
if (actions.length) {
|
if (actions.length) {
|
||||||
tableProps.rowSelection = {
|
tableProps.rowSelection = {
|
||||||
|
type: multiple ? 'checkbox' : 'radio',
|
||||||
selectedRowKeys,
|
selectedRowKeys,
|
||||||
onChange,
|
onChange,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user