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 },