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,
fill: "#808080",
};
const styleGround = {
...styleBase,
fill: "#deaa87",

View File

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

View File

@ -1,4 +1,4 @@
import Documents from "../components/Documents"
import Documents from "./Documents"
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 {useState} from "react";
import {SludgeDiagram} from "../components/modalWindows/MudDiagram";
import {Nnb} from "../components/modalWindows/Nnb"
import Disposition from "../components/Disposition";
export default function LastData() {
export default function LastData(/*{idWell}*/) {
const [tableVisible, setCementTableVisible] = useState(false)
const [tableSludgeVisible, setTableSludgeVisible] = useState(false)
const [tableNNBVisible, setTableNNBVisible] = useState(false)
const [dispositionVisible, setDispositionVisible] = useState(false)
//const [loader, setLoader] = useState(false)
return (
<>
@ -68,31 +64,5 @@ export default function LastData() {
>
<Nnb/>
</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 (
<Switch>
<Route path="/well/:id/">
<Route path="/well/:idWell/">
<LayoutPortal>
<Well/>
</LayoutPortal>

View File

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

View File

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

View File

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

View File

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