|
- // material-ui
- import {
- Grid, Typography
- } from '@mui/material';
- import MainCard from "../../components/MainCard";
- import SearchForm from "./OrganizationSearchForm";
- import EventTable from "./OrganizationTable";
- import {useEffect, useState} from "react";
- import * as UrlUtils from "../../utils/ApiPathConst";
- import * as React from "react";
- import LoadingComponent from "../extra-pages/LoadingComponent";
- import * as HttpUtils from "../../utils/HttpUtils";
-
- // ==============================|| DASHBOARD - DEFAULT ||============================== //
-
- const OrganizationSearchPage = () => {
-
- const [record,setRecord] = useState([]);
- const [searchCriteria, setSearchCriteria] = useState({});
- const [onReady, setOnReady] = useState(false);
-
- useEffect(() => {
- getUserList();
- }, []);
-
- useEffect(() => {
- setOnReady(true);
- }, [record]);
-
- useEffect(() => {
- getUserList();
- }, [searchCriteria]);
-
- function getUserList(){
- HttpUtils.get({
- url: UrlUtils.GET_ORG_PATH,
- params: searchCriteria,
- onSuccess: function(responseData){
- setRecord(responseData);
- }
- });
- }
-
- function applySearch(input) {
- setSearchCriteria(input);
- }
-
- return (
- !onReady ?
- <LoadingComponent/>
- :
- <Grid container rowSpacing={4.5} columnSpacing={2.75}>
- <Grid item xs={12} sx={{mb: -2.25}}>
- <Typography variant="h5">View Organization</Typography>
- </Grid>
-
- {/*row 1*/}
- <Grid item xs={12} md={12} lg={12}>
- <SearchForm applySearch={applySearch}/>
- </Grid>
- {/*row 2*/}
- <Grid item xs={12} md={12} lg={12}>
- <MainCard elevation={0}
- border={false}
- content={false}
- >
- <EventTable
- recordList={record}
- />
- </MainCard>
- </Grid>
- </Grid>
- );
- };
-
- export default OrganizationSearchPage;
|