| | |
| | | <ReferenceInput source="shipperId" label="table.field.matnr.shipperId" reference="shipper"> |
| | | <AutocompleteInput label="table.field.matnr.shipperId" optionText="name" filterToQuery={(val) => ({ name: val })} /> |
| | | </ReferenceInput>, |
| | | <ReferenceInput source="groupId" label="table.field.matnr.groupId" reference="matnrGroup"> |
| | | <ReferenceInput source="groupId" label="table.field.matnr.groupId" reference="matnrGroup" > |
| | | <AutocompleteInput label="table.field.matnr.groupId" optionText="code" filterToQuery={(val) => ({ code: val })} /> |
| | | </ReferenceInput>, |
| | | <ReferenceInput source="batchRegularId" label="table.field.matnr.batchRegularId" reference="batchRegular"> |
| | |
| | | <ReferenceField source="shipperId" label="table.field.matnr.shipperId" reference="shipper" link={false} sortable={false}> |
| | | <TextField source="name" /> |
| | | </ReferenceField> |
| | | <ReferenceField source="groupId" label="table.field.matnr.groupId" reference="matnrGroup" link={false} sortable={false} alwaysOn> |
| | | <ReferenceField source="groupId" label="table.field.matnr.groupId" reference="matnrGroup" link={false} sortable={false}> |
| | | <TextField source="code" /> |
| | | </ReferenceField> |
| | | <ReferenceField source="batchRegularId" label="table.field.matnr.batchRegularId" reference="batchRegular" link={false} sortable={false}> |
| | |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | | |
| | | |
| | | return ( |
| | |
| | | FilterFormInput, |
| | | FilterLiveForm, |
| | | TextInput, |
| | | useGetList |
| | | useGetList, |
| | | useListContext |
| | | } from 'react-admin'; |
| | | import BookmarkIcon from '@mui/icons-material/BookmarkBorder'; |
| | | import { Box, Typography, Card, CardContent, useTheme, TextField } from '@mui/material'; |
| | |
| | | |
| | | const MatListAside = () => { |
| | | const theme = useTheme(); |
| | | const { setFilters } = useListContext(); // 获取列表上下文 |
| | | const [selectedOption, setSelectedOption] = useState(null); |
| | | const treeData = [ |
| | | { |
| | | id: '0655', |
| | | label: '0655', |
| | | id: '19', |
| | | label: '半成品 ', |
| | | editable: true, |
| | | children: [ |
| | | { |
| | |
| | | ], |
| | | }, |
| | | { |
| | | id: 'pickers', |
| | | label: 'Date and Time pickers', |
| | | children: [ |
| | | { |
| | | id: 'pickers-community', |
| | | label: '@mui/x-date-pickers', |
| | | disabled: true, |
| | | }, |
| | | { id: 'pickers-pro', label: '@mui/x-date-pickers-pro', editable: true }, |
| | | ], |
| | | id: '18', |
| | | label: '原材料', |
| | | }, |
| | | { |
| | | id: 'charts', |
| | |
| | | children: [{ id: 'tree-view-community1', label: '@mui/x-tree-view' }], |
| | | }, |
| | | ]; |
| | | |
| | | const handleNodeSelect = (event, nodeId) => { |
| | | console.log('Selected Node ID:', nodeId); |
| | | setFilters({ groupId: nodeId }); |
| | | // 在这里可以根据 nodeId 更新主内容区域 |
| | | }; |
| | | |
| | | |
| | | const CustomCheckbox = React.forwardRef(function CustomCheckbox(props, ref) { |
| | |
| | | > |
| | | <CardContent> |
| | | <SavedQueriesList icon={<BookmarkIcon />} /> |
| | | <FilterLiveSearch source='groupId' hiddenLabel /> |
| | | <FilterLiveSearch source='condition' hiddenLabel /> |
| | | <RichTreeView |
| | | defaultExpandedItems={['grid', 'pickers']} |
| | | expansionTrigger="iconContainer" |
| | | items={ treeData } |
| | | slots={ CustomTreeItem } |
| | | onItemClick={handleNodeSelect} // 监听节点点击事件 |
| | | |
| | | /> |
| | | </CardContent> |
| | | </Card> |