Просмотр исходного кода

loading for export excel

web_access_fix
Jason Chuang 2 недель назад
Родитель
Сommit
3da4bb5ae0
2 измененных файлов: 25 добавлений и 7 удалений
  1. +13
    -4
      src/pages/Report/FullList/FullListForm.js
  2. +12
    -3
      src/pages/Report/Summary/SummaryForm.js

+ 13
- 4
src/pages/Report/FullList/FullListForm.js Просмотреть файл

@@ -1,6 +1,7 @@
// material-ui // material-ui
import { import {
Button, Button,
CircularProgress,
Grid, TextField, Grid, TextField,
Autocomplete, Autocomplete,
Typography Typography
@@ -62,7 +63,10 @@ const FullListForm = ({ searchCriteria, issueComboData}) => {
url: UrlUtils.GEN_FULL_LIST, url: UrlUtils.GEN_FULL_LIST,
params: temp, params: temp,
onResponse: () => { onResponse: () => {
setTimeout(()=> setWaitDownload(false), 500)
setTimeout(() => setWaitDownload(false), 500);
},
onError: () => {
setWaitDownload(false);
} }
}); });
}; };
@@ -208,12 +212,17 @@ const FullListForm = ({ searchCriteria, issueComboData}) => {
<Button <Button
variant="contained" variant="contained"
color="green" color="green"
onClick={()=>{
doExport()
onClick={() => {
doExport();
}} }}
disabled={waitDownload} disabled={waitDownload}
startIcon={
waitDownload ? (
<CircularProgress color="inherit" size={20} aria-hidden />
) : null
}
> >
Export
{waitDownload ? 'Loading' : 'Export'}
</Button> </Button>
</Grid> </Grid>
<Grid item sx={{ ml: 3 }}> <Grid item sx={{ ml: 3 }}>


+ 12
- 3
src/pages/Report/Summary/SummaryForm.js Просмотреть файл

@@ -1,7 +1,8 @@
// material-ui // material-ui
import { import {
Button, Button,
Grid,
CircularProgress,
Grid,
TextField, TextField,
Autocomplete, Autocomplete,
Typography Typography
@@ -92,7 +93,10 @@ const SummaryForm = ({ searchCriteria, issueComboData}) => {
url: UrlUtils.GEN_SUMMARY_LIST, url: UrlUtils.GEN_SUMMARY_LIST,
params: temp, params: temp,
onResponse: () => { onResponse: () => {
setTimeout(()=> setWaitDownload(false), 500)
setTimeout(() => setWaitDownload(false), 500);
},
onError: () => {
setWaitDownload(false);
} }
}); });
}; };
@@ -253,8 +257,13 @@ const SummaryForm = ({ searchCriteria, issueComboData}) => {
color="green" color="green"
type="submit" type="submit"
disabled={waitDownload} disabled={waitDownload}
startIcon={
waitDownload ? (
<CircularProgress color="inherit" size={20} aria-hidden />
) : null
}
> >
Export
{waitDownload ? 'Loading' : 'Export'}
</Button> </Button>
</Grid> </Grid>
<Grid item sx={{ ml: 3 }}> <Grid item sx={{ ml: 3 }}>


Загрузка…
Отмена
Сохранить