修复 lint warnings

This commit is contained in:
JIANG
2026-03-10 18:15:11 +08:00
parent 73201ae44e
commit f0f9d3f4f9
19 changed files with 225 additions and 200 deletions
@@ -117,7 +117,7 @@ const Timeline: React.FC<TimelineProps> = ({
setCurrentYear(value);
}, 500); // 500ms 防抖延迟
},
[minTime, maxTime],
[minTime, maxTime, setCurrentYear],
);
// 播放控制
@@ -133,7 +133,7 @@ const Timeline: React.FC<TimelineProps> = ({
});
}, playInterval);
}
}, [isPlaying, playInterval]);
}, [isPlaying, playInterval, maxTime, minTime, setCurrentYear]);
const handlePause = useCallback(() => {
setIsPlaying(false);
@@ -172,7 +172,7 @@ const Timeline: React.FC<TimelineProps> = ({
if (next < minTime) next += maxTime - minTime + 1;
return next;
});
}, [minTime, maxTime]);
}, [minTime, maxTime, setCurrentYear]);
const handleStepForward = useCallback(() => {
setCurrentYear((prev: number) => {
@@ -180,7 +180,7 @@ const Timeline: React.FC<TimelineProps> = ({
if (next > maxTime) next = minTime;
return next;
});
}, [minTime, maxTime]);
}, [minTime, maxTime, setCurrentYear]);
// 日期时间选择处理
const handleDateTimeChange = useCallback((newDate: Date | null) => {
@@ -207,7 +207,7 @@ const Timeline: React.FC<TimelineProps> = ({
}, newInterval);
}
},
[isPlaying],
[isPlaying, maxTime, minTime, setCurrentYear],
);
// 组件加载时设置初始时间为当前时间的最近15分钟
@@ -372,7 +372,7 @@ const Timeline: React.FC<TimelineProps> = ({
if (predictionResults.length > 0 && pipeLayer) {
applyPipeHealthStyle();
}
}, [applyPipeHealthStyle]);
}, [applyPipeHealthStyle, pipeLayer, predictionResults.length]);
// 这里防止地图缩放时,瓦片重新加载引起的属性更新出错
useEffect(() => {