asb_cloud_front/src/pages/Well.jsx

89 lines
3.9 KiB
React
Raw Normal View History

2022-03-18 19:40:52 +05:00
import { memo, useMemo } from 'react'
2021-08-27 14:21:48 +05:00
import {
FolderOutlined,
FundViewOutlined,
FilePdfOutlined,
2021-09-01 15:55:23 +05:00
ExperimentOutlined,
DeploymentUnitOutlined,
} from '@ant-design/icons'
import { Layout, Menu } from 'antd'
import { Switch, useParams } from 'react-router-dom'
2022-01-25 02:00:07 +05:00
import { PrivateRoute, PrivateDefaultRoute, PrivateMenuItem } from '@components/Private'
2022-01-25 02:00:07 +05:00
import Measure from './Measure'
import Reports from './Reports'
import Analytics from './Analytics'
2022-01-25 02:00:07 +05:00
import Documents from './Documents'
import Telemetry from './Telemetry'
import WellOperations from './WellOperations'
2022-01-25 02:00:07 +05:00
import DrillingProgram from './DrillingProgram'
import TelemetryAnalysis from './TelemetryAnalysis'
2021-04-16 15:50:01 +05:00
import '@styles/index.css'
const { Content } = Layout
2021-04-16 15:50:01 +05:00
export const Well = memo(() => {
const { idWell, tab } = useParams()
2022-03-18 19:40:52 +05:00
const rootPath = useMemo(() => `/well/${idWell}`, [idWell])
return (
<Layout>
<Menu mode={'horizontal'} selectable={true} selectedKeys={[tab]} className={'well_menu'}>
<PrivateMenuItem.Link root={rootPath} key={'telemetry'} path={'telemetry'} icon={<FundViewOutlined />} title={'Телеметрия'}/>
<PrivateMenuItem.Link root={rootPath} key={'reports'} path={'reports'} icon={<FilePdfOutlined />} title={'Рапорта'} />
<PrivateMenuItem.Link root={rootPath} key={'analytics'} path={'analytics'} icon={<DeploymentUnitOutlined />} title={'Аналитика'} />
<PrivateMenuItem.Link root={rootPath} key={'operations'} path={'operations'} icon={<FolderOutlined />} title={'Операции по скважине'} />
{/* <PrivateMenuItem.Link root={rootPath} key={'telemetryAnalysis'} path={'telemetryAnalysis'} icon={<FundProjectionScreenOutlined />} title={'Операции по телеметрии'} /> */}
<PrivateMenuItem.Link root={rootPath} key={'document'} path={'document'} icon={<FolderOutlined />} title={'Документы'} />
<PrivateMenuItem.Link root={rootPath} key={'measure'} path={'measure'} icon={<ExperimentOutlined />} title={'Измерения'} />
<PrivateMenuItem.Link root={rootPath} key={'drillingProgram'} path={'drillingProgram'} icon={<FolderOutlined />} title={'Программа бурения'} />
</Menu>
<Layout>
<Content className={'site-layout-background'}>
<Switch>
<PrivateRoute path={`${rootPath}/telemetry/:tab?`}>
<Telemetry idWell={idWell} />
</PrivateRoute>
<PrivateRoute path={`${rootPath}/reports/:tab?`}>
<Reports idWell={idWell} />
</PrivateRoute>
<PrivateRoute path={`${rootPath}/analytics/:tab?`}>
<Analytics idWell={idWell} rootPath={`${rootPath}/analytics`}/>
</PrivateRoute>
<PrivateRoute path={`${rootPath}/operations/:tab?`}>
<WellOperations idWell={idWell} />
</PrivateRoute>
<PrivateRoute path={`${rootPath}/telemetryAnalysis/:tab?`}>
<TelemetryAnalysis idWell={idWell} />
</PrivateRoute>
<PrivateRoute path={`${rootPath}/document/:category?`}>
<Documents idWell={idWell} />
</PrivateRoute>
<PrivateRoute path={`${rootPath}/measure`}>
<Measure idWell={idWell}/>
</PrivateRoute>
<PrivateRoute path={`${rootPath}/drillingProgram`}>
<DrillingProgram idWell={idWell}/>
</PrivateRoute>
<PrivateDefaultRoute urls={[
`${rootPath}/telemetry`,
`${rootPath}/report`,
`${rootPath}/analytics`,
`${rootPath}/operations`,
`${rootPath}/telemetryAnalysis`,
`${rootPath}/document`,
`${rootPath}/measure`,
`${rootPath}/drillingProgram`,
]}/>
</Switch>
</Content>
</Layout>
</Layout>
)
})
2022-01-25 02:00:07 +05:00
export default Well