Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 

101 wiersze
3.5 KiB

  1. // material-ui
  2. import {
  3. Grid,
  4. Typography,
  5. Stack
  6. } from '@mui/material';
  7. import MainCard from "components/MainCard";
  8. import * as React from "react";
  9. import * as DateUtils from "utils/DateUtils";
  10. import { getSearchCriteria } from "auth/utils";
  11. import * as HttpUtils from "utils/HttpUtils";
  12. import * as UrlUtils from "utils/ApiPathConst";
  13. import Loadable from 'components/Loadable';
  14. const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent')));
  15. const SummaryForm = Loadable(React.lazy(() => import('./SummaryForm')));
  16. import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
  17. const BackgroundHead = {
  18. backgroundImage: `url(${titleBackgroundImg})`,
  19. width: '100%',
  20. height: '100%',
  21. backgroundSize: 'contain',
  22. backgroundRepeat: 'no-repeat',
  23. backgroundColor: '#0C489E',
  24. backgroundPosition: 'right'
  25. }
  26. // ==============================|| DASHBOARD - DEFAULT ||============================== //
  27. const ReportSearchPage = () => {
  28. const [searchCriteria, setSearchCriteria] = React.useState({});
  29. const [onReady, setOnReady] = React.useState(false);
  30. const [issueCombo, setIssueCombo] = React.useState([]);
  31. React.useEffect(() => {
  32. getIssueCombo();
  33. if (Object.keys(getSearchCriteria(window.location.pathname)).length>0){
  34. setSearchCriteria(getSearchCriteria(window.location.pathname))
  35. }else{
  36. localStorage.setItem('searchCriteria',"")
  37. setSearchCriteria({
  38. dateTo: DateUtils.dateValue(new Date()),
  39. dateFrom: DateUtils.dateValue(new Date().setDate(new Date().getDate()-14)),
  40. })
  41. }
  42. }, []);
  43. function getIssueCombo() {
  44. HttpUtils.get({
  45. url: UrlUtils.GET_ISSUE_COMBO,
  46. onSuccess: function (responseData) {
  47. let combo = responseData;
  48. setIssueCombo(combo);
  49. }
  50. });
  51. }
  52. React.useEffect(() => {
  53. setOnReady(true);
  54. }, [searchCriteria]);
  55. return (
  56. !onReady ?
  57. <Grid container sx={{ minHeight: '95vh', mb: 3 }} direction="column" justifyContent="center" alignItems="center">
  58. <Grid item>
  59. <LoadingComponent />
  60. </Grid>
  61. </Grid>
  62. :
  63. <Grid container sx={{ minHeight: '95vh',backgroundColor: 'backgroundColor.default' }} direction="column">
  64. <Grid item xs={12} mb={2}>
  65. <div style={BackgroundHead}>
  66. <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">
  67. <Typography ml={15} color='#FFF' variant="h4" sx={{ "textShadow": "0px 0px 25px #1976d2" }}>Summary of Gazette Notice</Typography>
  68. </Stack>
  69. </div>
  70. </Grid>
  71. {/*row 1*/}
  72. <Grid item xs={12} md={12} lg={12} sx={{mb: -1}}>
  73. <SummaryForm
  74. searchCriteria={searchCriteria}
  75. issueComboData={issueCombo}
  76. />
  77. </Grid>
  78. {/*row 2*/}
  79. <Grid item xs={12} md={12} lg={12}>
  80. <MainCard elevation={0}
  81. border={false}
  82. content={false}
  83. sx={{ backgroundColor: '#fff' }}
  84. >
  85. </MainCard>
  86. </Grid>
  87. </Grid>
  88. );
  89. }
  90. export default ReportSearchPage;