Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 

84 Zeilen
2.4 KiB

  1. // material-ui
  2. import {
  3. Grid, Typography
  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. // ==============================|| DASHBOARD - DEFAULT ||============================== //
  19. const OrganizationSearchPage = () => {
  20. const [record,setRecord] = useState([]);
  21. const [searchCriteria, setSearchCriteria] = useState({});
  22. const [onReady, setOnReady] = useState(false);
  23. useEffect(() => {
  24. getUserList();
  25. }, []);
  26. useEffect(() => {
  27. setOnReady(true);
  28. }, [record]);
  29. useEffect(() => {
  30. getUserList();
  31. }, [searchCriteria]);
  32. function getUserList(){
  33. HttpUtils.get({
  34. url: UrlUtils.GET_ORG_PATH,
  35. params: searchCriteria,
  36. onSuccess: function(responseData){
  37. setRecord(responseData);
  38. }
  39. });
  40. }
  41. function applySearch(input) {
  42. setSearchCriteria(input);
  43. }
  44. return (
  45. !onReady ?
  46. <LoadingComponent/>
  47. :
  48. <Grid container rowSpacing={4.5} columnSpacing={2.75}>
  49. <Grid item xs={12} sx={{mb: -2.25}}>
  50. <Typography variant="h5">View Organization</Typography>
  51. </Grid>
  52. {/*row 1*/}
  53. <Grid item xs={12} md={12} lg={12}>
  54. <SearchForm applySearch={applySearch}/>
  55. </Grid>
  56. {/*row 2*/}
  57. <Grid item xs={12} md={12} lg={12}>
  58. <MainCard elevation={0}
  59. border={false}
  60. content={false}
  61. >
  62. <EventTable
  63. recordList={record}
  64. />
  65. </MainCard>
  66. </Grid>
  67. </Grid>
  68. );
  69. };
  70. export default OrganizationSearchPage;