From f34d81c9337673d15de3b03677a859514a0ebb69 Mon Sep 17 00:00:00 2001 From: Huarch Date: Mon, 17 Aug 2026 19:36:33 +0800 Subject: [PATCH] =?UTF-8?q?fix(flushing):=20=E5=AF=B9=E9=BD=90=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E9=A1=B9=E7=A9=BA=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/olmap/FlushingAnalysis/AnalysisParameters.tsx | 2 ++ src/components/olmap/common/PanelEmptyState.test.tsx | 4 ++++ src/components/olmap/common/PanelEmptyState.tsx | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/olmap/FlushingAnalysis/AnalysisParameters.tsx b/src/components/olmap/FlushingAnalysis/AnalysisParameters.tsx index 57f8c8a..9526e4f 100644 --- a/src/components/olmap/FlushingAnalysis/AnalysisParameters.tsx +++ b/src/components/olmap/FlushingAnalysis/AnalysisParameters.tsx @@ -551,6 +551,7 @@ const AnalysisParameters: React.FC = ({ {!drainageNode && ( } title="尚未选择排水节点" description="点击“选择节点”,然后在地图上指定排水点。" @@ -651,6 +652,7 @@ const AnalysisParameters: React.FC = ({ {valves.length === 0 && ( } title="未选择参与阀门" description="无需调整阀门时可跳过,也可点击“选择阀门”添加。" diff --git a/src/components/olmap/common/PanelEmptyState.test.tsx b/src/components/olmap/common/PanelEmptyState.test.tsx index 5471f9d..6f913ad 100644 --- a/src/components/olmap/common/PanelEmptyState.test.tsx +++ b/src/components/olmap/common/PanelEmptyState.test.tsx @@ -36,11 +36,15 @@ describe("PanelEmptyState", () => { render( , ); expect(screen.getByText("尚未选择阀门")).toBeInTheDocument(); + expect(screen.getByRole("status")).toHaveStyle({ + justifyContent: "flex-start", + }); }); }); diff --git a/src/components/olmap/common/PanelEmptyState.tsx b/src/components/olmap/common/PanelEmptyState.tsx index 57d95bb..bc97445 100644 --- a/src/components/olmap/common/PanelEmptyState.tsx +++ b/src/components/olmap/common/PanelEmptyState.tsx @@ -10,6 +10,7 @@ export interface PanelEmptyStateProps { title: string; description?: string; variant?: "panel" | "compact"; + horizontalAlign?: "center" | "start"; } const PanelEmptyState = ({ @@ -17,6 +18,7 @@ const PanelEmptyState = ({ title, description, variant = "panel", + horizontalAlign = "center", }: PanelEmptyStateProps) => { const compact = variant === "compact"; @@ -32,7 +34,8 @@ const PanelEmptyState = ({ display: "flex", flexDirection: compact ? "row" : { xs: "column", sm: "row" }, alignItems: "center", - justifyContent: "center", + justifyContent: + horizontalAlign === "start" ? "flex-start" : "center", gap: compact ? 1.5 : { xs: 1.75, sm: 2.5 }, px: compact ? 1.5 : { xs: 2, sm: 4 }, py: compact ? 1.25 : { xs: 4, sm: 5 },