asb_cloud_front/src/pages/Well.jsx

103 lines
4.5 KiB
React
Raw Normal View History

import { memo } from 'react'
2021-08-27 14:21:48 +05:00
import {
FolderOutlined,
FundViewOutlined,
AlertOutlined,
FilePdfOutlined,
DatabaseOutlined,
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 Report from './Report'
import Archive from './Archive'
import Measure from './Measure'
2022-01-25 02:00:07 +05:00
import Messages from './Messages'
import Documents from './Documents'
import TelemetryView from './TelemetryView'
import WellOperations from './WellOperations'
2022-01-25 02:00:07 +05:00
import DrillingProgram from './DrillingProgram'
import TelemetryAnalysis from './TelemetryAnalysis'
import WellCompositeEditor from './WellCompositeEditor'
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()
const rootPath = `/well/${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={'message'} path={'message'} icon={<AlertOutlined/>} title={'Сообщения'} />
<PrivateMenuItem.Link root={rootPath} key={'report'} path={'report'} icon={<FilePdfOutlined />} title={'Рапорт'} />
<PrivateMenuItem.Link root={rootPath} key={'composite'} path={'composite'} icon={<DeploymentUnitOutlined />} title={'Аналитика'} />
<PrivateMenuItem.Link root={rootPath} key={'operations'} path={'operations'} icon={<FolderOutlined />} title={'Операции по скважине'} />
<PrivateMenuItem.Link root={rootPath} key={'archive'} path={'archive'} icon={<DatabaseOutlined />} 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`}>
<TelemetryView idWell={idWell} />
</PrivateRoute>
<PrivateRoute path={`${rootPath}/message`}>
<Messages idWell={idWell} />
</PrivateRoute>
<PrivateRoute path={`${rootPath}/report`}>
<Report idWell={idWell} />
</PrivateRoute>
<PrivateRoute path={`${rootPath}/composite/:tab?`}>
<WellCompositeEditor idWell={idWell} rootPath={`${rootPath}/composite`}/>
</PrivateRoute>
<PrivateRoute path={`${rootPath}/operations/:tab?`}>
<WellOperations idWell={idWell} />
</PrivateRoute>
<PrivateRoute path={`${rootPath}/archive`}>
<Archive 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}/message`,
`${rootPath}/report`,
`${rootPath}/composite`,
`${rootPath}/operations`,
`${rootPath}/archive`,
`${rootPath}/telemetryAnalysis`,
`${rootPath}/document`,
`${rootPath}/measure`,
`${rootPath}/drillingProgram`,
]}/>
</Switch>
</Content>
</Layout>
</Layout>
)
})
2022-01-25 02:00:07 +05:00
export default Well