skyouc
2025-05-19 9d6170903806cb351975c9d68005837aec6a8578
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import React, { useState, useRef, useEffect, useMemo, useCallback } from "react";
import request from '@/utils/request';
import {
    SavedQueriesList,
    FilterLiveSearch,
    useNotify,
    useListContext,
    SearchInput,
    FilterList,
    FilterListItem,
} from 'react-admin';
import BookmarkIcon from '@mui/icons-material/BookmarkBorder';
import { Box, Typography, Card, CardContent, useTheme, Input } from '@mui/material';
import CategoryIcon from '@mui/icons-material/LocalOffer';
 
 
const WarehouseAside = () => {
    const isSelected = (value, filters) => {
        const aggType = filters.aggType || ["matnr"];
        return aggType.includes(value.aggType);
    };
 
    const toggleFilter = (value, filters) => {
        const aggType = filters.type || [];
        return {
            aggType: value.aggType,
        };
    };
 
    return (
        <Card
            sx={{
                order: -1,
                mr: 2,
                mt: 8,
                alignSelf: 'flex-start',
                width: 250,
                minWidth: 150,
                height: `87%`,
                "& .MuiTypography-root": {fontSize: '1rem'}
            }}
        >
            <FilterList label="common.aside.category" icon={<CategoryIcon />} sx={{ml: 2}}>
                <FilterListItem
                    label="common.aside.material"
                    value={{ aggType: 'matnr' }}
                    isSelected={isSelected}
                    toggleFilter={toggleFilter}
                />
                <FilterListItem
                    label="common.aside.supplier"
                    value={{ aggType: 'supplier' }}
                    isSelected={isSelected}
                    toggleFilter={toggleFilter}
                />
                <FilterListItem
                    label="common.aside.warehouse"
                    value={{ aggType: 'warehouse' }}
                    isSelected={isSelected}
                    toggleFilter={toggleFilter}
                />
                <FilterListItem
                    label="common.aside.batch"
                    value={{ aggType: 'batch' }}
                    isSelected={isSelected}
                    toggleFilter={toggleFilter}
                />
                <FilterListItem
                    label="common.aside.dynamicFields"
                    value={{ aggType: 'fieldsIndex' }}
                    isSelected={isSelected}
                    toggleFilter={toggleFilter}
                />
            </FilterList>
 
        </Card>
 
    )
}
 
export default WarehouseAside;