新增水质分析功能模块

This commit is contained in:
JIANG
2026-01-30 15:22:53 +08:00
parent c28325e997
commit d584268acd
12 changed files with 346 additions and 238 deletions
@@ -141,6 +141,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
}
});
}, [highlightFeatures]);
// 查询方案
const handleQuery = async () => {
if (!queryAll && !queryDate) return;
@@ -148,7 +149,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
setLoading(true);
try {
const response = await axios.get(
`${config.BACKEND_URL}/api/v1/getallsensorplacements/?network=${network}`
`${config.BACKEND_URL}/api/v1/getallsensorplacements/?network=${network}`,
);
let filteredResults = response.data;
@@ -171,7 +172,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
user: item.username,
create_time: item.create_time,
sensorLocation: item.sensor_location,
}))
})),
);
if (filteredResults.length === 0) {
@@ -206,14 +207,14 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
}
if (sensorIds.length > 0) {
queryFeaturesByIds(sensorIds).then((features) => {
queryFeaturesByIds(sensorIds, "geo_junctions_mat").then((features) => {
if (features.length > 0) {
// 设置高亮要素
setHighlightFeatures(features);
// 将 OpenLayers Feature 转换为 GeoJSON Feature
const geojsonFormat = new GeoJSON();
const geojsonFeatures = features.map((feature) =>
geojsonFormat.writeFeatureObject(feature)
geojsonFormat.writeFeatureObject(feature),
);
const extent = bbox(featureCollection(geojsonFeatures as any));
@@ -376,7 +377,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
size="small"
onClick={() =>
setExpandedId(
expandedId === scheme.id ? null : scheme.id
expandedId === scheme.id ? null : scheme.id,
)
}
color="primary"
@@ -385,7 +386,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
<InfoIcon fontSize="small" />
</IconButton>
</Tooltip>
<Tooltip title="定位">
{/* <Tooltip title="定位">
<IconButton
size="small"
onClick={() => onLocate?.(scheme.id)}
@@ -394,7 +395,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
>
<LocationIcon fontSize="small" />
</IconButton>
</Tooltip>
</Tooltip> */}
</Box>
</Box>
@@ -466,7 +467,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
className="font-medium text-gray-900"
>
{moment(scheme.create_time).format(
"YYYY-MM-DD HH:mm"
"YYYY-MM-DD HH:mm",
)}
</Typography>
</Box>
@@ -500,7 +501,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
>
{sensorId}
</Link>
)
),
)}
</Box>
</Box>