forked from ddrilling/asb_cloud_front
Добавлена страница РТК
This commit is contained in:
parent
0f5a00041e
commit
5689700c6d
@ -157,6 +157,19 @@ export const makeNumericStartEnd = (
|
|||||||
makeNumericColumn('конец', dataIndex + 'End', filters, filterDelegate, renderDelegate, width, makeNumericColumnOptions(fixed, dataIndex + 'End'))
|
makeNumericColumn('конец', dataIndex + 'End', filters, filterDelegate, renderDelegate, width, makeNumericColumnOptions(fixed, dataIndex + 'End'))
|
||||||
])
|
])
|
||||||
|
|
||||||
|
export const makeNumericMinMax = (
|
||||||
|
title: string,
|
||||||
|
dataIndex: string,
|
||||||
|
fixed: number,
|
||||||
|
filters: object[],
|
||||||
|
filterDelegate: (key: string | number) => any,
|
||||||
|
renderDelegate: (_: any, row: object) => any,
|
||||||
|
width: string,
|
||||||
|
) => makeGroupColumn(title, [
|
||||||
|
makeNumericColumn('мин', dataIndex + 'Min', filters, filterDelegate, renderDelegate, width, makeNumericColumnOptions(fixed, dataIndex + 'Min')),
|
||||||
|
makeNumericColumn('макс', dataIndex + 'Max', filters, filterDelegate, renderDelegate, width, makeNumericColumnOptions(fixed, dataIndex + 'Max')),
|
||||||
|
])
|
||||||
|
|
||||||
export const makeNumericAvgRange = (
|
export const makeNumericAvgRange = (
|
||||||
title: string,
|
title: string,
|
||||||
dataIndex: string,
|
dataIndex: string,
|
||||||
|
76
src/pages/WellOperations/DrillProcessFlow.jsx
Normal file
76
src/pages/WellOperations/DrillProcessFlow.jsx
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
import { useState, useEffect } from 'react'
|
||||||
|
|
||||||
|
import {
|
||||||
|
makeColumn,
|
||||||
|
makeNumericMinMax
|
||||||
|
} from '../../components/Table'
|
||||||
|
import LoaderPortal from '../../components/LoaderPortal'
|
||||||
|
import { invokeWebApiWrapperAsync } from '../../components/factory'
|
||||||
|
import { EditableTable, SelectFromDictionary } from '../../components/Table'
|
||||||
|
import { DrillFlowChartService } from '../../services/api'
|
||||||
|
import { dictionarySectionType, getByKeyOrReturnKey } from './dictionary'
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
makeColumn('Конструкция секции','idWellSectionType', {
|
||||||
|
editable: true,
|
||||||
|
input: <SelectFromDictionary dictionary={dictionarySectionType}/>,
|
||||||
|
width: 160,
|
||||||
|
render: (_, record)=>getByKeyOrReturnKey(dictionarySectionType, record.idWellSectionType)
|
||||||
|
}),
|
||||||
|
makeNumericMinMax('Глубина', 'depth'),
|
||||||
|
makeNumericMinMax('Нагрузка', 'axialLoad'),
|
||||||
|
makeNumericMinMax('Давление', 'pressure'),
|
||||||
|
makeNumericMinMax('Момент на ВСП', 'rotorTorque'),
|
||||||
|
makeNumericMinMax('Обороты на ВСП', 'rotorSpeed'),
|
||||||
|
makeNumericMinMax('Расход', 'flow')
|
||||||
|
]
|
||||||
|
|
||||||
|
export const DrillProcessFlow = ({idWell}) => {
|
||||||
|
const [flows, setFlows] = useState([])
|
||||||
|
const [showLoader, setShowLoader] = useState(false)
|
||||||
|
|
||||||
|
const updateFlows = () => invokeWebApiWrapperAsync(
|
||||||
|
async () => {
|
||||||
|
const flows = await DrillFlowChartService.get(idWell)
|
||||||
|
setFlows(Array.isArray(flows) ? flows : [])
|
||||||
|
},
|
||||||
|
setShowLoader,
|
||||||
|
'Не удалось загрузить режимно-технологическую карту скважины'
|
||||||
|
)
|
||||||
|
|
||||||
|
useEffect(updateFlows, [idWell])
|
||||||
|
|
||||||
|
const onAdd = async (param) => {
|
||||||
|
param.idWell = idWell
|
||||||
|
await DrillFlowChartService.insert(idWell, param)
|
||||||
|
updateFlows()
|
||||||
|
}
|
||||||
|
|
||||||
|
const onEdit = async (param) => {
|
||||||
|
if (!param.id) return
|
||||||
|
param.idWell = idWell
|
||||||
|
await DrillFlowChartService.update(idWell, param.id, param)
|
||||||
|
updateFlows()
|
||||||
|
}
|
||||||
|
|
||||||
|
const onDelete = async (param) => {
|
||||||
|
if (!param.id) return
|
||||||
|
await DrillFlowChartService.delete(idWell, param.id)
|
||||||
|
updateFlows()
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<LoaderPortal show={showLoader}>
|
||||||
|
<EditableTable
|
||||||
|
size={'small'}
|
||||||
|
bordered
|
||||||
|
columns={columns}
|
||||||
|
dataSource={flows}
|
||||||
|
onRowAdd={onAdd}
|
||||||
|
onRowEdit={onEdit}
|
||||||
|
onRowDelete={onDelete}
|
||||||
|
pagination={false}
|
||||||
|
/>
|
||||||
|
</LoaderPortal>
|
||||||
|
)
|
||||||
|
}
|
@ -1,12 +1,20 @@
|
|||||||
import {Layout, Menu} from "antd";
|
import {Layout, Menu} from "antd";
|
||||||
import {Switch, Link, Route, Redirect, useParams, useHistory} from "react-router-dom";
|
import {Switch, Link, Route, Redirect, useParams, useHistory} from "react-router-dom";
|
||||||
import { DeploymentUnitOutlined, LineChartOutlined, BuildOutlined, TableOutlined, ControlOutlined } from "@ant-design/icons";
|
import {
|
||||||
|
BarChartOutlined,
|
||||||
|
BuildOutlined,
|
||||||
|
ControlOutlined,
|
||||||
|
DeploymentUnitOutlined,
|
||||||
|
LineChartOutlined,
|
||||||
|
TableOutlined,
|
||||||
|
} from "@ant-design/icons";
|
||||||
import { WellDrillParams } from './WellDrillParams'
|
import { WellDrillParams } from './WellDrillParams'
|
||||||
import { WellSectionsStat } from './WellSectionsStat'
|
import { WellSectionsStat } from './WellSectionsStat'
|
||||||
import { WellCompositeEditor } from './WellCompositeEditor'
|
import { WellCompositeEditor } from './WellCompositeEditor'
|
||||||
import { WellOperationsEditor } from './WellOperationsEditor'
|
import { WellOperationsEditor } from './WellOperationsEditor'
|
||||||
import { Tvd } from './Tvd'
|
import { Tvd } from './Tvd'
|
||||||
import { ImportExportBar } from "./ImportExportBar";
|
import { ImportExportBar } from "./ImportExportBar";
|
||||||
|
import { DrillProcessFlow } from "./DrillProcessFlow";
|
||||||
|
|
||||||
const { Content } = Layout
|
const { Content } = Layout
|
||||||
|
|
||||||
@ -37,6 +45,9 @@ export default function WellOperations({idWell}) {
|
|||||||
<Menu.Item key="fact" icon={<TableOutlined />}>
|
<Menu.Item key="fact" icon={<TableOutlined />}>
|
||||||
<Link to={`${rootPath}/fact`}>Факт</Link>
|
<Link to={`${rootPath}/fact`}>Факт</Link>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
|
<Menu.Item key="dfc" icon={<BarChartOutlined />}>
|
||||||
|
<Link to={`${rootPath}/dfc`}>РТК</Link>
|
||||||
|
</Menu.Item>
|
||||||
<Menu.Item key="params" icon={<ControlOutlined />}>
|
<Menu.Item key="params" icon={<ControlOutlined />}>
|
||||||
<Link to={`${rootPath}/params`}>Режимы</Link>
|
<Link to={`${rootPath}/params`}>Режимы</Link>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
@ -60,6 +71,9 @@ export default function WellOperations({idWell}) {
|
|||||||
<Route path={`${rootPath}/fact`}>
|
<Route path={`${rootPath}/fact`}>
|
||||||
<WellOperationsEditor idWell={idWell} idType={1}/>
|
<WellOperationsEditor idWell={idWell} idType={1}/>
|
||||||
</Route>
|
</Route>
|
||||||
|
<Route path={`${rootPath}/dfc`}>
|
||||||
|
<DrillProcessFlow idWell={idWell} />
|
||||||
|
</Route>
|
||||||
<Route path={`${rootPath}/params`}>
|
<Route path={`${rootPath}/params`}>
|
||||||
<WellDrillParams idWell={idWell}/>
|
<WellDrillParams idWell={idWell}/>
|
||||||
</Route>
|
</Route>
|
||||||
|
Loading…
Reference in New Issue
Block a user