asb_cloud_front/src/pages/Well.jsx

118 lines
4.3 KiB
React
Raw Normal View History

2021-08-17 10:46:28 +05:00
import { Layout, Menu } from "antd";
2021-08-27 14:21:48 +05:00
import {
FolderOutlined,
FundViewOutlined,
AlertOutlined,
FilePdfOutlined,
DatabaseOutlined,
2021-09-01 15:55:23 +05:00
ExperimentOutlined,
FundProjectionScreenOutlined
2021-08-27 14:21:48 +05:00
} from "@ant-design/icons";
2021-08-17 10:46:28 +05:00
import { Link, Redirect, Route, Switch, useParams } from "react-router-dom";
2021-08-13 11:37:54 +05:00
import TelemetryView from "./TelemetryView";
2021-08-18 18:01:46 +05:00
import Messages from "./Messages";
import Report from "./Report";
2021-08-18 18:01:46 +05:00
import Archive from "./Archive";
import Documents from "./Documents";
2021-08-28 22:32:13 +05:00
import Measure from "./Measure";
2021-08-17 10:46:28 +05:00
import { makeMenuItems } from "./Documents/menuItems";
2021-08-18 18:01:46 +05:00
import WellOperations from "./WellOperations";
import DrillingProgram from "./Documents/DrillingProgram";
import TelemetryAnalysis from "./TelemetryAnalysis"
import {PrivateMenuItem} from '../components/Private'
2021-04-16 15:50:01 +05:00
2021-08-17 10:46:28 +05:00
const { Content } = Layout;
2021-04-16 15:50:01 +05:00
export default function Well() {
2021-08-27 14:21:48 +05:00
let { idWell, tab } = useParams();
2021-08-17 10:46:28 +05:00
const rootPath = `/well/${idWell}`;
2021-08-17 10:46:28 +05:00
const { SubMenu } = Menu;
return <Layout>
2021-08-27 14:21:48 +05:00
<Menu
mode="horizontal"
selectable={true}
selectedKeys={[tab]}
className="well_menu"
>
<PrivateMenuItem key="telemetry" icon={<FundViewOutlined />}>
2021-08-18 18:01:46 +05:00
<Link to={`${rootPath}/telemetry`}>Мониторинг</Link>
</PrivateMenuItem>
<PrivateMenuItem key="message" icon={<AlertOutlined/>} roles={[]}>
<Link to={`${rootPath}/message`}>Сообщения</Link>
</PrivateMenuItem>
<PrivateMenuItem key="report" icon={<FilePdfOutlined />}>
2021-08-18 18:01:46 +05:00
<Link to={`${rootPath}/report`}>Рапорт</Link>
</PrivateMenuItem>
<PrivateMenuItem key="operations" icon={<FolderOutlined />}>
2021-08-27 14:21:48 +05:00
<Link to={`${rootPath}/operations/plan`}>Операции по скважине</Link>
</PrivateMenuItem>
<PrivateMenuItem key="archive" icon={<DatabaseOutlined />}>
2021-08-18 18:01:46 +05:00
<Link to={`${rootPath}/archive`}>Архив</Link>
</PrivateMenuItem>
<PrivateMenuItem key="telemetryAnalysis" icon={<FundProjectionScreenOutlined />}>
<Link to={`${rootPath}/telemetryAnalysis/depthToDay`}>Операции по телеметрии</Link>
</PrivateMenuItem>
2021-08-17 10:46:28 +05:00
<SubMenu
2021-08-27 14:21:48 +05:00
key="document"
2021-08-17 10:46:28 +05:00
title={
<Link
2021-08-27 14:21:48 +05:00
to={`${rootPath}/document/fluidService`}
className="linkDocuments"
>
2021-08-17 10:46:28 +05:00
Документы
</Link>
}
icon={<FolderOutlined />}
selectable={true}
>
2021-08-17 16:46:46 +05:00
{makeMenuItems(rootPath)}
</SubMenu>
<PrivateMenuItem key="measure" icon={<ExperimentOutlined />}>
2021-08-28 22:32:13 +05:00
<Link to={`${rootPath}/measure`}>Измерения</Link>
</PrivateMenuItem>
<PrivateMenuItem key="drillingProgram" icon={<FolderOutlined />}>
2021-08-29 17:32:31 +05:00
<Link to={`${rootPath}/drillingProgram`}>Программа бурения</Link>
</PrivateMenuItem>
2021-08-17 10:46:28 +05:00
</Menu>
2021-08-17 10:46:28 +05:00
<Layout>
<Content className="site-layout-background">
<Switch>
<Route path="/well/:idWell/telemetry">
<TelemetryView idWell={idWell} />
</Route>
<Route path="/well/:idWell/message">
<Messages idWell={idWell} />
</Route>
<Route path="/well/:idWell/report">
<Report idWell={idWell} />
</Route>
2021-08-18 18:01:46 +05:00
<Route path="/well/:idWell/operations/:tab">
<WellOperations idWell={idWell} />
2021-08-17 10:46:28 +05:00
</Route>
<Route path="/well/:idWell/archive">
<Archive idWell={idWell} />
</Route>
<Route path="/well/:idWell/telemetryAnalysis/:tab">
<TelemetryAnalysis idWell={idWell} />
</Route>
2021-08-17 10:46:28 +05:00
<Route path="/well/:idWell/document/:category">
<Documents idWell={idWell} />
</Route>
2021-08-28 22:32:13 +05:00
<Route path="/well/:id/measure">
<Measure idWell={idWell}/>
2021-08-17 10:46:28 +05:00
</Route>
2021-08-29 17:32:31 +05:00
<Route path="/well/:id/drillingProgram">
<DrillingProgram idWell={idWell}/>
</Route>
2021-08-17 10:46:28 +05:00
<Route path="/">
2021-08-18 18:01:46 +05:00
<Redirect to={`${rootPath}/telemetry`} />
2021-08-17 10:46:28 +05:00
</Route>
</Switch>
</Content>
</Layout>
</Layout>
}