| | |
| | | return bIds.every(id => setA.has(id)); |
| | | }; |
| | | |
| | | const mapSelectionToOptions = (selection = [], options = []) => { |
| | | const optionMap = new Map(options.map(option => [getAgvOptionId(option), option])); |
| | | return selection.map(item => optionMap.get(getAgvOptionId(item)) || item); |
| | | }; |
| | | |
| | | const AreaSettings = (props) => { |
| | | const { open, onCancel, sprite, width = PAGE_DRAWER_WIDTH } = props; |
| | | const theme = useTheme(); |
| | |
| | | setPriority(curAreaInfo.priority ?? ''); |
| | | |
| | | const selected = curAreaInfo.agvList || []; |
| | | // const normalizedSelection = mapSelectionToOptions(selected, agvOptions); |
| | | setAgvList(selected); |
| | | setInitialBasic({ |
| | | name: curAreaInfo.name || '', |
| | |
| | | }; |
| | | |
| | | const handleSaveBasic = async () => { |
| | | console.log(agvList); |
| | | const id = sprite?.data?.id; |
| | | if (!id) { |
| | | return; |
| | |
| | | }; |
| | | const data = await updateAreaData(payload); |
| | | if (data) { |
| | | console.log(data); |
| | | |
| | | setCurAreaInfo(data); |
| | | // setInitialBasic({ |
| | | // name, |
| | | // agvIds: payload.agvIds, |
| | | // }); |
| | | // fetchAreaInfo(id); |
| | | } |
| | | }; |
| | | |