From a164cac9d0c3e94422ce5392e8a8bccc93c26691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=80=D0=BE=D0=BB=D0=BE=D0=B2?= Date: Sat, 28 Aug 2021 22:31:05 +0500 Subject: [PATCH 1/3] update api client --- src/services/api/index.ts | 8 +- src/services/api/models/FluidDataDto.ts | 36 ----- src/services/api/models/MeasureDto.ts | 12 ++ src/services/api/models/MudDiagramDataDto.ts | 30 ----- src/services/api/models/NnbDataDto.ts | 26 ---- src/services/api/services/FluidService.ts | 52 -------- src/services/api/services/MeasureService.ts | 126 ++++++++++++++++++ .../api/services/MudDiagramService.ts | 52 -------- src/services/api/services/NnbDataService.ts | 52 -------- .../api/services/WellOperationService.ts | 2 +- 10 files changed, 141 insertions(+), 255 deletions(-) delete mode 100644 src/services/api/models/FluidDataDto.ts create mode 100644 src/services/api/models/MeasureDto.ts delete mode 100644 src/services/api/models/MudDiagramDataDto.ts delete mode 100644 src/services/api/models/NnbDataDto.ts delete mode 100644 src/services/api/services/FluidService.ts create mode 100644 src/services/api/services/MeasureService.ts delete mode 100644 src/services/api/services/MudDiagramService.ts delete mode 100644 src/services/api/services/NnbDataService.ts diff --git a/src/services/api/index.ts b/src/services/api/index.ts index b76205a..42cbf9f 100644 --- a/src/services/api/index.ts +++ b/src/services/api/index.ts @@ -13,11 +13,9 @@ export type { DepositDto } from './models/DepositDto'; export type { EventDto } from './models/EventDto'; export type { FileInfoDto } from './models/FileInfoDto'; export type { FileInfoDtoPaginationContainer } from './models/FileInfoDtoPaginationContainer'; -export type { FluidDataDto } from './models/FluidDataDto'; +export type { MeasureDto } from './models/MeasureDto'; export type { MessageDto } from './models/MessageDto'; export type { MessageDtoPaginationContainer } from './models/MessageDtoPaginationContainer'; -export type { MudDiagramDataDto } from './models/MudDiagramDataDto'; -export type { NnbDataDto } from './models/NnbDataDto'; export type { StatClusterDto } from './models/StatClusterDto'; export type { StatOperationsDto } from './models/StatOperationsDto'; export type { StatOperationsDtoPlanFactBase } from './models/StatOperationsDtoPlanFactBase'; @@ -43,10 +41,8 @@ export { ClusterService } from './services/ClusterService'; export { DataService } from './services/DataService'; export { DepositService } from './services/DepositService'; export { FileService } from './services/FileService'; -export { FluidService } from './services/FluidService'; +export { MeasureService } from './services/MeasureService'; export { MessageService } from './services/MessageService'; -export { MudDiagramService } from './services/MudDiagramService'; -export { NnbDataService } from './services/NnbDataService'; export { ReportService } from './services/ReportService'; export { TelemetryAnalyticsService } from './services/TelemetryAnalyticsService'; export { TelemetryService } from './services/TelemetryService'; diff --git a/src/services/api/models/FluidDataDto.ts b/src/services/api/models/FluidDataDto.ts deleted file mode 100644 index c99a629..0000000 --- a/src/services/api/models/FluidDataDto.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type FluidDataDto = { - key?: number; - lastUpdate?: string; - name?: string | null; - temperature?: number; - density?: number; - conditionalViscosity?: number; - r300?: number; - r600?: number; - r3r6?: number; - dnsDpa?: number; - plasticViscocity?: number; - snsDpa?: number; - 'r3r649С'?: number; - dns49Cdpa?: number; - plasticViscocity49c?: number; - sns49Cdpa?: number; - mbt?: number; - sand?: number; - filtering?: number; - crust?: number; - ktk?: number; - ph?: number; - hardness?: number; - chlorides?: number; - pf?: number; - mf?: number; - pm?: number; - fluidSolidPhase?: number; - grease?: number; - calciumCarbonate?: number; -} \ No newline at end of file diff --git a/src/services/api/models/MeasureDto.ts b/src/services/api/models/MeasureDto.ts new file mode 100644 index 0000000..dea91c6 --- /dev/null +++ b/src/services/api/models/MeasureDto.ts @@ -0,0 +1,12 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type MeasureDto = { + id?: number; + idWell?: number; + idCategory?: number; + categoryName?: string | null; + timestamp?: string; + data?: Record | null; +} \ No newline at end of file diff --git a/src/services/api/models/MudDiagramDataDto.ts b/src/services/api/models/MudDiagramDataDto.ts deleted file mode 100644 index 5b0cba5..0000000 --- a/src/services/api/models/MudDiagramDataDto.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type MudDiagramDataDto = { - key?: number; - lastUpdate?: string; - probeNumber?: number; - probeExtractionDepth?: number; - sandstone?: number; - siltstone?: number; - argillit?: number; - brokenArgillit?: number; - coal?: number; - sand?: number; - clay?: number; - camstone?: number; - cement?: number; - summary?: string | null; - drillingMud?: number; - sludge?: number; - maxSum?: number; - methane?: number; - ethane?: number; - propane?: number; - butane?: number; - pentane?: number; - mechanicalSpeed?: number; - preliminaryConclusion?: string | null; -} \ No newline at end of file diff --git a/src/services/api/models/NnbDataDto.ts b/src/services/api/models/NnbDataDto.ts deleted file mode 100644 index 57c76c7..0000000 --- a/src/services/api/models/NnbDataDto.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type NnbDataDto = { - key?: number; - lastUpdate?: string; - depth?: number; - zenithAngle?: number; - magneticAzimuth?: number; - trueAzimuth?: number; - conditionalViscosity?: number; - directAzimuth?: number; - verticalDepth?: number; - absoluteMark?: number; - localNorthOffset?: number; - localEastOffset?: number; - outFallOffset?: number; - offsetAzimuth?: number; - areaIntensity?: number; - offsetStopAngle?: number; - zenithIntensity?: number; - comment?: number; - depthPlanFactDifference?: number; - distancePlanFactDifference?: number; -} \ No newline at end of file diff --git a/src/services/api/services/FluidService.ts b/src/services/api/services/FluidService.ts deleted file mode 100644 index fe1e065..0000000 --- a/src/services/api/services/FluidService.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { FluidDataDto } from '../models/FluidDataDto'; -import { request as __request } from '../core/request'; - -export class FluidService { - - /** - * @param idWell - * @param idCategory - * @returns any Success - * @throws ApiError - */ - public static async get( -idWell: number, -idCategory?: number, -): Promise { - const result = await __request({ - method: 'GET', - path: `/api/well/${idWell}/fluidLastData`, - query: { - 'idCategory': idCategory, - }, - }); - return result.body; - } - - /** - * @param idWell - * @param idCategory - * @param requestBody - * @returns any Success - * @throws ApiError - */ - public static async put( -idWell: number, -idCategory?: number, -requestBody?: FluidDataDto, -): Promise { - const result = await __request({ - method: 'POST', - path: `/api/well/${idWell}/fluidLastData`, - query: { - 'idCategory': idCategory, - }, - body: requestBody, - }); - return result.body; - } - -} \ No newline at end of file diff --git a/src/services/api/services/MeasureService.ts b/src/services/api/services/MeasureService.ts new file mode 100644 index 0000000..2547a53 --- /dev/null +++ b/src/services/api/services/MeasureService.ts @@ -0,0 +1,126 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { MeasureDto } from '../models/MeasureDto'; +import { request as __request } from '../core/request'; + +export class MeasureService { + + /** + * @param idWell + * @returns any Success + * @throws ApiError + */ + public static async getCategories( +idWell: number, +): Promise { + const result = await __request({ + method: 'GET', + path: `/api/well/${idWell}/measure/categories`, + }); + return result.body; + } + + /** + * @param idWell + * @returns any Success + * @throws ApiError + */ + public static async getAllLast( +idWell: number, +): Promise { + const result = await __request({ + method: 'GET', + path: `/api/well/${idWell}/measure/lastAll`, + }); + return result.body; + } + + /** + * @param idWell + * @param idCategory + * @returns any Success + * @throws ApiError + */ + public static async getLast( +idWell: number, +idCategory: number, +): Promise { + const result = await __request({ + method: 'GET', + path: `/api/well/${idWell}/measure/last/${idCategory}`, + }); + return result.body; + } + + /** + * @param idWell + * @param idCategory + * @returns any Success + * @throws ApiError + */ + public static async getHisory( +idWell: number, +idCategory: number, +): Promise { + const result = await __request({ + method: 'GET', + path: `/api/well/${idWell}/measure/history/${idCategory}`, + }); + return result.body; + } + + /** + * @param idWell + * @param requestBody + * @returns any Success + * @throws ApiError + */ + public static async insert( +idWell: number, +requestBody?: MeasureDto, +): Promise { + const result = await __request({ + method: 'POST', + path: `/api/well/${idWell}/measure`, + body: requestBody, + }); + return result.body; + } + + /** + * @param idWell + * @param requestBody + * @returns any Success + * @throws ApiError + */ + public static async update( +idWell: number, +requestBody?: MeasureDto, +): Promise { + const result = await __request({ + method: 'PUT', + path: `/api/well/${idWell}/measure`, + body: requestBody, + }); + return result.body; + } + + /** + * @param idWell + * @param idData + * @returns any Success + * @throws ApiError + */ + public static async markAsDelete( +idWell: number, +idData: number, +): Promise { + const result = await __request({ + method: 'DELETE', + path: `/api/well/${idWell}/measure`, + }); + return result.body; + } + +} \ No newline at end of file diff --git a/src/services/api/services/MudDiagramService.ts b/src/services/api/services/MudDiagramService.ts deleted file mode 100644 index f450da2..0000000 --- a/src/services/api/services/MudDiagramService.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { MudDiagramDataDto } from '../models/MudDiagramDataDto'; -import { request as __request } from '../core/request'; - -export class MudDiagramService { - - /** - * @param idWell - * @param idCategory - * @returns any Success - * @throws ApiError - */ - public static async get( -idWell: number, -idCategory?: number, -): Promise { - const result = await __request({ - method: 'GET', - path: `/api/well/${idWell}/mudLastData`, - query: { - 'idCategory': idCategory, - }, - }); - return result.body; - } - - /** - * @param idWell - * @param idCategory - * @param requestBody - * @returns any Success - * @throws ApiError - */ - public static async put( -idWell: number, -idCategory?: number, -requestBody?: MudDiagramDataDto, -): Promise { - const result = await __request({ - method: 'POST', - path: `/api/well/${idWell}/mudLastData`, - query: { - 'idCategory': idCategory, - }, - body: requestBody, - }); - return result.body; - } - -} \ No newline at end of file diff --git a/src/services/api/services/NnbDataService.ts b/src/services/api/services/NnbDataService.ts deleted file mode 100644 index 13a514f..0000000 --- a/src/services/api/services/NnbDataService.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { NnbDataDto } from '../models/NnbDataDto'; -import { request as __request } from '../core/request'; - -export class NnbDataService { - - /** - * @param idWell - * @param idCategory - * @returns any Success - * @throws ApiError - */ - public static async get( -idWell: number, -idCategory?: number, -): Promise { - const result = await __request({ - method: 'GET', - path: `/api/well/${idWell}/nnbLastData`, - query: { - 'idCategory': idCategory, - }, - }); - return result.body; - } - - /** - * @param idWell - * @param idCategory - * @param requestBody - * @returns any Success - * @throws ApiError - */ - public static async put( -idWell: number, -idCategory?: number, -requestBody?: NnbDataDto, -): Promise { - const result = await __request({ - method: 'POST', - path: `/api/well/${idWell}/nnbLastData`, - query: { - 'idCategory': idCategory, - }, - body: requestBody, - }); - return result.body; - } - -} \ No newline at end of file diff --git a/src/services/api/services/WellOperationService.ts b/src/services/api/services/WellOperationService.ts index 0fdbd49..3215e56 100644 --- a/src/services/api/services/WellOperationService.ts +++ b/src/services/api/services/WellOperationService.ts @@ -48,7 +48,7 @@ begin?: string, end?: string, minDepth: number = -1.7976931348623157e+308, maxDepth: number = 1.7976931348623157e+308, -skip?: number, +skip: number = 0, take: number = 32, ): Promise { const result = await __request({ From 04ce3f0ebf4364a1e1a4ecc70adf0b8c5792746d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=80=D0=BE=D0=BB=D0=BE=D0=B2?= Date: Sat, 28 Aug 2021 22:32:13 +0500 Subject: [PATCH 2/3] LastData renamed to Measure --- src/pages/LastData/DrillingFluid.jsx | 248 ------------------ src/pages/LastData/LastDataTable.jsx | 12 - src/pages/LastData/MudDiagram.jsx | 241 ----------------- src/pages/LastData/Nnb.jsx | 205 --------------- src/pages/LastData/index.jsx | 16 -- src/pages/Measure/MeasureTable.jsx | 27 ++ .../{LastData => Measure}/_old_LastData.__ | 0 src/pages/Measure/columnsDrillingFluid.js | 44 ++++ src/pages/Measure/columnsMudDiagram.js | 40 +++ src/pages/Measure/columnsNnb.js | 21 ++ src/pages/Measure/index.jsx | 24 ++ src/pages/Well.jsx | 10 +- src/pages/WellOperations/Tvd.jsx | 2 +- src/pages/WellOperations/index.jsx | 4 +- 14 files changed, 164 insertions(+), 730 deletions(-) delete mode 100644 src/pages/LastData/DrillingFluid.jsx delete mode 100644 src/pages/LastData/LastDataTable.jsx delete mode 100644 src/pages/LastData/MudDiagram.jsx delete mode 100644 src/pages/LastData/Nnb.jsx delete mode 100644 src/pages/LastData/index.jsx create mode 100644 src/pages/Measure/MeasureTable.jsx rename src/pages/{LastData => Measure}/_old_LastData.__ (100%) create mode 100644 src/pages/Measure/columnsDrillingFluid.js create mode 100644 src/pages/Measure/columnsMudDiagram.js create mode 100644 src/pages/Measure/columnsNnb.js create mode 100644 src/pages/Measure/index.jsx diff --git a/src/pages/LastData/DrillingFluid.jsx b/src/pages/LastData/DrillingFluid.jsx deleted file mode 100644 index fcf3dd3..0000000 --- a/src/pages/LastData/DrillingFluid.jsx +++ /dev/null @@ -1,248 +0,0 @@ -import { useState, useEffect } from 'react'; -import { useParams } from "react-router-dom"; -import { InputNumber, Form, Popconfirm, Typography, Button } from 'antd' -import LoaderPortal from '../../components/LoaderPortal' -import { makeColumn, Table } from '../../components/Table' -import { FluidService } from '../../services/api/services/FluidService'; -import { notify } from "../../components/factory" - -const EditableCell = ({ - editing, - dataIndex, - title, - inputType, - record, - index, - children, - ...restProps -}) => { - return ( - -
- {editing ? ( - - - - ) : ( - children - )} -
- - ); -}; - -export function DrillingFluid() { - let {id} = useParams() - - const [form] = Form.useForm(); - const [editingKey, setEditingKey] = useState(''); - const [idCategory, setIdCategory] = useState(8); - const [dataPlan, setDataPlan] = useState({}) - const [dataFact, setDataFact] = useState({}) - const [isUpdatingData, setIsUpdatingData] = useState(false) - - const [showLoader, setShowLoader] = useState(false) - - const isEditing = (row) => row?.key === editingKey; - - const columns = [ - makeColumn('Наименование', 'name', { dataIndex: 'name', align: 'center', className: 'small-font'}), - makeColumn('Температура, °C', 'temperature', { dataIndex: 'temperature', align: 'center', className: 'small-font', editable: true}), - makeColumn('Плотность, г/см³', 'density', { dataIndex: 'density', align: 'center', className: 'small-font', editable: true}), - makeColumn('Усл. вязкость, сек', 'conditionalViscosity', { dataIndex: 'conditionalViscosity', align: 'center', className: 'small-font', editable: true}), - makeColumn('R300', 'r300', { dataIndex: 'r300', align: 'center', className: 'small-font', editable: true}), - makeColumn('R600', 'r600', { dataIndex: 'r600', align: 'center', className: 'small-font', editable: true}), - makeColumn('R3/R6', 'r3r6', { dataIndex: 'r3r6', align: 'center', className: 'small-font', editable: true}), - makeColumn('ДНС, дПа', 'dnsDpa', { dataIndex: 'dnsDpa', align: 'center', className: 'small-font', editable: true}), - makeColumn('Пластич. вязкость, сПз', 'plasticViscocity', { dataIndex: 'plasticViscocity', align: 'center', className: 'small-font', editable: true}), - makeColumn('СНС, дПа', 'snsDpa', { dataIndex: 'snsDpa', align: 'center', className: 'small-font', editable: true}), - makeColumn('R3/R6 49С', 'r3r649С', { dataIndex: 'r3r649С', align: 'center', className: 'small-font', editable: true}), - makeColumn('ДНС 49С, дПа', 'dns49Cdpa', { dataIndex: 'dns49Cdpa', align: 'center', className: 'small-font', editable: true}), - makeColumn('Пластич. вязкость 49С, сПз', 'plasticViscocity49c', { dataIndex: 'plasticViscocity49c', align: 'center', className: 'small-font', editable: true}), - makeColumn('СНС 49С, дПа', 'sns49Cdpa', { dataIndex: 'sns49Cdpa', align: 'center', className: 'small-font', editable: true}), - makeColumn('МВТ, кг/м³', 'mbt', { dataIndex: 'mbt', align: 'center', className: 'small-font', editable: true}), - makeColumn('Песок, %', 'sand', { dataIndex: 'sand', align: 'center', className: 'small-font', editable: true}), - makeColumn('Фильтрация, см³/30мин', 'filtering', { dataIndex: 'filtering', align: 'center', className: 'small-font', editable: true}), - makeColumn('Корка, мм', 'crust', { dataIndex: 'crust', align: 'center', className: 'small-font', editable: true}), - makeColumn('KTK', 'ktk', { dataIndex: 'ktk', align: 'center', className: 'small-font', editable: true}), - makeColumn('pH', 'ph', { dataIndex: 'ph', align: 'center', className: 'small-font', editable: true}), - makeColumn('Жесткость, мг/л', 'hardness', { dataIndex: 'hardness', align: 'center', className: 'small-font', editable: true}), - makeColumn('Хлориды, мг/л', 'chlorides', { dataIndex: 'chlorides', align: 'center', className: 'small-font', editable: true}), - makeColumn('PF', 'pf', { dataIndex: 'pf', align: 'center', className: 'small-font', - render: text => {text}, editable: true}), - makeColumn('Mf', 'mf', { dataIndex: 'mf', align: 'center', className: 'small-font', - render: text => {text}, editable: true}), - makeColumn('Pm', 'pm', { dataIndex: 'pm', align: 'center', className: 'small-font', - render: text => {text}, editable: true}), - makeColumn('Твердая фаза раствора, %', 'fluidSolidPhase', { dataIndex: 'fluidSolidPhase', align: 'center', className: 'small-font', editable: true}), - makeColumn('Смазка, %', 'grease', { dataIndex: 'grease', align: 'center', className: 'small-font', editable: true}), - makeColumn('Карбонат кальция, кг/м³', 'calciumCarbonate', { dataIndex: 'calciumCarbonate', align: 'center', className: 'small-font', editable: true}), - { - title: 'Действие', - dataIndex: 'action', - align: 'center', - width: 150, - className: 'small-font', - render: (_, row) => { - const editable = isEditing(row); - return editable ? ( - - - Отменить
редактирование?
} onConfirm={cancel}> - - - - ) : ( - edit(row)}> - Редактировать - - ); - }, - } - ]; - - useEffect(() => { - const update = async () => { - setShowLoader(true) - - try { - let response = await FluidService.get(id, 8) - response.key = 8 - response.name = 'План' - setDataPlan(response) - } - catch (ex) { - notify(`Не удалось загрузить плановые данные бурового раствора по скважине "${id}"`, 'error') - console.log(ex) - } - - try { - let response = await FluidService.get(id, 9) - response.key = 9 - response.name = 'Факт' - setDataFact(response) - } - catch (ex) { - notify(`Не удалось загрузить фактические данные бурового раствора по скважине "${id}"`, 'error') - console.log(ex) - } - - setIsUpdatingData(false) - setShowLoader(false) - } - update() - }, [id, isUpdatingData]) - - const mergedColumns = columns.map((col) => { - if (!col.editable) { - return col; - } - - return { - ...col, - onCell: (row) => ({ - row, - dataIndex: col.dataIndex, - title: col.title, - editing: isEditing(row), - }), - }; - }); - - const edit = (row) => { - setIdCategory(row.key) - form.setFieldsValue({ - ...row, - }); - setEditingKey(row.key); - }; - - const cancel = () => { - setEditingKey(''); - }; - - const save = async (formData) => { - - const params = { - key: form.getFieldValue('key'), - name: idCategory === 8 ? 'План' : 'Факт', - temperature: form.getFieldValue('temperature'), - density: form.getFieldValue('density'), - conditionalViscosity: form.getFieldValue('conditionalViscosity'), - r300: form.getFieldValue('r300'), - r600: form.getFieldValue('r600'), - r3r6: form.getFieldValue('r3r6'), - dnsDpa: form.getFieldValue('dnsDpa'), - plasticViscocity: form.getFieldValue('plasticViscocity'), - snsDpa: form.getFieldValue('snsDpa'), - r3r649С: form.getFieldValue('r3r649С'), - dns49Cdpa: form.getFieldValue('dns49Cdpa'), - plasticViscocity49c: form.getFieldValue('plasticViscocity49c'), - sns49Cdpa: form.getFieldValue('sns49Cdpa'), - mbt: form.getFieldValue('mbt'), - sand: form.getFieldValue('sand'), - filtering: form.getFieldValue('filtering'), - crust: form.getFieldValue('crust'), - ktk: form.getFieldValue('ktk'), - ph: form.getFieldValue('ph'), - hardness: form.getFieldValue('hardness'), - chlorides: form.getFieldValue('chlorides'), - pf: form.getFieldValue('pf'), - mf: form.getFieldValue('mf'), - pm: form.getFieldValue('pm'), - fluidSolidPhase: form.getFieldValue('fluidSolidPhase'), - grease: form.getFieldValue('grease'), - calciumCarbonate: form.getFieldValue('calciumCarbonate') - } - - try { - setShowLoader(true) - await FluidService.put(`${id}`, idCategory, params) - - setIsUpdatingData(true) - setShowLoader(false) - - setEditingKey('') - } catch (errInfo) { - console.log('Validate Failed:', errInfo); - } - }; - - return ( -
- - -
 
-

- Дата последнего обновления: -  План: {new Date(dataPlan?.lastUpdate).toLocaleString()}   -  Факт: {new Date(dataFact?.lastUpdate).toLocaleString()}  -

- ) -} \ No newline at end of file diff --git a/src/pages/LastData/LastDataTable.jsx b/src/pages/LastData/LastDataTable.jsx deleted file mode 100644 index 8d651fa..0000000 --- a/src/pages/LastData/LastDataTable.jsx +++ /dev/null @@ -1,12 +0,0 @@ -// import { useState, useEffect } from 'react' -// import { EditableTable, DatePickerWrapper, SelectFromDictionary, numericColumnOptions, makeColumn } from "../../components/Table" -// import LoaderPortal from '../../components/LoaderPortal' -// import { invokeWebApiWrapperAsync } from '../../components/factory' - -export const LastDataTable = ({idWell, columns, service}) => { - // const [showLoader, setShowLoader] = useState(false) - - // const update = () => {} - - return
Open hystory
-} \ No newline at end of file diff --git a/src/pages/LastData/MudDiagram.jsx b/src/pages/LastData/MudDiagram.jsx deleted file mode 100644 index 56a4209..0000000 --- a/src/pages/LastData/MudDiagram.jsx +++ /dev/null @@ -1,241 +0,0 @@ -import { useState, useEffect } from 'react'; -import { useParams } from "react-router-dom"; -import { Table, InputNumber, Input, Form, Popconfirm, Typography, Button } from 'antd' -import LoaderPortal from '../LoaderPortal' -import { makeColumn } from '../Table' -import { MudDiagramService } from '../../services/api/services/MudDiagramService' -import { notify } from "../factory" - -const EditableCell = ({ - editing, - dataIndex, - title, - inputType, - record, - index, - children, - ...restProps -}) => { - const inputNumber = - const input = - return ( - - ); -}; - -export function SludgeDiagram() { - let {id} = useParams() - - const [form] = Form.useForm(); - const [editingKey, setEditingKey] = useState(''); - const [data, setData] = useState({}) - const [isUpdatingData, setIsUpdatingData] = useState(false) - const [showLoader, setShowLoader] = useState(false) - - const isEditing = (row) => row.key === editingKey; - - const columns = [ - makeColumn('N пробы', 'probeNumber', { dataIndex: 'probeNumber', align: 'center', className: 'yellow-background', editable: true}), - makeColumn('Глубина отбора пробы', 'probeExtractionDepth', { dataIndex: 'probeExtractionDepth', align: 'center', className: 'yellow-background', editable: true}), - { - title: 'Литология', - key: 'lithology', - dataIndex: 'lithology', - align: 'center', - className: 'yellow-background', - editable: true, - children: [ - makeColumn('Песчаник (%)', 'sandstone', { dataIndex: 'sandstone', align: 'center', className: 'lightpurple-background', editable: true}), - makeColumn('Алевролит (%)', 'siltstone', { dataIndex: 'siltstone', align: 'center', className: 'lightpurple-background', editable: true}), - makeColumn('Аргиллит (%)', 'argillit', { dataIndex: 'argillit', align: 'center', className: 'lightpurple-background', editable: true}), - makeColumn('Аргиллит бит. (%)', 'brokenArgillit', { dataIndex: 'brokenArgillit', align: 'center', className: 'lightpurple-background', editable: true}), - makeColumn('Уголь (%)', 'coal', { dataIndex: 'coal', align: 'center', className: 'lightpurple-background', editable: true}), - makeColumn('Песок (%)', 'sand', { dataIndex: 'sand', align: 'center', className: 'lightpurple-background', editable: true}), - makeColumn('Глина (%)', 'clay', { dataIndex: 'clay', align: 'center', className: 'lightpurple-background', editable: true}), - makeColumn('Известняк (%)', 'camstone', { dataIndex: 'camstone', align: 'center', className: 'lightpurple-background', editable: true}), - makeColumn('Цемент (%)', 'cement', { dataIndex: 'cement', align: 'center', className: 'lightpurple-background', editable: true}) - ] - }, - makeColumn('Краткое описание', 'summary', { dataIndex: 'summary', align: 'center', className: 'yellow-background', editable: true}), - makeColumn('ЛБА бурового раствора', 'drillingMud', { dataIndex: 'drillingMud', align: 'center', className: 'lightgray-background', editable: true}), - makeColumn('ЛБА (шлама)', 'sludge', { dataIndex: 'sludge', align: 'center', className: 'lightorange-background', editable: true}), - { - title: 'Газопоказания', - key: 'gasIndications', - dataIndex: 'gasIndications', - align: 'center', - className: 'yellow-background', - children: [ - makeColumn('Сумма УВ мах. (абс%)', 'maxSum', { dataIndex: 'maxSum', align: 'center', className: 'lightpurple-background', editable: true}), - makeColumn('С1 метан (отн%)', 'methane', { dataIndex: 'methane', align: 'center', className: 'lightpurple-background', editable: true}), - makeColumn('С2 этан (отн%)', 'ethane', { dataIndex: 'ethane', align: 'center', className: 'lightpurple-background', editable: true}), - makeColumn('С3 пропан (отн%)', 'propane', { dataIndex: 'propane', align: 'center', className: 'lightpurple-background', editable: true}), - makeColumn('С4 бутан (отн%)', 'butane', { dataIndex: 'butane', align: 'center', className: 'lightpurple-background', editable: true}), - makeColumn('С5 пентан (отн%)', 'pentane', { dataIndex: 'pentane', align: 'center', className: 'lightpurple-background', editable: true}) - ] - }, - makeColumn('Мех. скорость', 'mechanicalSpeed', { dataIndex: 'mechanicalSpeed', align: 'center', className: 'yellow-background', editable: true}), - makeColumn('Предварительное заключение о насыщении по ГК', 'preliminaryConclusion', { dataIndex: 'preliminaryConclusion', align: 'center', className: 'lightorange-background', editable: true}), - { - title: 'Действие', - dataIndex: 'action', - align: 'center', - width: 150, - className: 'small-font', - render: (_, row) => { - const editable = isEditing(row); - return editable ? ( - - - Отменить
редактирование?
} onConfirm={cancel}> - - - - ) : ( - edit(row)}> - Редактировать - - ); - }, - } - ]; - - useEffect(() => { - const update = async () => { - setShowLoader(true) - - try { - let response = await MudDiagramService.get(id, 10) - response.key = 10 - setData(response) - } - catch (ex) { - notify(`Не удалось загрузить данные шламограммы по скважине "${id}"`, 'error') - console.log(ex) - } - - setIsUpdatingData(false) - setShowLoader(false) - } - update() - }, [id, isUpdatingData]) - - const mapColumns = (col) => { - if(col.children) - col.children = col.children.map(mapColumns) - - if (!col.editable) { - return col; - } - - return { - ...col, - onCell: (row) => ({ - row, - dataIndex: col.dataIndex, - title: col.title, - editing: isEditing(row) - }), - }; - } - - const mergedColumns = columns.map(mapColumns); - - const edit = (row) => { - form.setFieldsValue({ - ...row - }); - setEditingKey(row.key); - }; - - const cancel = () => { - setEditingKey(''); - }; - - const save = async (formData) => { - - const params = { - key: 10, - probeNumber: form.getFieldValue('probeNumber'), - probeExtractionDepth: form.getFieldValue('probeExtractionDepth'), - sandstone: form.getFieldValue('sandstone'), - siltstone: form.getFieldValue('siltstone'), - argillit: form.getFieldValue('argillit'), - brokenArgillit: form.getFieldValue('brokenArgillit'), - coal: form.getFieldValue('coal'), - sand: form.getFieldValue('sand'), - clay: form.getFieldValue('clay'), - camstone: form.getFieldValue('camstone'), - cement: form.getFieldValue('cement'), - summary: form.getFieldValue('summary'), - drillingMud: form.getFieldValue('drillingMud'), - sludge: form.getFieldValue('sludge'), - maxSum: form.getFieldValue('maxSum'), - methane: form.getFieldValue('methane'), - ethane: form.getFieldValue('ethane'), - propane: form.getFieldValue('propane'), - butane: form.getFieldValue('butane'), - pentane: form.getFieldValue('pentane'), - mechanicalSpeed: form.getFieldValue('mechanicalSpeed'), - preliminaryConclusion: form.getFieldValue('preliminaryConclusion'), - } - - try { - setShowLoader(true) - await MudDiagramService.put(`${id}`, 10, params) - - setIsUpdatingData(true) - setShowLoader(false) - - setEditingKey('') - } catch (errInfo) { - console.log('Validate Failed:', errInfo); - } - }; - - return ( -
-
-
- {editing ? ( - - {(dataIndex === 'preliminaryConclusion' || dataIndex === 'summary') ? input : inputNumber } - - ) : ( - children - )} -
-
- -
 
-

- Дата последнего обновления: {new Date(data?.lastUpdate).toLocaleString()} -

- - ) -} \ No newline at end of file diff --git a/src/pages/LastData/Nnb.jsx b/src/pages/LastData/Nnb.jsx deleted file mode 100644 index 4146037..0000000 --- a/src/pages/LastData/Nnb.jsx +++ /dev/null @@ -1,205 +0,0 @@ -import { useState, useEffect } from 'react' -import { useParams } from "react-router-dom"; -import {Table, InputNumber, Form, Popconfirm, Typography, Button } from 'antd' -import LoaderPortal from '../LoaderPortal' -import { makeColumn } from '../Table' -import { NnbDataService } from '../../services/api/services/NnbDataService'; -import { notify } from "../factory" - - -const EditableCell = ({ - editing, - dataIndex, - title, - inputType, - record, - index, - children, - ...restProps -}) => { - return ( - - ); -}; - -export function Nnb() { - let {id} = useParams() - - const [form] = Form.useForm(); - const [editingKey, setEditingKey] = useState(''); - const [data, setData] = useState({}) - const [isUpdatingData, setIsUpdatingData] = useState(false) - const [showLoader, setShowLoader] = useState(false) - - const isEditing = (row) => row.key === editingKey; - - const columns = [ - makeColumn('Глубина по стволу, м', 'depth', { dataIndex: 'depth', align: 'center', editable: true}), - makeColumn('Зенитный угол, град', 'zenithAngle', { dataIndex: 'zenithAngle', align: 'center', editable: true}), - makeColumn('Азимут магнитный, град', 'magneticAzimuth', { dataIndex: 'magneticAzimuth', align: 'center', editable: true}), - makeColumn('Азимут истинный, град', 'trueAzimuth', { dataIndex: 'trueAzimuth', align: 'center', editable: true}), - makeColumn('Азимут дирекц., град', 'directAzimuth', { dataIndex: 'directAzimuth', align: 'center', editable: true}), - makeColumn('Глубина по вертикали, м', 'verticalDepth', { dataIndex: 'verticalDepth', align: 'center', editable: true}), - makeColumn('Абсолютная отметка, м', 'absoluteMark', { dataIndex: 'absoluteMark', align: 'center', editable: true}), - makeColumn('Лок. смещение к северу, м', 'localNorthOffset', { dataIndex: 'localNorthOffset', align: 'center', editable: true}), - makeColumn('Лок. смещение к востоку, м', 'localEastOffset', { dataIndex: 'localEastOffset', align: 'center', editable: true}), - makeColumn('Отклонение от устья, м', 'outFallOffset', { dataIndex: 'outFallOffset', align: 'center', editable: true}), - makeColumn('Азимут смещения, град', 'offsetAzimuth', { dataIndex: 'offsetAzimuth', align: 'center', editable: true}), - makeColumn('Пространст. интенсивность, град/10 м', 'areaIntensity', { dataIndex: 'areaIntensity', align: 'center', editable: true}), - makeColumn('Угол установки отклон., град', 'offsetStopAngle', { dataIndex: 'offsetStopAngle', align: 'center', editable: true}), - makeColumn('Интенсив. по зениту, град/10 м', 'zenithIntensity', { dataIndex: 'zenithIntensity', align: 'center', editable: true}), - makeColumn('Комментарий', 'comment', { dataIndex: 'comment', align: 'comment', editable: true}), - makeColumn('Разница вертикальных глубин между ХХХ (план) и ХХХ (факт)', 'depthPlanFactDifference', { dataIndex: 'depthPlanFactDifference', align: 'center', editable: true}), - makeColumn('Расстояние в пространстве между ХХХ (план) и ХХХ (факт)', 'distancePlanFactDifference', { dataIndex: 'distancePlanFactDifference', align: 'center', editable: true}), - { - title: 'Действие', - dataIndex: 'action', - align: 'center', - width: 150, - className: 'small-font', - render: (_, row) => { - const editable = isEditing(row); - return editable ? ( - - - Отменить
редактирование?
} onConfirm={cancel}> - - - - ) : ( - edit(row)}> - Редактировать - - ); - }, - } - ]; - - useEffect(() => { - const update = async () => { - setShowLoader(true) - - try { - let response = await NnbDataService.get(id,11) - response.key = 11 - setData(response) - } - catch (ex) { - notify(`Не удалось загрузить данные ННБ по скважине "${id}"`, 'error') - console.log(ex) - } - - setIsUpdatingData(false) - setShowLoader(false) - } - update() - }, [id, isUpdatingData]) - - const mergedColumns = columns.map((col) => { - if (!col.editable) { - return col; - } - - return { - ...col, - onCell: (row) => ({ - row, - dataIndex: col.dataIndex, - title: col.title, - editing: isEditing(row), - }), - }; - }); - - const edit = (row) => { - form.setFieldsValue({ - ...row, - }); - setEditingKey(row.key); - }; - - const cancel = () => { - setEditingKey(''); - }; - - const save = async (formData) => { - const params = { - key: 11, - depth: form.getFieldValue('depth'), - zenithAngle: form.getFieldValue('zenithAngle'), - magneticAzimuth: form.getFieldValue('magneticAzimuth'), - trueAzimuth: form.getFieldValue('trueAzimuth'), - directAzimuth: form.getFieldValue('directAzimuth'), - verticalDepth: form.getFieldValue('verticalDepth'), - absoluteMark: form.getFieldValue('absoluteMark'), - localNorthOffset: form.getFieldValue('localNorthOffset'), - localEastOffset: form.getFieldValue('localEastOffset'), - outFallOffset: form.getFieldValue('outFallOffset'), - offsetAzimuth: form.getFieldValue('offsetAzimuth'), - areaIntensity: form.getFieldValue('areaIntensity'), - offsetStopAngle: form.getFieldValue('offsetStopAngle'), - zenithIntensity: form.getFieldValue('zenithIntensity'), - comment: form.getFieldValue('comment'), - depthPlanFactDifference: form.getFieldValue('depthPlanFactDifference'), - distancePlanFactDifference: form.getFieldValue('distancePlanFactDifference') - } - - try { - setShowLoader(true) - await NnbDataService.put(`${id}`, 11, params) - - setIsUpdatingData(true) - setShowLoader(false) - - setEditingKey('') - } catch (errInfo) { - console.log('Validate Failed:', errInfo); - } - }; - - - return ( -
-
-
- {editing ? ( - - - - ) : ( - children - )} -
-
- -
 
-

- Дата последнего обновления: {new Date(data?.lastUpdate).toLocaleString()} -

- ) -} \ No newline at end of file diff --git a/src/pages/LastData/index.jsx b/src/pages/LastData/index.jsx deleted file mode 100644 index 5ae5777..0000000 --- a/src/pages/LastData/index.jsx +++ /dev/null @@ -1,16 +0,0 @@ -import { LastDataTable } from './LastDataTable' -import { MudDiagramService } from '../../services/api' - -const columnsMud = [] - -export default function LastData({idWell}){ - return <> -

Замер бурового раствора

- -

Шлабограмма

-

ННБ

- -} \ No newline at end of file diff --git a/src/pages/Measure/MeasureTable.jsx b/src/pages/Measure/MeasureTable.jsx new file mode 100644 index 0000000..f276599 --- /dev/null +++ b/src/pages/Measure/MeasureTable.jsx @@ -0,0 +1,27 @@ +import { useState, useEffect } from 'react' +import { Table } from 'antd' +import LoaderPortal from '../../components/LoaderPortal' +import { invokeWebApiWrapperAsync } from '../../components/factory' +import { MeasureService } from '../../services/api' + +export const MeasureTable = ({idWell, idCategory, title, columns}) => { + const [showLoader, setShowLoader] = useState(false) + const [lastData, setLastData] = useState([]) + + useEffect(()=>invokeWebApiWrapperAsync(async()=>{ + const data = await MeasureService.getLast(idWell, idCategory) + setLastData(data) + } + , setShowLoader + , "не удалось загрузить") + , [idWell, idCategory]) + + return +

{title}

+ дата: {lastData?.timestamp} +
+ +} \ No newline at end of file diff --git a/src/pages/LastData/_old_LastData.__ b/src/pages/Measure/_old_LastData.__ similarity index 100% rename from src/pages/LastData/_old_LastData.__ rename to src/pages/Measure/_old_LastData.__ diff --git a/src/pages/Measure/columnsDrillingFluid.js b/src/pages/Measure/columnsDrillingFluid.js new file mode 100644 index 0000000..ebfe66d --- /dev/null +++ b/src/pages/Measure/columnsDrillingFluid.js @@ -0,0 +1,44 @@ +import { makeColumn } from "../../components/Table"; + +export const columnsDrillingFluid = [ + makeColumn("Наименование", "name"), + makeColumn("Температура, °C", "temperature"), + makeColumn("Плотность, г/см³", "density"), + makeColumn("Усл. вязкость, сек", "conditionalViscosity"), + makeColumn("R300", "r300"), + makeColumn("R600", "r600"), + makeColumn("R3/R6", "r3r6"), + makeColumn("ДНС, дПа", "dnsDpa"), + makeColumn("Пластич. вязкость, сПз", "plasticViscocity"), + makeColumn("СНС, дПа", "snsDpa"), + makeColumn("R3/R6 49С", "r3r649С"), + makeColumn("ДНС 49С, дПа", "dns49Cdpa"), + makeColumn("Пластич. вязкость 49С, сПз", "plasticViscocity49c"), + makeColumn("СНС 49С, дПа", "sns49Cdpa"), + makeColumn("МВТ, кг/м³", "mbt"), + makeColumn("Песок, %", "sand"), + makeColumn("Фильтрация, см³/30мин", "filtering"), + makeColumn("Корка, мм", "crust"), + makeColumn("KTK", "ktk"), + makeColumn("pH", "ph"), + makeColumn("Жесткость, мг/л", "hardness"), + makeColumn("Хлориды, мг/л", "chlorides"), + makeColumn("PF", "pf", { + render: (text) => ( + {text} + ), + }), + makeColumn("Mf", "mf", { + render: (text) => ( + {text} + ), + }), + makeColumn("Pm", "pm", { + render: (text) => ( + {text} + ), + }), + makeColumn("Твердая фаза раствора, %", "fluidSolidPhase"), + makeColumn("Смазка, %", "grease"), + makeColumn("Карбонат кальция, кг/м³", "calciumCarbonate"), +]; diff --git a/src/pages/Measure/columnsMudDiagram.js b/src/pages/Measure/columnsMudDiagram.js new file mode 100644 index 0000000..9f8b82e --- /dev/null +++ b/src/pages/Measure/columnsMudDiagram.js @@ -0,0 +1,40 @@ +import {makeColumn} from '../../components/Table' + +export const columnsMudDiagram = [ + makeColumn('N пробы', 'probeNumber', { className: 'yellow-background'}), + makeColumn('Глубина отбора пробы', 'probeExtractionDepth', { className: 'yellow-background'}), + { + title: 'Литология', + key: 'lithology', + children: [ + makeColumn('Песчаник (%)', 'sandstone', { className: 'lightpurple-background'}), + makeColumn('Алевролит (%)', 'siltstone', { className: 'lightpurple-background'}), + makeColumn('Аргиллит (%)', 'argillit', { className: 'lightpurple-background'}), + makeColumn('Аргиллит бит. (%)', 'brokenArgillit', { className: 'lightpurple-background'}), + makeColumn('Уголь (%)', 'coal', { className: 'lightpurple-background'}), + makeColumn('Песок (%)', 'sand', { className: 'lightpurple-background'}), + makeColumn('Глина (%)', 'clay', { className: 'lightpurple-background'}), + makeColumn('Известняк (%)', 'camstone', { className: 'lightpurple-background'}), + makeColumn('Цемент (%)', 'cement', { className: 'lightpurple-background'}) + ] + }, + makeColumn('Краткое описание', 'summary', { className: 'yellow-background'}), + makeColumn('ЛБА бурового раствора', 'drillingMud', { className: 'lightgray-background'}), + makeColumn('ЛБА (шлама)', 'sludge', { className: 'lightorange-background'}), + { + title: 'Газопоказания', + key: 'gasIndications', + align: 'center', + className: 'yellow-background', + children: [ + makeColumn('Сумма УВ мах. (абс%)', 'maxSum', { className: 'lightpurple-background'}), + makeColumn('С1 метан (отн%)', 'methane', { className: 'lightpurple-background'}), + makeColumn('С2 этан (отн%)', 'ethane', { className: 'lightpurple-background'}), + makeColumn('С3 пропан (отн%)', 'propane', { className: 'lightpurple-background'}), + makeColumn('С4 бутан (отн%)', 'butane', { className: 'lightpurple-background'}), + makeColumn('С5 пентан (отн%)', 'pentane', { className: 'lightpurple-background'}) + ] + }, + makeColumn('Мех. скорость', 'mechanicalSpeed', { className: 'yellow-background'}), + makeColumn('Предварительное заключение о насыщении по ГК', 'preliminaryConclusion', { className: 'lightorange-background'}), +]; \ No newline at end of file diff --git a/src/pages/Measure/columnsNnb.js b/src/pages/Measure/columnsNnb.js new file mode 100644 index 0000000..82ed173 --- /dev/null +++ b/src/pages/Measure/columnsNnb.js @@ -0,0 +1,21 @@ +import { makeColumn } from '../../components/Table' + +export const columnsNnb = [ + makeColumn('Глубина по стволу, м', 'depth'), + makeColumn('Зенитный угол, град', 'zenithAngle'), + makeColumn('Азимут магнитный, град', 'magneticAzimuth'), + makeColumn('Азимут истинный, град', 'trueAzimuth'), + makeColumn('Азимут дирекц., град', 'directAzimuth'), + makeColumn('Глубина по вертикали, м', 'verticalDepth'), + makeColumn('Абсолютная отметка, м', 'absoluteMark'), + makeColumn('Лок. смещение к северу, м', 'localNorthOffset'), + makeColumn('Лок. смещение к востоку, м', 'localEastOffset'), + makeColumn('Отклонение от устья, м', 'outFallOffset'), + makeColumn('Азимут смещения, град', 'offsetAzimuth'), + makeColumn('Пространст. интенсивность, град/10 м', 'areaIntensity'), + makeColumn('Угол установки отклон., град', 'offsetStopAngle'), + makeColumn('Интенсив. по зениту, град/10 м', 'zenithIntensity'), + makeColumn('Комментарий', 'comment'), + makeColumn('Разница вертикальных глубин между ХХХ (план) и ХХХ (факт)', 'depthPlanFactDifference'), + makeColumn('Расстояние в пространстве между ХХХ (план) и ХХХ (факт)', 'distancePlanFactDifference'), +]; \ No newline at end of file diff --git a/src/pages/Measure/index.jsx b/src/pages/Measure/index.jsx new file mode 100644 index 0000000..b7dda68 --- /dev/null +++ b/src/pages/Measure/index.jsx @@ -0,0 +1,24 @@ +import { columnsMudDiagram} from './columnsMudDiagram' +// import { columnsDrillingFluid} from './columnsDrillingFluid' +// import { columnsNnb } from './columnsNnb' +import { MeasureTable } from './MeasureTable' + +export default function Measure({idWell}){ + return <> + + {/* + */} + +} \ No newline at end of file diff --git a/src/pages/Well.jsx b/src/pages/Well.jsx index 6c04c17..09bbf01 100644 --- a/src/pages/Well.jsx +++ b/src/pages/Well.jsx @@ -12,7 +12,7 @@ import Messages from "./Messages"; import Report from "./Report"; import Archive from "./Archive"; import Documents from "./Documents"; -import LastData from "./LastData"; +import Measure from "./Measure"; import { makeMenuItems } from "./Documents/menuItems"; import WellOperations from "./WellOperations"; @@ -63,8 +63,8 @@ export default function Well() { > {makeMenuItems(rootPath)} - }> - Последние данные + }> + Измерения @@ -89,8 +89,8 @@ export default function Well() { - - + + diff --git a/src/pages/WellOperations/Tvd.jsx b/src/pages/WellOperations/Tvd.jsx index 037569b..c6511f5 100644 --- a/src/pages/WellOperations/Tvd.jsx +++ b/src/pages/WellOperations/Tvd.jsx @@ -4,7 +4,7 @@ import { invokeWebApiWrapperAsync } from '../../components/factory'; import { WellOperationStatService } from '../../services/api'; -export const TVD = ({ idWell }) => { +export const Tvd = ({ idWell }) => { const [dataPlan, setDataPlan] = useState([]); const [dataFact, setDataFact] = useState([]); const [dataForecast, setDataForecast] = useState([]); diff --git a/src/pages/WellOperations/index.jsx b/src/pages/WellOperations/index.jsx index 9da1074..ba226e9 100644 --- a/src/pages/WellOperations/index.jsx +++ b/src/pages/WellOperations/index.jsx @@ -3,7 +3,7 @@ import {Switch, Link, Route, Redirect, useParams} from "react-router-dom"; import { FolderOutlined } from "@ant-design/icons"; import { WellOperationsEditor } from './WellOperationsEditor' import { WellSectionsStat } from './WellSectionsStat' -import { TVD } from './TVD' +import { Tvd } from './Tvd' const { Content } = Layout @@ -34,7 +34,7 @@ export default function WellOperations({idWell}) { - + From bf9d34357017b5989ad87dc77152e03f111aa494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=80=D0=BE=D0=BB=D0=BE=D0=B2?= Date: Sun, 29 Aug 2021 12:14:10 +0500 Subject: [PATCH 3/3] fix NaN in WellSectionsStat --- src/pages/WellOperations/WellSectionsStat.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/WellOperations/WellSectionsStat.jsx b/src/pages/WellOperations/WellSectionsStat.jsx index 6ca03fe..8c89d18 100644 --- a/src/pages/WellOperations/WellSectionsStat.jsx +++ b/src/pages/WellOperations/WellSectionsStat.jsx @@ -4,7 +4,12 @@ import { invokeWebApiWrapperAsync } from '../../components/factory' import { Table, makeColumn, makeColumnsPlanFact } from '../../components/Table' import { WellOperationStatService } from '../../services/api' -const makeNumberRender = (format) => ((value) => (+value).toFixed(format)) +const makeNumberRender = format => value => { + const v = +value + if(Number.isFinite(v)) + return v.toFixed(format) + return '-' +} const columns = [ makeColumn('Тип секции','sectionType'),