Number.isFinite(number) ? number.toFixed(2) : '-'
-
-export const getOperations = async (idWell) => {
- const ops = await OperationStatService.getTvd(idWell)
-
- if (!ops) return []
-
- const convert = wellOperationDto => ({
- key: wellOperationDto?.id,
- depth: wellOperationDto?.depthStart,
- date: wellOperationDto?.dateStart,
- day: wellOperationDto?.day,
- })
-
- const planData = ops
- .map(item => convert(item.plan))
- .filter(el => el.key)
-
- const factData = ops
- .map(item => convert(item.fact))
- .filter(el => el.key)
-
- const predictData = ops
- .map(item => convert(item.predict))
- .filter(el => el.key)
-
- return { operations: ops, plan: planData, fact: factData, predict: predictData }
-}
-
-export const makeFilterMinMaxFunction = (key) => (filterValue,
- dataItem) =>
- filterValue === 'max'
- ? dataItem[maxPrefix + key]
- : filterValue === 'min'
- ? dataItem[minPrefix + key]
- : false
-
-export const calcAndUpdateStats = (data, keys) => {
- const mins = {}
- const maxs = {}
-
- keys.forEach((key) => {
- maxs[key] = Number.MIN_VALUE
- mins[key] = Number.MAX_VALUE
- })
-
- data.forEach((item) => {
- keys.forEach((key) => {
- if (mins[key] > item[key]) mins[key] = item[key]
- if (maxs[key] < item[key]) maxs[key] = item[key]
- })
- })
-
- for (let i = 0; i < data.length; i++) {
- keys.forEach((key) => {
- data[i][maxPrefix + key] = data[i][key] === maxs[key]
- data[i][minPrefix + key] = data[i][key] === mins[key]
- })
- }
-}
-
-export const calcAndUpdateStatsBySections = (data, keys) => {
- const sectionTypes = new Set()
- data.forEach((item) => sectionTypes.add(item.sectionType))
- sectionTypes.forEach(sectionType => {
- const filteredBySectionData = data.filter((item) => item.sectionType === sectionType)
- calcAndUpdateStats(filteredBySectionData, keys)
- })
-}
diff --git a/src/pages/Documents/DocumentsTemplate.jsx b/src/pages/Documents/DocumentsTemplate.jsx
index 1926379..674c066 100644
--- a/src/pages/Documents/DocumentsTemplate.jsx
+++ b/src/pages/Documents/DocumentsTemplate.jsx
@@ -1,4 +1,3 @@
-import moment from 'moment'
import { useState, useEffect } from 'react'
import { DatePicker, Button, Input } from 'antd'
@@ -9,6 +8,7 @@ import { UploadForm } from '@components/UploadForm'
import { CompanyView, UserView } from '@components/views'
import { EditableTable, makePaginationObject } from '@components/Table'
import { invokeWebApiWrapperAsync, downloadFile, formatBytes } from '@components/factory'
+import { formatDate } from '@utils'
const pageSize = 12
const { RangePicker } = DatePicker
@@ -28,7 +28,7 @@ const columns = [
title: 'Дата загрузки',
key: 'uploadDate',
dataIndex: 'uploadDate',
- render: item => moment.utc(item).local().format('DD MMM YYYY, HH:mm:ss'),
+ render: item => formatDate(item, false, 'DD MMM YYYY, HH:mm:ss'),
}, {
title: 'Размер',
key: 'size',
diff --git a/src/pages/Measure/MeasureTable.jsx b/src/pages/Measure/MeasureTable.jsx
index 2cdf50a..af0be5d 100644
--- a/src/pages/Measure/MeasureTable.jsx
+++ b/src/pages/Measure/MeasureTable.jsx
@@ -138,20 +138,20 @@ export const MeasureTable = memo(({ idWell, group, updateMeasuresFunc, additiona
- {data.map((item, index) =>
+ {data.map((item, index) => (
setDisplayedValues(item)}
- dot={item?.id === displayedValues?.id &&
+ dot={item?.id === displayedValues?.id && (
- }
+ )}
>
- {formatDate(item.timestamp, true) ?? 'Нет данных'}
+ {formatDate(item.timestamp) ?? 'Нет данных'}
- )}
+ ))}
diff --git a/src/pages/TelemetryView/Setpoints.jsx b/src/pages/TelemetryView/Setpoints.jsx
index 3666b22..78da535 100644
--- a/src/pages/TelemetryView/Setpoints.jsx
+++ b/src/pages/TelemetryView/Setpoints.jsx
@@ -82,7 +82,7 @@ export const Setpoints = ({ idWell, ...other }) => {
visible={isModalVisible}
onCancel={() => setIsModalVisible(false)}
footer={(
-