From 98a87b3f3ad65e71afce0be63f9093f2a787114b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=80=D0=BE=D0=BB=D0=BE=D0=B2?= Date: Thu, 19 Aug 2021 17:51:56 +0500 Subject: [PATCH] Grouping well operations into folder --- .../WellOperationsEditor.jsx | 27 +++++-------------- src/pages/WellOperations/dictionary.js | 15 +++++++++++ .../index.jsx} | 8 +++--- 3 files changed, 26 insertions(+), 24 deletions(-) rename src/pages/{ => WellOperations}/WellOperationsEditor.jsx (86%) create mode 100644 src/pages/WellOperations/dictionary.js rename src/pages/{WellOperations.jsx => WellOperations/index.jsx} (87%) diff --git a/src/pages/WellOperationsEditor.jsx b/src/pages/WellOperations/WellOperationsEditor.jsx similarity index 86% rename from src/pages/WellOperationsEditor.jsx rename to src/pages/WellOperations/WellOperationsEditor.jsx index b8d577d..7ef253c 100644 --- a/src/pages/WellOperationsEditor.jsx +++ b/src/pages/WellOperations/WellOperationsEditor.jsx @@ -1,10 +1,11 @@ import { useState, useEffect } from 'react' import { Input, DatePicker, Select } from 'antd' -import { EditableTable } from "../components/EditableTable" -import LoaderPortal from '../components/LoaderPortal' -import { makeColumn, RegExpIsFloat, invokeWebApiWrapperAsync } from '../components/factory' -import { WellOperationService} from '../services/api' import moment from 'moment' +import { EditableTable } from "../../components/EditableTable" +import LoaderPortal from '../../components/LoaderPortal' +import { makeColumn, RegExpIsFloat, invokeWebApiWrapperAsync } from '../../components/factory' +import { WellOperationService} from '../../services/api' +import { dictionarySectionType, getNameById } from './dictionary' const { Option } = Select const { TextArea } = Input; @@ -25,22 +26,6 @@ const numericColumnOptions = { ], }; -const dictionarySectionType = [ - {id:1, name:'Пилотный ствол'}, - {id:2, name:'Направление'}, - {id:3, name:'Кондуктор'}, - {id:4, name:'Эксплуатационная колонна'}, - {id:5, name:'Транспортный ствол'}, - {id:6, name:'Хвостовик'}, -] - -const getNameById = (dictionary, id) => { - if(!dictionary?.length) - return id - const item = dictionary.find(i => i?.id === id) - return item?.name ?? id -} - const DatePickerWrapper = ({value, onChange, ...other}) => { return { /> } -export default function WellOperationsEditor({idWell, idType}){ +export const WellOperationsEditor = ({idWell, idType}) => { const [pageNumAndPageSize, setPageNumAndPageSize] = useState({current:1, pageSize:basePageSize}) const [paginationTotal, setPaginationTotal] = useState(0) const [dictionaryOperationCategory, setDictionaryOperationCategory] = useState([]) diff --git a/src/pages/WellOperations/dictionary.js b/src/pages/WellOperations/dictionary.js new file mode 100644 index 0000000..f44e2a7 --- /dev/null +++ b/src/pages/WellOperations/dictionary.js @@ -0,0 +1,15 @@ +export const getNameById = (dictionary, id) => { + if(!dictionary?.length) + return id + const item = dictionary.find(i => i?.id === id) + return item?.name ?? id +} + +export const dictionarySectionType = [ + {id:1, name:'Пилотный ствол'}, + {id:2, name:'Направление'}, + {id:3, name:'Кондуктор'}, + {id:4, name:'Эксплуатационная колонна'}, + {id:5, name:'Транспортный ствол'}, + {id:6, name:'Хвостовик'}, +] \ No newline at end of file diff --git a/src/pages/WellOperations.jsx b/src/pages/WellOperations/index.jsx similarity index 87% rename from src/pages/WellOperations.jsx rename to src/pages/WellOperations/index.jsx index 427522f..ba226e9 100644 --- a/src/pages/WellOperations.jsx +++ b/src/pages/WellOperations/index.jsx @@ -1,7 +1,9 @@ import {Layout, Menu} from "antd"; import {Switch, Link, Route, Redirect, useParams} from "react-router-dom"; import { FolderOutlined } from "@ant-design/icons"; -import WellOperationsEditor from './WellOperationsEditor' +import { WellOperationsEditor } from './WellOperationsEditor' +import { WellSectionsStat } from './WellSectionsStat' +import { Tvd } from './Tvd' const { Content } = Layout @@ -32,10 +34,10 @@ export default function WellOperations({idWell}) { -
sss
+
-
sss
+