This commit is contained in:
Фролов 2021-08-13 11:37:54 +05:00
parent 131b5bce81
commit 7ea9d8a393
13 changed files with 33 additions and 121 deletions

View File

@ -1,19 +0,0 @@
let date = new Date().toLocaleString()
export default function Disposition() {
return (
<>
<h1 style={{textAlign: "center"}}>Распоряжение</h1>
<p style={{textAlign: "justify"}}>
Текст
</p>
<p style={{textAlign: "right"}}><i>Ф.И.О.</i></p>
<p style={{textAlign: "right"}}><i>Должность</i></p>
<p style={{textAlign: "right"}}><i>Компания</i></p>
<p style={{textAlign: "right"}}><b>{date}</b></p>
</>
)
}

View File

@ -1,35 +0,0 @@
import React, { useMemo, useState } from "react";
export default function MessageFilter() {
return (
<div className="App">
<List words={["apple", "potato"]} />
</div>
)
}
function List({ words }) {
const [searchString, setSearchString] = useState("")
function handleChange(e) {
setSearchString(e.target.value)
}
const filteredWords = useMemo(() => {
if (!searchString) {
return words
}
return words.filter((w) => w.includes(searchString))
}, [searchString, words])
return (
<>
<input type="text" onChange={handleChange} />
<ul>
{filteredWords.map((word, i) => (
<li key={i}>{word}</li>
))}
</ul>
</>
)
}

View File

View File

