实现 SCADA 设备列表数据对接;监测点优化,实现传感器定位;爆管分析,属性面板新增计算属性的获取;更新部分图标;爆管分析定位,更改时间轴样式。

This commit is contained in:
JIANG
2025-10-29 16:39:23 +08:00
parent 86e7349c85
commit a5954624a0
22 changed files with 474 additions and 170 deletions

View File

@@ -110,7 +110,7 @@ const AnalysisParameters: React.FC = () => {
new Style({
geometry: new Point(midPointMercator),
image: new Icon({
src: "/icons/burst_pipe_icon.svg",
src: "/icons/burst_pipe.svg",
scale: 0.2,
anchor: [0.5, 1],
}),

View File

@@ -32,14 +32,20 @@ import { config, NETWORK_NAME } from "@config/config";
import { useNotification } from "@refinedev/core";
import { queryFeaturesByIds } from "@/utils/mapQueryService";
import { useMap } from "@app/OlMap/MapComponent";
import * as turf from "@turf/turf";
import { useData, useMap } from "@app/OlMap/MapComponent";
import { GeoJSON } from "ol/format";
import VectorLayer from "ol/layer/Vector";
import VectorSource from "ol/source/Vector";
import { Stroke, Style, Icon } from "ol/style";
import Feature, { FeatureLike } from "ol/Feature";
import { along, lineString, length, toMercator } from "@turf/turf";
import {
along,
lineString,
length,
toMercator,
bbox,
featureCollection,
} from "@turf/turf";
import { Point } from "ol/geom";
import { toLonLat } from "ol/proj";
import Timeline from "@app/OlMap/Controls/Timeline";
@@ -100,7 +106,6 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
{ start: Date; end: Date } | undefined
>();
const [internalSchemes, setInternalSchemes] = useState<SchemeRecord[]>([]);
const [schemeName, setSchemeName] = useState<string>("");
const [loading, setLoading] = useState<boolean>(false);
const [expandedId, setExpandedId] = useState<number | null>(null);
const [mapContainer, setMapContainer] = useState<HTMLElement | null>(null); // 地图容器元素
@@ -108,7 +113,9 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
const { open } = useNotification();
const map = useMap();
const data = useData();
if (!data) return null;
const { schemeName, setSchemeName } = data;
// 使用外部提供的 schemes 或内部状态
const schemes =
externalSchemes !== undefined ? externalSchemes : internalSchemes;
@@ -183,9 +190,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
geojsonFormat.writeFeatureObject(feature)
);
const extent = turf.bbox(
turf.featureCollection(geojsonFeatures as any)
);
const extent = bbox(featureCollection(geojsonFeatures as any));
if (extent) {
map?.getView().fit(extent, { maxZoom: 18, duration: 1000 });
@@ -211,7 +216,9 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
);
setSelectedDate(schemeDate);
setTimeRange({ start, end });
setSchemeName(scheme.schemeName);
if (setSchemeName) {
setSchemeName(scheme.schemeName);
}
handleLocatePipes(burstPipeIds);
}
};
@@ -270,7 +277,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
new Style({
geometry: new Point(midPointMercator),
image: new Icon({
src: "/icons/burst_pipe_icon.svg",
src: "/icons/burst_pipe.svg",
scale: 0.2,
anchor: [0.5, 1],
}),
@@ -283,6 +290,8 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
const highlightLayer = new VectorLayer({
source: new VectorSource(),
style: burstPipeStyle,
maxZoom: 24,
minZoom: 12,
properties: {
name: "爆管管段高亮",
value: "burst_pipe_highlight",