Move drillingProgramButton into documentTemplate header

This commit is contained in:
Фролов 2021-09-01 13:43:14 +05:00
parent 449a7566b6
commit e42b9069fe
2 changed files with 18 additions and 9 deletions

View File

@ -17,7 +17,7 @@ const pageSize = 12
const { RangePicker } = DatePicker const { RangePicker } = DatePicker
const { Search } = Input const { Search } = Input
export default function DocumentsTemplate({ idCategory, idWell, accept, onChange }) { export default function DocumentsTemplate({ idCategory, idWell, accept, headerChild, onChange }) {
const [page, setPage] = useState(1) const [page, setPage] = useState(1)
const [filterDataRange, setFilterDataRange] = useState([]) const [filterDataRange, setFilterDataRange] = useState([])
const [filterCompanyName, setFilterCompanyName] = useState([]) const [filterCompanyName, setFilterCompanyName] = useState([])
@ -181,6 +181,8 @@ export default function DocumentsTemplate({ idCategory, idWell, accept, onChange
onUploadStart={() => setShowLoader(true)} onUploadStart={() => setShowLoader(true)}
onUploadComplete={handleUploadComplete}/> onUploadComplete={handleUploadComplete}/>
</div> </div>
&nbsp;&nbsp;
{headerChild}
</div> </div>
<EditableTable <EditableTable

View File

@ -35,18 +35,25 @@ export default function DrillingProgram({idWell}) {
} }
} }
return(<LoaderPortal show={showLoader}> const downloadButton = <div>
<span>Программа бурения</span>
<div>
<Tooltip title={tooltip}> <Tooltip title={tooltip}>
<Button <Button
onClick={downloadProgram} onClick={downloadProgram}
disabled={!downloadButtonEnabled}> disabled={!downloadButtonEnabled}>
Сформировать программу бурения Сформировать и скачать
</Button> </Button>
</Tooltip> </Tooltip>
</div>
</div>
return(<LoaderPortal show={showLoader}>
<DocumentsTemplate <DocumentsTemplate
idWell={idWell} idWell={idWell}
idCategory={idFileCategoryDrillingProgramItems} idCategory={idFileCategoryDrillingProgramItems}
accept='.xlsx' accept='.xlsx'
onChange={filesUpdated}/> headerChild={downloadButton}
onChange={filesUpdated} />
</LoaderPortal>) </LoaderPortal>)
} }