| | |
| | | () => extractRelationItems(info, ['routeList', 'routes', 'routeRefs']), |
| | | [info] |
| | | ); |
| | | const funcStaBool = detectBoolean( |
| | | info?.funcStaBool ?? info?.isFuncSta ?? info?.funcStation ?? info?.funcStaFlag |
| | | const funcStaRelations = useMemo( |
| | | () => extractRelationItems(info, ['funcStaList', 'funcStas']), |
| | | [info] |
| | | ); |
| | | const funcStaText = info?.funcSta$ || info?.funcStaName || info?.funcStaType || info?.funcStaCode || info?.funcStaUuid || info?.funcSta; |
| | | |
| | | const ruleList = useMemo(() => normalizeDirRule(info?.dirRule), [info?.dirRule]); |
| | | |
| | |
| | | } |
| | | }; |
| | | |
| | | const funcStaLabel = funcStaBool == null |
| | | ? translate('common.enums.na') |
| | | : translate(funcStaBool ? 'common.enums.true' : 'common.enums.false'); |
| | | |
| | | return ( |
| | | <Box sx={{ pr: 1, pb: 3 }}> |
| | | <Grid container spacing={3} alignItems="flex-start"> |
| | |
| | | disabled={!info?.id} |
| | | sx={{ alignSelf: 'flex-start', textTransform: 'none', px: 3 }} |
| | | > |
| | | {translate('page.map.insight.code.actions.openDetail', { _: '进入 Code 页面' })} |
| | | {translate('page.map.insight.code.actions.openDetail', { _: '编辑' })} |
| | | </Button> |
| | | </Stack> |
| | | </Paper> |
| | |
| | | /> |
| | | </InfoPanel> |
| | | <InfoPanel title={translate('menu.funcSta', { _: '功能站' })}> |
| | | <Stack spacing={1}> |
| | | <BooleanDisplay |
| | | value={funcStaBool} |
| | | label={funcStaLabel} |
| | | /> |
| | | {funcStaText && funcStaText !== funcStaLabel && ( |
| | | <Typography variant="body2" color="text.secondary"> |
| | | {funcStaText} |
| | | </Typography> |
| | | )} |
| | | </Stack> |
| | | <RelationsChips |
| | | items={funcStaRelations} |
| | | emptyLabel={translate('page.map.insight.code.relations.empty', { _: '暂无关联信息' })} |
| | | /> |
| | | </InfoPanel> |
| | | </Stack> |
| | | </Paper> |
| | |
| | | return item; |
| | | } |
| | | if (typeof item === 'object') { |
| | | if (item.startCode$ && item.endCode$) { |
| | | return `${item.startCode$} -> ${item.endCode$}`; |
| | | } |
| | | if (item.name || item.type || item.state) { |
| | | return [item.name, item.type, item.state].filter(Boolean).join(' / '); |
| | | } |
| | | return item.name || item.code || item.data || item.no || item.uuid || item.locNo || item.staNo || JSON.stringify(item); |
| | | } |
| | | return String(item); |