From 57716e5de367a16585a15126bccb53e972a5e649 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 17 十月 2024 14:06:43 +0800
Subject: [PATCH] #
---
zy-acs-flow/src/map/insight/agv/AgvMain.jsx | 93 ++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 88 insertions(+), 5 deletions(-)
diff --git a/zy-acs-flow/src/map/insight/agv/AgvMain.jsx b/zy-acs-flow/src/map/insight/agv/AgvMain.jsx
index 8651c52..b6686e3 100644
--- a/zy-acs-flow/src/map/insight/agv/AgvMain.jsx
+++ b/zy-acs-flow/src/map/insight/agv/AgvMain.jsx
@@ -1,6 +1,16 @@
import React, { useRef, useEffect, useState } from 'react';
import * as THREE from 'three';
-import { Box, CircularProgress } from '@mui/material';
+import { useTranslate } from 'react-admin';
+import {
+ Box,
+ CircularProgress,
+ Grid,
+ Typography,
+ Paper,
+ Button,
+ Divider,
+ Stack,
+} from '@mui/material';
import AgvThree from './AgvThree';
import { getAgvInfo } from '../../http';
@@ -41,8 +51,9 @@
loaderMesh.scale.set(scaleVal, scaleVal, scaleVal);
forkMesh.scale.set(scaleVal, scaleVal, scaleVal);
- loaderMesh.position.set(0, 150, 0);;
- forkMesh.position.set(0, 165, 0);;
+ bodyMesh.position.set(55, 0, 0);;
+ loaderMesh.position.set(55, 150, 0);;
+ forkMesh.position.set(55, 165, 0);;
const agvGroup = new THREE.Group();
agvGroup.add(bodyMesh);
@@ -53,8 +64,7 @@
addObject(agvGroup);
- three.setNewSelectedMesh(curAgvNo);
- three.rePerspective(350, 550);
+ three.rePerspective(350, 450);
}).catch((error) => {
console.error(error);
@@ -65,6 +75,7 @@
const AgvMain = (props) => {
const { data, curAgvNo, setCurAgvNo } = props;
+ const translate = useTranslate();
const containerRef = useRef();
const [loading, setLoading] = useState(true);
const [info, setInfo] = useState(null);
@@ -115,9 +126,81 @@
)}
</Box>
<Box width="50%" height="100%" overflow="auto" pl={1}>
+ <Paper elevation={1} style={{
+ height: "100%",
+ padding: '16px',
+ display: 'flex',
+ flexDirection: 'column',
+ justifyContent: 'space-between',
+ }}>
+ <Box>
+ <Grid container spacing={2} style={{ marginTop: '0px' }}>
+ <Grid item xs={12}>
+ <KeyValuePair label={translate('table.field.agv.uuid')} value={info?.uuid || 'N/A'} />
+ </Grid>
+ <Grid item xs={12}>
+ <KeyValuePair label={translate('table.field.loc.row')} value={info?.row || 'N/A'} />
+ </Grid>
+ <Grid item xs={12}>
+ <KeyValuePair label={translate('table.field.loc.bay')} value={info?.bay || 'N/A'} />
+ </Grid>
+ <Grid item xs={12}>
+ <KeyValuePair label={translate('table.field.loc.lev')} value={info?.lev || 'N/A'} />
+ </Grid>
+ <Grid item xs={12}>
+ <KeyValuePair label={translate('table.field.loc.offset')} value={info?.offset || 'N/A'} />
+ </Grid>
+ <Grid item xs={12}>
+ <KeyValuePair label={translate('table.field.loc.locSts')} value={info?.locSts$ || 'N/A'} />
+ </Grid>
+ <Grid item xs={12}>
+ <KeyValuePair label={translate('table.field.loc.zoneId')} value={info?.zoneId$ || 'N/A'} />
+ </Grid>
+ <Grid item xs={12}>
+ <KeyValuePair label={translate('table.field.loc.code')} value={info?.code$ || 'N/A'} />
+ </Grid>
+ </Grid>
+ </Box>
+
+ <Grid container spacing={2} style={{ marginTop: '0px' }}>
+ <Grid item xs={12}>
+ <Typography variant="subtitle1">
+ {translate('common.field.opt')}
+ </Typography>
+ <Stack spacing={2} mt={2}>
+ <Button variant="contained" fullWidth>
+ {translate('page.map.insight.shelf.updateStatus')}
+ </Button>
+ <Button variant="contained" color="error" disabled={info?.locStsEl !== 'STOCK'} fullWidth>
+ {translate('page.map.insight.shelf.outbound')}
+ </Button>
+ </Stack>
+ </Grid>
+ </Grid>
+ </Paper>
</Box>
</Box>
);
}
+const KeyValuePair = ({ label, value }) => (
+ <>
+ <Stack direction="row" alignItems="center" spacing={1} sx={{ mb: 1 }}>
+ <Typography
+ variant="body2"
+ sx={{ width: '80px', fontWeight: 'bold', color: 'text.secondary', textAlign: 'left' }}
+ >
+ {label}:
+ </Typography>
+ <Typography
+ variant="body2"
+ sx={{ flexGrow: 1, color: 'text.primary', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}
+ >
+ {value}
+ </Typography>
+ </Stack>
+ <Divider />
+ </>
+);
+
export default AgvMain;
--
Gitblit v1.9.1