asb_cloud_front/src/pages/Well.jsx

95 lines
3.3 KiB
React
Raw Normal View History

2021-08-17 10:46:28 +05:00
import { Layout, Menu } from "antd";
2021-08-20 16:33:56 +05:00
import { FolderOutlined, FundViewOutlined, AlertOutlined, FilePdfOutlined, DatabaseOutlined } 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";
import LastData from './LastData'
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";
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-17 10:46:28 +05:00
let { idWell } = useParams();
const rootPath = `/well/${idWell}`;
2021-08-17 10:46:28 +05:00
const { SubMenu } = Menu;
2021-08-17 10:46:28 +05:00
return (
<>
<Layout>
<Menu mode="horizontal" selectable={true} className="well_menu">
<Menu.Item key="1" icon={<FundViewOutlined />}>
2021-08-18 18:01:46 +05:00
<Link to={`${rootPath}/telemetry`}>Мониторинг</Link>
2021-08-17 10:46:28 +05:00
</Menu.Item>
2021-08-20 16:33:56 +05:00
<Menu.Item key="2" icon={<AlertOutlined />}>
2021-08-18 18:01:46 +05:00
<Link to={`${rootPath}/message`}>Сообщения</Link>
2021-08-17 10:46:28 +05:00
</Menu.Item>
2021-08-20 16:33:56 +05:00
<Menu.Item key="3" icon={<FilePdfOutlined />}>
2021-08-18 18:01:46 +05:00
<Link to={`${rootPath}/report`}>Рапорт</Link>
2021-08-17 10:46:28 +05:00
</Menu.Item>
<Menu.Item key="5" icon={<FolderOutlined />}>
2021-08-18 18:01:46 +05:00
<Link to={`${rootPath}/operations/plan`}>
2021-08-17 10:46:28 +05:00
Операции по скважине
</Link>
</Menu.Item>
2021-08-20 16:33:56 +05:00
<Menu.Item key="7" icon={<DatabaseOutlined/>}>
2021-08-18 18:01:46 +05:00
<Link to={`${rootPath}/archive`}>Архив</Link>
2021-08-17 10:46:28 +05:00
</Menu.Item>
<SubMenu
key="documentsSub"
2021-08-17 10:46:28 +05:00
title={
<Link
2021-08-18 18:01:46 +05:00
to={`${rootPath}/document/fluidService` }
2021-08-17 16:46:46 +05:00
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>
2021-08-17 10:46:28 +05:00
<Menu.Item key="9" icon={<FolderOutlined />}>
2021-08-18 18:01:46 +05:00
<Link to={`${rootPath}/lastData`}>Последние данные</Link>
2021-08-17 10:46:28 +05:00
</Menu.Item>
</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/document/:category">
<Documents idWell={idWell} />
</Route>
<Route path="/well/:id/lastData">
<LastData/>
</Route>
<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>
2021-08-17 10:46:28 +05:00
</>
);
}