@@ -1,19 +1,11 @@ | |||
import React, { createContext, useState, useEffect } from 'react'; | |||
import {useNavigate} from "react-router-dom"; | |||
//import axios from "axios"; | |||
// import {getUserData} from "auth/utils"; | |||
// import {isObjEmpty} from "../utils/Utils"; | |||
import {useIdleTimer} from "react-idle-timer"; | |||
import { handleLogoutFunction } from 'auth/index'; | |||
import { useDispatch } from "react-redux"; | |||
import { | |||
isUserLoggedIn, | |||
isGLDLoggedIn, | |||
// isPrimaryLoggedIn, | |||
// isCreditorLoggedIn, | |||
// isINDLoggedIn, | |||
// isORGLoggedIn, | |||
// getUserId | |||
} from "utils/Utils"; | |||
const TimerContext = createContext(); | |||
@@ -101,6 +101,7 @@ export function FiDataGrid({ rows, columns, sx, autoHeight, | |||
function getDataList() { | |||
if(_doLoad.url == null) return; | |||
if(_doLoad.params == null) _doLoad.params = {}; | |||
_doLoad.params.start = page*pageSize; | |||
_doLoad.params.limit = pageSize; | |||
HttpUtils.get({ | |||
@@ -140,7 +141,7 @@ export function FiDataGrid({ rows, columns, sx, autoHeight, | |||
rowsPerPage={pageSize} | |||
rowsPerPageOptions={_pageSizeOptions} | |||
labelDisplayedRows={() => | |||
`${page*pageSize+1}-${page*pageSize+(_rows?.length??0)} ${intl.formatMessage({ id: "of" })} ${rowCount}` | |||
`${(_rows?.length?page*pageSize+1:0)}-${page*pageSize+(_rows?.length??0)} ${intl.formatMessage({ id: "of" })} ${rowCount}` | |||
} | |||
labelRowsPerPage={intl.formatMessage({ id: "rowsPerPage" }) + ":"} | |||
onPageChange={handleChangePage} | |||
@@ -1,15 +1,13 @@ | |||
// material-ui | |||
import * as React from 'react'; | |||
// import { | |||
// Button | |||
// } from '@mui/material'; | |||
import * as FormatUtils from "utils/FormatUtils" | |||
import {GFIMIS_LIST} from "utils/ApiPathConst"; | |||
import { useNavigate } from "react-router-dom"; | |||
import { FiDataGrid } from "components/FiDataGrid"; | |||
// ==============================|| EVENT TABLE ||============================== // | |||
export default function SearchPublicNoticeTable({ recordList }) { | |||
const [rows, setRows] = React.useState(recordList); | |||
export default function SearchTable({ searchCriteria }) { | |||
const [_searchCriteria, set_searchCriteria] = React.useState(searchCriteria); | |||
const navigate = useNavigate() | |||
const _sx = { | |||
@@ -29,8 +27,8 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||
} | |||
React.useEffect(() => { | |||
setRows(recordList); | |||
}, [recordList]); | |||
set_searchCriteria(searchCriteria); | |||
}, [searchCriteria]); | |||
const handleEditClick = (params) => () => { | |||
navigate('/paymentPage/details/' + params.row.id); | |||
@@ -65,10 +63,15 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||
<FiDataGrid | |||
sx={_sx} | |||
rowHeight={80} | |||
rows={rows} | |||
columns={columns} | |||
customPageSize={10} | |||
onRowDoubleClick={handleEditClick} | |||
doLoad={{ | |||
url:GFIMIS_LIST, | |||
params:_searchCriteria, | |||
callback: function(){ | |||
} | |||
}} | |||
/> | |||
</div> | |||
); | |||
@@ -5,7 +5,7 @@ import { | |||
Stack | |||
} from '@mui/material'; | |||
import MainCard from "components/MainCard"; | |||
import * as UrlUtils from "utils/ApiPathConst"; | |||
import {GEN_GFMIS_XML} from "utils/ApiPathConst"; | |||
import * as React from "react"; | |||
import * as HttpUtils from "utils/HttpUtils"; | |||
import * as DateUtils from "utils/DateUtils"; | |||
@@ -30,7 +30,6 @@ const BackgroundHead = { | |||
const Index = () => { | |||
const [record,setRecord] = React.useState([]); | |||
const [searchCriteria, setSearchCriteria] = React.useState({ | |||
dateFrom: DateUtils.dateValue(new Date()), | |||
// dateFrom: DateUtils.dateValue(new Date().setDate(new Date().getDate()-14)), | |||
@@ -39,27 +38,13 @@ const Index = () => { | |||
React.useEffect(() => { | |||
setOnReady(true); | |||
}, [record]); | |||
React.useEffect(() => { | |||
// console.log(searchCriteria) | |||
loadGrid(); | |||
}, [searchCriteria]); | |||
function loadGrid(){ | |||
HttpUtils.get({ | |||
url: UrlUtils.GFIMIS_LIST, | |||
params: searchCriteria, | |||
onSuccess: function(responseData){ | |||
setRecord(responseData); | |||
} | |||
}); | |||
} | |||
function downloadXML(input) { | |||
// console.log(input) | |||
HttpUtils.get({ | |||
url: UrlUtils.GEN_GFMIS_XML + "/today", | |||
url: GEN_GFMIS_XML + "/today", | |||
params:{ | |||
// dateTo: input.dateTo, | |||
dateFrom: input.dateFrom, | |||
@@ -149,7 +134,7 @@ const Index = () => { | |||
sx={{width: "-webkit-fill-available"}} | |||
> | |||
<EventTable | |||
recordList={record} | |||
searchCriteria={searchCriteria} | |||
/> | |||
</MainCard> | |||
</Grid> | |||
@@ -9,7 +9,7 @@ import { FiDataGrid } from "components/FiDataGrid"; | |||
import { clickableLink } from 'utils/CommonFunction'; | |||
// ==============================|| EVENT TABLE ||============================== // | |||
export default function SearchPublicNoticeTable({ searchCriteria }) { | |||
export default function SearchPaymentTable({ searchCriteria }) { | |||
const [_searchCriteria, set_searchCriteria] = React.useState(searchCriteria); | |||
const navigate = useNavigate() | |||
@@ -30,8 +30,8 @@ export default function SearchPublicNoticeTable({ searchCriteria }) { | |||
} | |||
React.useEffect(() => { | |||
setRows(recordList); | |||
}, [recordList]); | |||
set_searchCriteria(searchCriteria); | |||
}, [searchCriteria]); | |||
const handleEditClick = (params) => () => { | |||
navigate('/paymentPage/details/' + params.row.id); | |||
@@ -5,9 +5,7 @@ import { | |||
Stack | |||
} from '@mui/material'; | |||
import MainCard from "components/MainCard"; | |||
import * as UrlUtils from "utils/ApiPathConst"; | |||
import * as React from "react"; | |||
import * as HttpUtils from "utils/HttpUtils"; | |||
import * as DateUtils from "utils/DateUtils"; | |||
import Loadable from 'components/Loadable'; | |||
@@ -30,7 +28,6 @@ const BackgroundHead = { | |||
const Index = () => { | |||
const [record,setRecord] = React.useState([]); | |||
const [searchCriteria, setSearchCriteria] = React.useState({ | |||
dateTo: DateUtils.dateValue(new Date()), | |||
dateFrom: DateUtils.dateValue(new Date().setDate(new Date().getDate()-14)), | |||
@@ -39,23 +36,8 @@ const Index = () => { | |||
React.useEffect(() => { | |||
setOnReady(true); | |||
}, [record]); | |||
React.useEffect(() => { | |||
loadGrid(); | |||
}, [searchCriteria]); | |||
function loadGrid(){ | |||
HttpUtils.get({ | |||
url: UrlUtils.PAYMENT_LIST, | |||
params: searchCriteria, | |||
onSuccess: function(responseData){ | |||
setRecord(responseData); | |||
} | |||
}); | |||
} | |||
function applySearch(input) { | |||
setSearchCriteria(input); | |||
} | |||
@@ -93,7 +75,7 @@ const Index = () => { | |||
sx={{width: "-webkit-fill-available"}} | |||
> | |||
<EventTable | |||
recordList={record} | |||
searchCriteria={searchCriteria} | |||
/> | |||
</MainCard> | |||
</Grid> | |||
@@ -9,7 +9,7 @@ import { useEffect, useState } from "react"; | |||
import { useNavigate, useLocation } from "react-router-dom"; | |||
// import * as FormatUtils from "utils/FormatUtils"; | |||
// const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); | |||
import * as Utils from "auth/utils"; | |||
import {getBowserType, local, preferpaymentmethods} from "auth/utils"; | |||
import { | |||
Button, | |||
@@ -80,7 +80,7 @@ const Index = () => { | |||
localStorage.removeItem("webtoken"); | |||
localStorage.removeItem("transactionid"); | |||
localStorage.removeItem("paymentId"); | |||
if (Utils.getBowserType() === "PC_Browser"){ | |||
if (getBowserType() === "PC_Browser"){ | |||
setIsFullScreen(false) | |||
setBrowserType(desktopBrowser) | |||
} else { | |||
@@ -190,12 +190,12 @@ const Index = () => { | |||
HttpUtils.post({ | |||
url: UrlUtils.PAYMENT_AVAILABLE_PAYMENT, | |||
params: { | |||
"locale": locale === 'en' ?Utils.local.en:locale === 'zh-HK' ?Utils.local.zh:Utils.local.cn, | |||
"locale": locale === 'en' ?local.en:locale === 'zh-HK' ?local.zh:local.cn, | |||
"amount": totalAmount, | |||
// "eserviceids": [ | |||
// "<eserviceid>", "<eserviceid>" | |||
// ], | |||
"preferpaymentmethods": Utils.preferpaymentmethods | |||
"preferpaymentmethods": preferpaymentmethods | |||
}, | |||
onSuccess: (responseData) => { | |||
let availableMethods = responseData.availablepaymentmethods; | |||
@@ -2,13 +2,13 @@ | |||
import { | |||
Grid, Typography, Stack | |||
} from '@mui/material'; | |||
import MainCard from "../../../components/MainCard"; | |||
import MainCard from "components/MainCard"; | |||
import { useEffect, useState } from "react"; | |||
//import axios from "axios"; | |||
//import {apiPath} from "../../auth/utils"; | |||
import * as UrlUtils from "../../../utils/ApiPathConst"; | |||
import * as UrlUtils from "utils/ApiPathConst"; | |||
import * as React from "react"; | |||
import * as HttpUtils from "../../../utils/HttpUtils"; | |||
import * as HttpUtils from "utils/HttpUtils"; | |||
//import LoadingComponent from "../extra-pages/LoadingComponent"; | |||
//import SearchForm from "./UserSearchForm_Organization"; | |||