(<Query type="GET_ONE"
// resource="permission/menu"
resource={getUrlMenu(props, 'menu')}
payload={{ id: record.parentId }}>
{({ data, loading, error }) => {
if (loading) { return null; }
if (error) { return null; }
return <>
<Labeled label="Parent Menu Name">
<Typography gutterBottom variant="body1">
{data.menuName}
</Typography>
</Labeled>
</>
}}
</Query>) : null;
SelectField
*
* @example Display all the comments of the current post as a datagrid
* <ReferenceManyField reference="comments" target="post_id">
* <Datagrid>
* <TextField source="id" />
* <TextField source="body" />
* <DateField source="created_at" />
* <EditButton />
* </Datagrid>
* </ReferenceManyField>
*
* @example Display all the books by the current author, only the title
* <ReferenceManyField reference="books" target="author_id">
* <SingleFieldList>
* <ChipField source="title" />
* </SingleFieldList>
* </ReferenceManyField>
*
* By default, restricts the possible values to 25. You can extend this limit
* by setting the `perPage` prop.
*
* @example
* <ReferenceManyField perPage={10} reference="comments" target="post_id">
* ...
* </ReferenceManyField>
*
* By default, orders the possible values by id desc. You can change this order
* by setting the `sort` prop (an object with `field` and `order` properties).
*
* @example
* <ReferenceManyField sort={{ field: 'created_at', order: 'DESC' }} reference="comments" target="post_id">
* ...
* </ReferenceManyField>
*
* Also, you can filter the query used to populate the possible values. Use the
* `filter` prop for that.
*
* @example
* <ReferenceManyField filter={{ is_published: true }} reference="comments" target="post_id">
* ...
* </ReferenceManyField>
*/
<ReferenceManyField
// source="permissionVoList"
reference="permission/auth"
target="parentId" //叫什么名字 默认是url上的id
perPage={10000}
record={record}
{...rest}
>
选中操作
show 里面的 BooleanField
<SelectArrayInput source="authors" choices={choices} optionText="full_name" optionValue="_id" />
自定义表格
select自定义:
<SelectField
label="Menu Icon"
choices={options}
source="menuCss"
optionText={<IconField />}
/>
<SelectInput
style={{minWidth: 600}}
source="supplierId"
optionText="supplierName"
label=""
choices={suppliersList && suppliersList.filter(lib => formData.supplierIds && formData.supplierIds.indexOf(lib.id) > -1)}
validate={required()}
/>
optionText,optionValue, optionText="full_name" optionValue="_id"