|  |  |  | 
|---|
|  |  |  | ListItemText, | 
|---|
|  |  |  | CircularProgress, | 
|---|
|  |  |  | } from '@mui/material'; | 
|---|
|  |  |  | import { handleLocateAllAgv } from "../http"; | 
|---|
|  |  |  | import { locateAllAgv, startPatrolBatch, cancelPatrolBatch } from "../http"; | 
|---|
|  |  |  | import GpsFixedIcon from '@mui/icons-material/GpsFixed'; | 
|---|
|  |  |  | import { VERIFY_PASSWORD } from '@/config/setting'; | 
|---|
|  |  |  | import TimelineIcon from '@mui/icons-material/Timeline'; | 
|---|
|  |  |  | import CloseIcon from '@mui/icons-material/Close'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const MoreOperate = ({ }) => { | 
|---|
|  |  |  | const translate = useTranslate(); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const handleLocateAll = async () => { | 
|---|
|  |  |  | setLoading(true) | 
|---|
|  |  |  | const debounced = async (fn) => { | 
|---|
|  |  |  | setLoading(true); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | await handleLocateAllAgv(); | 
|---|
|  |  |  | await fn(); | 
|---|
|  |  |  | } finally { | 
|---|
|  |  |  | setLoading(false); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const handleLocateAll = () => { | 
|---|
|  |  |  | debounced(locateAllAgv); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const handleStartPatrolBatch = () => { | 
|---|
|  |  |  | debounced(startPatrolBatch); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const handleCancelPatrolBatch = () => { | 
|---|
|  |  |  | debounced(cancelPatrolBatch); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | 
|---|
|  |  |  | <Select | 
|---|
|  |  |  | value={translate('page.map.action.moreOperation')} | 
|---|
|  |  |  | onChange={(event) => { | 
|---|
|  |  |  | console.log(event.target.value); | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | renderValue={() => ( | 
|---|
|  |  |  | <Box sx={{ display: 'flex', alignItems: 'center' }}> | 
|---|
|  |  |  | 
|---|
|  |  |  | </ListItemIcon> | 
|---|
|  |  |  | <ListItemText>{translate('page.map.action.oneClickLocate')}</ListItemText> | 
|---|
|  |  |  | </MenuItem> | 
|---|
|  |  |  | <MenuItem | 
|---|
|  |  |  | onClick={() => { | 
|---|
|  |  |  | verifyPassword(handleStartPatrolBatch); | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | disabled={loading} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <ListItemIcon> | 
|---|
|  |  |  | {loading | 
|---|
|  |  |  | ? <CircularProgress size={20} /> | 
|---|
|  |  |  | : <TimelineIcon fontSize="small" /> | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </ListItemIcon> | 
|---|
|  |  |  | <ListItemText>{translate('page.map.action.oneClickPatrol')}</ListItemText> | 
|---|
|  |  |  | </MenuItem> | 
|---|
|  |  |  | <MenuItem | 
|---|
|  |  |  | onClick={() => { | 
|---|
|  |  |  | verifyPassword(handleCancelPatrolBatch); | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | disabled={loading} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <ListItemIcon> | 
|---|
|  |  |  | {loading | 
|---|
|  |  |  | ? <CircularProgress size={20} /> | 
|---|
|  |  |  | : <CloseIcon fontSize="small" /> | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </ListItemIcon> | 
|---|
|  |  |  | <ListItemText>{translate('page.map.action.cancelPatrol')}</ListItemText> | 
|---|
|  |  |  | </MenuItem> | 
|---|
|  |  |  | </Select> | 
|---|
|  |  |  | {/* <Button | 
|---|
|  |  |  | variant="contained" | 
|---|
|  |  |  | color="primary" | 
|---|
|  |  |  | onClick={handleToggle} | 
|---|
|  |  |  | sx={{ mr: 2 }} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | 重新定位 | 
|---|
|  |  |  | </Button> */} | 
|---|
|  |  |  | </> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|