skyouc
2025-02-21 1e643b7beb7ae711803b47285ca0aa7f2c1eb926
rsf-admin/src/page/matnr/MatnrList.jsx
@@ -32,7 +32,7 @@
    AutocompleteInput,
    DeleteButton,
} from 'react-admin';
import { Box, Typography, Card, Stack } from '@mui/material';
import { Box, Typography, Card, Stack,LinearProgress } from '@mui/material';
import { styled } from '@mui/material/styles';
import MatnrCreate from "./MatnrCreate";
import MatnrPanel from "./MatnrPanel";
@@ -44,6 +44,7 @@
import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting';
import * as Common from '@/utils/common';
import ImportButton from "../components/ImportButton";
import MatListAside from './MatnrListAside';
const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
    '& .css-1vooibu-MuiSvgIcon-root': {
@@ -84,9 +85,9 @@
    <TextInput source="describle" label="table.field.matnr.describle" />,
    <NumberInput source="nromNum" label="table.field.matnr.nromNum" />,
    <TextInput source="unit" label="table.field.matnr.unit" />,
    <TextInput source="purUnit" label="table.field.matnr.purUnit" />,
    <TextInput source="purchaseUnit" label="table.field.matnr.purUnit" />,
    <TextInput source="stockUnit" label="table.field.matnr.stockUnit" />,
    <SelectInput source="stockLevel" label="table.field.matnr.stockLevel"
    <SelectInput source="stockLeval" label="table.field.matnr.stockLevel"
        choices={[
            { id: 0, name: ' A' },
            { id:   1, name: ' B' },
@@ -119,38 +120,23 @@
    />,
]
const MatnrList = () => {
const MatnrListContent = (props) => {
    const translate = useTranslate();
    const [createDialog, setCreateDialog] = useState(false);
    const [drawerVal, setDrawerVal] = useState(false);
    const { isLoading } = useListContext();
    return (
        <Box display="flex">
            <List
        <Box sx={{ position: 'relative' }}>
                {isLoading && (
                    <LinearProgress
                sx={{
                    flexGrow: 1,
                    transition: (theme) =>
                        theme.transitions.create(['all'], {
                            duration: theme.transitions.duration.enteringScreen,
                        }),
                    marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0,
                            height: "2px",
                            position: 'absolute',
                            top: 0,
                            left: 0,
                            right: 0,
                }}
                title={"menu.matnr"}
                empty={<EmptyData onClick={() => { setCreateDialog(true) }} />}
                filters={filters}
                sort={{ field: "create_time", order: "desc" }}
                actions={(
                    <TopToolbar>
                        <FilterButton />
                        <MyCreateButton onClick={() => { setCreateDialog(true) }} />
                        <SelectColumnsButton preferenceKey='matnr' />
                        <ImportButton />
                        <MyExportButton />
                    </TopToolbar>
                    />
                )}
                perPage={DEFAULT_PAGE_SIZE}
            >
                <StyledDatagrid
                    preferenceKey='matnr'
                    bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />}
@@ -165,7 +151,7 @@
                    <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}>
                <ReferenceField source="groupId" label="table.field.matnr.groupId" reference="matnrGroup" link={false} sortable={false} alwaysOn>
                        <TextField source="code" />
                    </ReferenceField>
                    <ReferenceField source="rglarId" label="table.field.matnr.rglarId" reference="rglarId" link={false} sortable={false}>
@@ -180,7 +166,7 @@
                    <TextField source="describle" label="table.field.matnr.describle" />
                    <NumberField source="nromNum" label="table.field.matnr.nromNum" />
                    <TextField source="unit" label="table.field.matnr.unit" />
                    <TextField source="purUnit" label="table.field.matnr.purUnit" />
                <TextField source="purchaseUnit" label="table.field.matnr.purUnit" />
                    <TextField source="stockUnit" label="table.field.matnr.stockUnit" />
                    <TextField source="stockLeval$" label="table.field.matnr.stockLevel" sortable={false} />
                    <TextField source="isLabelMange$" label="table.field.matnr.isLabelMange" sortable={false} />
@@ -207,6 +193,47 @@
                        <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} />
                    </WrapperField>
                </StyledDatagrid>
        </Box>
    );
}
const MatnrList = () => {
    const translate = useTranslate();
    const [createDialog, setCreateDialog] = useState(false);
    const [drawerVal, setDrawerVal] = useState(false);
    return (
        <Box display="flex">
            <List
                sx={{
                    flexGrow: 1,
                    transition: (theme) =>
                        theme.transitions.create(['all'], {
                            duration: theme.transitions.duration.enteringScreen,
                        }),
                    marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0,
                }}
                title={"menu.matnr"}
                empty={<EmptyData onClick={() => { setCreateDialog(true) }} />}
                filters={filters}
                sort={{ field: "create_time", order: "desc" }}
                actions={(
                    <TopToolbar>
                        <FilterButton />
                        <MyCreateButton onClick={() => { setCreateDialog(true) }} />
                        <SelectColumnsButton preferenceKey='matnr' />
                        <ImportButton />
                        <MyExportButton />
                    </TopToolbar>
                )}
                perPage={DEFAULT_PAGE_SIZE}
                aside={ <MatListAside /> }
            >
                <MatnrListContent />
            </List>
            <MatnrCreate
                open={createDialog}