import React, { useState, useRef, useEffect, useMemo } from "react";
|
import {
|
ShowBase,
|
TabbedShowLayout,
|
useShowContext,
|
} from 'react-admin';
|
import {
|
Box,
|
Button,
|
Card,
|
CardContent,
|
Stack,
|
Typography,
|
Avatar,
|
} from '@mui/material';
|
import { formatDistance } from 'date-fns';
|
import { AgvShowDetail } from "./show/AgvShowDetail";
|
import { AgvShowAside } from "./show/AgvShowAside";
|
import { AgvShowTask } from "./show/AgvShowTask";
|
import CustomerTopToolBar from "../components/EditTopToolBar";
|
import { useTheme } from '@mui/material/styles';
|
|
export const AgvShow = () => {
|
|
return (
|
<>
|
<ShowBase>
|
<AgvShowContent />
|
</ShowBase>
|
</>
|
)
|
}
|
|
const AgvShowContent = (props) => {
|
const { record, isPending } = useShowContext();
|
const theme = useTheme();
|
if (isPending || !record) return null;
|
|
return (
|
<>
|
<Box mt={2} display="flex">
|
<Box flex="1">
|
<Card>
|
<CardContent sx={{ pt: 0 }}>
|
<Box display="flex" mb={1} sx={{
|
justifyContent: 'space-between',
|
alignItems: 'center',
|
}}>
|
<CustomerTopToolBar />
|
<Box mt={1} mr={1}>
|
<Stack direction='row'>
|
<Typography
|
variant="h5"
|
sx={{
|
mt: .5,
|
mr: 2
|
}}
|
>
|
{record.agvModelData?.type}
|
</Typography>
|
<Avatar sx={{ bgcolor: theme.palette.primary.main }}>{record.uuid}</Avatar>
|
</Stack>
|
</Box>
|
</Box>
|
|
<TabbedShowLayout
|
sx={{
|
'& .RaTabbedShowLayout-content': { p: 0 },
|
}}
|
>
|
<TabbedShowLayout.Tab label="page.agv.show.tabs.detail">
|
<AgvShowDetail agvId={record.id} />
|
</TabbedShowLayout.Tab>
|
<TabbedShowLayout.Tab label="page.agv.show.tabs.task">
|
<AgvShowTask agvId={record.id} />
|
</TabbedShowLayout.Tab>
|
</TabbedShowLayout>
|
</CardContent>
|
</Card>
|
</Box>
|
<AgvShowAside />
|
</Box>
|
</>
|
)
|
}
|