Исправлена работа переходов на документы и операции по телеметрии

This commit is contained in:
Александр Сироткин 2022-02-07 15:18:19 +05:00
parent 374eaaef21
commit 2667a39361
2 changed files with 8 additions and 7 deletions

View File

@ -1,9 +1,10 @@
import { join } from 'path'
import { memo } from 'react'
import { Layout, Menu } from 'antd'
import { FolderOutlined } from '@ant-design/icons'
import { Switch, useParams } from 'react-router-dom'
import { PrivateDefaultRoute, PrivateMenuItem, PrivateRoute } from '@components/Private'
import { PrivateDefaultRoute, PrivateMenuItemLink, PrivateRoute } from '@components/Private'
import DocumentsTemplate from './DocumentsTemplate'
@ -30,7 +31,7 @@ export const MenuDocuments = memo(({ idWell }) => {
<>
<Menu mode={'horizontal'} selectable={true} className={'well_menu'} selectedKeys={[category]}>
{documentCategories.map(category => (
<PrivateMenuItem.Link
<PrivateMenuItemLink
root={root}
key={`${category.key}`}
path={`${category.key}`}
@ -44,11 +45,11 @@ export const MenuDocuments = memo(({ idWell }) => {
<Content className={'site-layout-background'}>
<Switch>
{documentCategories.map(category => (
<PrivateRoute path={`${root}/${category.key}`} key={`${category.key}`}>
<PrivateRoute path={join(root, category.key)} key={`${category.key}`}>
<DocumentsTemplate idCategory={category.id} idWell={idWell} />
</PrivateRoute>
))}
<PrivateDefaultRoute urls={documentCategories.map((cat) => `${root}/${cat.key}`)}/>
<PrivateDefaultRoute urls={documentCategories.map((cat) => join(root, cat.key))}/>
</Switch>
</Content>
</Layout>

View File

@ -61,10 +61,10 @@ export const Well = memo(() => {
<PrivateRoute path={`${rootPath}/archive`}>
<Archive idWell={idWell} />
</PrivateRoute>
<PrivateRoute path={`${rootPath}/telemetryAnalysis/:tab`}>
<PrivateRoute path={`${rootPath}/telemetryAnalysis/:tab?`}>
<TelemetryAnalysis idWell={idWell} />
</PrivateRoute>
<PrivateRoute path={`${rootPath}/document/:category`}>
<PrivateRoute path={`${rootPath}/document/:category?`}>
<Documents idWell={idWell} />
</PrivateRoute>
<PrivateRoute path={`${rootPath}/measure`}>