From c0b5f82ad269f9b1d47c8578709d3d9badc9b1b3 Mon Sep 17 00:00:00 2001 From: "av.maiorov" Date: Tue, 20 Dec 2022 12:04:58 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BD=20=D0=B2=D1=8B?= =?UTF-8?q?=D0=B7=D0=BE=D0=B2=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=D0=B0=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=BB=D1=83=D1=87=D0=B5=D0=BD=D0=B8=D1=8F=20=D1=81?= =?UTF-8?q?=D0=BF=D0=B8=D1=81=D0=BA=D0=B0=20=D0=BA=D0=B0=D1=82=D0=B5=D0=B3?= =?UTF-8?q?=D0=BE=D1=80=D0=B8=D0=B9=20=D0=B8=D0=B7=20=D0=B4=D0=BE=D1=87?= =?UTF-8?q?=D0=B5=D1=80=D0=BD=D0=B5=D0=B3=D0=BE=20=D0=BA=D0=BE=D0=BC=D0=BF?= =?UTF-8?q?=D0=BE=D0=BD=D0=B5=D0=BD=D1=82=D0=B0=20=D0=BD=D0=B0=20=D1=81?= =?UTF-8?q?=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D0=B5=20"=D0=9E=D0=BF?= =?UTF-8?q?=D0=B5=D1=80=D0=B0=D1=86=D0=B8=D0=B8".?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Well/Telemetry/Operations/TargetEditor.jsx | 7 ++----- src/pages/Well/Telemetry/Operations/index.jsx | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/pages/Well/Telemetry/Operations/TargetEditor.jsx b/src/pages/Well/Telemetry/Operations/TargetEditor.jsx index dc1dfd1..4e83c91 100644 --- a/src/pages/Well/Telemetry/Operations/TargetEditor.jsx +++ b/src/pages/Well/Telemetry/Operations/TargetEditor.jsx @@ -4,7 +4,7 @@ import { Button, Modal } from 'antd' import { useWell } from '@asb/context' import { invokeWebApiWrapperAsync } from '@components/factory' import { EditableTable, makeGroupColumn, makeNumericColumn, makeNumericRender, makeSelectColumn } from '@components/Table' -import { DetectedOperationService, OperationValueService } from '@api' +import { OperationValueService } from '@api' import { arrayOrDefault } from '@utils' const columnOptions = { @@ -14,7 +14,7 @@ const columnOptions = { const scroll = { y: '75vh', scrollToFirstRowOnChange: true } const numericRender = makeNumericRender(2) -export const TargetEditor = memo(({ loading, onChange }) => { +export const TargetEditor = memo(({ loading, onChange, options }) => { const [targets, setTargets] = useState([]) const [showModal, setShowModal] = useState(false) const [showLoader, setShowLoader] = useState(false) @@ -62,9 +62,6 @@ export const TargetEditor = memo(({ loading, onChange }) => { useEffect(() => { invokeWebApiWrapperAsync( async () => { - const categories = arrayOrDefault(await DetectedOperationService.getCategories()) - const options = categories.map(({ id, name }) => ({ value: id, label: name })) - setTargetColumns([ makeSelectColumn('Название', 'idOperationCategory', options, undefined, { ...columnOptions, width: 200 }, { showSearch: true, diff --git a/src/pages/Well/Telemetry/Operations/index.jsx b/src/pages/Well/Telemetry/Operations/index.jsx index 3d3748e..14f4674 100644 --- a/src/pages/Well/Telemetry/Operations/index.jsx +++ b/src/pages/Well/Telemetry/Operations/index.jsx @@ -142,8 +142,8 @@ const Operations = memo(() => { )} - {permissions.detectedOperation.get && permissions.operationValue.get && ( - + {permissions.detectedOperation.get && permissions.operationValue.get && categories && ( + )}