| | |
| | | Button, |
| | | Divider, |
| | | Stack, |
| | | useTheme, |
| | | } from '@mui/material'; |
| | | import AgvThree from './AgvThree'; |
| | | import { getAgvInfo } from '../../http'; |
| | |
| | | |
| | | addObject(agvGroup); |
| | | |
| | | three.rePerspective(350, 450); |
| | | three?.rePerspective(350, 450); |
| | | |
| | | }).catch((error) => { |
| | | console.error(error); |
| | |
| | | } |
| | | |
| | | const AgvMain = (props) => { |
| | | const { data, curAgvNo, setCurAgvNo } = props; |
| | | const { curAgvNo, setCurAgvNo, setJsonData } = props; |
| | | const theme = useTheme(); |
| | | const translate = useTranslate(); |
| | | const containerRef = useRef(); |
| | | const [loading, setLoading] = useState(true); |
| | | const [info, setInfo] = useState(null); |
| | | |
| | | useEffect(() => { |
| | | if (data) { |
| | | getAgvInfo(data.no, (response) => { |
| | | if (curAgvNo) { |
| | | getAgvInfo(curAgvNo, (response) => { |
| | | setInfo(response); |
| | | setCurAgvNo(data.no); |
| | | }); |
| | | } |
| | | }, [data]); |
| | | }, [curAgvNo]); |
| | | |
| | | useEffect(() => { |
| | | if (info) { |
| | | // console.log(info); |
| | | setJsonData(info); |
| | | endThree(); |
| | | setLoading(true); |
| | | setTimeout(() => { |
| | |
| | | } |
| | | return endThree; |
| | | }, [info]); |
| | | |
| | | const handleReset = () => { |
| | | alert(1) |
| | | } |
| | | |
| | | return ( |
| | | <Box display="flex" height="100%"> |
| | |
| | | <Stack spacing={2} mt={2}> |
| | | <ConfirmButton |
| | | label="page.map.action.reset" |
| | | color="info" |
| | | color="primary" |
| | | variant="contained" |
| | | onConfirm={() => { |
| | | alert(1) |
| | | handleReset(); |
| | | }} |
| | | /> |
| | | {info && ( |
| | |
| | | } |
| | | |
| | | const KeyValuePair = ({ label, value, bool }) => { |
| | | console.log({ label, value, bool }); |
| | | |
| | | return ( |
| | | <> |
| | | <Stack direction="row" alignItems="center" spacing={1} sx={{ mb: 1 }}> |