fix(map): show simulation pipe ids
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
TableHead,
|
||||
TableRow,
|
||||
Button,
|
||||
Link,
|
||||
} from "@mui/material";
|
||||
import {
|
||||
FormatListBulleted,
|
||||
@@ -251,6 +252,7 @@ const LocationResults: React.FC<Props> = ({ result }) => {
|
||||
);
|
||||
const sourceLabel = getDataSourceLabel(result);
|
||||
const normalDataDescription = getNormalDataDescription(result);
|
||||
const simulationBurstIds = result.simulation_scheme?.burst_ids ?? [];
|
||||
|
||||
return (
|
||||
<Box className="h-full overflow-auto p-1">
|
||||
@@ -287,6 +289,7 @@ const LocationResults: React.FC<Props> = ({ result }) => {
|
||||
variant="outlined"
|
||||
startIcon={<LocationOnIcon />}
|
||||
onClick={() => locatePipes([result.located_pipe])}
|
||||
disabled={!result.located_pipe}
|
||||
sx={{
|
||||
height: 24,
|
||||
minWidth: 0,
|
||||
@@ -348,6 +351,55 @@ const LocationResults: React.FC<Props> = ({ result }) => {
|
||||
爆管方案: {result.simulation_scheme.name}
|
||||
</Typography>
|
||||
) : null}
|
||||
{simulationBurstIds.length > 0 ? (
|
||||
<Box className="mt-1 flex flex-wrap items-center gap-1">
|
||||
<Typography variant="caption" className="text-purple-600">
|
||||
模拟管段:
|
||||
</Typography>
|
||||
{simulationBurstIds.map((pipeId) => (
|
||||
<Link
|
||||
key={pipeId}
|
||||
component="button"
|
||||
variant="caption"
|
||||
onClick={() => locatePipes([pipeId])}
|
||||
title={pipeId}
|
||||
sx={{
|
||||
maxWidth: 132,
|
||||
color: "#7c3aed",
|
||||
fontSize: "0.75rem",
|
||||
fontWeight: 700,
|
||||
lineHeight: "22px",
|
||||
cursor: "pointer",
|
||||
overflow: "hidden",
|
||||
textOverflow: "ellipsis",
|
||||
whiteSpace: "nowrap",
|
||||
textDecoration: "underline",
|
||||
textUnderlineOffset: "2px",
|
||||
"&:hover": {
|
||||
color: "#5b21b6",
|
||||
},
|
||||
}}
|
||||
>
|
||||
{pipeId}
|
||||
</Link>
|
||||
))}
|
||||
<Button
|
||||
size="small"
|
||||
variant="text"
|
||||
startIcon={<LocationOnIcon />}
|
||||
onClick={() => locatePipes(simulationBurstIds)}
|
||||
sx={{
|
||||
minWidth: 0,
|
||||
px: 0.5,
|
||||
py: 0,
|
||||
color: "#7c3aed",
|
||||
fontSize: "0.72rem",
|
||||
}}
|
||||
>
|
||||
定位全部
|
||||
</Button>
|
||||
</Box>
|
||||
) : null}
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user