asb_cloud_front/src/pages/Documents/DrillingProgram.jsx

26 lines
958 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import {Button} from 'antd'
import { useState } from "react"
import {invokeWebApiWrapperAsync, download} from '../../components/factory'
import DocumentsTemplate from './DocumentsTemplate'
import LoaderPortal from '../../components/LoaderPortal'
const idFileCategoryDrillingProgramItems = 13;
export default function DrillingProgram({idWell}) {
const [showLoader, setShowLoader] = useState(false)
const urlDownloadProgram =`api/well/${idWell}/drillingProgram`
const downloadProgram = () => invokeWebApiWrapperAsync(async()=>{
await download(urlDownloadProgram)
},
setShowLoader,
"Не удалось загрузить программу бурения")
return(<LoaderPortal show={showLoader}>
<Button onClick={downloadProgram}>Сформировать программу бурения</Button>
<DocumentsTemplate
idWell={idWell}
idCategory={idFileCategoryDrillingProgramItems}/>
</LoaderPortal>)
}