forked from ddrilling/asb_cloud_front
Base pages and components for Telemetry analytics charts
This commit is contained in:
parent
6165c871a1
commit
eab4e3d749
@ -1,40 +0,0 @@
|
|||||||
import { ChartDepthToDay } from './charts/ChartDepthToDayOldVersion'
|
|
||||||
import { notify } from "./factory"
|
|
||||||
import { useState, useEffect } from 'react'
|
|
||||||
import { TelemetryAnalyticsService } from "../services/api"
|
|
||||||
import LoaderPortal from './LoaderPortal'
|
|
||||||
|
|
||||||
const lines = [
|
|
||||||
{ label: "Глубина забоя", yAccessorName: "wellDepth", color: '#f00' },
|
|
||||||
{ label: "Положение инструмента", yAccessorName: "bitDepth", color: '#ff0' }
|
|
||||||
]
|
|
||||||
|
|
||||||
export function TelemetryAnalysisDepthToDay({idWell}) {
|
|
||||||
const [depthToDayData, setDepthToDayData] = useState([])
|
|
||||||
const [loader, setLoader] = useState(false)
|
|
||||||
|
|
||||||
const handleReceiveDepthToDayData = (data) => {
|
|
||||||
setDepthToDayData(data)
|
|
||||||
}
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
setLoader(true)
|
|
||||||
TelemetryAnalyticsService.getWellDepthToDay(idWell)
|
|
||||||
.then(handleReceiveDepthToDayData)
|
|
||||||
.catch(error => {
|
|
||||||
notify(`Не удалось получить данные для Анализа Глубина-День по скважине "${idWell}"`,
|
|
||||||
'warning')
|
|
||||||
console.log(error)
|
|
||||||
})
|
|
||||||
.finally(setLoader(false))
|
|
||||||
}, [idWell])
|
|
||||||
|
|
||||||
return (
|
|
||||||
<LoaderPortal show={loader}>
|
|
||||||
<ChartDepthToDay
|
|
||||||
data={depthToDayData}
|
|
||||||
lines={lines}
|
|
||||||
/>
|
|
||||||
</LoaderPortal>
|
|
||||||
)
|
|
||||||
}
|
|
@ -1,13 +1,12 @@
|
|||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { ChartDepthToDayBase } from './ChartDepthToDayBaseOldVersion'
|
import { ChartTelemetryDepthToDayBase } from './ChartTelemetryDepthToDayBase'
|
||||||
import { CreateDataset } from './ChartTimeArchive'
|
import { CreateDataset } from './ChartTimeArchive'
|
||||||
|
|
||||||
export const ChartDepthToDayOldVersion = ({data, lines}) => {
|
export const ChartTelemetryDepthToDay = ({data, lines}) => {
|
||||||
const [depthToDayDataParams, setDepthToDayDataParams] = useState({data: {datasets: []}})
|
const [depthToDayDataParams, setDepthToDayDataParams] = useState({data: {datasets: []}})
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if ((!lines)
|
if (!lines || !data)
|
||||||
|| (!data))
|
|
||||||
return
|
return
|
||||||
|
|
||||||
let newDatasets = lines.map(lineCfg => {
|
let newDatasets = lines.map(lineCfg => {
|
||||||
@ -33,6 +32,6 @@ export const ChartDepthToDayOldVersion = ({data, lines}) => {
|
|||||||
}, [data, lines])
|
}, [data, lines])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ChartDepthToDayBase dataParams={depthToDayDataParams} />
|
<ChartTelemetryDepthToDayBase dataParams={depthToDayDataParams} />
|
||||||
)
|
)
|
||||||
}
|
}
|
@ -62,7 +62,8 @@ const defaultOptions = {
|
|||||||
|
|
||||||
y:{
|
y:{
|
||||||
type:'linear',
|
type:'linear',
|
||||||
position:'top'
|
position:'top',
|
||||||
|
reverse: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
elements:{
|
elements:{
|
||||||
@ -174,7 +175,7 @@ export const timeParamsByInterval = (intervalSec:number) :TimeParams => {
|
|||||||
return {unit, stepSize}
|
return {unit, stepSize}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ChartDepthToDayBaseOldVersion: React.FC<ChartTimeBaseProps> = ({options, dataParams}) => {
|
export const ChartTelemetryDepthToDayBase: React.FC<ChartTimeBaseProps> = ({options, dataParams}) => {
|
||||||
const chartRef = useRef<HTMLCanvasElement>(null)
|
const chartRef = useRef<HTMLCanvasElement>(null)
|
||||||
const [chart, setChart] = useState<any>()
|
const [chart, setChart] = useState<any>()
|
||||||
|
|
6
src/pages/TelemetryAnalysis/OperationsSummary.jsx
Normal file
6
src/pages/TelemetryAnalysis/OperationsSummary.jsx
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
export default function OperationsSummary({idWell}){
|
||||||
|
|
||||||
|
return (<>123</>)
|
||||||
|
}
|
6
src/pages/TelemetryAnalysis/OperationsToInterval.jsx
Normal file
6
src/pages/TelemetryAnalysis/OperationsToInterval.jsx
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
export default function OperationsToInterval({idWell}){
|
||||||
|
|
||||||
|
return (<>123</>)
|
||||||
|
}
|
35
src/pages/TelemetryAnalysis/TelemetryAnalysisDepthToDay.jsx
Normal file
35
src/pages/TelemetryAnalysis/TelemetryAnalysisDepthToDay.jsx
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
import { ChartTelemetryDepthToDay } from '../../components/charts/ChartTelemetryDepthToDay'
|
||||||
|
import { useState, useEffect } from 'react'
|
||||||
|
import { invokeWebApiWrapperAsync } from '../../components/factory'
|
||||||
|
import { TelemetryAnalyticsService } from "../../services/api"
|
||||||
|
import LoaderPortal from '../../components/LoaderPortal'
|
||||||
|
|
||||||
|
const lines = [
|
||||||
|
{ label: "Глубина забоя", yAccessorName: "wellDepth", color: '#f00' },
|
||||||
|
{ label: "Положение инструмента", yAccessorName: "bitDepth", color: '#ff0' }
|
||||||
|
]
|
||||||
|
|
||||||
|
export default function TelemetryAnalysisDepthToDay({idWell}) {
|
||||||
|
const [depthToDayData, setDepthToDayData] = useState([])
|
||||||
|
const [loader, setLoader] = useState(false)
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setLoader(true)
|
||||||
|
invokeWebApiWrapperAsync(
|
||||||
|
async () => {
|
||||||
|
const depthToDayData = await TelemetryAnalyticsService.getWellDepthToDay(idWell)
|
||||||
|
setDepthToDayData(depthToDayData)
|
||||||
|
},
|
||||||
|
setLoader,
|
||||||
|
`Не удалось получить данные для Анализа Глубина-День по скважине "${idWell}"`)
|
||||||
|
}, [idWell])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<LoaderPortal show={loader}>
|
||||||
|
<ChartTelemetryDepthToDay
|
||||||
|
data={depthToDayData}
|
||||||
|
lines={lines}
|
||||||
|
/>
|
||||||
|
</LoaderPortal>
|
||||||
|
)
|
||||||
|
}
|
@ -1,10 +1,9 @@
|
|||||||
import { useParams } from "react-router-dom"
|
import { notify } from "../../components/factory"
|
||||||
import { notify } from "./factory"
|
|
||||||
import { useState, useEffect } from 'react'
|
import { useState, useEffect } from 'react'
|
||||||
import { TelemetryAnalyticsService } from '../services/api'
|
import { TelemetryAnalyticsService } from '../../services/api'
|
||||||
import { ChartDepthToInterval } from './charts/ChartDepthToInterval'
|
import { ChartDepthToInterval } from '../../components/charts/ChartDepthToInterval'
|
||||||
import { Select } from 'antd'
|
import { Select } from 'antd'
|
||||||
import LoaderPortal from './LoaderPortal'
|
import LoaderPortal from '../../components/LoaderPortal'
|
||||||
|
|
||||||
const { Option } = Select
|
const { Option } = Select
|
||||||
|
|
||||||
@ -21,8 +20,7 @@ const timePeriodCollection = [
|
|||||||
|
|
||||||
const lines = [{ label: 'График скорость проходки-интервал', yAccessorName: "intervalDepthProgress", xAccessorName: "intervalStartDate", color: '#00f' }]
|
const lines = [{ label: 'График скорость проходки-интервал', yAccessorName: "intervalDepthProgress", xAccessorName: "intervalStartDate", color: '#00f' }]
|
||||||
|
|
||||||
export function TelemetryAnalysisDepthToInterval() {
|
export default function TelemetryAnalysisDepthToInterval({idWell}) {
|
||||||
let { id } = useParams()
|
|
||||||
const [depthToIntervalData, setDepthToIntervalData] = useState([])
|
const [depthToIntervalData, setDepthToIntervalData] = useState([])
|
||||||
const [loader, setLoader] = useState(false)
|
const [loader, setLoader] = useState(false)
|
||||||
const [chartInterval, setChartInterval] = useState(600)
|
const [chartInterval, setChartInterval] = useState(600)
|
||||||
@ -35,15 +33,15 @@ export function TelemetryAnalysisDepthToInterval() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setLoader(true)
|
setLoader(true)
|
||||||
TelemetryAnalyticsService.getWellDepthToInterval(id, chartInterval)
|
TelemetryAnalyticsService.getWellDepthToInterval(idWell, chartInterval)
|
||||||
.then(handleReceiveDepthToIntervalData)
|
.then(handleReceiveDepthToIntervalData)
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
notify(`Не удалось получить данные для Анализа скорость проходки-интервал "${id}"`,
|
notify(`Не удалось получить данные для Анализа скорость проходки-интервал "${idWell}"`,
|
||||||
'warning')
|
'warning')
|
||||||
console.log(error)
|
console.log(error)
|
||||||
})
|
})
|
||||||
.finally(setLoader(false))
|
.finally(setLoader(false))
|
||||||
}, [id, chartInterval])
|
}, [idWell, chartInterval])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<LoaderPortal show={loader}>
|
<LoaderPortal show={loader}>
|
53
src/pages/TelemetryAnalysis/index.jsx
Normal file
53
src/pages/TelemetryAnalysis/index.jsx
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
import {Layout, Menu} from "antd";
|
||||||
|
import {Switch, Link, Route, useParams} from "react-router-dom";
|
||||||
|
import { FolderOutlined } from "@ant-design/icons";
|
||||||
|
import OperationsSummary from "./OperationsSummary";
|
||||||
|
import OperationsToInterval from "./OperationsToInterval";
|
||||||
|
import TelemetryAnalysisDepthToDay from './TelemetryAnalysisDepthToDay'
|
||||||
|
import TelemetryAnalysisDepthToInterval from './TelemetryAnalysisDepthToInterval'
|
||||||
|
|
||||||
|
const { Content } = Layout
|
||||||
|
|
||||||
|
export default function TelemetryAnalysis({idWell}) {
|
||||||
|
let {tab} = useParams()
|
||||||
|
const rootPath = `/well/${idWell}/telemetryAnalysis`;
|
||||||
|
|
||||||
|
return (<>
|
||||||
|
<Menu
|
||||||
|
mode="horizontal"
|
||||||
|
selectable={true}
|
||||||
|
className="well_menu"
|
||||||
|
selectedKeys={[tab]}>
|
||||||
|
<Menu.Item key="depthToDay" icon={<FolderOutlined />}>
|
||||||
|
<Link to={`${rootPath}/depthToDay`}>Глубина-день</Link>
|
||||||
|
</Menu.Item>
|
||||||
|
<Menu.Item key="depthToInterval" icon={<FolderOutlined />}>
|
||||||
|
<Link to={`${rootPath}/depthToInterval`}>Глубина-интервал</Link>
|
||||||
|
</Menu.Item>
|
||||||
|
<Menu.Item key="operationsSummary" icon={<FolderOutlined />}>
|
||||||
|
<Link to={`${rootPath}/operationsSummary`}>Все операции</Link>
|
||||||
|
</Menu.Item>
|
||||||
|
<Menu.Item key="operationsToInterval" icon={<FolderOutlined />}>
|
||||||
|
<Link to={`${rootPath}/operationsToInterval`}>Операции-интервал</Link>
|
||||||
|
</Menu.Item>
|
||||||
|
</Menu>
|
||||||
|
<Layout>
|
||||||
|
<Content className="site-layout-background">
|
||||||
|
<Switch>
|
||||||
|
<Route path={`${rootPath}/depthToDay`}>
|
||||||
|
<TelemetryAnalysisDepthToDay idWell={idWell}/>
|
||||||
|
</Route>
|
||||||
|
<Route path={`${rootPath}/depthToInterval`}>
|
||||||
|
<TelemetryAnalysisDepthToInterval idWell={idWell}/>
|
||||||
|
</Route>
|
||||||
|
<Route path={`${rootPath}/operationsSummary`}>
|
||||||
|
<OperationsSummary idWell={idWell}/>
|
||||||
|
</Route>
|
||||||
|
<Route path={`${rootPath}/operationsToInterval`}>
|
||||||
|
<OperationsToInterval idWell={idWell}/>
|
||||||
|
</Route>
|
||||||
|
</Switch>
|
||||||
|
</Content>
|
||||||
|
</Layout>
|
||||||
|
</>)
|
||||||
|
}
|
@ -6,6 +6,7 @@ import {
|
|||||||
FilePdfOutlined,
|
FilePdfOutlined,
|
||||||
DatabaseOutlined,
|
DatabaseOutlined,
|
||||||
ExperimentOutlined,
|
ExperimentOutlined,
|
||||||
|
FundProjectionScreenOutlined
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import { Link, Redirect, Route, Switch, useParams } from "react-router-dom";
|
import { Link, Redirect, Route, Switch, useParams } from "react-router-dom";
|
||||||
import TelemetryView from "./TelemetryView";
|
import TelemetryView from "./TelemetryView";
|
||||||
@ -17,6 +18,7 @@ import Measure from "./Measure";
|
|||||||
import { makeMenuItems } from "./Documents/menuItems";
|
import { makeMenuItems } from "./Documents/menuItems";
|
||||||
import WellOperations from "./WellOperations";
|
import WellOperations from "./WellOperations";
|
||||||
import DrillingProgram from "./Documents/DrillingProgram";
|
import DrillingProgram from "./Documents/DrillingProgram";
|
||||||
|
import TelemetryAnalysis from "./TelemetryAnalysis"
|
||||||
import {PrivateMenuItem} from '../components/Private'
|
import {PrivateMenuItem} from '../components/Private'
|
||||||
|
|
||||||
const { Content } = Layout;
|
const { Content } = Layout;
|
||||||
@ -49,6 +51,9 @@ export default function Well() {
|
|||||||
<PrivateMenuItem key="archive" icon={<DatabaseOutlined />}>
|
<PrivateMenuItem key="archive" icon={<DatabaseOutlined />}>
|
||||||
<Link to={`${rootPath}/archive`}>Архив</Link>
|
<Link to={`${rootPath}/archive`}>Архив</Link>
|
||||||
</PrivateMenuItem>
|
</PrivateMenuItem>
|
||||||
|
<PrivateMenuItem key="telemetryAnalysis" icon={<FundProjectionScreenOutlined />}>
|
||||||
|
<Link to={`${rootPath}/telemetryAnalysis/depthToDay`}>Операции по телеметрии</Link>
|
||||||
|
</PrivateMenuItem>
|
||||||
<SubMenu
|
<SubMenu
|
||||||
key="document"
|
key="document"
|
||||||
title={
|
title={
|
||||||
@ -90,6 +95,9 @@ export default function Well() {
|
|||||||
<Route path="/well/:idWell/archive">
|
<Route path="/well/:idWell/archive">
|
||||||
<Archive idWell={idWell} />
|
<Archive idWell={idWell} />
|
||||||
</Route>
|
</Route>
|
||||||
|
<Route path="/well/:idWell/telemetryAnalysis/:tab">
|
||||||
|
<TelemetryAnalysis idWell={idWell} />
|
||||||
|
</Route>
|
||||||
<Route path="/well/:idWell/document/:category">
|
<Route path="/well/:idWell/document/:category">
|
||||||
<Documents idWell={idWell} />
|
<Documents idWell={idWell} />
|
||||||
</Route>
|
</Route>
|
||||||
|
Loading…
Reference in New Issue
Block a user