feat(sensor): 完善监测点结果编辑与图层切换

This commit is contained in:
2026-08-03 19:00:16 +08:00
parent 5592c27386
commit 5d9c40e454
12 changed files with 463 additions and 127 deletions
@@ -69,6 +69,11 @@ export const getTabIndicatorSx = (tabIndex: number) => ({
},
});
export const getMonitoringLayerVisibility = (tabIndex: number) => ({
editor: tabIndex === 1,
query: tabIndex === 2,
});
interface PreparedSchemeEditorProps
extends React.ComponentProps<typeof SchemeEditor> {
onReady?: () => void;
@@ -126,6 +131,7 @@ const MonitoringPlaceOptimizationPanel: React.FC<
};
const drawerWidth = currentTab === 1 ? 820 : 520;
const layerVisibility = getMonitoringLayerVisibility(currentTab);
const handleSchemeEditorReady = useCallback(() => {
setCurrentTab(1);
@@ -326,7 +332,7 @@ const MonitoringPlaceOptimizationPanel: React.FC<
<PreparedSchemeEditor
scheme={activeScheme}
network={NETWORK_NAME}
active={isOpen && currentTab === 1}
active={layerVisibility.editor}
onSaved={handleSchemeSaved}
onReady={
pendingOpenSchemeId === activeScheme.id
@@ -346,6 +352,7 @@ const MonitoringPlaceOptimizationPanel: React.FC<
<TabPanel value={currentTab} index={2}>
<SchemeQuery
schemes={schemes}
active={layerVisibility.query}
onSchemesChange={setSchemes}
state={queryState}
onStateChange={setQueryState}