zhou zhou
昨天 4a620b306e2e0ff208dbea260f998ffce8d08e39
rsf-admin/src/page/basStationArea/BasStationAreaList.jsx
@@ -2,10 +2,9 @@
import { useNavigate } from 'react-router-dom';
import {
    List,
    DatagridConfigurable,
    SearchInput,
    TopToolbar,
    SelectColumnsButton,
    ColumnsButton,
    EditButton,
    FilterButton,
    CreateButton,
@@ -33,7 +32,6 @@
    DeleteButton,
} from 'react-admin';
import { Box, Typography, Card, Stack } from '@mui/material';
import { styled } from '@mui/material/styles';
import BasStationAreaCreate from "./BasStationAreaCreate";
import BasStationAreaPanel from "./BasStationAreaPanel";
import EmptyData from "../components/EmptyData";
@@ -41,22 +39,10 @@
import MyExportButton from '../components/MyExportButton';
import PageDrawer from "../components/PageDrawer";
import MyField from "../components/MyField";
import StickyDataTable from "@/page/components/StickyDataTable";
import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting';
import * as Common from '@/utils/common';
const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
    '& .css-1vooibu-MuiSvgIcon-root': {
        height: '.9em'
    },
    '& .RaDatagrid-row': {
        cursor: 'auto'
    },
    '& .column-name': {
    },
    '& .opt': {
        width: 200
    },
}));
import useTableLayout from '@/utils/useTableLayout';
const filters = [
    <SearchInput source="condition" alwaysOn />,
@@ -97,8 +83,14 @@
    const [createDialog, setCreateDialog] = useState(false);
    const [drawerVal, setDrawerVal] = useState(false);
    const { boxMaxWidth, boxMaxHeight } = useTableLayout(drawerVal);
    return (
        <Box display="flex">
        <Box display="flex" sx={{
            '& .opt': {
                width: 200
            }
        }}>
            <List
                sx={{
                    flexGrow: 1,
@@ -116,52 +108,55 @@
                    <TopToolbar>
                        <FilterButton />
                        <MyCreateButton onClick={() => { setCreateDialog(true) }} />
                        <SelectColumnsButton preferenceKey='basStationArea' />
                        <ColumnsButton storeKey='basStationArea' />
                        <MyExportButton />
                    </TopToolbar>
                )}
                perPage={DEFAULT_PAGE_SIZE}
            >
                <StyledDatagrid
                    preferenceKey='basStationArea'
                    bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />}
                    rowClick={(id, resource, record) => false}
                    expand={() => <BasStationAreaPanel />}
                    expandSingle={true}
                    omit={['id', 'createTime', 'createBy', 'memo']}
                <Box
                    sx={{
                        position: 'relative',
                        maxHeight: boxMaxHeight,
                        maxWidth: boxMaxWidth,
                        overflowX: 'auto',
                        overflowY: 'auto',
                        '& .MuiTableCell-root': {
                            whiteSpace: 'nowrap',
                        }
                    }}
                >
                    <NumberField source="id" />
                    <NumberField source="type" label="table.field.basStationArea.type" />
                    <TextField source="stationAreaName" label="table.field.basStationArea.stationAreaName" />
                    <NumberField source="inAble" label="table.field.basStationArea.inAble" />
                    <NumberField source="outAble" label="table.field.basStationArea.outAble" />
                    <TextField source="useStatus" label="table.field.basStationArea.useStatus" />
                    <NumberField source="area" label="table.field.basStationArea.area" />
                    <NumberField source="isCrossZone" label="table.field.basStationArea.isCrossZone" />
                    <TextField source="crossZoneArea" label="table.field.basStationArea.crossZoneArea" />
                    <NumberField source="isWcs" label="table.field.basStationArea.isWcs" />
                    <TextField source="wcsData" label="table.field.basStationArea.wcsData" />
                    <TextField source="containerType" label="table.field.basStationArea.containerType" />
                    <TextField source="barcode" label="table.field.basStationArea.barcode" />
                    <NumberField source="autoTransfer" label="table.field.basStationArea.autoTransfer" />
                    <TextField source="stationAreaId" label="table.field.basStationArea.stationAreaId" />
                    <TextField source="stationAlias" label="table.field.basStationArea.stationAlias" />
                    <StickyDataTable
                        storeKey='basStationArea'
                        bulkActionButtons={<BulkDeleteButton mutationMode={OPERATE_MODE} />}
                        rowClick={(id, resource, record) => false}
                        stickyRight={['opt']}
                        expandSingle={true}
                        hiddenColumns={['id', 'createTime', 'createBy', 'memo']}
                    >
                        <NumberField source="id" />
                        <TextField source="stationAreaName" label="table.field.basStationArea.stationAreaName" />
                        <NumberField source="area" label="table.field.basStationArea.area" />
                        <TextField source="containerType" label="table.field.basStationArea.containerType" />
                        <TextField source="stationAreaId" label="table.field.basStationArea.stationAreaId" />
                        <TextField source="stationAlias" label="table.field.basStationArea.stationAlias" />
                    <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}>
                        <TextField source="nickname" />
                    </ReferenceField>
                    <DateField source="updateTime" label="common.field.updateTime" showTime />
                    <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}>
                        <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>
                </StyledDatagrid>
                        <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}>
                            <TextField source="nickname" />
                        </ReferenceField>
                        <DateField source="updateTime" label="common.field.updateTime" showTime />
                        <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}>
                            <TextField source="nickname" />
                        </ReferenceField>
                        <DateField source="createTime" label="common.field.createTime" showTime />
                        <WrapperField source="opt" cellClassName="opt" label="common.field.opt">
                            <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} />
                            <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} />
                        </WrapperField>
                    </StickyDataTable>
                </Box>
            </List>
            <BasStationAreaCreate
                open={createDialog}