@@ -8,15 +8,16 @@ import EditIcon from '@mui/icons-material/Visibility'; | |||||
import { useEffect } from "react"; | import { useEffect } from "react"; | ||||
import { useNavigate } from "react-router-dom"; | import { useNavigate } from "react-router-dom"; | ||||
import * as DateUtils from "utils/DateUtils"; | import * as DateUtils from "utils/DateUtils"; | ||||
import {GET_ORG_PATH} from "utils/ApiPathConst"; | |||||
// ==============================|| EVENT TABLE ||============================== // | // ==============================|| EVENT TABLE ||============================== // | ||||
export default function OrganizationTable({ recordList }) { | |||||
const [rows, setRows] = React.useState(recordList); | |||||
export default function OrganizationTable({ searchCriteria }) { | |||||
const [_searchCriteria, set_searchCriteria] = React.useState(searchCriteria); | |||||
const navigate = useNavigate() | const navigate = useNavigate() | ||||
useEffect(() => { | useEffect(() => { | ||||
setRows(recordList); | |||||
}, [recordList]); | |||||
set_searchCriteria(searchCriteria); | |||||
}, [searchCriteria]); | |||||
const handleActionClick = (id) => () => { | const handleActionClick = (id) => () => { | ||||
navigate('/org/' + id); | navigate('/org/' + id); | ||||
@@ -106,10 +107,13 @@ export default function OrganizationTable({ recordList }) { | |||||
return ( | return ( | ||||
<div style={{ height: "fit-content", width: '100%' }}> | <div style={{ height: "fit-content", width: '100%' }}> | ||||
<FiDataGrid | <FiDataGrid | ||||
rows={rows} | |||||
columns={columns} | columns={columns} | ||||
customPageSize={5} | customPageSize={5} | ||||
onRowDoubleClick={handleRowDoubleClick} | onRowDoubleClick={handleRowDoubleClick} | ||||
doLoad={{ | |||||
url: GET_ORG_PATH, | |||||
params: _searchCriteria, | |||||
}} | |||||
/> | /> | ||||
</div> | </div> | ||||
); | ); | ||||
@@ -2,11 +2,8 @@ | |||||
import { | import { | ||||
Grid, Typography, Stack | Grid, Typography, Stack | ||||
} from '@mui/material'; | } from '@mui/material'; | ||||
import MainCard from "../../../components/MainCard"; | |||||
import MainCard from "components/MainCard"; | |||||
import { useEffect, useState } from "react"; | import { useEffect, useState } from "react"; | ||||
import * as UrlUtils from "../../../utils/ApiPathConst"; | |||||
import * as HttpUtils from "../../../utils/HttpUtils"; | |||||
import * as React from "react"; | import * as React from "react"; | ||||
@@ -24,7 +21,7 @@ const BackgroundHead = { | |||||
backgroundImage: `url(${titleBackgroundImg})`, | backgroundImage: `url(${titleBackgroundImg})`, | ||||
width: '100%', | width: '100%', | ||||
height: '100%', | height: '100%', | ||||
backgroundSize:'contain', | |||||
backgroundSize: 'contain', | |||||
backgroundRepeat: 'no-repeat', | backgroundRepeat: 'no-repeat', | ||||
backgroundColor: '#0C489E', | backgroundColor: '#0C489E', | ||||
backgroundPosition: 'right' | backgroundPosition: 'right' | ||||
@@ -33,32 +30,13 @@ const BackgroundHead = { | |||||
const OrganizationSearchPage = () => { | const OrganizationSearchPage = () => { | ||||
const [record, setRecord] = useState([]); | |||||
const [searchCriteria, setSearchCriteria] = useState({}); | const [searchCriteria, setSearchCriteria] = useState({}); | ||||
const [onReady, setOnReady] = useState(false); | const [onReady, setOnReady] = useState(false); | ||||
useEffect(() => { | |||||
getUserList(); | |||||
}, []); | |||||
useEffect(() => { | useEffect(() => { | ||||
setOnReady(true); | setOnReady(true); | ||||
}, [record]); | |||||
useEffect(() => { | |||||
getUserList(); | |||||
}, [searchCriteria]); | }, [searchCriteria]); | ||||
function getUserList() { | |||||
HttpUtils.get({ | |||||
url: UrlUtils.GET_ORG_PATH, | |||||
params: searchCriteria, | |||||
onSuccess: function (responseData) { | |||||
setRecord(responseData); | |||||
} | |||||
}); | |||||
} | |||||
function applySearch(input) { | function applySearch(input) { | ||||
setSearchCriteria(input); | setSearchCriteria(input); | ||||
} | } | ||||
@@ -71,7 +49,7 @@ const OrganizationSearchPage = () => { | |||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
: | : | ||||
<Grid container sx={{minHeight: '87vh', backgroundColor:"backgroundColor.default"}} direction="column"> | |||||
<Grid container sx={{ minHeight: '87vh', backgroundColor: "backgroundColor.default" }} direction="column"> | |||||
<Grid item xs={12}> | <Grid item xs={12}> | ||||
<div style={BackgroundHead}> | <div style={BackgroundHead}> | ||||
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | ||||
@@ -80,7 +58,7 @@ const OrganizationSearchPage = () => { | |||||
</div> | </div> | ||||
</Grid> | </Grid> | ||||
{/*row 1*/} | {/*row 1*/} | ||||
<Grid item xs={12} md={12} lg={12} sx={{mb:-1}}> | |||||
<Grid item xs={12} md={12} lg={12} sx={{ mb: -1 }}> | |||||
<SearchForm applySearch={applySearch} /> | <SearchForm applySearch={applySearch} /> | ||||
</Grid> | </Grid> | ||||
{/*row 2*/} | {/*row 2*/} | ||||
@@ -90,7 +68,7 @@ const OrganizationSearchPage = () => { | |||||
content={false} | content={false} | ||||
> | > | ||||
<EventTable | <EventTable | ||||
recordList={record} | |||||
searchCriteria={searchCriteria} | |||||
/> | /> | ||||
</MainCard> | </MainCard> | ||||
</Grid> | </Grid> | ||||
@@ -5,7 +5,7 @@ import {useEffect} from "react"; | |||||
import {useNavigate} from "react-router-dom"; | import {useNavigate} from "react-router-dom"; | ||||
import { useTheme } from '@mui/material/styles'; | import { useTheme } from '@mui/material/styles'; | ||||
import Checkbox from '@mui/material/Checkbox'; | import Checkbox from '@mui/material/Checkbox'; | ||||
import * as HttpUtils from '../../../utils/HttpUtils'; | |||||
import * as HttpUtils from 'utils/HttpUtils'; | |||||
import { GLD_USER_PATH, GET_USER_LOCK, GET_USER_UNLOCK } from "utils/ApiPathConst"; | import { GLD_USER_PATH, GET_USER_LOCK, GET_USER_UNLOCK } from "utils/ApiPathConst"; | ||||
import { notifyLockSuccess, notifyUnlockSuccess , clickableLink} from 'utils/CommonFunction'; | import { notifyLockSuccess, notifyUnlockSuccess , clickableLink} from 'utils/CommonFunction'; | ||||
@@ -7,17 +7,18 @@ import HighlightOff from '@mui/icons-material/HighlightOff'; | |||||
import CheckCircleOutline from '@mui/icons-material/CheckCircleOutline'; | import CheckCircleOutline from '@mui/icons-material/CheckCircleOutline'; | ||||
import { useEffect } from "react"; | import { useEffect } from "react"; | ||||
import { useNavigate } from "react-router-dom"; | import { useNavigate } from "react-router-dom"; | ||||
import * as DateUtils from "../../../utils/DateUtils"; | |||||
import * as DateUtils from "utils/DateUtils"; | |||||
import { GET_IND_USER_PATH } from "utils/ApiPathConst"; | |||||
// ==============================|| EVENT TABLE ||============================== // | // ==============================|| EVENT TABLE ||============================== // | ||||
export default function UserTable_Individual({ recordList }) { | |||||
const [rows, setRows] = React.useState(recordList); | |||||
export default function UserTable_Individual({ searchCriteria }) { | |||||
const [_searchCriteria, set_searchCriteria] = React.useState(searchCriteria); | |||||
const navigate = useNavigate() | const navigate = useNavigate() | ||||
useEffect(() => { | useEffect(() => { | ||||
setRows(recordList); | |||||
}, [recordList]); | |||||
set_searchCriteria(searchCriteria); | |||||
}, [searchCriteria]); | |||||
const handleActionClick = (id) => () => { | const handleActionClick = (id) => () => { | ||||
navigate('/indUser/' + id); | navigate('/indUser/' + id); | ||||
@@ -145,10 +146,13 @@ export default function UserTable_Individual({ recordList }) { | |||||
return ( | return ( | ||||
<div style={{ height: "fit-content", width: '100%' }}> | <div style={{ height: "fit-content", width: '100%' }}> | ||||
<FiDataGrid | <FiDataGrid | ||||
rows={rows} | |||||
columns={columns} | columns={columns} | ||||
customPageSize={5} | |||||
customPageSize={10} | |||||
onRowDoubleClick={handleRowDoubleClick} | onRowDoubleClick={handleRowDoubleClick} | ||||
doLoad={{ | |||||
url: GET_IND_USER_PATH, | |||||
params: _searchCriteria, | |||||
}} | |||||
/> | /> | ||||
</div> | </div> | ||||
); | ); | ||||
@@ -2,20 +2,12 @@ | |||||
import { | import { | ||||
Grid, Typography, Stack | Grid, Typography, Stack | ||||
} from '@mui/material'; | } from '@mui/material'; | ||||
import MainCard from "../../../components/MainCard"; | |||||
import MainCard from "components/MainCard"; | |||||
import { useEffect, useState } from "react"; | import { useEffect, useState } from "react"; | ||||
//import axios from "axios"; | |||||
//import {apiPath} from "../../auth/utils"; | |||||
import { GET_IND_USER_PATH } from "../../../utils/ApiPathConst"; | |||||
import * as React from "react"; | import * as React from "react"; | ||||
import * as HttpUtils from "../../../utils/HttpUtils"; | |||||
//import LoadingComponent from "../extra-pages/LoadingComponent"; | |||||
//import SearchForm from "./UserSearchForm_Individual"; | |||||
//import EventTable from "./UserTable_Individual"; | |||||
import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
import { lazy } from 'react'; | import { lazy } from 'react'; | ||||
const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); | |||||
const LoadingComponent = Loadable(lazy(() => import('pages/extra-pages/LoadingComponent'))); | |||||
const SearchForm = Loadable(lazy(() => import('./UserSearchForm_Individual'))); | const SearchForm = Loadable(lazy(() => import('./UserSearchForm_Individual'))); | ||||
const EventTable = Loadable(lazy(() => import('./UserTable_Individual'))); | const EventTable = Loadable(lazy(() => import('./UserTable_Individual'))); | ||||
import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | ||||
@@ -33,32 +25,13 @@ const BackgroundHead = { | |||||
const UserSearchPage_Individual = () => { | const UserSearchPage_Individual = () => { | ||||
const [record, setRecord] = useState([]); | |||||
const [searchCriteria, setSearchCriteria] = useState({}); | const [searchCriteria, setSearchCriteria] = useState({}); | ||||
const [onReady, setOnReady] = useState(false); | const [onReady, setOnReady] = useState(false); | ||||
useEffect(() => { | |||||
getUserList(); | |||||
}, []); | |||||
useEffect(() => { | useEffect(() => { | ||||
setOnReady(true); | setOnReady(true); | ||||
}, [record]); | |||||
useEffect(() => { | |||||
getUserList(); | |||||
}, [searchCriteria]); | }, [searchCriteria]); | ||||
function getUserList() { | |||||
HttpUtils.get({ | |||||
url: GET_IND_USER_PATH, | |||||
params: searchCriteria, | |||||
onSuccess: function (responseData) { | |||||
setRecord(responseData); | |||||
} | |||||
}); | |||||
} | |||||
function applySearch(input) { | function applySearch(input) { | ||||
setSearchCriteria(input); | setSearchCriteria(input); | ||||
} | } | ||||
@@ -93,7 +66,7 @@ const UserSearchPage_Individual = () => { | |||||
content={false} | content={false} | ||||
> | > | ||||
<EventTable | <EventTable | ||||
recordList={record} | |||||
searchCriteria={searchCriteria} | |||||
/> | /> | ||||
</MainCard> | </MainCard> | ||||
</Grid> | </Grid> | ||||
@@ -10,18 +10,19 @@ import {useEffect} from "react"; | |||||
import {useNavigate} from "react-router-dom"; | import {useNavigate} from "react-router-dom"; | ||||
import HighlightOff from '@mui/icons-material/HighlightOff'; | import HighlightOff from '@mui/icons-material/HighlightOff'; | ||||
import CheckCircleOutline from '@mui/icons-material/CheckCircleOutline'; | import CheckCircleOutline from '@mui/icons-material/CheckCircleOutline'; | ||||
import * as DateUtils from '../../../utils/DateUtils'; | |||||
import * as DateUtils from 'utils/DateUtils'; | |||||
import { GET_ORG_USER_PATH } from "utils/ApiPathConst"; | |||||
// ==============================|| EVENT TABLE ||============================== // | // ==============================|| EVENT TABLE ||============================== // | ||||
export default function UserTable_Organization({recordList}) { | |||||
const [rows, setRows] = React.useState(recordList); | |||||
export default function UserTable_Organization({searchCriteria}) { | |||||
const [_searchCriteria, set_searchCriteria] = React.useState(searchCriteria); | |||||
const navigate = useNavigate() | const navigate = useNavigate() | ||||
useEffect(() => { | useEffect(() => { | ||||
setRows(recordList); | |||||
}, [recordList]); | |||||
set_searchCriteria(searchCriteria); | |||||
}, [searchCriteria]); | |||||
const handleActionClick = (id) => () => { | const handleActionClick = (id) => () => { | ||||
navigate('/orgUser/'+ id); | navigate('/orgUser/'+ id); | ||||
@@ -140,10 +141,13 @@ export default function UserTable_Organization({recordList}) { | |||||
return ( | return ( | ||||
<div style={{height: "fit-content", width: '100%'}}> | <div style={{height: "fit-content", width: '100%'}}> | ||||
<FiDataGrid | <FiDataGrid | ||||
rows={rows} | |||||
columns={columns} | columns={columns} | ||||
customPageSize={5} | customPageSize={5} | ||||
onRowDoubleClick={handleRowDoubleClick} | onRowDoubleClick={handleRowDoubleClick} | ||||
doLoad={{ | |||||
url: GET_ORG_USER_PATH, | |||||
params: _searchCriteria, | |||||
}} | |||||
/> | /> | ||||
</div> | </div> | ||||
); | ); | ||||
@@ -4,15 +4,7 @@ import { | |||||
} from '@mui/material'; | } from '@mui/material'; | ||||
import MainCard from "components/MainCard"; | import MainCard from "components/MainCard"; | ||||
import { useEffect, useState } from "react"; | import { useEffect, useState } from "react"; | ||||
//import axios from "axios"; | |||||
//import {apiPath} from "../../auth/utils"; | |||||
import * as UrlUtils from "utils/ApiPathConst"; | |||||
import * as React from "react"; | import * as React from "react"; | ||||
import * as HttpUtils from "utils/HttpUtils"; | |||||
//import LoadingComponent from "../extra-pages/LoadingComponent"; | |||||
//import SearchForm from "./UserSearchForm_Organization"; | |||||
//import EventTable from "./UserTable_Organization"; | |||||
import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
import { lazy } from 'react'; | import { lazy } from 'react'; | ||||
const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); | const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); | ||||
@@ -34,32 +26,14 @@ const BackgroundHead = { | |||||
const UserSearchPage_Organization = () => { | const UserSearchPage_Organization = () => { | ||||
const [record, setRecord] = useState([]); | |||||
const [searchCriteria, setSearchCriteria] = useState({}); | const [searchCriteria, setSearchCriteria] = useState({}); | ||||
const [onReady, setOnReady] = useState(false); | const [onReady, setOnReady] = useState(false); | ||||
useEffect(() => { | |||||
getUserList(); | |||||
}, []); | |||||
useEffect(() => { | useEffect(() => { | ||||
setOnReady(true); | setOnReady(true); | ||||
}, [record]); | |||||
useEffect(() => { | |||||
getUserList(); | |||||
}, [searchCriteria]); | }, [searchCriteria]); | ||||
function getUserList() { | |||||
HttpUtils.get({ | |||||
url: UrlUtils.GET_ORG_USER_PATH, | |||||
params: searchCriteria, | |||||
onSuccess: function (responseData) { | |||||
setRecord(responseData); | |||||
} | |||||
}); | |||||
} | |||||
function applySearch(input) { | function applySearch(input) { | ||||
setSearchCriteria(input); | setSearchCriteria(input); | ||||
} | } | ||||
@@ -91,7 +65,7 @@ const UserSearchPage_Organization = () => { | |||||
content={false} | content={false} | ||||
> | > | ||||
<EventTable | <EventTable | ||||
recordList={record} | |||||
searchCriteria={searchCriteria} | |||||
/> | /> | ||||
</MainCard> | </MainCard> | ||||
</Grid> | </Grid> | ||||
@@ -7,15 +7,16 @@ import {FiDataGrid} from "components/FiDataGrid"; | |||||
import EditIcon from '@mui/icons-material/Edit'; | import EditIcon from '@mui/icons-material/Edit'; | ||||
import {useEffect} from "react"; | import {useEffect} from "react"; | ||||
import {useNavigate} from "react-router-dom"; | import {useNavigate} from "react-router-dom"; | ||||
import { GET_GROUP_LIST_PATH } from "utils/ApiPathConst"; | |||||
// ==============================|| EVENT TABLE ||============================== // | // ==============================|| EVENT TABLE ||============================== // | ||||
export default function UserGroupTable({recordList}) { | |||||
const [rows, setRows] = React.useState(recordList); | |||||
export default function UserGroupTable({searchCriteria}) { | |||||
const [_searchCriteria, set_searchCriteria] = React.useState(searchCriteria); | |||||
const navigate = useNavigate() | const navigate = useNavigate() | ||||
useEffect(() => { | useEffect(() => { | ||||
setRows(recordList); | |||||
}, [recordList]); | |||||
set_searchCriteria(searchCriteria); | |||||
}, [searchCriteria]); | |||||
const handleEditClick = (id) => () => { | const handleEditClick = (id) => () => { | ||||
navigate('/userGroup/'+ id); | navigate('/userGroup/'+ id); | ||||
@@ -61,11 +62,14 @@ export default function UserGroupTable({recordList}) { | |||||
return ( | return ( | ||||
<div style={{height: "fit-content", width: '100%'}}> | <div style={{height: "fit-content", width: '100%'}}> | ||||
<FiDataGrid | <FiDataGrid | ||||
rows={rows} | |||||
columns={columns} | columns={columns} | ||||
customPageSize={10} | customPageSize={10} | ||||
pageSizeOptions={[10, 15, 20]} | pageSizeOptions={[10, 15, 20]} | ||||
onRowDoubleClick={handleRowDoubleClick} | onRowDoubleClick={handleRowDoubleClick} | ||||
doLoad={{ | |||||
url: GET_GROUP_LIST_PATH, | |||||
params: _searchCriteria, | |||||
}} | |||||
/> | /> | ||||
</div> | </div> | ||||
); | ); | ||||
@@ -5,11 +5,8 @@ import { | |||||
// Button, | // Button, | ||||
Grid, Typography | Grid, Typography | ||||
} from '@mui/material'; | } from '@mui/material'; | ||||
import MainCard from "../../components/MainCard"; | |||||
import MainCard from "components/MainCard"; | |||||
import { useEffect, useState } from "react"; | import { useEffect, useState } from "react"; | ||||
import axios from "axios"; | |||||
import { apiPath } from "../../auth/utils"; | |||||
import { GET_GROUP_LIST_PATH } from "../../utils/ApiPathConst"; | |||||
import * as React from "react"; | import * as React from "react"; | ||||
//import LoadingComponent from "../extra-pages/LoadingComponent"; | //import LoadingComponent from "../extra-pages/LoadingComponent"; | ||||
@@ -35,38 +32,13 @@ const BackgroundHead = { | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
const UserGroupSearchPanel = () => { | const UserGroupSearchPanel = () => { | ||||
const [record, setRecord] = useState([]); | |||||
const [searchCriteria, setSearchCriteria] = useState({}); | const [searchCriteria, setSearchCriteria] = useState({}); | ||||
const [onReady, setOnReady] = useState(false); | const [onReady, setOnReady] = useState(false); | ||||
// const navigate = useNavigate(); | |||||
useEffect(() => { | |||||
getGroupList(); | |||||
}, []); | |||||
useEffect(() => { | useEffect(() => { | ||||
setOnReady(true); | setOnReady(true); | ||||
}, [record]); | |||||
useEffect(() => { | |||||
getGroupList(); | |||||
}, [searchCriteria]); | }, [searchCriteria]); | ||||
function getGroupList() { | |||||
axios.get(`${apiPath}${GET_GROUP_LIST_PATH}`, | |||||
{ params: searchCriteria } | |||||
) | |||||
.then((response) => { | |||||
if (response.status === 200) { | |||||
setRecord(response.data.records); | |||||
} | |||||
}) | |||||
.catch(error => { | |||||
console.log(error); | |||||
return false; | |||||
}); | |||||
} | |||||
function applySearch(input) { | function applySearch(input) { | ||||
setSearchCriteria(input); | setSearchCriteria(input); | ||||
} | } | ||||
@@ -101,7 +73,7 @@ const UserGroupSearchPanel = () => { | |||||
content={false} | content={false} | ||||
> | > | ||||
<UserGroupTable | <UserGroupTable | ||||
recordList={record} | |||||
searchCriteria={searchCriteria} | |||||
/> | /> | ||||
</MainCard> | </MainCard> | ||||
</Grid> | </Grid> | ||||
@@ -7,7 +7,7 @@ export const CHANGE_PASSWORD_PATH = "/user/change-password" | |||||
export const GET_SYS_PARAMS = apiPath+'/settings'; | export const GET_SYS_PARAMS = apiPath+'/settings'; | ||||
//Group Config | //Group Config | ||||
export const GET_GROUP_LIST_PATH = '/group'; | |||||
export const GET_GROUP_LIST_PATH = apiPath+'/group'; | |||||
export const GET_GROUP_COMBO_PATH = '/group/combo'; | export const GET_GROUP_COMBO_PATH = '/group/combo'; | ||||
export const GET_GROUP_MEMBER_LIST_PATH = '/group/member'; | export const GET_GROUP_MEMBER_LIST_PATH = '/group/member'; | ||||
export const GET_GROUP_AUTH_LIST = '/group/auth/combo'; | export const GET_GROUP_AUTH_LIST = '/group/auth/combo'; | ||||