| | |
| | | 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'; |
| | |
| | | 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]' |
| | | ]; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | 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', |
| | |
| | | /> |
| | | )} |
| | | {columns.length > 0 && |
| | | <DataTable |
| | | <StickyDataTable |
| | | stickyRight={['createTime']} |
| | | storeKey='asnOrderItem' |
| | | bulkActionButtons={false} |
| | | rowClick={false} |
| | |
| | | key={column.key || column.props.source} |
| | | source={column.props.source} |
| | | label={column.props.label} |
| | | sx={column.props.sx} |
| | | > |
| | | {column} |
| | | </DataTable.Col> |
| | | )) |
| | | } |
| | | </DataTable>} |
| | | </StickyDataTable>} |
| | | </Box> |
| | | ) |
| | | } |