| | |
| | | endY: 'End Y', |
| | | memo: 'Memo', |
| | | priority: 'Priority', |
| | | agvCount: 'AGV · %{count}', |
| | | areaSize: 'Area %{size} ㎡', |
| | | }, |
| | | confirm: { |
| | | save: 'Save current changes?', |
| | |
| | | endY: '终点 Y', |
| | | memo: '备注', |
| | | priority: '优先级', |
| | | agvCount: 'AGV · %{count}', |
| | | areaSize: '占地 %{size} ㎡', |
| | | }, |
| | | confirm: { |
| | | save: '确认保存当前修改?', |
| | |
| | | {translate('page.map.area.form.codesEmpty')} |
| | | </Typography> |
| | | )} |
| | | {areas.map((area) => ( |
| | | {areas.map((area) => { |
| | | const agvCount = Array.isArray(area.agvList) ? area.agvList.length : 0; |
| | | const width = Math.abs((area?.end?.x ?? 0) - (area?.start?.x ?? 0)); |
| | | const height = Math.abs((area?.end?.y ?? 0) - (area?.start?.y ?? 0)); |
| | | const areaSize = (width * height) / 1_000_000; |
| | | const formattedSize = areaSize > 0 ? areaSize.toFixed(2) : '0.00'; |
| | | return ( |
| | | <ListItemButton |
| | | key={area.id} |
| | | onClick={() => handleItemClick(area)} |
| | |
| | | display: 'flex', |
| | | gap: 1.5, |
| | | alignItems: 'center', |
| | | justifyContent: 'space-between', |
| | | transition: 'transform 0.2s ease, box-shadow 0.2s ease', |
| | | boxShadow: |
| | | themeMode === 'light' |
| | |
| | | /> |
| | | <ListItemText |
| | | primary={area.name || translate('page.map.area.form.name')} |
| | | // secondary={area.code ? `${translate('page.map.area.form.code')}: ${area.code}` : ''} |
| | | primaryTypographyProps={{ |
| | | fontWeight: 600, |
| | | fontSize: 16, |
| | | }} |
| | | secondaryTypographyProps={{ |
| | | color: theme.palette.text.secondary, |
| | | fontSize: 12, |
| | | }} |
| | | /> |
| | | <Box textAlign="right"> |
| | | <Typography variant="body2" fontWeight={500}> |
| | | {translate('page.map.area.form.agvCount', { count: agvCount })} |
| | | </Typography> |
| | | <Typography variant="caption" color="text.secondary"> |
| | | {translate('page.map.area.form.areaSize', { size: formattedSize })} |
| | | </Typography> |
| | | </Box> |
| | | </ListItemButton> |
| | | ))} |
| | | ); |
| | | })} |
| | | </List> |
| | | )} |
| | | </Box> |