import React, { useState, useRef, useEffect, useMemo } from "react";
|
import { Box, Card, CardContent, Grid, Typography, Tooltip } from '@mui/material';
|
import {
|
useTranslate,
|
useRecordContext,
|
} from 'react-admin';
|
import PanelTypography from "../components/PanelTypography";
|
import * as Common from '@/utils/common'
|
|
const LocPanel = () => {
|
const record = useRecordContext();
|
if (!record) return null;
|
const translate = useTranslate();
|
return (
|
<>
|
<Card sx={{ width: { xs: 300, sm: 500, md: 600, lg: 800 }, margin: 'auto' }}>
|
<CardContent>
|
<Grid container spacing={2}>
|
<Grid item xs={12} sx={{ display: 'flex', justifyContent: 'space-between' }}>
|
<Typography variant="h6" gutterBottom align="left" sx={{
|
maxWidth: { xs: '100px', sm: '180px', md: '260px', lg: '360px' },
|
whiteSpace: 'nowrap',
|
overflow: 'hidden',
|
textOverflow: 'ellipsis',
|
}}>
|
{Common.camelToPascalWithSpaces(translate('table.field.loc.name'))}: {record.name}
|
</Typography>
|
{/* inherit, primary, secondary, textPrimary, textSecondary, error */}
|
<Typography variant="h6" gutterBottom align="right" >
|
ID: {record.id}
|
</Typography>
|
</Grid>
|
</Grid>
|
<Grid container spacing={2}>
|
<Grid item xs={12} container alignContent="flex-end">
|
<Typography variant="caption" color="textSecondary" sx={{ wordWrap: 'break-word', wordBreak: 'break-all' }}>
|
{Common.camelToPascalWithSpaces(translate('common.field.memo'))}:{record.memo}
|
</Typography>
|
</Grid>
|
</Grid>
|
<Box height={20}> </Box>
|
<Grid container spacing={2}>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.loc.areaId"
|
property={record.areaId}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.loc.code"
|
property={record.code}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.loc.type"
|
property={record.type}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.loc.name"
|
property={record.name}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.loc.flagLogic"
|
property={record.flagLogic}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.loc.fucAtrrs"
|
property={record.fucAtrrs}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.loc.barcode"
|
property={record.barcode}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.loc.unit"
|
property={record.unit}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.loc.size"
|
property={record.size}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.loc.row"
|
property={record.row}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.loc.col"
|
property={record.col}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.loc.lev"
|
property={record.lev}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.loc.channel"
|
property={record.channel}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.loc.maxParts"
|
property={record.maxParts}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.loc.maxPack"
|
property={record.maxPack}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.loc.flagLabelMange"
|
property={record.flagLabelMange}
|
/>
|
</Grid>
|
<Grid item xs={6}>
|
<PanelTypography
|
title="table.field.loc.locAttrs"
|
property={record.locAttrs}
|
/>
|
</Grid>
|
|
</Grid>
|
</CardContent>
|
</Card >
|
</>
|
);
|
};
|
|
export default LocPanel;
|