From 5c008043c57b7ceb28743e0da253f9554d5b02a1 Mon Sep 17 00:00:00 2001 From: goodmice Date: Wed, 20 Oct 2021 16:27:11 +0500 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=81=D1=81=D1=8B=D0=BB=D0=BA=D0=B0=20=D0=BD?= =?UTF-8?q?=D0=B0=20=D1=81=D0=BA=D0=B0=D1=87=D0=B8=D0=B2=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BF=D1=80=D0=BE=D0=B3=D1=80=D0=B0=D0=BC=D0=BC=D1=8B?= =?UTF-8?q?=20=D0=B1=D1=83=D1=80=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Documents/DrillingProgram.jsx | 28 ++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/pages/Documents/DrillingProgram.jsx b/src/pages/Documents/DrillingProgram.jsx index b05e212..4c23f49 100644 --- a/src/pages/Documents/DrillingProgram.jsx +++ b/src/pages/Documents/DrillingProgram.jsx @@ -1,8 +1,11 @@ import {Button, Tooltip} from 'antd' -import { useState } from "react" +import { FileExcelOutlined } from '@ant-design/icons' +import { useEffect, useState } from "react" import {invokeWebApiWrapperAsync, download} from '../../components/factory' import DocumentsTemplate from './DocumentsTemplate' import LoaderPortal from '../../components/LoaderPortal' +import { Flex } from '../../components/Grid' +import { WellService } from '../../services/api' const idFileCategoryDrillingProgramItems = 13; @@ -10,6 +13,16 @@ export default function DrillingProgram({idWell}) { const [downloadButtonEnabled, selDownloadButtonEnabled] = useState(false) const [showLoader, setShowLoader] = useState(false) const [tooltip, setTooltip] = useState('нет файлов для формирования') + const [wellLabel, setWellLabel] = useState(`${idWell}`) + + useEffect(() => invokeWebApiWrapperAsync( + async () => { + const well = await WellService.get(idWell) + setWellLabel(well.caption ?? `${idWell}`) + }, + setShowLoader, + `Не удалось загрузить название скважины "${idWell}"` + ), [idWell]) const urlDownloadProgram =`/api/well/${idWell}/drillingProgram` @@ -37,7 +50,7 @@ export default function DrillingProgram({idWell}) { const downloadButton =
Программа бурения -
+
+ + + +
return(