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 { 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 [filterDataRange, setFilterDataRange] = useState([])
const [filterCompanyName, setFilterCompanyName] = useState([])
@ -181,6 +181,8 @@ export default function DocumentsTemplate({ idCategory, idWell, accept, onChange
onUploadStart={() => setShowLoader(true)}
onUploadComplete={handleUploadComplete}/>
</div>
&nbsp;&nbsp;
{headerChild}
</div>
<EditableTable

View File

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