Fixed Well Sections table

This commit is contained in:
Фролов 2021-08-20 17:59:28 +05:00 committed by KharchenkoVV
parent 2ab34efdd6
commit 6e1bb81bce
9 changed files with 34 additions and 61 deletions

View File

@ -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 <div>Open hystory</div>
}

View File

@ -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 <>
<h3>last data</h3>
<h3>Замер бурового раствора</h3>
<LastDataTable
idWell={idWell}
columns={columnsMud}
service={MudDiagramService} />
<h3>Шлабограмма</h3>
<h3>ННБ</h3>
</>
}

View File

@ -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)
}
},

View File

@ -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) => {

View File

@ -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';

View File

@ -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<WellSectionDto> | null;
}

View File

@ -85,7 +85,7 @@ fileId: number,
}
/**
* Удаляет файл с диска на сервере
* Помечает файл как удаленный
* @param idWell id скважины
* @param idFile id запрашиваемого файла
* @returns number Success

View File

@ -44,7 +44,7 @@ sectionTypeIds?: Array<number>,
operationCategoryIds?: Array<number>,
begin?: string,
end?: string,
skip: number = 0,
skip?: number,
take: number = 32,
): Promise<WellOperationDtoPaginationContainer> {
const result = await __request({

View File

@ -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<Array<string>> {
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<WellSectionDtoPaginationContainer> {
): Promise<Array<WellSectionDto>> {
const result = await __request({
method: 'GET',
path: `/api/well/${idWell}/sections`,
query: {
'skip': skip,
'take': take,
},
});
return result.body;
}