#
whycq
2025-02-21 735c1b82a64d48ef7fc9e274b971732ab0693345
rsf-admin/src/page/matnr/MatnrListAside.jsx
@@ -3,6 +3,7 @@
import {
    SavedQueriesList,
    FilterLiveSearch,
    useNotify,
    FilterList,
    FilterListItem,
    useStore,
@@ -22,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.get('/matnrGroup/tree')
        .then(res => {
            console.log('Tree Data:', res);
            if (res?.data?.code === 200) {
                setTreeData(res.data.data);
            } else {
                notify(res.data);
            }
        })
        .catch(error => {
            notify('Error fetching tree data');
        });
    },[]);
    const treeData1 = [
        {
            id: '19',
            label: '半成品 ',
@@ -63,6 +87,9 @@
        setFilters({ groupId: nodeId });
        // 在这里可以根据 nodeId 更新主内容区域
    };
    const handleSearch = () => {
            console.log('Search Input:', selectedOption);
    };
    const CustomCheckbox = React.forwardRef(function CustomCheckbox(props, ref) {
@@ -96,7 +123,7 @@
        >
            <CardContent>
                <SavedQueriesList icon={<BookmarkIcon />} />
                <FilterLiveSearch source='condition' hiddenLabel  />
                <FilterLiveSearch source="condition"  />
                <RichTreeView
                    defaultExpandedItems={['grid', 'pickers']}
                    expansionTrigger="iconContainer"