优化工具栏面板关闭逻辑,增强用户体验

This commit is contained in:
2026-04-30 13:42:04 +08:00
parent 85b4f45d4a
commit 24d81e04e0
+21 -1
View File
@@ -877,7 +877,15 @@ const Toolbar: React.FC<ToolbarProps> = ({
/>
)}
</div>
{showPropertyPanel && <PropertyPanel {...getFeatureProperties()} />}
{showPropertyPanel && (
<PropertyPanel
{...getFeatureProperties()}
onClose={() => {
deactivateTool("info");
setActiveTools((prev) => prev.filter((t) => t !== "info"));
}}
/>
)}
{showDrawPanel && map && <DrawPanel />}
<div style={{ display: showStyleEditor ? "block" : "none" }}>
<StyleEditorPanel
@@ -892,6 +900,10 @@ const Toolbar: React.FC<ToolbarProps> = ({
visible={showHistoryPanel}
start_time={chatPanelTimeRange?.startTime}
end_time={chatPanelTimeRange?.endTime}
onClose={() => {
deactivateTool("history");
setActiveTools((prev) => prev.filter((t) => t !== "history"));
}}
/>
) : HistoryPanel ? (
<HistoryPanel
@@ -936,6 +948,10 @@ const Toolbar: React.FC<ToolbarProps> = ({
type={chatPanelFeatureInfos ? chatPanelType : (queryType as "realtime" | "scheme" | "none")}
start_time={chatPanelTimeRange?.startTime}
end_time={chatPanelTimeRange?.endTime}
onClose={() => {
deactivateTool("history");
setActiveTools((prev) => prev.filter((t) => t !== "history"));
}}
/>
) : (
<HistoryDataPanel
@@ -980,6 +996,10 @@ const Toolbar: React.FC<ToolbarProps> = ({
type={chatPanelFeatureInfos ? chatPanelType : (queryType as "realtime" | "scheme" | "none")}
start_time={chatPanelTimeRange?.startTime}
end_time={chatPanelTimeRange?.endTime}
onClose={() => {
deactivateTool("history");
setActiveTools((prev) => prev.filter((t) => t !== "history"));
}}
/>
))}