feat(sensor): 完善监测点结果编辑与图层切换
This commit is contained in:
+8
-1
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user