|  |  | 
 |  |  |     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> |