前端项目实战肆佰肆拾壹react-admin和material ui-增加过滤条件

 <List filters={postFilters} empty={<Empty />} disableAuthentication={false} actions={<CreateListActions productId={productId} solutionname={solutionname} isCreating={isCreating} handleCreate={handleCreate} />} filter={!productId ? {} : { po_id: productId }} exporter={false} hasCreate={true} resource="t_lps_po_detail"
                >
                    <Datagrid rowClick={'expand'} expandSingle={true} expand={StepEdit}>
                        <ReferenceField source="po_id" reference="t_lps_product_order" label="生产单" />
                        <ReferenceField source="color" reference="t_prod_color" label="颜色" />
                        <ReferenceField source="size" reference="t_prod_size" label="尺码" />
                        <TextField source='count' label="数量" />
                        <TextField source='description' label="描述" />
                    </Datagrid>
                </List>
const postFilters = [
    <ReferenceInput variant='outlined' source="color" reference="t_prod_color" label='颜色'/>,
    <ReferenceInput variant='outlined' source="size" reference="t_prod_size" label='尺码'/>,
    <TextInput label="数量" source="count" />,
    <TextInput label="描述" source="size" />,
];

运行结果

 

posted @ 2023-10-07 09:21  前端导师歌谣  阅读(19)  评论(0)    收藏  举报  来源