Исправлена работа крошек

This commit is contained in:
Александр Сироткин 2022-11-21 12:04:48 +05:00
parent 16fb37910f
commit 51ac260c74
4 changed files with 12 additions and 18 deletions

View File

@ -74,8 +74,8 @@ const params = [
{ label: 'Рот.', unit: 'об/мин', accessorName: 'rotorSpeed', iconRenderer },
{ label: 'Долото', unit: 'м', accessorName: 'bitDepth', iconRenderer, format: 2 },
{ label: 'Забой', unit: 'м', accessorName: 'wellDepth', iconRenderer, format: 2 },
{ label: 'Расход', unit: 'м³/ч', accessorName: 'flow', iconRenderer },
{ label: 'Расход х.х.', unit: 'м³/ч', accessorName: 'flowIdle', iconRenderer },
{ label: 'Расход', unit: 'л/ч', accessorName: 'flow', iconRenderer },
{ label: 'Расход х.х.', unit: 'л/ч', accessorName: 'flowIdle', iconRenderer },
{ label: 'MSE', unit: '%', accessorName: 'mse', format: 2 },
]

View File

@ -138,11 +138,9 @@ export const WellOperationsEditor = memo(({ idType, showNpt, ...other }) => {
)
}, [well])
useEffect(() => {
setTopRightBlock(
useEffect(() => setTopRightBlock((well) => (
<ImportExportBar well={well} onImported={updateOperations} />
)
}, [well, setTopRightBlock, updateOperations])
)), [setTopRightBlock, updateOperations])
return (
<LoaderPortal show={showLoader}>

View File

@ -229,14 +229,12 @@ const Tvd = memo(({ well: givenWell, title, ...other }) => {
)
}, [well])
useEffect(() => {
setTopRightBlock(
useEffect(() => setTopRightBlock((well) => (
<div style={{ display: 'flex', gap: 15 }}>
<StatExport well={well} />
<NetGraphExport well={well} />
</div>
)
}, [well, setTopRightBlock])
)), [setTopRightBlock])
return (
<div className={'container tvd-page'} {...other}>

View File

@ -78,11 +78,9 @@ const Well = memo(() => {
useEffect(() => setLayoutProps({
sider: <NavigationMenu idWell={well.id} />,
breadcrumb: makeMenuBreadcrumbItems(menuItems, location.pathname, /^\/well\/[0-9]+\//),
topRightBlock: topRightBlock,
topRightBlock: topRightBlock?.(well),
}), [well, location.pathname, setLayoutProps, topRightBlock])
useEffect(() => setTopRightBlock(undefined), [location])
return (
<RootPathContext.Provider value={rootPath}>
<WellContext.Provider value={[well, updateWell]}>