@@ -58,6 +58,7 @@ export function FiDataGrid({ rows, columns, sx, autoHeight, | |||
} | |||
if (rows) { | |||
set_rows(rows) | |||
setRowCount(rows.length) | |||
} | |||
if (columns) { | |||
set_columns(columns) | |||
@@ -194,12 +194,13 @@ export default function FileList({ refType, refId, allowDelete, sx, dateHideable | |||
columns={columns} | |||
editMode="row" | |||
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} | |||
/> | |||
@@ -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' }}> | |||
<TabTableDetail | |||
appId={params?.id} | |||
proofCount={applicationDetailData.proofCount} | |||
paymentCount={applicationDetailData.paymentCount} | |||
statusHistoryCount={applicationDetailData.statusHistoryCount} | |||
/> | |||
</Box> | |||
<br /> | |||
@@ -17,6 +17,14 @@ export default function SubmittedTab({ appId, setCount }) { | |||
const theme = useTheme(); | |||
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 = [ | |||
{ | |||
field: 'actions', | |||
@@ -66,7 +74,7 @@ export default function SubmittedTab({ appId, setCount }) { | |||
columns={columns} | |||
customPageSize={10} | |||
doLoad={React.useMemo(() => ({ | |||
url: GET_PUBLIC_NOTICE_APPLY_DETAIL_PAYMENT+"/"+appId, | |||
url: GET_PUBLIC_NOTICE_APPLY_DETAIL_PAYMENT+"/"+_appId, | |||
params: {}, | |||
callback: function (responseData) { | |||
setCount(responseData?.count); | |||
@@ -18,6 +18,14 @@ export default function StatusHistoryTab({appId, setCount}) { | |||
const theme = useTheme(); | |||
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 = [ | |||
{ | |||
id: 'created', | |||
@@ -55,7 +63,7 @@ export default function StatusHistoryTab({appId, setCount}) { | |||
columns={columns} | |||
customPageSize={10} | |||
doLoad={{ | |||
url: GET_PUBLIC_NOTICE_APPLY_DETAIL_STATUS_HISTORY+"/"+appId, | |||
url: GET_PUBLIC_NOTICE_APPLY_DETAIL_STATUS_HISTORY+"/"+_appId, | |||
params: {}, | |||
callback: function (responseData) { | |||
setCount(responseData?.count); | |||
@@ -25,10 +25,10 @@ import StatusHistoryTab from './StatusHistoryTab'; | |||
// ==============================|| 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 [selectedTab, setSelectedTab] = React.useState("1"); | |||
@@ -52,9 +52,9 @@ const PublicNotice = ({ appId }) => { | |||
<TabContext value={selectedTab}> | |||
<Box sx={{ borderBottom: 1, borderColor: 'divider', overflowX: 'auto' }}> | |||
<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> | |||
</Box> | |||
<TabPanel value="1" sx={{ p: 0 }}> | |||
@@ -22,8 +22,6 @@ import { FormattedMessage, useIntl } from "react-intl"; | |||
export default function SearchPublicNoticeTable({ searchCriteria }) { | |||
const [rows, setRows] = React.useState([]); | |||
const [_searchCriteria, set_searchCriteria] = React.useState(searchCriteria); | |||
const navigate = useNavigate() | |||
const [selectedRowItems, setSelectedRowItems] = React.useState([]); | |||
@@ -32,6 +30,7 @@ export default function SearchPublicNoticeTable({ searchCriteria }) { | |||
const intl = useIntl(); | |||
const [_searchCriteria, set_searchCriteria] = React.useState(searchCriteria); | |||
React.useEffect(() => { | |||
set_searchCriteria(searchCriteria); | |||
}, [searchCriteria]); | |||
@@ -7,18 +7,12 @@ import { | |||
useMediaQuery | |||
} from '@mui/material'; | |||
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 {getStatusIntl} from "utils/statusUtils/PublicNoteStatusUtils"; | |||
// import { | |||
// FormattedMessage, | |||
// useIntl} from "react-intl"; | |||
// ==============================|| EVENT TABLE ||============================== // | |||
export default function LoginGrid({rows}) { | |||
export default function LoginGrid({userId}) { | |||
// const navigate = useNavigate() | |||
const theme = useTheme(); | |||
const isMdOrLg = useMediaQuery(theme.breakpoints.up('md')); | |||
@@ -64,11 +58,14 @@ export default function LoginGrid({rows}) { | |||
return ( | |||
<div style={{minHeight: 200, height:"100%", width: '100%', padding: 4}}> | |||
<FiDataGrid | |||
rows={rows} | |||
columns={columns} | |||
customPageSize={10} | |||
// onRowDoubleClick={handleRowDoubleClick} | |||
getRowHeight={() => 'auto'} | |||
doLoad={{ | |||
url:GET_LOGIN_LOG_LIST, | |||
params:{userId:userId} | |||
}} | |||
/> | |||
</div> | |||
); | |||
@@ -56,7 +56,7 @@ const UserMaintainPage = () => { | |||
const [userConfirm, setUserConfirm] = useState(false); | |||
const [isNewRecord, setIsNewRecord] = useState(false); | |||
const [refUserData, setRefUserData] = React.useState({}); | |||
const [loginLogData, setLoginLogData] = React.useState([]) | |||
// const [loginLogData, setLoginLogData] = React.useState([]) | |||
const [editMode, setEditMode] = React.useState(false); | |||
function updateUserObject(userData) { | |||
@@ -360,7 +360,7 @@ const UserMaintainPage = () => { | |||
<Grid item xs={12} md={12} lg={12}> | |||
<Box xs={12} ml={2} mt={2} mr={3} sx={{ borderRadius: '10px', backgroundColor: '#fff' }}> | |||
<LoginGrid | |||
rows = {loginLogData} | |||
userId = {params.id} | |||
/> | |||
</Box> | |||
</Grid> | |||
@@ -2,23 +2,15 @@ | |||
import * as React from 'react'; | |||
import {FiDataGrid} from "components/FiDataGrid"; | |||
import { | |||
// Button, | |||
// Typography, | |||
useMediaQuery | |||
} from '@mui/material'; | |||
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 {getStatusIntl} from "utils/statusUtils/PublicNoteStatusUtils"; | |||
// import { | |||
// FormattedMessage, | |||
// useIntl} from "react-intl"; | |||
// ==============================|| EVENT TABLE ||============================== // | |||
export default function LoginGrid({rows}) { | |||
export default function LoginGrid({userId}) { | |||
// const navigate = useNavigate() | |||
const theme = useTheme(); | |||
const isMdOrLg = useMediaQuery(theme.breakpoints.up('md')); | |||
@@ -64,11 +56,13 @@ export default function LoginGrid({rows}) { | |||
return ( | |||
<div style={{minHeight: 200, height:"100%", width: '100%', padding: 4}}> | |||
<FiDataGrid | |||
rows={rows} | |||
columns={columns} | |||
customPageSize={10} | |||
// onRowDoubleClick={handleRowDoubleClick} | |||
getRowHeight={() => 'auto'} | |||
doLoad={{ | |||
url:GET_LOGIN_LOG_LIST, | |||
params:{userId:userId} | |||
}} | |||
/> | |||
</div> | |||
); | |||
@@ -43,7 +43,6 @@ const UserMaintainPage_Individual = () => { | |||
const params = useParams(); | |||
const navigate = useNavigate(); | |||
const [formData, setFormData] = React.useState({}) | |||
const [loginLogData, setLoginLogData] = React.useState([]) | |||
const [isLoading, setLoding] = React.useState(true); | |||
const [selectedTab, setSelectedTab] = React.useState("1"); | |||
@@ -91,7 +90,7 @@ const UserMaintainPage_Individual = () => { | |||
response.data["preferLocale"] = getObjectByType(ComboData.Locale, "type", response.data?.preferLocale); | |||
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 ( | |||
isLoading ? | |||
<Grid container sx={{ minHeight: '87vh', mb: 3 }} direction="column" justifyContent="center" alignItems="center"> | |||
@@ -211,7 +192,7 @@ const UserMaintainPage_Individual = () => { | |||
</TabPanel> | |||
<TabPanel value="2"> | |||
<LoginGrid | |||
rows = {loginLogData} | |||
userId = {params.id} | |||
/> | |||
</TabPanel> | |||
</TabContext> | |||