From d777b02661c9f35f84924695d50d00fb22e72ea5 Mon Sep 17 00:00:00 2001 From: goodmice Date: Tue, 12 Oct 2021 15:04:02 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A1=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86?= =?UTF-8?q?=D0=B0=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B8=D0=BC=D0=B5=D0=BD=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...peationsParams.jsx => WellDrillParams.jsx} | 26 +++++++++---------- src/pages/WellOperations/index.jsx | 7 ++--- 2 files changed, 17 insertions(+), 16 deletions(-) rename src/pages/WellOperations/{WellOpeationsParams.jsx => WellDrillParams.jsx} (76%) diff --git a/src/pages/WellOperations/WellOpeationsParams.jsx b/src/pages/WellOperations/WellDrillParams.jsx similarity index 76% rename from src/pages/WellOperations/WellOpeationsParams.jsx rename to src/pages/WellOperations/WellDrillParams.jsx index 5e7ab22..3e43fea 100644 --- a/src/pages/WellOperations/WellOpeationsParams.jsx +++ b/src/pages/WellOperations/WellDrillParams.jsx @@ -8,13 +8,13 @@ import { import LoaderPortal from '../../components/LoaderPortal' import { invokeWebApiWrapperAsync } from '../../components/factory' import { EditableTable, SelectFromDictionary } from '../../components/Table' -import { DrillingParamsService } from '../../services/api' +import { DrillParamsService } from '../../services/api' import { dictionarySectionType, getByKeyOrReturnKey } from './dictionary' const basePageSize = 160; -export const WellOpeationsParams = ({idWell}) => { +export const WellDrillParams = ({idWell}) => { const [pageNumAndPageSize, setPageNumAndPageSize] = useState({current:1, pageSize:basePageSize}) const [paginationTotal, setPaginationTotal] = useState(0) const [params, setParams] = useState([]) @@ -24,7 +24,7 @@ export const WellOpeationsParams = ({idWell}) => { async () => { const skip = ((pageNumAndPageSize.current - 1) * pageNumAndPageSize.pageSize) || 0 const take = pageNumAndPageSize.pageSize - const paginatedParams = await DrillingParamsService.getParams(idWell, skip, take) + const paginatedParams = await DrillParamsService.getParams(idWell, skip, take) const params = paginatedParams?.items ?? [] setParams(params) const total = paginatedParams.count?? paginatedParams.items?.length ?? 0 @@ -43,31 +43,31 @@ export const WellOpeationsParams = ({idWell}) => { width:160, render:(_, record)=>getByKeyOrReturnKey(dictionarySectionType, record.idWellSectionType) }), - makeNumericStartEnd('Глубина', 'depth', true), - makeNumericAvgRange('Нагрузка', 'axial_load', true), - makeNumericAvgRange('Давление', 'pressure', true), - makeNumericAvgRange('Момент на ВПС', 'rotor_torque', true), - makeNumericAvgRange('Обороты на ВПС', 'rotor_speed', true), - makeNumericAvgRange('Расход', 'flow', true) + // makeNumericStartEnd('Глубина', 'depth'), + makeNumericAvgRange('Нагрузка', 'axialLoad'), + makeNumericAvgRange('Давление', 'pressure'), + makeNumericAvgRange('Момент на ВПС', 'topDriveTorque'), + makeNumericAvgRange('Обороты на ВПС', 'topDriveSpeed'), + makeNumericAvgRange('Расход', 'flow') ] const onAdd = async (param) => { if (!param.id) return // TODO: Add row - await DrillingParamsService.insertRange(idWell, [param]) + await DrillParamsService.saveDrillParams(idWell, param) updatePrograms() } const onEdit = async (param) => { if (!param.id) return // TODO: Edit row - await DrillingParamsService.update(idWell, param.id, param) + await DrillParamsService.update(idWell, param.id, param) updatePrograms() } const onDelete = async (param) => { if (!param.id) return - await DrillingParamsService.delete(idWell, param.id) + await DrillParamsService.delete(idWell, param.id) updatePrograms() } @@ -78,7 +78,7 @@ export const WellOpeationsParams = ({idWell}) => { bordered columns={columns} dataSource={params} - onRowAdd={onAdd} + //onRowAdd={onAdd} onRowEdit={onEdit} onRowDelete={onDelete} pagination={{ diff --git a/src/pages/WellOperations/index.jsx b/src/pages/WellOperations/index.jsx index 11c289f..d6cd0cd 100644 --- a/src/pages/WellOperations/index.jsx +++ b/src/pages/WellOperations/index.jsx @@ -1,6 +1,7 @@ import {Layout, Menu} from "antd"; import {Switch, Link, Route, Redirect, useParams, useHistory} from "react-router-dom"; import { FolderOutlined } from "@ant-design/icons"; +import { WellDrillParams } from './WellDrillParams' import { WellOperationsEditor } from './WellOperationsEditor' import { WellSectionsStat } from './WellSectionsStat' import { Tvd } from './Tvd' @@ -36,7 +37,7 @@ export default function WellOperations({idWell}) { Факт }> - Режимы + Режимы @@ -55,8 +56,8 @@ export default function WellOperations({idWell}) { - - + +