删除多余的依赖变量

This commit is contained in:
JIANG
2025-11-24 15:23:19 +08:00
parent b4aef962dd
commit 543725ee1f
2 changed files with 18 additions and 27 deletions

View File

@@ -188,8 +188,8 @@ const StyleEditorPanel: React.FC<StyleEditorPanelProps> = ({
currentPipeCalData,
junctionText,
pipeText,
setShowJunctionText,
setShowPipeText,
setShowJunctionTextLayer,
setShowPipeTextLayer,
setShowContourLayer,
setJunctionText,
setPipeText,
@@ -354,9 +354,9 @@ const StyleEditorPanel: React.FC<StyleEditorPanelProps> = ({
}
// 更新文字标签设置
if (layerId === "junctions") {
if (setJunctionText && setShowJunctionText) {
if (setJunctionText && setShowJunctionTextLayer) {
setJunctionText(property);
setShowJunctionText(styleConfig.showLabels);
setShowJunctionTextLayer(styleConfig.showLabels);
setApplyJunctionStyle(true);
saveLayerStyle(layerId);
open?.({
@@ -366,9 +366,9 @@ const StyleEditorPanel: React.FC<StyleEditorPanelProps> = ({
}
}
if (layerId === "pipes") {
if (setPipeText && setShowPipeText) {
if (setPipeText && setShowPipeTextLayer) {
setPipeText(property);
setShowPipeText(styleConfig.showLabels);
setShowPipeTextLayer(styleConfig.showLabels);
setApplyPipeStyle(true);
saveLayerStyle(layerId);
open?.({
@@ -414,7 +414,6 @@ const StyleEditorPanel: React.FC<StyleEditorPanelProps> = ({
// 如果不足则补齐最后一个值
while (breaks.length < desired)
breaks.push(breaks[breaks.length - 1] ?? 0);
console.log(breaks);
} else {
const calc = calculateClassification(
currentJunctionCalData.map((d) => d.value),
@@ -676,11 +675,11 @@ const StyleEditorPanel: React.FC<StyleEditorPanelProps> = ({
// 重置样式应用状态
if (layerId === "junctions") {
setApplyJunctionStyle(false);
if (setShowJunctionText) setShowJunctionText(false);
if (setShowJunctionTextLayer) setShowJunctionTextLayer(false);
if (setJunctionText) setJunctionText("");
} else if (layerId === "pipes") {
setApplyPipeStyle(false);
if (setShowPipeText) setShowPipeText(false);
if (setShowPipeTextLayer) setShowPipeTextLayer(false);
if (setPipeText) setPipeText("");
}
}