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(