重新设计弹出组件的层次布局,非常驻窗口将置于顶部;新增变量控制水流图层的显示;完善历史数据面板的设计

This commit is contained in:
JIANG
2025-12-16 16:08:29 +08:00
parent 715ec9ead0
commit 3aa68d796b
10 changed files with 53 additions and 78 deletions

View File

@@ -52,8 +52,9 @@ interface DataContextType {
setShowJunctionTextLayer?: React.Dispatch<React.SetStateAction<boolean>>;
setShowPipeTextLayer?: React.Dispatch<React.SetStateAction<boolean>>;
setShowContourLayer?: React.Dispatch<React.SetStateAction<boolean>>;
flowAnimation?: React.RefObject<boolean>;
// flowAnimation?: React.RefObject<boolean>;
isContourLayerAvailable?: boolean;
setShowWaterflowLayer?: React.Dispatch<React.SetStateAction<boolean>>;
setContourLayerAvailable?: React.Dispatch<React.SetStateAction<boolean>>;
isWaterflowLayerAvailable?: boolean;
setWaterflowLayerAvailable?: React.Dispatch<React.SetStateAction<boolean>>;
@@ -124,7 +125,8 @@ const MapComponent: React.FC<MapComponentProps> = ({ children }) => {
const flowAnimation = useRef(false); // 添加动画控制标志
const [isContourLayerAvailable, setContourLayerAvailable] = useState(false); // 控制等高线图层显示
const [isWaterflowLayerAvailable, setWaterflowLayerAvailable] =
useState(false); // 控制等高线图层显示
useState(true); // 控制等高线图层显示
const [showWaterflowLayer, setShowWaterflowLayer] = useState(false); // 控制等高线图层显示
const [currentZoom, setCurrentZoom] = useState(11); // 当前缩放级别
// 防抖更新函数
@@ -867,6 +869,7 @@ const MapComponent: React.FC<MapComponentProps> = ({ children }) => {
opacity: 0.8,
visible:
isWaterflowLayerAvailable &&
showWaterflowLayer &&
flowAnimation.current &&
currentZoom >= 12 &&
currentZoom <= 24,
@@ -898,6 +901,7 @@ const MapComponent: React.FC<MapComponentProps> = ({ children }) => {
pipeText,
pipeData.length,
isWaterflowLayerAvailable,
showWaterflowLayer,
]);
// 计算值更新时,更新 junctionData 和 pipeData
@@ -967,11 +971,12 @@ const MapComponent: React.FC<MapComponentProps> = ({ children }) => {
setShowJunctionTextLayer,
setShowPipeTextLayer,
setShowContourLayer,
flowAnimation,
// flowAnimation,
isContourLayerAvailable,
setContourLayerAvailable,
isWaterflowLayerAvailable,
setWaterflowLayerAvailable,
setShowWaterflowLayer,
setJunctionText,
setPipeText,
junctionText,