forked from ddrilling/asb_cloud_front
CF2-49: Added default values for 'Measure' table
This commit is contained in:
parent
d562b910ca
commit
00ed56c8b1
@ -10,7 +10,7 @@ import '../../styles/measure.css'
|
|||||||
|
|
||||||
const format='YYYY.MM.DD HH:mm'
|
const format='YYYY.MM.DD HH:mm'
|
||||||
|
|
||||||
export const MeasureTable = ({idWell, idCategory, title, columns, values, updateMeasures}) => {
|
export const MeasureTable = ({idWell, idCategory, title, columns, values, updateMeasuresFunc}) => {
|
||||||
|
|
||||||
const [showLoader, setShowLoader] = useState(false);
|
const [showLoader, setShowLoader] = useState(false);
|
||||||
const [selectedTimeLineId, setSelectedTimeLineId] = useState(0)
|
const [selectedTimeLineId, setSelectedTimeLineId] = useState(0)
|
||||||
@ -72,6 +72,9 @@ export const MeasureTable = ({idWell, idCategory, title, columns, values, update
|
|||||||
key={conf.key}
|
key={conf.key}
|
||||||
className='w-100'
|
className='w-100'
|
||||||
onClick={onClickDelegate}
|
onClick={onClickDelegate}
|
||||||
|
disabled={conf.key !== 'add' && displayedValues.isDefaultData
|
||||||
|
? true
|
||||||
|
: false}
|
||||||
>
|
>
|
||||||
{conf.name}
|
{conf.name}
|
||||||
</Button>
|
</Button>
|
||||||
@ -94,7 +97,7 @@ export const MeasureTable = ({idWell, idCategory, title, columns, values, update
|
|||||||
if(editingActionName === 'Удалить'){
|
if(editingActionName === 'Удалить'){
|
||||||
setShowLoader(true)
|
setShowLoader(true)
|
||||||
await MeasureService.markAsDelete(idWell, displayedValues.id)
|
await MeasureService.markAsDelete(idWell, displayedValues.id)
|
||||||
updateMeasures()
|
updateMeasuresFunc()
|
||||||
setShowLoader(false)
|
setShowLoader(false)
|
||||||
setIsTableEditing(false)
|
setIsTableEditing(false)
|
||||||
} else {
|
} else {
|
||||||
@ -121,7 +124,7 @@ export const MeasureTable = ({idWell, idCategory, title, columns, values, update
|
|||||||
setShowLoader(true)
|
setShowLoader(true)
|
||||||
await MeasureService.insert(idWell, measureParams)
|
await MeasureService.insert(idWell, measureParams)
|
||||||
setIsTableEditing(false)
|
setIsTableEditing(false)
|
||||||
updateMeasures()
|
updateMeasuresFunc()
|
||||||
setShowLoader(false)
|
setShowLoader(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,3 +31,41 @@ export const columnsDrillingFluid = [
|
|||||||
makeColumn(v("Смазка, %"), "grease",numericColumnOptions),
|
makeColumn(v("Смазка, %"), "grease",numericColumnOptions),
|
||||||
makeColumn(v("Карбонат кальция, кг/м³"), "calciumCarbonate",numericColumnOptions),
|
makeColumn(v("Карбонат кальция, кг/м³"), "calciumCarbonate",numericColumnOptions),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const drillingFluidDefaultData = {
|
||||||
|
idWell: 0,
|
||||||
|
key: 'drillingFluidDefaultData',
|
||||||
|
idCategory: 0,
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
isDefaultData: true,
|
||||||
|
data: {
|
||||||
|
"name": 0,
|
||||||
|
"temperature": 0,
|
||||||
|
"density": 0,
|
||||||
|
"conditionalViscosity": 0,
|
||||||
|
"r300": 0,
|
||||||
|
"r600": 0,
|
||||||
|
"r3r6": 0,
|
||||||
|
"dnsDpa": 0,
|
||||||
|
"plasticViscocity": 0,
|
||||||
|
"snsDpa": 0,
|
||||||
|
"r3r649С": 0,
|
||||||
|
"dns49Cdpa": 0,
|
||||||
|
"plasticViscocity49c": 0,
|
||||||
|
"sns49Cdpa": 0,
|
||||||
|
"mbt": 0,
|
||||||
|
"sand": 0,
|
||||||
|
"filtering": 0,
|
||||||
|
"crust": 0,
|
||||||
|
"ktk": 0,
|
||||||
|
"ph": 0,
|
||||||
|
"hardness": 0,
|
||||||
|
"chlorides": 0,
|
||||||
|
"pf": 0,
|
||||||
|
"mf": 0,
|
||||||
|
"pm": 0,
|
||||||
|
"fluidSolidPhase": 0,
|
||||||
|
"grease": 0,
|
||||||
|
"calciumCarbonate": 0
|
||||||
|
}
|
||||||
|
}
|
@ -1,9 +1,12 @@
|
|||||||
import { useState, useEffect } from 'react'
|
import { useState, useEffect } from 'react'
|
||||||
import { columnsMudDiagram} from './columnsMudDiagram'
|
import { columnsMudDiagram} from './mudDiagramData'
|
||||||
import { columnsDrillingFluid} from './columnsDrillingFluid'
|
import { mudDiagramDefaultData} from './mudDiagramData'
|
||||||
|
import { columnsDrillingFluid} from './drillingFluidData'
|
||||||
|
import { drillingFluidDefaultData} from './drillingFluidData'
|
||||||
|
import { columnsNnb } from './nnbData'
|
||||||
|
import { nnbDefaultData } from './nnbData'
|
||||||
import { invokeWebApiWrapperAsync } from '../../components/factory'
|
import { invokeWebApiWrapperAsync } from '../../components/factory'
|
||||||
import { MeasureService } from '../../services/api'
|
import { MeasureService } from '../../services/api'
|
||||||
import { columnsNnb } from './columnsNnb'
|
|
||||||
import LoaderPortal from '../../components/LoaderPortal'
|
import LoaderPortal from '../../components/LoaderPortal'
|
||||||
import { MeasureTable } from './MeasureTable'
|
import { MeasureTable } from './MeasureTable'
|
||||||
|
|
||||||
@ -18,11 +21,11 @@ export default function Measure({idWell}){
|
|||||||
const measures = await MeasureService.getHisory(idWell)
|
const measures = await MeasureService.getHisory(idWell)
|
||||||
|
|
||||||
const fluids = measures.filter(el => el.idCategory === 1)
|
const fluids = measures.filter(el => el.idCategory === 1)
|
||||||
setFluidValues(fluids ?? [])
|
setFluidValues(fluids.length ? fluids : [drillingFluidDefaultData])
|
||||||
const muds = measures.filter(el => el.idCategory === 2)
|
const muds = measures.filter(el => el.idCategory === 2)
|
||||||
setMudValues(muds ?? [])
|
setMudValues(muds.length ? muds : [mudDiagramDefaultData])
|
||||||
const nnbs = measures.filter(el => el.idCategory === 3)
|
const nnbs = measures.filter(el => el.idCategory === 3)
|
||||||
setNnbValues(nnbs ?? [])
|
setNnbValues(nnbs.length ? nnbs : [nnbDefaultData])
|
||||||
}
|
}
|
||||||
,setShowLoader
|
,setShowLoader
|
||||||
,`Не удалось загрузить последние данные по скважине ${idWell}`)
|
,`Не удалось загрузить последние данные по скважине ${idWell}`)
|
||||||
|
@ -24,4 +24,36 @@ export const columnsMudDiagram = [
|
|||||||
makeColumn(v('С5 пентан (отн%)'), 'pentane', numericColumnOptions),
|
makeColumn(v('С5 пентан (отн%)'), 'pentane', numericColumnOptions),
|
||||||
makeColumn(v('Мех. скорость'), 'mechanicalSpeed', numericColumnOptions),
|
makeColumn(v('Мех. скорость'), 'mechanicalSpeed', numericColumnOptions),
|
||||||
makeColumn('Предварительное заключение о насыщении по ГК', 'preliminaryConclusion', textColumnOptions),
|
makeColumn('Предварительное заключение о насыщении по ГК', 'preliminaryConclusion', textColumnOptions),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
export const mudDiagramDefaultData = {
|
||||||
|
idWell: 0,
|
||||||
|
key: 'mudDiagramDefaultData',
|
||||||
|
idCategory: 0,
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
isDefaultData: true,
|
||||||
|
data: {
|
||||||
|
"probeNumber": 0,
|
||||||
|
"probeExtractionDepth": 0,
|
||||||
|
"sandstone": 0,
|
||||||
|
"siltstone": 0,
|
||||||
|
"argillit": 0,
|
||||||
|
"brokenArgillit": 0,
|
||||||
|
"coal": 0,
|
||||||
|
"sand": 0,
|
||||||
|
"clay": 0,
|
||||||
|
"camstone": 0,
|
||||||
|
"cement": 0,
|
||||||
|
"summary": '-',
|
||||||
|
"drillingMud": 0,
|
||||||
|
"sludge": 0,
|
||||||
|
"maxSum": 0,
|
||||||
|
"methane": 0,
|
||||||
|
"ethane": 0,
|
||||||
|
"propane": 0,
|
||||||
|
"butane": 0,
|
||||||
|
"pentane": 0,
|
||||||
|
"mechanicalSpeed": 0,
|
||||||
|
"preliminaryConclusion": '-'
|
||||||
|
}
|
||||||
|
}
|
@ -19,4 +19,31 @@ export const columnsNnb = [
|
|||||||
makeColumn(v('Комментарий'), 'comment', numericColumnOptions),
|
makeColumn(v('Комментарий'), 'comment', numericColumnOptions),
|
||||||
makeColumn(v('Разница вертикальных глубин\nмежду планом и фактом'), 'depthPlanFactDifference', numericColumnOptions),
|
makeColumn(v('Разница вертикальных глубин\nмежду планом и фактом'), 'depthPlanFactDifference', numericColumnOptions),
|
||||||
makeColumn(v('Расстояние в пространстве\nмежду планом и фактом'), 'distancePlanFactDifference', numericColumnOptions),
|
makeColumn(v('Расстояние в пространстве\nмежду планом и фактом'), 'distancePlanFactDifference', numericColumnOptions),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const nnbDefaultData = {
|
||||||
|
idWell: 0,
|
||||||
|
key: 'nnbDefaultData',
|
||||||
|
idCategory: 0,
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
isDefaultData: true,
|
||||||
|
data: {
|
||||||
|
"depth": 0,
|
||||||
|
"zenithAngle": 0,
|
||||||
|
"magneticAzimuth": 0,
|
||||||
|
"trueAzimuth": 0,
|
||||||
|
"directAzimuth": 0,
|
||||||
|
"verticalDepth": 0,
|
||||||
|
"absoluteMark": 0,
|
||||||
|
"localNorthOffset": 0,
|
||||||
|
"localEastOffset": 0,
|
||||||
|
"outFallOffset": 0,
|
||||||
|
"offsetAzimuth": 0,
|
||||||
|
"areaIntensity": '-',
|
||||||
|
"offsetStopAngle": 0,
|
||||||
|
"zenithIntensity": 0,
|
||||||
|
"comment": '-',
|
||||||
|
"depthPlanFactDifference": 0,
|
||||||
|
"distancePlanFactDifference": 0
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user