Commit e94700ef authored by fahrur huzain's avatar fahrur huzain

download logactivity

parent cb28dfab
...@@ -94,6 +94,20 @@ export default class LogActivity extends Component { ...@@ -94,6 +94,20 @@ export default class LogActivity extends Component {
}) })
} }
downloadDataTable = async () => {
let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/approval_matrix/export_approval_matrix`
)
res = await res.blob()
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
a.href = url;
a.download = 'Log Activity.xlsx';
a.click();
}
}
getData() { getData() {
this.setState({loading: true}) this.setState({loading: true})
api.create().getAM().then((response) => { api.create().getAM().then((response) => {
...@@ -297,6 +311,22 @@ export default class LogActivity extends Component { ...@@ -297,6 +311,22 @@ export default class LogActivity extends Component {
/> />
</div> */} </div> */}
</div> </div>
<div style={{ width: '100%', justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" />
<a data-tip={'Download'} data-for="download">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
marginRight: 30
}}
onClick={() => this.downloadDataTable()}
>
<img src={Images.download} />
</button>
</a>
</div>
<div style={{ padding: 25, width: '100%' }}> <div style={{ padding: 25, width: '100%' }}>
{this.state.loading && loadingComponent} {this.state.loading && loadingComponent}
<MuiThemeProvider theme={getMuiTheme()}> <MuiThemeProvider theme={getMuiTheme()}>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment