zhou zhou
2026-02-07 49f8eeef1dfbc4ba1eb3a4cc413e4a78eba0357c
rsf-admin/src/page/basicInfo/warehouse/WarehouseList.jsx
@@ -2,10 +2,9 @@
import { useNavigate } from 'react-router-dom';
import {
    List,
    DatagridConfigurable,
    SearchInput,
    TopToolbar,
    SelectColumnsButton,
    ColumnsButton,
    EditButton,
    FilterButton,
    CreateButton,
@@ -43,51 +42,20 @@
import MyField from "@/page/components/MyField";
import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting';
import * as Common from '@/utils/common';
import StickyDataTable from "@/page/components/StickyDataTable";
const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
    '& .css-1vooibu-MuiSvgIcon-root': {
        height: '.9em'
    },
    '& .RaDatagrid-row': {
        cursor: 'auto'
    },
    '& .column-name': {
    },
    '& .opt': {
        width: 200
    },
}));
const filters = [
    <SearchInput source="condition" alwaysOn />,
    <DateInput label='common.time.after' source="timeStart" alwaysOn />,
    <DateInput label='common.time.before' source="timeEnd" alwaysOn />,
    <TextInput source="name" label="table.field.warehouse.name" />,
    <TextInput source="code" label="table.field.warehouse.code" />,
    <SearchInput source="condition" placeholder="搜索仓库名称" alwaysOn />,
    <TextInput source="factory" label="table.field.warehouse.factory" />,
    <TextInput source="address" label="table.field.warehouse.address" />,
    <TextInput source="longitude" label="table.field.warehouse.longitude" />,
    <TextInput source="latgitude" label="table.field.warehouse.latgitude" />,
    <NumberInput source="length" label="table.field.warehouse.length" />,
    <NumberInput source="width" label="table.field.warehouse.width" />,
    <NumberInput source="height" label="table.field.warehouse.height" />,
    <TextInput source="code" label="table.field.warehouse.code" />,
    <TextInput source="name" label="table.field.warehouse.name" />,
    <TextInput label="common.field.memo" source="memo" />,
    <SelectInput
        label="common.field.status"
        source="status"
        choices={[
            { id: '1', name: 'common.enums.statusTrue' },
            { id: '0', name: 'common.enums.statusFalse' },
        ]}
        resettable
    />,
]
const WarehouseList = () => {
    const translate = useTranslate();
    const [createDialog, setCreateDialog] = useState(false);
    const [drawerVal, setDrawerVal] = useState(false);
@@ -100,7 +68,7 @@
                        theme.transitions.create(['all'], {
                            duration: theme.transitions.duration.enteringScreen,
                        }),
                    marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0,
                    marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0,
                }}
                title={"menu.warehouse"}
                empty={<EmptyData onClick={() => { setCreateDialog(true) }} />}
@@ -110,31 +78,24 @@
                    <TopToolbar>
                        <FilterButton />
                        <MyCreateButton onClick={() => { setCreateDialog(true) }} />
                        <SelectColumnsButton preferenceKey='warehouse' />
                        <ColumnsButton storeKey='warehouse' />
                        <MyExportButton />
                    </TopToolbar>
                )}
                perPage={DEFAULT_PAGE_SIZE}
            >
                <StyledDatagrid
                    preferenceKey='warehouse'
                <StickyDataTable
                    storeKey='warehouse'
                    bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />}
                    rowClick={(id, resource, record) => false}
                    expand={() => <WarehousePanel />}
                    expandSingle={true}
                    omit={['id', 'createTime', 'createBy', 'memo']}
                    stickyRight={['opt']}
                    hiddenColumns={['id', 'updateTime', 'updateBy', 'createTime', 'createBy', 'longitude', 'latgitude', 'length', 'width', 'height']}
                >
                    <NumberField source="id" />
                    <TextField source="name" label="table.field.warehouse.name" />
                    <TextField source="code" label="table.field.warehouse.code" />
                    <TextField source="factory" label="table.field.warehouse.factory" />
                    <TextField source="code" label="table.field.warehouse.code" />
                    <TextField source="name" label="table.field.warehouse.name" />
                    <TextField source="address" label="table.field.warehouse.address" />
                    <TextField source="longitude" label="table.field.warehouse.longitude" />
                    <TextField source="latgitude" label="table.field.warehouse.latgitude" />
                    <NumberField source="length" label="table.field.warehouse.length" />
                    <NumberField source="width" label="table.field.warehouse.width" />
                    <NumberField source="height" label="table.field.warehouse.height" />
                    <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}>
                        <TextField source="nickname" />
                    </ReferenceField>
@@ -143,13 +104,13 @@
                        <TextField source="nickname" />
                    </ReferenceField>
                    <DateField source="createTime" label="common.field.createTime" showTime />
                    <BooleanField source="statusBool" label="common.field.status" sortable={false} />
                    <TextField source="memo" label="common.field.memo" sortable={false} />
                    <WrapperField cellClassName="opt" label="common.field.opt">
                        <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} />
                        <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} />
                    <WrapperField source="opt" cellClassName="opt" label="common.field.opt">
                        <EditButton />
                        <DeleteButton mutationMode={OPERATE_MODE} />
                    </WrapperField>
                </StyledDatagrid>
                </StickyDataTable>
            </List>
            <WarehouseCreate
                open={createDialog}