| | |
| | | import CloseIcon from '@mui/icons-material/Close'; |
| | | import { PAGE_DRAWER_WIDTH } from '@/config/setting'; |
| | | import { fetchAreaList } from './http'; |
| | | import * as Tool from './tool'; |
| | | |
| | | const AreaList = ({ |
| | | open, |
| | |
| | | setLoading(true); |
| | | fetchAreaList(zoneId) |
| | | .then((list) => { |
| | | console.log(list); |
| | | |
| | | setAreas(Array.isArray(list) ? list : []); |
| | | }) |
| | | .finally(() => setLoading(false)); |
| | | }, [open, zoneId]); |
| | | |
| | | const handleItemClick = (area) => { |
| | | if (!area?.id) { |
| | | return; |
| | | } |
| | | const sprite = Tool.findAreaSpriteById(area.id); |
| | | if (sprite) { |
| | | Tool.focusAreaSprite(sprite); |
| | | // Tool.showSelectedEffect?.(sprite); |
| | | } |
| | | onSelect?.(area); |
| | | }; |
| | | |