From a217d0355a08f65251b3cdd6c505ee62a0b0bb58 Mon Sep 17 00:00:00 2001
From: vincentlu <t1341870251@gmail.com>
Date: 星期六, 21 三月 2026 16:36:17 +0800
Subject: [PATCH] #
---
zy-acs-flow/src/map/insight/code/CodeMain.jsx | 84 ++++++++++++++++++++++++++++++------------
1 files changed, 60 insertions(+), 24 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..9aaec4e 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: () => (
@@ -135,18 +133,18 @@
/>
)}
<FieldGrid items={spatialItems} loading={loading} />
- <Button
- variant="contained"
- color="primary"
- startIcon={<OpenInNewIcon />}
- onClick={handleOpenDetail}
- disabled={!info?.id}
- sx={{ alignSelf: 'flex-start', textTransform: 'none', px: 3 }}
- >
- {translate('page.map.insight.code.actions.openDetail', { _: '缂栬緫' })}
- </Button>
</Stack>
</Paper>
+ <Button
+ variant="contained"
+ color="primary"
+ startIcon={<OpenInNewIcon />}
+ onClick={handleOpenDetail}
+ disabled={!info?.id}
+ sx={{ alignSelf: 'flex-start', textTransform: 'none', px: 3 }}
+ >
+ {translate('page.map.insight.code.actions.openDetail', { _: '缂栬緫' })}
+ </Button>
</Stack>
</Grid>
<Grid item xs={12} md={7}>
@@ -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', { _: '鏆傛棤鍏宠仈淇℃伅' })}
/>
@@ -229,6 +227,43 @@
label={`+${items.length - MAX_RELATION_ITEMS}`}
size="small"
/>
+ )}
+ </Stack>
+ );
+};
+
+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>
);
@@ -442,32 +477,32 @@
const theme = useTheme();
const enabledCount = rules.filter(rule => rule.enabled).length;
const placement = {
- 0: { gridColumn: 2, gridRow: 1 },
- 90: { gridColumn: 3, gridRow: 2 },
- 180: { gridColumn: 2, gridRow: 3 },
- 270: { gridColumn: 1, gridRow: 2 },
+ 0: { gridColumn: '2 / span 3', gridRow: 1 },
+ 90: { gridColumn: '4 / span 2', gridRow: 2 },
+ 180: { gridColumn: '2 / span 3', gridRow: 3 },
+ 270: { gridColumn: '1 / span 2', gridRow: 2 },
};
return (
<Box
sx={{
display: 'grid',
- gridTemplateColumns: 'repeat(3, minmax(0, 1fr))',
- gridTemplateRows: 'repeat(3, minmax(58px, auto))',
+ gridTemplateColumns: 'repeat(5, minmax(0, 1fr))',
+ gridTemplateRows: 'repeat(3, minmax(44px, auto))',
gap: 1,
alignItems: 'stretch',
}}
>
<Box
sx={{
- gridColumn: 2,
+ gridColumn: 3,
gridRow: 2,
borderRadius: 3,
border: '1px dashed',
borderColor: 'divider',
backgroundColor: alpha(theme.palette.primary.main, 0.04),
px: 1,
- py: 0.75,
+ py: 0.5,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
@@ -495,9 +530,9 @@
backgroundColor: rule.enabled
? alpha(theme.palette.success.main, 0.08)
: alpha(theme.palette.error.main, 0.08),
- px: 1,
- py: 0.75,
- minHeight: 60,
+ px: 1.25,
+ py: 0.5,
+ minHeight: 46,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
@@ -512,6 +547,7 @@
variant="caption"
sx={{
lineHeight: 1.1,
+ fontSize: '0.73rem',
color: rule.enabled ? 'success.dark' : 'error.dark',
fontWeight: 600,
}}
--
Gitblit v1.9.1