@@ -58,6 +58,7 @@ export function FiDataGrid({ rows, columns, sx, autoHeight, | |||||
} | } | ||||
if (rows) { | if (rows) { | ||||
set_rows(rows) | set_rows(rows) | ||||
setRowCount(rows.length) | |||||
} | } | ||||
if (columns) { | if (columns) { | ||||
set_columns(columns) | set_columns(columns) | ||||
@@ -194,12 +194,13 @@ export default function FileList({ refType, refId, allowDelete, sx, dateHideable | |||||
columns={columns} | columns={columns} | ||||
editMode="row" | editMode="row" | ||||
rowModesModel={rowModesModel} | rowModesModel={rowModesModel} | ||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: { page: 0, pageSize: 5 }, | |||||
}, | |||||
}} | |||||
pageSizeOptions={[5, 10]} | |||||
// initialState={{ | |||||
// pagination: { | |||||
// paginationModel: { page: 0, pageSize: 5 }, | |||||
// }, | |||||
// }} | |||||
//pageSizeOptions={[5, 10]} | |||||
customPageSize={100} | |||||
autoHeight={true} | autoHeight={true} | ||||
/> | /> | ||||
@@ -394,6 +394,9 @@ const PublicNoticeDetail_GLD = () => { | |||||
<Box xs={12} sx={{ ml: 2, mt: 3, mr: { sm: 2 }, borderRadius: '10px', width: { xs: '92vw', sm: '96.5vw', md: "auto" }, backgroundColor: '#ffffff' }}> | <Box xs={12} sx={{ ml: 2, mt: 3, mr: { sm: 2 }, borderRadius: '10px', width: { xs: '92vw', sm: '96.5vw', md: "auto" }, backgroundColor: '#ffffff' }}> | ||||
<TabTableDetail | <TabTableDetail | ||||
appId={params?.id} | appId={params?.id} | ||||
proofCount={applicationDetailData.proofCount} | |||||
paymentCount={applicationDetailData.paymentCount} | |||||
statusHistoryCount={applicationDetailData.statusHistoryCount} | |||||
/> | /> | ||||
</Box> | </Box> | ||||
<br /> | <br /> | ||||
@@ -17,6 +17,14 @@ export default function SubmittedTab({ appId, setCount }) { | |||||
const theme = useTheme(); | const theme = useTheme(); | ||||
const isMdOrLg = useMediaQuery(theme.breakpoints.up('md')); | const isMdOrLg = useMediaQuery(theme.breakpoints.up('md')); | ||||
const [_appId, set_appId] = React.useState({}); | |||||
React.useEffect(() => { | |||||
set_appId(appId); | |||||
}, [appId]); | |||||
React.useEffect(() => { | |||||
set_appId(appId); | |||||
}, []); | |||||
const columns = [ | const columns = [ | ||||
{ | { | ||||
field: 'actions', | field: 'actions', | ||||
@@ -66,7 +74,7 @@ export default function SubmittedTab({ appId, setCount }) { | |||||
columns={columns} | columns={columns} | ||||
customPageSize={10} | customPageSize={10} | ||||
doLoad={React.useMemo(() => ({ | doLoad={React.useMemo(() => ({ | ||||
url: GET_PUBLIC_NOTICE_APPLY_DETAIL_PAYMENT+"/"+appId, | |||||
url: GET_PUBLIC_NOTICE_APPLY_DETAIL_PAYMENT+"/"+_appId, | |||||
params: {}, | params: {}, | ||||
callback: function (responseData) { | callback: function (responseData) { | ||||
setCount(responseData?.count); | setCount(responseData?.count); | ||||
@@ -18,6 +18,14 @@ export default function StatusHistoryTab({appId, setCount}) { | |||||
const theme = useTheme(); | const theme = useTheme(); | ||||
const isMdOrLg = useMediaQuery(theme.breakpoints.up('md')); | const isMdOrLg = useMediaQuery(theme.breakpoints.up('md')); | ||||
const [_appId, set_appId] = React.useState({}); | |||||
React.useEffect(() => { | |||||
set_appId(appId); | |||||
}, [appId]); | |||||
React.useEffect(() => { | |||||
set_appId(appId); | |||||
}, []); | |||||
const columns = [ | const columns = [ | ||||
{ | { | ||||
id: 'created', | id: 'created', | ||||
@@ -55,7 +63,7 @@ export default function StatusHistoryTab({appId, setCount}) { | |||||
columns={columns} | columns={columns} | ||||
customPageSize={10} | customPageSize={10} | ||||
doLoad={{ | doLoad={{ | ||||
url: GET_PUBLIC_NOTICE_APPLY_DETAIL_STATUS_HISTORY+"/"+appId, | |||||
url: GET_PUBLIC_NOTICE_APPLY_DETAIL_STATUS_HISTORY+"/"+_appId, | |||||
params: {}, | params: {}, | ||||
callback: function (responseData) { | callback: function (responseData) { | ||||
setCount(responseData?.count); | setCount(responseData?.count); | ||||
@@ -25,10 +25,10 @@ import StatusHistoryTab from './StatusHistoryTab'; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
const PublicNotice = ({ appId }) => { | |||||
const [proofCount, setProofCount] = React.useState(0); | |||||
const [paymentCount, setPaymentCount] = React.useState(0); | |||||
const [statusHistoryCount, setStatusHistoryCount] = React.useState(0); | |||||
const PublicNotice = ({ appId, proofCount, paymentCount, statusHistoryCount }) => { | |||||
const [_proofCount, setProofCount] = React.useState(proofCount); | |||||
const [_paymentCount, setPaymentCount] = React.useState(paymentCount); | |||||
const [_statusHistoryCount, setStatusHistoryCount] = React.useState(statusHistoryCount); | |||||
const [onReady, setOnReady] = React.useState(false); | const [onReady, setOnReady] = React.useState(false); | ||||
const [selectedTab, setSelectedTab] = React.useState("1"); | const [selectedTab, setSelectedTab] = React.useState("1"); | ||||
@@ -52,9 +52,9 @@ const PublicNotice = ({ appId }) => { | |||||
<TabContext value={selectedTab}> | <TabContext value={selectedTab}> | ||||
<Box sx={{ borderBottom: 1, borderColor: 'divider', overflowX: 'auto' }}> | <Box sx={{ borderBottom: 1, borderColor: 'divider', overflowX: 'auto' }}> | ||||
<TabList onChange={handleChange} aria-label="lab API tabs example"> | <TabList onChange={handleChange} aria-label="lab API tabs example"> | ||||
<Tab label={"Proof (" + proofCount + ") "} value="1" /> | |||||
<Tab label={"Payment (" + paymentCount + ") "} value="2" /> | |||||
<Tab label={"Status History (" + statusHistoryCount + ") "} value="3" /> | |||||
<Tab renderActiveOnly={false} label={"Proof (" + _proofCount + ") "} value="1" /> | |||||
<Tab renderActiveOnly={false} label={"Payment (" + _paymentCount + ") "} value="2" /> | |||||
<Tab renderActiveOnly={false} label={"Status History (" + _statusHistoryCount + ") "} value="3" /> | |||||
</TabList> | </TabList> | ||||
</Box> | </Box> | ||||
<TabPanel value="1" sx={{ p: 0 }}> | <TabPanel value="1" sx={{ p: 0 }}> | ||||
@@ -22,8 +22,6 @@ import { FormattedMessage, useIntl } from "react-intl"; | |||||
export default function SearchPublicNoticeTable({ searchCriteria }) { | export default function SearchPublicNoticeTable({ searchCriteria }) { | ||||
const [rows, setRows] = React.useState([]); | const [rows, setRows] = React.useState([]); | ||||
const [_searchCriteria, set_searchCriteria] = React.useState(searchCriteria); | |||||
const navigate = useNavigate() | const navigate = useNavigate() | ||||
const [selectedRowItems, setSelectedRowItems] = React.useState([]); | const [selectedRowItems, setSelectedRowItems] = React.useState([]); | ||||
@@ -32,6 +30,7 @@ export default function SearchPublicNoticeTable({ searchCriteria }) { | |||||
const intl = useIntl(); | const intl = useIntl(); | ||||
const [_searchCriteria, set_searchCriteria] = React.useState(searchCriteria); | |||||
React.useEffect(() => { | React.useEffect(() => { | ||||
set_searchCriteria(searchCriteria); | set_searchCriteria(searchCriteria); | ||||
}, [searchCriteria]); | }, [searchCriteria]); | ||||
@@ -7,18 +7,12 @@ import { | |||||
useMediaQuery | useMediaQuery | ||||
} from '@mui/material'; | } from '@mui/material'; | ||||
import * as DateUtils from "utils/DateUtils" | import * as DateUtils from "utils/DateUtils" | ||||
// import {useNavigate} from "react-router-dom"; | |||||
// import { | |||||
// isORGLoggedIn, | |||||
// } from "utils/Utils"; | |||||
import {GET_LOGIN_LOG_LIST } from "utils/ApiPathConst"; | |||||
import {useTheme} from "@emotion/react"; | import {useTheme} from "@emotion/react"; | ||||
// import {getStatusIntl} from "utils/statusUtils/PublicNoteStatusUtils"; | |||||
// import { | |||||
// FormattedMessage, | |||||
// useIntl} from "react-intl"; | |||||
// ==============================|| EVENT TABLE ||============================== // | // ==============================|| EVENT TABLE ||============================== // | ||||
export default function LoginGrid({rows}) { | |||||
export default function LoginGrid({userId}) { | |||||
// const navigate = useNavigate() | // const navigate = useNavigate() | ||||
const theme = useTheme(); | const theme = useTheme(); | ||||
const isMdOrLg = useMediaQuery(theme.breakpoints.up('md')); | const isMdOrLg = useMediaQuery(theme.breakpoints.up('md')); | ||||
@@ -64,11 +58,14 @@ export default function LoginGrid({rows}) { | |||||
return ( | return ( | ||||
<div style={{minHeight: 200, height:"100%", width: '100%', padding: 4}}> | <div style={{minHeight: 200, height:"100%", width: '100%', padding: 4}}> | ||||
<FiDataGrid | <FiDataGrid | ||||
rows={rows} | |||||
columns={columns} | columns={columns} | ||||
customPageSize={10} | customPageSize={10} | ||||
// onRowDoubleClick={handleRowDoubleClick} | // onRowDoubleClick={handleRowDoubleClick} | ||||
getRowHeight={() => 'auto'} | getRowHeight={() => 'auto'} | ||||
doLoad={{ | |||||
url:GET_LOGIN_LOG_LIST, | |||||
params:{userId:userId} | |||||
}} | |||||
/> | /> | ||||
</div> | </div> | ||||
); | ); | ||||
@@ -56,7 +56,7 @@ const UserMaintainPage = () => { | |||||
const [userConfirm, setUserConfirm] = useState(false); | const [userConfirm, setUserConfirm] = useState(false); | ||||
const [isNewRecord, setIsNewRecord] = useState(false); | const [isNewRecord, setIsNewRecord] = useState(false); | ||||
const [refUserData, setRefUserData] = React.useState({}); | const [refUserData, setRefUserData] = React.useState({}); | ||||
const [loginLogData, setLoginLogData] = React.useState([]) | |||||
// const [loginLogData, setLoginLogData] = React.useState([]) | |||||
const [editMode, setEditMode] = React.useState(false); | const [editMode, setEditMode] = React.useState(false); | ||||
function updateUserObject(userData) { | function updateUserObject(userData) { | ||||
@@ -360,7 +360,7 @@ const UserMaintainPage = () => { | |||||
<Grid item xs={12} md={12} lg={12}> | <Grid item xs={12} md={12} lg={12}> | ||||
<Box xs={12} ml={2} mt={2} mr={3} sx={{ borderRadius: '10px', backgroundColor: '#fff' }}> | <Box xs={12} ml={2} mt={2} mr={3} sx={{ borderRadius: '10px', backgroundColor: '#fff' }}> | ||||
<LoginGrid | <LoginGrid | ||||
rows = {loginLogData} | |||||
userId = {params.id} | |||||
/> | /> | ||||
</Box> | </Box> | ||||
</Grid> | </Grid> | ||||
@@ -2,23 +2,15 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import {FiDataGrid} from "components/FiDataGrid"; | import {FiDataGrid} from "components/FiDataGrid"; | ||||
import { | import { | ||||
// Button, | |||||
// Typography, | |||||
useMediaQuery | useMediaQuery | ||||
} from '@mui/material'; | } from '@mui/material'; | ||||
import * as DateUtils from "utils/DateUtils" | import * as DateUtils from "utils/DateUtils" | ||||
// import {useNavigate} from "react-router-dom"; | |||||
// import { | |||||
// isORGLoggedIn, | |||||
// } from "utils/Utils"; | |||||
import {GET_LOGIN_LOG_LIST } from "utils/ApiPathConst"; | |||||
import {useTheme} from "@emotion/react"; | import {useTheme} from "@emotion/react"; | ||||
// import {getStatusIntl} from "utils/statusUtils/PublicNoteStatusUtils"; | |||||
// import { | |||||
// FormattedMessage, | |||||
// useIntl} from "react-intl"; | |||||
// ==============================|| EVENT TABLE ||============================== // | // ==============================|| EVENT TABLE ||============================== // | ||||
export default function LoginGrid({rows}) { | |||||
export default function LoginGrid({userId}) { | |||||
// const navigate = useNavigate() | // const navigate = useNavigate() | ||||
const theme = useTheme(); | const theme = useTheme(); | ||||
const isMdOrLg = useMediaQuery(theme.breakpoints.up('md')); | const isMdOrLg = useMediaQuery(theme.breakpoints.up('md')); | ||||
@@ -64,11 +56,13 @@ export default function LoginGrid({rows}) { | |||||
return ( | return ( | ||||
<div style={{minHeight: 200, height:"100%", width: '100%', padding: 4}}> | <div style={{minHeight: 200, height:"100%", width: '100%', padding: 4}}> | ||||
<FiDataGrid | <FiDataGrid | ||||
rows={rows} | |||||
columns={columns} | columns={columns} | ||||
customPageSize={10} | customPageSize={10} | ||||
// onRowDoubleClick={handleRowDoubleClick} | |||||
getRowHeight={() => 'auto'} | getRowHeight={() => 'auto'} | ||||
doLoad={{ | |||||
url:GET_LOGIN_LOG_LIST, | |||||
params:{userId:userId} | |||||
}} | |||||
/> | /> | ||||
</div> | </div> | ||||
); | ); | ||||
@@ -43,7 +43,6 @@ const UserMaintainPage_Individual = () => { | |||||
const params = useParams(); | const params = useParams(); | ||||
const navigate = useNavigate(); | const navigate = useNavigate(); | ||||
const [formData, setFormData] = React.useState({}) | const [formData, setFormData] = React.useState({}) | ||||
const [loginLogData, setLoginLogData] = React.useState([]) | |||||
const [isLoading, setLoding] = React.useState(true); | const [isLoading, setLoding] = React.useState(true); | ||||
const [selectedTab, setSelectedTab] = React.useState("1"); | const [selectedTab, setSelectedTab] = React.useState("1"); | ||||
@@ -91,7 +90,7 @@ const UserMaintainPage_Individual = () => { | |||||
response.data["preferLocale"] = getObjectByType(ComboData.Locale, "type", response.data?.preferLocale); | response.data["preferLocale"] = getObjectByType(ComboData.Locale, "type", response.data?.preferLocale); | ||||
setFormData(response.data); | setFormData(response.data); | ||||
getLoginLogList() | |||||
setLoding(false); | |||||
} | } | ||||
}); | }); | ||||
} | } | ||||
@@ -124,24 +123,6 @@ const UserMaintainPage_Individual = () => { | |||||
} | } | ||||
}; | }; | ||||
const getLoginLogList = () => { | |||||
HttpUtils.get({ | |||||
url: `${UrlUtils.GET_LOGIN_LOG_LIST}`, | |||||
params:{ | |||||
userId:params.id | |||||
}, | |||||
onSuccess: function (response) { | |||||
// console.log(response) | |||||
setLoginLogData(response); | |||||
} | |||||
}); | |||||
} | |||||
React.useEffect(() => { | |||||
setLoding(false); | |||||
}, [loginLogData]); | |||||
return ( | return ( | ||||
isLoading ? | isLoading ? | ||||
<Grid container sx={{ minHeight: '87vh', mb: 3 }} direction="column" justifyContent="center" alignItems="center"> | <Grid container sx={{ minHeight: '87vh', mb: 3 }} direction="column" justifyContent="center" alignItems="center"> | ||||
@@ -211,7 +192,7 @@ const UserMaintainPage_Individual = () => { | |||||
</TabPanel> | </TabPanel> | ||||
<TabPanel value="2"> | <TabPanel value="2"> | ||||
<LoginGrid | <LoginGrid | ||||
rows = {loginLogData} | |||||
userId = {params.id} | |||||
/> | /> | ||||
</TabPanel> | </TabPanel> | ||||
</TabContext> | </TabContext> | ||||