zhou zhou
19 小时以前 2dae7a77781f4ef123a673893a9a7ffb34285f8f
rsf-admin/src/page/orders/asnOrderItem/AsnOrderItemList.jsx
@@ -39,6 +39,8 @@
import { Box, Typography, Card, Stack, Dialog, DialogActions, DialogTitle, LinearProgress } from '@mui/material';
import { styled } from '@mui/material/styles';
import PageDrawer from "../../components/PageDrawer";
import StickyDataTable from "../../components/StickyDataTable";
import useTableLayout from '@/utils/useTableLayout';
import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting';
import { fetchInOrderItemColumns } from '../config/orderItemColumns';
@@ -128,13 +130,11 @@
    const [columns, setColumns] = useState([]);
    const { isLoading } = useListContext();
    const refresh = useRefresh();
    const [sidebarIsOpen] = useSidebarState();
    const omittedFields = [
        'id', 'orderId', 'orderCode', 'poCode', 'poId', 'wkType', 'type', 'checkType',
        'spec', 'model', 'purQty', 'purUnit', 'qrcode', 'trackCode', 'splrCode',
        'splrName', 'projectCode', 'supplierId', 'supplierName', 'priceUnitId',
        'shipperId', 'businessTime', 'extendFields.[businessTime]',
        'id', 'orderId', 'orderCode', 'poCode', 'poId', 'wkType', 'type', 'checkType',
        'spec', 'model', 'purQty', 'purUnit', 'qrcode', 'trackCode', 'splrCode',
        'splrName', 'projectCode', 'supplierId', 'supplierName', 'priceUnitId',
        'shipperId', 'businessTime', 'extendFields.[businessTime]',
        'extendFields.[wkType]', 'extendFields.[type]'
    ];
@@ -158,16 +158,11 @@
        }
    }
    const sidebarWidth = sidebarIsOpen ? 200 : 50;
    const contentPadding = 10; // 预留边距
    const rightDrawerWidth = drawerVal ? PAGE_DRAWER_WIDTH : 0;
    const boxMaxWidth = `calc(100vw - ${sidebarWidth + rightDrawerWidth + contentPadding}px)`;
    // 计算 maxHeight: 100vh - (Header+Tabs 86px) - (Toolbar ~50px) - (Filters ~60px) - (Pagination ~50px) - (Padding ~40px) ≈ 290px
    const boxMaxHeight = `calc(100vh - 210px)`;
    const { boxMaxWidth, boxMaxHeight } = useTableLayout(drawerVal);
    return (
        <Box sx={{
            position: 'relative',
            position: 'relative',
            maxHeight: boxMaxHeight,
            maxWidth: boxMaxWidth,
            overflowX: 'auto',
@@ -188,7 +183,8 @@
                />
            )}
            {columns.length > 0 &&
                <DataTable
                <StickyDataTable
                    stickyRight={['createTime']}
                    storeKey='asnOrderItem'
                    bulkActionButtons={false}
                    rowClick={false}
@@ -200,12 +196,13 @@
                                key={column.key || column.props.source}
                                source={column.props.source}
                                label={column.props.label}
                                sx={column.props.sx}
                            >
                                {column}
                            </DataTable.Col>
                        ))
                    }
                </DataTable>}
                </StickyDataTable>}
        </Box>
    )
}