From 5df3c4f3b8a1ca3f81f91dcb904d17b7bfc40017 Mon Sep 17 00:00:00 2001
From: vincentlu <t1341870251@gmail.com>
Date: 星期六, 21 三月 2026 16:30:05 +0800
Subject: [PATCH] #
---
zy-acs-flow/src/map/insight/code/CodeMain.jsx | 41 ++++++++++++++++++++++++++++++++++++++---
1 files changed, 38 insertions(+), 3 deletions(-)
diff --git a/zy-acs-flow/src/map/insight/code/CodeMain.jsx b/zy-acs-flow/src/map/insight/code/CodeMain.jsx
index f89fb26..a266088 100644
--- a/zy-acs-flow/src/map/insight/code/CodeMain.jsx
+++ b/zy-acs-flow/src/map/insight/code/CodeMain.jsx
@@ -63,8 +63,6 @@
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: () => (
@@ -170,7 +168,7 @@
/>
</InfoPanel>
<InfoPanel title={translate('page.map.insight.code.relations.routes', { _: '鍏宠仈璺嚎' })}>
- <RelationsChips
+ <RelationsList
items={routeRelations}
emptyLabel={translate('page.map.insight.code.relations.empty', { _: '鏆傛棤鍏宠仈淇℃伅' })}
/>
@@ -234,6 +232,43 @@
);
};
+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}
--
Gitblit v1.9.1