| | |
| | | const ruleList = useMemo(() => normalizeDirRule(info?.dirRule), [info?.dirRule]); |
| | | |
| | | const spatialItems = [ |
| | | { label: translate('table.field.code.x'), value: formatNumber(info?.x, 0), hideWhenEmpty: true }, |
| | | { label: translate('table.field.code.y'), value: formatNumber(info?.y, 0), hideWhenEmpty: true }, |
| | | { |
| | | label: translate('page.map.insight.code.fields.mapPosition', { _: '地图坐标' }), |
| | | render: () => ( |
| | |
| | | /> |
| | | </InfoPanel> |
| | | <InfoPanel title={translate('page.map.insight.code.relations.routes', { _: '关联路线' })}> |
| | | <RelationsChips |
| | | <RelationsList |
| | | items={routeRelations} |
| | | emptyLabel={translate('page.map.insight.code.relations.empty', { _: '暂无关联信息' })} |
| | | /> |
| | |
| | | ); |
| | | }; |
| | | |
| | | const RelationsList = ({ items, emptyLabel }) => { |
| | | if (!items?.length) { |
| | | return ( |
| | | <Typography variant="body2" color="text.disabled"> |
| | | {emptyLabel} |
| | | </Typography> |
| | | ); |
| | | } |
| | | |
| | | return ( |
| | | <Stack spacing={1}> |
| | | {items.slice(0, MAX_RELATION_ITEMS).map((item, index) => ( |
| | | <Box |
| | | key={`${getRelationKey(item)}-${index}`} |
| | | sx={{ |
| | | px: 1.25, |
| | | py: 0.75, |
| | | borderRadius: 999, |
| | | border: '1px solid', |
| | | borderColor: 'divider', |
| | | backgroundColor: 'background.default', |
| | | }} |
| | | > |
| | | <Typography variant="body2" sx={{ lineHeight: 1.2 }}> |
| | | {getRelationLabel(item)} |
| | | </Typography> |
| | | </Box> |
| | | ))} |
| | | {items.length > MAX_RELATION_ITEMS && ( |
| | | <Typography variant="caption" color="text.secondary"> |
| | | +{items.length - MAX_RELATION_ITEMS} |
| | | </Typography> |
| | | )} |
| | | </Stack> |
| | | ); |
| | | }; |
| | | |
| | | const QrPreview = ({ translate, value, loading, statusLabel, statusBool }) => ( |
| | | <Paper |
| | | elevation={3} |