@@ -181,4 +177,6 @@ export default function Archive({idWell}) {
>
)
-}
+})
+
+export default Archive
diff --git a/src/pages/Documents/DrillingProgram.jsx b/src/pages/DrillingProgram.jsx
similarity index 87%
rename from src/pages/Documents/DrillingProgram.jsx
rename to src/pages/DrillingProgram.jsx
index 4c8d456..683f220 100644
--- a/src/pages/Documents/DrillingProgram.jsx
+++ b/src/pages/DrillingProgram.jsx
@@ -2,18 +2,18 @@ import { useEffect, useState } from 'react'
import { FileExcelOutlined } from '@ant-design/icons'
import { Popconfirm, Button, Tooltip, Typography } from 'antd'
-import { Flex } from '../../components/Grid'
-import { MarkView, UserView } from '../../components/views'
-import LoaderPortal from '../../components/LoaderPortal'
-import { invokeWebApiWrapperAsync, download, formatBytes } from '../../components/factory'
-import { DrillingProgramService, WellService } from '../../services/api'
+import { Flex } from '@components/Grid'
+import LoaderPortal from '@components/LoaderPortal'
+import { MarkView, UserView } from '@components/views'
+import { invokeWebApiWrapperAsync, download, formatBytes } from '@components/factory'
+import { DrillingProgramService, WellService } from '@api'
-import DocumentsTemplate from './DocumentsTemplate'
+import DocumentsTemplate from '@pages/Documents/DocumentsTemplate'
const idFileCategoryDrillingProgramItems = 13
-const {Text} = Typography
+const { Text } = Typography
-export default function DrillingProgram({ idWell }) {
+export const DrillingProgram = ({ idWell }) => {
const [downloadButtonEnabled, selDownloadButtonEnabled] = useState(false)
const [showLoader, setShowLoader] = useState(false)
const [tooltip, setTooltip] = useState('нет файлов для формирования')
@@ -27,15 +27,13 @@ export default function DrillingProgram({ idWell }) {
setWellLabel(well.caption ?? `${idWell}`)
},
setShowLoader,
- `Не удалось загрузить название скважины '${idWell}'`
+ `Не удалось загрузить название скважины "${idWell}"`
), [idWell])
- const urlDownloadProgram = `/api/well/${idWell}/drillingProgram`
-
const downloadProgram = () => invokeWebApiWrapperAsync(
- async () => await download(urlDownloadProgram),
+ async () => await download(`/api/well/${idWell}/drillingProgram`),
setShowLoader,
- 'Не удалось загрузить программу бурения'
+ `Не удалось загрузить программу бурения для скважины "${idWell}"`
)
const openProgramPreview = () => invokeWebApiWrapperAsync(
@@ -151,15 +149,17 @@ export default function DrillingProgram({ idWell }) {
return (
)
}
+
+export default DrillingProgram
diff --git a/src/pages/SuspenseFallback.jsx b/src/pages/SuspenseFallback.tsx
similarity index 55%
rename from src/pages/SuspenseFallback.jsx
rename to src/pages/SuspenseFallback.tsx
index 438ae41..d287b53 100644
--- a/src/pages/SuspenseFallback.jsx
+++ b/src/pages/SuspenseFallback.tsx
@@ -1,9 +1,17 @@
import { LoadingOutlined } from '@ant-design/icons'
-import { Flex } from '../components/Grid'
+import { CSSProperties, memo } from 'react'
-export const SuspenseFallback = ({ style }) => (
+import { Flex } from '@components/Grid'
+
+export type SuspenseFallbackProps = {
+ style?: CSSProperties
+}
+
+export const SuspenseFallback = memo
(({ style }) => (
Страница загружается, пожалуйста, подождите...
-)
+))
+
+export default SuspenseFallback
diff --git a/src/pages/TelemetryAnalysis/TelemetryAnalysisOperationsToInterval.jsx b/src/pages/TelemetryAnalysis/TelemetryAnalysisOperationsToInterval.jsx
index cb5d16e..ba6dfab 100644
--- a/src/pages/TelemetryAnalysis/TelemetryAnalysisOperationsToInterval.jsx
+++ b/src/pages/TelemetryAnalysis/TelemetryAnalysisOperationsToInterval.jsx
@@ -1,6 +1,3 @@
+export const TelemetryAnalysisOperationsToInterval = ({ idWell }) => (<>123>)
-
-export default function TelemetryAnalysisOperationsToInterval({idWell}){
-
- return (<>123>)
-}
\ No newline at end of file
+export default TelemetryAnalysisOperationsToInterval
diff --git a/src/pages/TelemetryView/RigMnemo.jsx b/src/pages/TelemetryView/RigMnemo.jsx
index fa9c036..c6f00ea 100644
--- a/src/pages/TelemetryView/RigMnemo.jsx
+++ b/src/pages/TelemetryView/RigMnemo.jsx
@@ -1,64 +1,62 @@
+import { memo } from 'react'
+
const styleBase = {
- stroke: "none",
- strokeLinecap: "butt",
- strokeLinejoin: "miter",
+ stroke: 'none',
+ strokeLinecap: 'butt',
+ strokeLinejoin: 'miter',
}
const styleCasing = {
...styleBase,
- fill: "#808080",
+ fill: '#808080',
};
const styleGround = {
...styleBase,
- fill: "#deaa87",
+ fill: '#deaa87',
};
const styleTower = {
...styleBase,
- fill: "#999999",
+ fill: '#999999',
};
const styleWell = {
...styleBase,
- fill: "#37abc8",
+ fill: '#37abc8',
};
const styleBitDrive = {
...styleBase,
- fill: "#ff8080",
+ fill: '#ff8080',
};
const styleBitTool = {
...styleBase,
- fill: "#f9f9f9",
+ fill: '#f9f9f9',
};
const styleBlock = {
...styleBase,
- fill: "#ffdd55",
+ fill: '#ffdd55',
};
// const stylePump1 = {
// ...styleBase,
-// fill: "#5fd35f",
+// fill: '#5fd35f',
// };
// const stylePump2 = {
// ...styleBase,
-// fill: "#b3b3b3",
+// fill: '#b3b3b3',
// };
-export default function RigMnemo({
- blockPosition,
- bitPosition,
- wellDepth
-}) {
+export const RigMnemo = memo(({ blockPosition, bitPosition, wellDepth }) => {
let blockPositionY = 0
let bitPositionY = 0
- const isBlockVisible = blockPosition != null && Number.isFinite(blockPosition)
- const isBitVisible = wellDepth && bitPosition != null && Number.isFinite(bitPosition) && Number.isFinite(wellDepth)
+ const isBlockVisible = Number.isFinite(blockPosition)
+ const isBitVisible = Number.isFinite(bitPosition) && Number.isFinite(wellDepth)
if (isBlockVisible)
blockPositionY = -35 + (50 * (30 - +blockPosition) / 30)
@@ -76,133 +74,91 @@ export default function RigMnemo({
bitPositionY = -59 + 59 * bitPositionLocal / wellDepthLocal
if( wellDepthLocal > 20 && (wellDepthLocal - bitPositionLocal) > 2 && bitPositionProc > 0.96)
- bitPositionY = -2
+ bitPositionY = -2
}
const blockTranslate = `translate(-75, ${blockPositionY})`
const bitTranslate = `translate(0, ${bitPositionY})`
return (
-
+ )
+}
diff --git a/src/pages/WellOperations/TvdOldVersion.jsx b/src/pages/WellOperations/TvdOldVersion.jsx
deleted file mode 100644
index f79e6aa..0000000
--- a/src/pages/WellOperations/TvdOldVersion.jsx
+++ /dev/null
@@ -1,366 +0,0 @@
-// import { useEffect, useRef, useState } from "react";
-// import {
-// Chart,
-// TimeScale,
-// LinearScale,
-// Legend,
-// LineController,
-// PointElement,
-// LineElement,
-// } from "chart.js";
-// import "chartjs-adapter-moment";
-// import ChartDataLabels from "chartjs-plugin-datalabels";
-// import zoomPlugin from "chartjs-plugin-zoom";
-// import { invokeWebApiWrapperAsync } from "../../components/factory";
-// import LoaderPortal from "../../components/LoaderPortal";
-// import { WellOperationDtoPlanFactPredictBase } from '../../services/api'
-
-// const defaultDataPlan = [
-// {"depth": 0, "date": 0.00},
-// {"depth": 0, "date": 0.00},
-// {"depth": 50, "date": 0.08},
-// {"depth": 50, "date": 0.10},
-// {"depth": 50, "date": 0.15},
-// {"depth": 50, "date": 0.17},
-// {"depth": 50, "date": 0.19},
-// {"depth": 50, "date": 0.23},
-// {"depth": 50, "date": 0.25},
-// {"depth": 50, "date": 0.38},
-// {"depth": 50, "date": 0.40},
-// {"depth": 50, "date": 0.44},
-// {"depth": 50, "date": 0.52},
-// {"depth": 50, "date": 0.94},
-// {"depth": 50, "date": 1.06},
-// {"depth": 50, "date": 1.08},
-// {"depth": 50, "date": 1.13},
-// {"depth": 50, "date": 1.19},
-// {"depth": 1324, "date": 3.02},
-// {"depth": 1324, "date": 3.10},
-// {"depth": 1324, "date": 3.27},
-// {"depth": 1324, "date": 3.35},
-// {"depth": 1324, "date": 3.65},
-// {"depth": 1324, "date": 3.73},
-// {"depth": 1324, "date": 3.90},
-// {"depth": 1324, "date": 3.98},
-// {"depth": 1324, "date": 4.27},
-// {"depth": 1324, "date": 4.31},
-// {"depth": 1324, "date": 4.81},
-// {"depth": 1324, "date": 4.90},
-// {"depth": 1324, "date": 4.94},
-// {"depth": 1324, "date": 5.10},
-// {"depth": 1324, "date": 5.60},
-// {"depth": 1324, "date": 6.10},
-// {"depth": 1324, "date": 6.23},
-// {"depth": 1324, "date": 6.40},
-// {"depth": 1324, "date": 6.65},
-// {"depth": 1324, "date": 6.69},
-// {"depth": 1324, "date": 6.73},
-// {"depth": 1324, "date": 6.81},
-// {"depth": 1324, "date": 6.85},
-// {"depth": 2600, "date": 8.85},
-// {"depth": 2600, "date": 8.94},
-// {"depth": 2600, "date": 9.15},
-// {"depth": 2600, "date": 9.35},
-// {"depth": 2600, "date": 9.52},
-// {"depth": 2600, "date": 9.60},
-// {"depth": 3283, "date": 11.85},
-// {"depth": 3283, "date": 11.98},
-// {"depth": 3283, "date": 12.35},
-// {"depth": 3283, "date": 12.48},
-// {"depth": 3283, "date": 12.60},
-// {"depth": 3283, "date": 12.85},
-// {"depth": 3283, "date": 13.10},
-// {"depth": 3283, "date": 13.27},
-// {"depth": 3283, "date": 13.35},
-// {"depth": 3500, "date": 15.02},
-// {"depth": 3500, "date": 15.15},
-// {"depth": 3500, "date": 15.23},
-// {"depth": 3500, "date": 15.31},
-// {"depth": 3500, "date": 15.48},
-// {"depth": 3500, "date": 15.56},
-// {"depth": 3780, "date": 17.40},
-// {"depth": 3780, "date": 17.52},
-// {"depth": 3780, "date": 17.94},
-// {"depth": 3780, "date": 18.44},
-// {"depth": 3780, "date": 18.60},
-// {"depth": 3780, "date": 18.69},
-// {"depth": 4050, "date": 20.69},
-// {"depth": 4050, "date": 20.81},
-// {"depth": 4050, "date": 21.06},
-// {"depth": 4050, "date": 21.23},
-// {"depth": 4050, "date": 21.31},
-// {"depth": 4050, "date": 23.31},
-// {"depth": 4327, "date": 23.44},
-// {"depth": 4327, "date": 23.60},
-// {"depth": 4327, "date": 23.77},
-// {"depth": 4327, "date": 23.90},
-// {"depth": 4327, "date": 24.35},
-// {"depth": 4327, "date": 24.48},
-// {"depth": 4327, "date": 25.73},
-// {"depth": 4327, "date": 25.85},
-// {"depth": 4327, "date": 26.31},
-// {"depth": 4327, "date": 26.48},
-// {"depth": 4327, "date": 26.94},
-// {"depth": 4327, "date": 27.06},
-// {"depth": 4327, "date": 27.15},
-// {"depth": 4327, "date": 27.48},
-// {"depth": 4327, "date": 27.60},
-// {"depth": 4327, "date": 27.67},
-// {"depth": 4327, "date": 28.42},
-// {"depth": 4327, "date": 28.63},
-// {"depth": 4327, "date": 28.67},
-// {"depth": 4327, "date": 28.88},
-// {"depth": 4327, "date": 29.29},
-// {"depth": 4327, "date": 29.29}
-// ]
-
-// const defaultDataFact = [
-// { "depth": 0, "date": 0.00 },
-// { "depth": 55, "date": 0.04 },
-// { "depth": 55, "date": 0.08 },
-// { "depth": 55, "date": 0.14 },
-// { "depth": 55, "date": 0.26 },
-// { "depth": 55, "date": 0.71 },
-// { "depth": 55, "date": 0.81 },
-// { "depth": 55, "date": 0.83 },
-// { "depth": 264, "date": 1.06 },
-// { "depth": 547, "date": 1.39 },
-// { "depth": 547, "date": 1.43 },
-// { "depth": 947, "date": 2.06 },
-// { "depth": 1285, "date": 2.51 },
-// { "depth": 1285, "date": 2.58 },
-// { "depth": 1285, "date": 2.81 },
-// { "depth": 1285, "date": 2.87 },
-// { "depth": 1285, "date": 3.07 },
-// { "depth": 1285, "date": 3.08 },
-// { "depth": 1285, "date": 3.10 },
-// { "depth": 1285, "date": 3.26 },
-// { "depth": 1285, "date": 3.34 },
-// { "depth": 1285, "date": 3.60 },
-// { "depth": 1285, "date": 3.65 },
-// { "depth": 1285, "date": 3.90 },
-// { "depth": 1285, "date": 3.91 },
-// { "depth": 1285, "date": 4.00 },
-// { "depth": 1285, "date": 4.06 },
-// { "depth": 1285, "date": 4.08 },
-// { "depth": 1285, "date": 4.26 },
-// { "depth": 1285, "date": 4.76 },
-// { "depth": 1285, "date": 4.87 },
-// { "depth": 1285, "date": 5.01 },
-// { "depth": 1285, "date": 5.03 },
-// { "depth": 1285, "date": 5.08 },
-// { "depth": 1285, "date": 5.12 },
-// { "depth": 1285, "date": 5.14 },
-// { "depth": 1285, "date": 5.16 },
-// { "depth": 1285, "date": 5.20 },
-// { "depth": 1289, "date": 5.21 },
-// { "depth": 1289, "date": 5.23 },
-// { "depth": 1289, "date": 5.27 },
-// { "depth": 1872, "date": 6.08 },
-// { "depth": 2357, "date": 7.08 },
-// { "depth": 2614, "date": 7.73 },
-// { "depth": 2614, "date": 7.81 },
-// { "depth": 2614, "date": 7.98 },
-// { "depth": 2614, "date": 8.03 },
-// { "depth": 2614, "date": 8.08 },
-// { "depth": 2614, "date": 8.11 },
-// { "depth": 2614, "date": 8.14 },
-// { "depth": 2918, "date": 9.08 },
-// {"depth": 3230, "date": 9.12},
-// ]
-
-// const defaultDataForecast = [
-// {"depth": 3230, "date": 9.12},
-// {"depth": 3283, "date": 9.12},
-// {"depth": 3283, "date": 9.21},
-// {"depth": 3283, "date": 9.58},
-// {"depth": 3283, "date": 9.71},
-// {"depth": 3283, "date": 9.83},
-// {"depth": 3283, "date": 10.08},
-// {"depth": 3283, "date": 10.33},
-// {"depth": 3283, "date": 10.50},
-// {"depth": 3283, "date": 10.58},
-// {"depth": 3500, "date": 12.25},
-// {"depth": 3500, "date": 12.38},
-// {"depth": 3500, "date": 12.46},
-// {"depth": 3500, "date": 12.33},
-// {"depth": 3500, "date": 12.71},
-// {"depth": 3500, "date": 12.79},
-// {"depth": 3780, "date": 14.63},
-// {"depth": 3780, "date": 14.75},
-// {"depth": 3780, "date": 15.17},
-// {"depth": 3780, "date": 15.67},
-// {"depth": 3780, "date": 15.83},
-// {"depth": 3780, "date": 15.92},
-// {"depth": 4050, "date": 17.92},
-// {"depth": 4050, "date": 18.04},
-// {"depth": 4050, "date": 18.29},
-// {"depth": 4050, "date": 18.46},
-// {"depth": 4050, "date": 18.54},
-// {"depth": 4050, "date": 20.54},
-// {"depth": 4327, "date": 20.67},
-// {"depth": 4327, "date": 20.83},
-// {"depth": 4327, "date": 21.00},
-// {"depth": 4327, "date": 21.13},
-// {"depth": 4327, "date": 21.58},
-// {"depth": 4327, "date": 21.71},
-// {"depth": 4327, "date": 22.96},
-// {"depth": 4327, "date": 23.08},
-// {"depth": 4327, "date": 23.54},
-// {"depth": 4327, "date": 23.71},
-// {"depth": 4327, "date": 24.17},
-// {"depth": 4327, "date": 24.29},
-// {"depth": 4327, "date": 24.61},
-// {"depth": 4327, "date": 24.71},
-// {"depth": 4327, "date": 24.83},
-// {"depth": 4327, "date": 24.90},
-// {"depth": 4327, "date": 25.65},
-// {"depth": 4327, "date": 25.86},
-// {"depth": 4327, "date": 25.90},
-// {"depth": 4327, "date": 26.11},
-// {"depth": 4327, "date": 26.52},
-// {"depth": 4327, "date": 26.52}
-// ]
-
-
-// Chart.register(
-// TimeScale,
-// LinearScale,
-// LineController,
-// LineElement,
-// PointElement,
-// Legend,
-// ChartDataLabels,
-// zoomPlugin
-// );
-
-// const defaultOptions = {
-// responsive: true,
-// aspectRatio: 2.35,
-// interaction: {
-// intersect: false,
-// mode: "index",
-// },
-// scales: {
-// x: {
-// display: true,
-// title: {
-// display: true,
-// },
-// type: "linear", // был 'time' + его конфиг ниже
-// grid: {
-// drawTicks: true,
-// },
-// ticks: {
-// //count:24,
-// stepSize: 3,
-// major: { enabled: true },
-// z: 1,
-// display: true,
-// textStrokeColor: "#fff",
-// textStrokeWidth: 2,
-// color: "#000",
-// },
-// },
-
-// y: {
-// type: "linear",
-// position: "top",
-// reverse: true,
-// display: true,
-// title: {
-// display: true,
-// text: "Value",
-// },
-// },
-// },
-// parsing: {
-// xAxisKey: "date",
-// yAxisKey: "depth",
-// },
-// elements: {
-// point: {
-// radius: 1.7,
-// },
-// },
-// plugins: {
-// legend: {
-// display: true,
-// },
-// datalabels: {
-// display: false,
-// },
-// tooltip: {
-// enabled: true,
-// callbacks: {
-// label(tooltipItem) {
-// return tooltipItem.yLabel;
-// },
-// },
-// },
-// },
-// };
-
-// const makeDataset = (data, label, color, width = 1.5, dash) => ({
-// label: label,
-// data: data,
-// backgroundColor: color,
-// borderColor: color,
-// borderWidth: width,
-// borderDash: dash,
-// });
-
-// export const TvdOldVersion = ({ idWell }) => {
-// const chartRef = useRef(null);
-// const [chart, setChart] = useState();
-// const [data, setData] = useState({ datasets: [] });
-// const [showLoader, setShowLoader] = useState(false);
-
-// useEffect(
-// () =>
-// invokeWebApiWrapperAsync(
-// async () => {
-// const dataPlan = [];
-// const dataFact = [];
-// const dataPredict = [];
-// const data = {
-// datasets: [
-// makeDataset(dataPlan, "План", "#C004", 4),
-// makeDataset(dataFact, "Факт", "#0A0"),
-// makeDataset(dataPredict, "Прогноз", "purple", 1, [7, 3]),
-// ],
-// };
-// setData(data);
-// },
-// setShowLoader,
-// `Не удалось загрузить данные TVD по скважине ${idWell}`
-// ),
-// [idWell]
-// );
-
-// useEffect(() => {
-// if (chartRef.current && !chart) {
-// let thisOptions = {};
-// Object.assign(thisOptions, defaultOptions);
-
-// let newChart = new Chart(chartRef.current, {
-// type: "line",
-// plugins: [ChartDataLabels],
-// options: thisOptions,
-// data: data,
-// });
-// setChart(newChart);
-
-// return () => chart?.destroy();
-// } else {
-// chart.data = data;
-// chart.update();
-// }
-// }, [chart, data]);
-
-// return (
-//