| | |
| | | import AreaBasicTab from './AreaBasicTab'; |
| | | import AreaAdvancedTab from './AreaAdvancedTab'; |
| | | import { getAreaInfo, fetchAgvListAll, updateAreaData, removeArea } from '../http'; |
| | | import * as Tool from '../tool'; |
| | | |
| | | const getAgvOptionId = (option) => { |
| | | if (option == null) { |
| | |
| | | const data = await updateAreaData(payload); |
| | | if (data) { |
| | | setCurAreaInfo(data); |
| | | if (sprite) { |
| | | Tool.updateAreaSpriteName(sprite, data.name || name); |
| | | } |
| | | } |
| | | }; |
| | | |
| | |
| | | draft.addChild(label); |
| | | }; |
| | | |
| | | export const updateAreaSpriteName = (sprite, newName) => { |
| | | if (!sprite || sprite?.data?.type !== DEVICE_TYPE.AREA) { |
| | | return; |
| | | } |
| | | sprite.data.name = newName; |
| | | const label = sprite.children?.find((child) => child instanceof PIXI.Text); |
| | | if (label) { |
| | | label.text = newName ?? ''; |
| | | } |
| | | }; |
| | | |
| | | export const loadAreas = (curZone, setCurSprite) => { |
| | | if (!mapContainer) return; |
| | | clearAreas(); |