Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

97 linhas
3.0 KiB

  1. // material-ui
  2. import {
  3. Grid, Typography, Stack
  4. } from '@mui/material';
  5. import MainCard from "../../components/MainCard";
  6. import { useEffect, useState } from "react";
  7. import * as UrlUtils from "../../utils/ApiPathConst";
  8. import * as React from "react";
  9. import * as HttpUtils from "../../utils/HttpUtils";
  10. // import LoadingComponent from "../extra-pages/LoadingComponent";
  11. // import SearchForm from "./OrganizationSearchForm";
  12. // import EventTable from "./OrganizationTable";
  13. import Loadable from 'components/Loadable';
  14. import { lazy } from 'react';
  15. const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingComponent')));
  16. const SearchForm = Loadable(lazy(() => import('./OrganizationSearchForm')));
  17. const EventTable = Loadable(lazy(() => import('./OrganizationTable')));
  18. import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
  19. const BackgroundHead = {
  20. backgroundImage: `url(${titleBackgroundImg})`,
  21. width: '100%',
  22. height: '100%',
  23. backgroundSize:'contain',
  24. backgroundRepeat: 'no-repeat',
  25. backgroundColor: '#0C489E',
  26. backgroundPosition: 'right'
  27. }
  28. // ==============================|| DASHBOARD - DEFAULT ||============================== //
  29. const OrganizationSearchPage = () => {
  30. const [record, setRecord] = useState([]);
  31. const [searchCriteria, setSearchCriteria] = useState({});
  32. const [onReady, setOnReady] = useState(false);
  33. useEffect(() => {
  34. getUserList();
  35. }, []);
  36. useEffect(() => {
  37. setOnReady(true);
  38. }, [record]);
  39. useEffect(() => {
  40. getUserList();
  41. }, [searchCriteria]);
  42. function getUserList() {
  43. HttpUtils.get({
  44. url: UrlUtils.GET_ORG_PATH,
  45. params: searchCriteria,
  46. onSuccess: function (responseData) {
  47. setRecord(responseData);
  48. }
  49. });
  50. }
  51. function applySearch(input) {
  52. setSearchCriteria(input);
  53. }
  54. return (
  55. !onReady ?
  56. <LoadingComponent />
  57. :
  58. <Grid container sx={{backgroundColor:"backgroundColor.default"}}>
  59. <Grid item xs={12}>
  60. <div style={BackgroundHead}>
  61. <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">
  62. <Typography ml={15} color='#FFF' variant="h4">View Organization</Typography>
  63. </Stack>
  64. </div>
  65. </Grid>
  66. {/*row 1*/}
  67. <Grid item xs={12} md={12} lg={12}>
  68. <SearchForm applySearch={applySearch} />
  69. </Grid>
  70. {/*row 2*/}
  71. <Grid item xs={12} md={12} lg={12}>
  72. <MainCard elevation={0}
  73. border={false}
  74. content={false}
  75. >
  76. <EventTable
  77. recordList={record}
  78. />
  79. </MainCard>
  80. </Grid>
  81. </Grid>
  82. );
  83. };
  84. export default OrganizationSearchPage;