diff --git a/src/app/OlMap/Controls/StyleEditorPanel.tsx b/src/app/OlMap/Controls/StyleEditorPanel.tsx
index 11a2fcd..80d4044 100644
--- a/src/app/OlMap/Controls/StyleEditorPanel.tsx
+++ b/src/app/OlMap/Controls/StyleEditorPanel.tsx
@@ -28,6 +28,7 @@ import { FlatStyleLike } from "ol/style/flat";
import { calculateClassification } from "@utils/breaks_classification";
import { parseColor } from "@utils/parseColor";
import { VectorTile } from "ol";
+import { useNotification } from "@refinedev/core";
interface StyleConfig {
property: string;
@@ -117,6 +118,8 @@ const StyleEditorPanel: React.FC = () => {
setPipeText,
} = data;
+ const { open, close } = useNotification();
+
const [applyJunctionStyle, setApplyJunctionStyle] = useState(false);
const [applyPipeStyle, setApplyPipeStyle] = useState(false);
const [styleUpdateTrigger, setStyleUpdateTrigger] = useState(0); // 用于触发样式更新的状态
@@ -194,7 +197,7 @@ const StyleEditorPanel: React.FC = () => {
const finalLegendConfig: LegendStyleConfig = legendConfig || {
layerId,
layerName,
- property: styleConfig.property,
+ property: selectedProperty.name,
colors: [],
type: "point",
dimensions: [],
@@ -240,15 +243,22 @@ const StyleEditorPanel: React.FC = () => {
setShowJunctionText(styleConfig.showLabels);
setApplyJunctionStyle(true);
saveLayerStyle(layerId);
+ open?.({
+ type: "success",
+ message: "节点图层样式设置成功,等待数据更新。",
+ });
}
}
if (layerId === "pipes") {
- console.log(styleConfig);
if (setPipeText && setShowPipeText) {
setPipeText(property);
setShowPipeText(styleConfig.showLabels);
setApplyPipeStyle(true);
saveLayerStyle(layerId);
+ open?.({
+ type: "success",
+ message: "管道图层样式设置成功,等待数据更新。",
+ });
}
}
// 触发样式更新
diff --git a/src/app/OlMap/Controls/Timeline.tsx b/src/app/OlMap/Controls/Timeline.tsx
index 3dca1a6..ac08144 100644
--- a/src/app/OlMap/Controls/Timeline.tsx
+++ b/src/app/OlMap/Controls/Timeline.tsx
@@ -33,16 +33,25 @@ const Timeline: React.FC = () => {
return
Loading...
; // 或其他占位符
}
const {
+ currentTime,
+ setCurrentTime,
+ selectedDate,
+ setSelectedDate,
setCurrentJunctionCalData,
setCurrentPipeCalData,
junctionText,
pipeText,
} = data;
+ if (
+ setCurrentTime === undefined ||
+ currentTime === undefined ||
+ selectedDate === undefined ||
+ setSelectedDate === undefined
+ ) {
+ return Loading...
; // 或其他占位符
+ }
const { open, close } = useNotification();
- const [currentTime, setCurrentTime] = useState(0); // 分钟数 (0-1439)
- const [selectedDate, setSelectedDate] = useState(new Date("2025-9-17"));
- // const [selectedDate, setSelectedDate] = useState(new Date()); // 默认今天
const [isPlaying, setIsPlaying] = useState(false);
const [playInterval, setPlayInterval] = useState(5000); // 毫秒
const [calculatedInterval, setCalculatedInterval] = useState(1440); // 分钟
@@ -51,62 +60,79 @@ const Timeline: React.FC = () => {
const intervalRef = useRef(null);
const timelineRef = useRef(null);
// 添加缓存引用
- const cacheRef = useRef<
- Map
- >(new Map());
+ const nodeCacheRef = useRef