From 6e1bb81bce4cdcd6cab1fd8ba4e7099cf5a37d02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=80=D0=BE=D0=BB=D0=BE=D0=B2?= Date: Fri, 20 Aug 2021 17:59:28 +0500 Subject: [PATCH] Fixed Well Sections table --- src/pages/LastData/LastDataTable.jsx | 14 ++++----- src/pages/LastData/index.jsx | 14 +++++++-- src/pages/WellOperations/WellSectionsStat.jsx | 7 +++-- src/pages/WellOperations/dictionary.js | 13 ++++---- src/services/api/index.ts | 1 - .../WellSectionDtoPaginationContainer.ts | 12 -------- src/services/api/services/FileService.ts | 2 +- .../api/services/WellOperationService.ts | 2 +- .../api/services/WellSectionService.ts | 30 ++----------------- 9 files changed, 34 insertions(+), 61 deletions(-) delete mode 100644 src/services/api/models/WellSectionDtoPaginationContainer.ts diff --git a/src/pages/LastData/LastDataTable.jsx b/src/pages/LastData/LastDataTable.jsx index 1afe993..8d651fa 100644 --- a/src/pages/LastData/LastDataTable.jsx +++ b/src/pages/LastData/LastDataTable.jsx @@ -1,12 +1,12 @@ -import { useState, useEffect } from 'react' -import { EditableTable, DatePickerWrapper, SelectFromDictionary, numericColumnOptions, makeColumn } from "../../components/Table" -import LoaderPortal from '../../components/LoaderPortal' -import { invokeWebApiWrapperAsync } from '../../components/factory' +// 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 default function LastDataTable({idWell}){ - const [showLoader, setShowLoader] = useState(false) +export const LastDataTable = ({idWell, columns, service}) => { + // const [showLoader, setShowLoader] = useState(false) - const update = () => {} + // const update = () => {} return
Open hystory
} \ No newline at end of file diff --git a/src/pages/LastData/index.jsx b/src/pages/LastData/index.jsx index 3ddee23..5ae5777 100644 --- a/src/pages/LastData/index.jsx +++ b/src/pages/LastData/index.jsx @@ -1,8 +1,16 @@ -//import { useState, useEffect } from 'react' +import { LastDataTable } from './LastDataTable' +import { MudDiagramService } from '../../services/api' + +const columnsMud = [] export default function LastData({idWell}){ return <> -

last data

- +

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

+ +

Шлабограмма

+

