You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

114 rivejä
3.8 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 UrlUtils from "utils/ApiPathConst";
  10. import * as HttpUtils from "utils/HttpUtils";
  11. import * as DateUtils from "utils/DateUtils";
  12. import Loadable from 'components/Loadable';
  13. const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent')));
  14. const SearchForm = Loadable(React.lazy(() => import('./SearchForm')));
  15. const EventTable = Loadable(React.lazy(() => import('./DataGrid')));
  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 UserSearchPage_Individual = () => {
  28. const [orgCombo, setOrgCombo] = React.useState([]);
  29. const [issueCombo, setIssueCombo] = React.useState([]);
  30. const [searchCriteria, setSearchCriteria] = React.useState({
  31. dateTo: DateUtils.dateValue(new Date()),
  32. dateFrom: DateUtils.dateValue(new Date().setDate(new Date().getDate() - 14))
  33. });
  34. const [onReady, setOnReady] = React.useState(false);
  35. React.useEffect(() => {
  36. getOrgCombo();
  37. getIssueCombo();
  38. }, []);
  39. React.useEffect(() => {
  40. setOnReady(true);
  41. }, [searchCriteria]);
  42. function getOrgCombo() {
  43. HttpUtils.get({
  44. url: UrlUtils.GET_ORG_COMBO,
  45. onSuccess: function (responseData) {
  46. let combo = responseData;
  47. setOrgCombo(combo);
  48. }
  49. });
  50. }
  51. function getIssueCombo() {
  52. HttpUtils.get({
  53. url: UrlUtils.GET_ISSUE_COMBO,
  54. onSuccess: function (responseData) {
  55. let combo = responseData;
  56. setIssueCombo(combo);
  57. }
  58. });
  59. }
  60. function applySearch(input) {
  61. setSearchCriteria(input);
  62. }
  63. return (
  64. !onReady ?
  65. <Grid container sx={{ minHeight: '87vh', mb: 3 }} direction="column" justifyContent="center" alignItems="center">
  66. <Grid item>
  67. <LoadingComponent />
  68. </Grid>
  69. </Grid>
  70. :
  71. <Grid container sx={{ minHeight: '87vh',backgroundColor: 'backgroundColor.default' }} direction="column">
  72. <Grid item xs={12}>
  73. <div style={BackgroundHead}>
  74. <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">
  75. <Typography ml={15} color='#FFF' variant="h4" sx={{ "textShadow": "0px 0px 25px #0C489E" }}>Application</Typography>
  76. </Stack>
  77. </div>
  78. </Grid>
  79. {/*row 1*/}
  80. <Grid item xs={12} md={12} lg={12} sx={{mb: -1}}>
  81. <SearchForm
  82. applySearch={applySearch}
  83. orgComboData={orgCombo}
  84. issueComboData={issueCombo}
  85. searchCriteria={searchCriteria}
  86. />
  87. </Grid>
  88. {/*row 2*/}
  89. <Grid item xs={12} md={12} lg={12}>
  90. <MainCard elevation={0}
  91. border={false}
  92. content={false}
  93. sx={{ backgroundColor: '#fff' }}
  94. >
  95. <EventTable
  96. searchCriteria={searchCriteria}
  97. />
  98. </MainCard>
  99. </Grid>
  100. </Grid>
  101. );
  102. }
  103. export default UserSearchPage_Individual;