属性查询面板添加计算值;完善时间轴获取数据的缓存机制;

This commit is contained in:
JIANG
2025-10-17 18:15:09 +08:00
parent 6ddce65445
commit 4e819b20ea
4 changed files with 251 additions and 77 deletions

View File

@@ -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: "管道图层样式设置成功,等待数据更新。",
});
}
}
// 触发样式更新