ННБ

} \ No newline at end of file diff --git a/src/pages/WellOperations/WellSectionsStat.jsx b/src/pages/WellOperations/WellSectionsStat.jsx index ca9e4b5..9620edb 100644 --- a/src/pages/WellOperations/WellSectionsStat.jsx +++ b/src/pages/WellOperations/WellSectionsStat.jsx @@ -23,9 +23,10 @@ export const WellSectionsStat = ({idWell}) => { useEffect(() => invokeWebApiWrapperAsync( async () => { - const sectiionsPaginated = await WellSectionService.getAll(idWell, 0, 1000) - if(sectiionsPaginated?.items?.length){ - const sections = sectiionsPaginated.items.sort((a,b)=>a.wellDepthPlan - b.wellDepthPlan) + const sectionsResponse = await WellSectionService.getSectionsByWellId(idWell) + + if(sectionsResponse){ + const sections = sectionsResponse.sort((a,b)=>a.wellDepthPlan - b.wellDepthPlan) setSections(sections) } }, diff --git a/src/pages/WellOperations/dictionary.js b/src/pages/WellOperations/dictionary.js index bf4a39f..92b1db9 100644 --- a/src/pages/WellOperations/dictionary.js +++ b/src/pages/WellOperations/dictionary.js @@ -1,10 +1,11 @@ export const dictionarySectionType = new Map([ - [1, 'Пилотный ствол'], - [2, 'Направление'], - [3, 'Кондуктор'], - [4, 'Эксплуатационная колонна'], - [5, 'Транспортный ствол'], - [6, 'Хвостовик'], + [1, 'Обощенное по скважине'], + [2, 'Пилотный ствол'], + [3, 'Направление'], + [4, 'Кондуктор'], + [5, 'Эксплуатационная колонна'], + [6, 'Транспортный ствол'], + [7, 'Хвостовик'], ]) export const getByKeyOrReturnKey = (dictionary, key) => { diff --git a/src/services/api/index.ts b/src/services/api/index.ts index 6c4bc45..5b12400 100644 --- a/src/services/api/index.ts +++ b/src/services/api/index.ts @@ -33,7 +33,6 @@ export type { WellOperationCategoryDto } from './models/WellOperationCategoryDto export type { WellOperationDto } from './models/WellOperationDto'; export type { WellOperationDtoPaginationContainer } from './models/WellOperationDtoPaginationContainer'; export type { WellSectionDto } from './models/WellSectionDto'; -export type { WellSectionDtoPaginationContainer } from './models/WellSectionDtoPaginationContainer'; export type { WellStatDto } from './models/WellStatDto'; export { AuthService } from './services/AuthService'; diff --git a/src/services/api/models/WellSectionDtoPaginationContainer.ts b/src/services/api/models/WellSectionDtoPaginationContainer.ts deleted file mode 100644 index f1a922a..0000000 --- a/src/services/api/models/WellSectionDtoPaginationContainer.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { WellSectionDto } from './WellSectionDto'; - -export type WellSectionDtoPaginationContainer = { - skip?: number; - take?: number; - count?: number; - items?: Array | null; -} \ No newline at end of file diff --git a/src/services/api/services/FileService.ts b/src/services/api/services/FileService.ts index 755d9c7..866599a 100644 --- a/src/services/api/services/FileService.ts +++ b/src/services/api/services/FileService.ts @@ -85,7 +85,7 @@ fileId: number, } /** - * Удаляет файл с диска на сервере + * Помечает файл как удаленный * @param idWell id скважины * @param idFile id запрашиваемого файла * @returns number Success diff --git a/src/services/api/services/WellOperationService.ts b/src/services/api/services/WellOperationService.ts index 09d7004..94be3ed 100644 --- a/src/services/api/services/WellOperationService.ts +++ b/src/services/api/services/WellOperationService.ts @@ -44,7 +44,7 @@ sectionTypeIds?: Array, operationCategoryIds?: Array, begin?: string, end?: string, -skip: number = 0, +skip?: number, take: number = 32, ): Promise { const result = await __request({ diff --git a/src/services/api/services/WellSectionService.ts b/src/services/api/services/WellSectionService.ts index 5630e06..9fb6950 100644 --- a/src/services/api/services/WellSectionService.ts +++ b/src/services/api/services/WellSectionService.ts @@ -2,45 +2,21 @@ /* tslint:disable */ /* eslint-disable */ import type { WellSectionDto } from '../models/WellSectionDto'; -import type { WellSectionDtoPaginationContainer } from '../models/WellSectionDtoPaginationContainer'; import { request as __request } from '../core/request'; export class WellSectionService { /** * @param idWell - * @returns string Success + * @returns WellSectionDto Success * @throws ApiError */ - public static async getTypes( -idWell: string, -): Promise> { - const result = await __request({ - method: 'GET', - path: `/api/well/${idWell}/sections/types`, - }); - return result.body; - } - - /** - * @param idWell - * @param skip - * @param take - * @returns WellSectionDtoPaginationContainer Success - * @throws ApiError - */ - public static async getAll( + public static async getSectionsByWellId( idWell: number, -skip: number, -take: number = 32, -): Promise { +): Promise> { const result = await __request({ method: 'GET', path: `/api/well/${idWell}/sections`, - query: { - 'skip': skip, - 'take': take, - }, }); return result.body; }