skyouc
2025-02-21 65953b12f9d667c54049c34050d39bf90556585c
rsf-admin/src/page/basicInfo/matnr/MatnrListAside.jsx
File was renamed from rsf-admin/src/page/matnr/MatnrListAside.jsx
@@ -3,7 +3,15 @@
import {
    SavedQueriesList,
    FilterLiveSearch,
    useListContext,
    useNotify,
    FilterList,
    FilterListItem,
    useStore,
    FilterFormInput,
    FilterLiveForm,
    TextInput,
    useGetList,
    useListContext
} from 'react-admin';
import BookmarkIcon from '@mui/icons-material/BookmarkBorder';
import { Box, Typography, Card, CardContent, useTheme, TextField } from '@mui/material';
@@ -15,9 +23,32 @@
const MatListAside = () => {
    const theme = useTheme();
    const notify = useNotify();
    const { setFilters } = useListContext(); // 获取列表上下文
    const [selectedOption, setSelectedOption] = useState(null);
    const treeData = [
    const [treeData, setTreeData] = useState([]);
    useEffect(() => {
        request.post('/matnrGroup/tree')
            .then(res => {
                console.log('Tree Data:', res);
                if (res?.data?.code === 200) {
                    setTreeData(res.data.data);
                } else {
                    notify(res.data.msg);
                }
            })
            .catch(error => {
                notify('Error fetching tree data');
            });
    },[]);
    const treeData1 = [
        {
            id: '19',
            label: '半成品 ',
@@ -56,6 +87,9 @@
        setFilters({ groupId: nodeId });
        // 在这里可以根据 nodeId 更新主内容区域
    };
    const handleSearch = () => {
            console.log('Search Input:', selectedOption);
    };
    const CustomCheckbox = React.forwardRef(function CustomCheckbox(props, ref) {
@@ -89,7 +123,7 @@
        >
            <CardContent>
                <SavedQueriesList icon={<BookmarkIcon />} />
                <FilterLiveSearch source='condition' hiddenLabel  />
                <FilterLiveSearch source="condition"  />
                <RichTreeView
                    defaultExpandedItems={['grid', 'pickers']}
                    expansionTrigger="iconContainer"