@ -8,6 +8,7 @@ const styleCasing = {
...styleBase, ...styleBase,
fill: "#808080", fill: "#808080",
}; };
const styleGround = { const styleGround = {
...styleBase, ...styleBase,
fill: "#deaa87", fill: "#deaa87",

View File

@ -1,20 +1,17 @@
import {useState, useEffect} from "react"
import {Table, DatePicker, Button, Modal, ConfigProvider} from 'antd' import {Table, DatePicker, Button, Modal, ConfigProvider} from 'antd'
import { UploadOutlined } from '@ant-design/icons' import { UploadOutlined } from '@ant-design/icons'
import DocumentCreationForm from './modalWindows/DocumentCreationForm'
import { FileService } from '../services/api'
import {useState, useEffect} from "react"
import { useParams } from "react-router-dom"
import notify from './notify'
import LoaderPortal from './LoaderPortal'
import locale from "antd/lib/locale/ru_RU" import locale from "antd/lib/locale/ru_RU"
import moment from 'moment' import moment from 'moment'
import DocumentCreationForm from '../components/modalWindows/DocumentCreationForm'
import { FileService } from '../services/api'
import notify from '../components/notify'
import LoaderPortal from '../components/LoaderPortal'
const pageSize = 12 const pageSize = 12
const {RangePicker} = DatePicker; const {RangePicker} = DatePicker;
export default function Documents({selectedFileCategory}) { export default function Documents({selectedFileCategory, idWell}) {
let {id} = useParams()
const [page, setPage] = useState(1) const [page, setPage] = useState(1)
const [range, setRange] = useState([]) const [range, setRange] = useState([])
const [pagination, setPagination] = useState(null) const [pagination, setPagination] = useState(null)
@ -31,7 +28,7 @@ export default function Documents({selectedFileCategory}) {
try { try {
setShowLoader(true) setShowLoader(true)
await fetch(`/api/files/${id}/${row.id}`, { await fetch(`/api/files/${idWell}/${row.id}`, {
headers: { headers: {
Authorization: 'Bearer ' + localStorage['token'] Authorization: 'Bearer ' + localStorage['token']
} }
@ -100,7 +97,7 @@ export default function Documents({selectedFileCategory}) {
} }
await FileService.getFilesInfo( await FileService.getFilesInfo(
`${id}`, `${idWell}`,
(page - 1) * pageSize, (page - 1) * pageSize,
pageSize, pageSize,
selectedFileCategory, selectedFileCategory,
@ -125,12 +122,12 @@ export default function Documents({selectedFileCategory}) {
} }
) )
} catch (ex) { } catch (ex) {
notify(`Не удалось загрузить файлы по скважине "${id}"`, 'error') notify(`Не удалось загрузить файлы по скважине "${idWell}"`, 'error')
console.log(ex) console.log(ex)
} }
} }
GetDocuments() GetDocuments()
}, [id, range, page, selectedFileCategory, isTableUpdating]) }, [idWell, range, page, selectedFileCategory, isTableUpdating])
return ( return (
<div> <div>

View File

@ -1,4 +1,4 @@
import Documents from "../components/Documents" import Documents from "./Documents"
export default function FluidService({selectedFileCategory}) { export default function FluidService({selectedFileCategory}) {

View File

@ -1,18 +1,14 @@
import {Button, Modal, Checkbox } from "antd"; import {Button, Modal } from "antd";
import {DrillingFluid} from "../components/modalWindows/DrillingFluid"; import {DrillingFluid} from "../components/modalWindows/DrillingFluid";
import {useState} from "react"; import {useState} from "react";
import {SludgeDiagram} from "../components/modalWindows/MudDiagram"; import {SludgeDiagram} from "../components/modalWindows/MudDiagram";
import {Nnb} from "../components/modalWindows/Nnb" import {Nnb} from "../components/modalWindows/Nnb"
import Disposition from "../components/Disposition";
export default function LastData(/*{idWell}*/) {
export default function LastData() {
const [tableVisible, setCementTableVisible] = useState(false) const [tableVisible, setCementTableVisible] = useState(false)
const [tableSludgeVisible, setTableSludgeVisible] = useState(false) const [tableSludgeVisible, setTableSludgeVisible] = useState(false)
const [tableNNBVisible, setTableNNBVisible] = useState(false) const [tableNNBVisible, setTableNNBVisible] = useState(false)
const [dispositionVisible, setDispositionVisible] = useState(false)
//const [loader, setLoader] = useState(false)
return ( return (
<> <>
@ -68,31 +64,5 @@ export default function LastData() {
> >
<Nnb/> <Nnb/>
</Modal> </Modal>
<Button type="primary" onClick={() => setDispositionVisible(true)} style={{marginLeft: "5px"}}>
Распоряжение
</Button>
<Modal
title='Распоряжение'
centered
visible={dispositionVisible}
onOk={() => setDispositionVisible(false)}
onCancel={() => setDispositionVisible(false)}
width={850}
okText='Ок'
cancelText='Отмена'
footer={[
<Checkbox style={{marginRight: '10px'}}>Принять распоряжение</Checkbox>,
<Button key="submit" type="secondary"
onClick={() => setDispositionVisible(false)}>
Отмена
</Button>,
<Button key="submit" type="primary"
onClick={() => setDispositionVisible(false)}>
Ок
</Button>
]}
>
<Disposition/>
</Modal>
</>) </>)
} }

View File

@ -8,7 +8,7 @@ export default function Main() {
return ( return (
<Switch> <Switch>
<Route path="/well/:id/"> <Route path="/well/:idWell/">
<LayoutPortal> <LayoutPortal>
<Well/> <Well/>
</LayoutPortal> </LayoutPortal>

View File

@ -1,17 +1,16 @@
import { useState, useEffect } from "react";
import {Layout, Menu} from "antd"; import {Layout, Menu} from "antd";
import {FolderOutlined} from "@ant-design/icons"; import {FolderOutlined} from "@ant-design/icons";
import {Link, Route, Switch, useParams, useLocation} from "react-router-dom"; import {Link, Route, Switch, useLocation} from "react-router-dom";
import Documents from "../components/Documents"; import Documents from "./Documents";
import LastData from '../pages/LastData' import LastData from './LastData'
import { useState, useEffect } from "react";
const { Content } = Layout const { Content } = Layout
export default function MenuDocuments() { export default function MenuDocuments({idWell}) {
let { id } = useParams()
let currentPath = useLocation().pathname let currentPath = useLocation().pathname
const rootPath = `/well/${id}` const rootPath = `/well/${idWell}`
const [selectedElement, setSelectedElement] = useState('fluidService') const [selectedElement, setSelectedElement] = useState('fluidService')

View File

@ -1,5 +1,5 @@
import {Row, Col} from 'antd' import {Row, Col} from 'antd'
import Documents from '../../components/Documents' import Documents from '../Documents'
import '../../styles/equipment_details.css' import '../../styles/equipment_details.css'
export default function EquipmentDetails({id, equipmentTimers, equipmentSensors}) { export default function EquipmentDetails({id, equipmentTimers, equipmentSensors}) {

View File

@ -138,7 +138,6 @@ const defaultChartInterval = '600'
export default function TelemetryView({idWell}) { export default function TelemetryView({idWell}) {
const [saubData, setSaubData] = useState([]) const [saubData, setSaubData] = useState([])
const [chartInterval, setChartInterval] = useState(defaultChartInterval) const [chartInterval, setChartInterval] = useState(defaultChartInterval)
const [loader, setLoader] = useState(false) const [loader, setLoader] = useState(false)
const options = timePeriodCollection.map((line) => <Option key={line.value}>{line.label}</Option>) const options = timePeriodCollection.map((line) => <Option key={line.value}>{line.label}</Option>)

View File

@ -1,20 +1,20 @@
import {Layout, Menu} from "antd"; import {Layout, Menu} from "antd";
import {FolderOutlined, FundViewOutlined} from "@ant-design/icons"; import {FolderOutlined, FundViewOutlined} from "@ant-design/icons";
import {Link, Redirect, Route, Switch, useParams} from "react-router-dom"; import {Link, Redirect, Route, Switch, useParams} from "react-router-dom";
import Archive from "../pages/Archive"; import TelemetryView from "./TelemetryView";
import Messages from "../pages/Messages"; import Messages from "../pages/Messages";
import Report from "../pages/Report"; import Report from "../pages/Report";
import Archive from "../pages/Archive";
import Analysis from "../pages/Analysis"; import Analysis from "../pages/Analysis";
import WellAnalysis from "../pages/WellAnalysis"; import WellAnalysis from "../pages/WellAnalysis";
import TelemetryView from "./TelemetryView"; import MenuDocuments from "./MenuDocuments";
import MenuDocuments from "../components/MenuDocuments";
import WellStat from "./WellStat" import WellStat from "./WellStat"
import Smbo from "./Smbo" import Smbo from "./Smbo"
const { Content } = Layout const { Content } = Layout
export default function Well() { export default function Well() {
let { id: idWell } = useParams() let { idWell } = useParams()
const rootPath = `/well/${idWell}` const rootPath = `/well/${idWell}`
const {SubMenu} = Menu const {SubMenu} = Menu
@ -86,11 +86,8 @@ export default function Well() {
<Layout> <Layout>
<Content className="site-layout-background"> <Content className="site-layout-background">
<Switch> <Switch>
<Route path="/well/:id/stat"> <Route path="/well/:id/telemetry">
<WellStat idWell={idWell}/> <TelemetryView idWell={idWell}/>
</Route>
<Route path="/well/:id/archive">
<Archive idWell={idWell}/>
</Route> </Route>
<Route path="/well/:id/message"> <Route path="/well/:id/message">
<Messages idWell={idWell}/> <Messages idWell={idWell}/>
@ -101,11 +98,14 @@ export default function Well() {
<Route path="/well/:id/analysis"> <Route path="/well/:id/analysis">
<Analysis idWell={idWell}/> <Analysis idWell={idWell}/>
</Route> </Route>
<Route path="/well/:id/stat">
<WellStat idWell={idWell}/>
</Route>
<Route path="/well/:id/wellAnalysis"> <Route path="/well/:id/wellAnalysis">
<WellAnalysis idWell={idWell}/> <WellAnalysis idWell={idWell}/>
</Route> </Route>
<Route path="/well/:id/telemetry"> <Route path="/well/:id/archive">
<TelemetryView idWell={idWell}/> <Archive idWell={idWell}/>
</Route> </Route>
<Route path="/well/:id/documents"> <Route path="/well/:id/documents">
<MenuDocuments idWell={idWell}/> <MenuDocuments idWell={idWell}/>