From 1cd6cc1aac9560de12608b4cbe0a22e1bc351677 Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 11 Jan 2024 15:56:57 +0800 Subject: [PATCH 01/10] update ui --- src/pages/DemandNote/Search/DataGrid.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pages/DemandNote/Search/DataGrid.js b/src/pages/DemandNote/Search/DataGrid.js index e0c75ec..f6b57d1 100644 --- a/src/pages/DemandNote/Search/DataGrid.js +++ b/src/pages/DemandNote/Search/DataGrid.js @@ -7,6 +7,7 @@ import { Box, Dialog, DialogTitle, DialogContent, DialogActions, } from '@mui/material'; +import DownloadIcon from '@mui/icons-material/Download'; import * as DateUtils from "utils/DateUtils"; import * as FormatUtils from "utils/FormatUtils"; import * as StatusUtils from "utils/statusUtils/DnStatus"; @@ -233,8 +234,11 @@ export default function SearchDemandNote({ recordList, reloadFun }) { }, { field: 'filename', - headerName: 'DN File', - width: 220, + //headerName: 'DN File', + renderHeader: () => ( + <>DN File + ), + width: 250, renderCell: (params) => { return ; }, From d567f8837f0bc64c5670e3bbff5dacf657851434 Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 11 Jan 2024 16:12:39 +0800 Subject: [PATCH 02/10] update ui --- src/pages/DemandNote/Search/DataGrid.js | 75 ++++++++++++++--------- src/pages/DemandNote/Search/SearchForm.js | 20 ------ src/pages/DemandNote/Search/index.js | 1 + 3 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/pages/DemandNote/Search/DataGrid.js b/src/pages/DemandNote/Search/DataGrid.js index f6b57d1..965a33f 100644 --- a/src/pages/DemandNote/Search/DataGrid.js +++ b/src/pages/DemandNote/Search/DataGrid.js @@ -20,7 +20,7 @@ import * as UrlUtils from "utils/ApiPathConst"; import * as HttpUtils from "utils/HttpUtils"; // ==============================|| EVENT TABLE ||============================== // -export default function SearchDemandNote({ recordList, reloadFun }) { +export default function SearchDemandNote({ recordList, reloadFun, applySearch }) { const [isConfirmPopUp, setConfirmPopUp] = React.useState(false); const [isSendPopUp, setSendPopUp] = React.useState(false); @@ -40,15 +40,22 @@ export default function SearchDemandNote({ recordList, reloadFun }) { navigate('/paymentPage/demandNote/details/' + params.id); }; + const findReadyToSend=()=>{ + const temp = { + status: 'pending', + }; + applySearch(temp); + } + const exportXml = () => { let idList = []; const datas = rows?.filter((row) => selectedRowItems.includes(row.id) ); - if(datas?.length<1){ + if (datas?.length < 1) { setSelectonWarning(true); return; - }else if (datas?.length >= 100) { + } else if (datas?.length >= 100) { setIsErrorPopUp(true); return; } @@ -56,10 +63,10 @@ export default function SearchDemandNote({ recordList, reloadFun }) { idList.push(datas[i].id); } HttpUtils.fileDownload({ - method:'post', + method: 'post', url: UrlUtils.DEMAND_NOTE_EXPORT, params: { - dnIdList:idList + dnIdList: idList }, onSuccess: function () { notifyDownloadSuccess(); @@ -81,7 +88,7 @@ export default function SearchDemandNote({ recordList, reloadFun }) { const datas = rows?.filter((row) => selectedRowItems.includes(row.id) ); - if(datas?.length<1){ + if (datas?.length < 1) { setSelectonWarning(true); return; } @@ -107,16 +114,16 @@ export default function SearchDemandNote({ recordList, reloadFun }) { selectedRowItems.includes(row.id) ); for (var i = 0; i < datas?.length; i++) { - let dnNo = datas[i].dnNo.replaceAll("-",""); + let dnNo = datas[i].dnNo.replaceAll("-", ""); dnMap[dnNo] = datas[i].id } let file = event.target.files[0]; HttpUtils.postWithFiles({ - url:UrlUtils.DEMAND_NOTE_ATTACH, - params:{ - dnMap:dnMap + url: UrlUtils.DEMAND_NOTE_ATTACH, + params: { + dnMap: dnMap }, - files:[file], + files: [file], onSuccess() { setWait(false); if (reloadFun) reloadFun(); @@ -131,7 +138,7 @@ export default function SearchDemandNote({ recordList, reloadFun }) { const datas = rows?.filter((row) => selectedRowItems.includes(row.id) ); - if(datas?.length<1){ + if (datas?.length < 1) { setSelectonWarning(true); return; } @@ -165,7 +172,7 @@ export default function SearchDemandNote({ recordList, reloadFun }) { headerName: 'Client', width: 300, renderCell: (params) => { - let company = params.row.enCompanyName != null?params.row.enCompanyName: params.row.chCompanyName; + let company = params.row.enCompanyName != null ? params.row.enCompanyName : params.row.chCompanyName; company = company != null ? " (" + (company) + ")" : ""; let phone = JSON.parse(params.row.contactTelNo); @@ -194,7 +201,7 @@ export default function SearchDemandNote({ recordList, reloadFun }) { width: 100, renderCell: (params) => { return (<> - {params?.value+"cm"}
+ {params?.value + "cm"}
{params.row.column} ); } @@ -236,7 +243,7 @@ export default function SearchDemandNote({ recordList, reloadFun }) { field: 'filename', //headerName: 'DN File', renderHeader: () => ( - <>DN File + <>DN File ), width: 250, renderCell: (params) => { @@ -248,7 +255,7 @@ export default function SearchDemandNote({ recordList, reloadFun }) { headerName: 'App Status', width: 175, renderCell: (params) => { - return [PublicNoteStatusUtils.getStatusByTextEng(params?.value,true)] + return [PublicNoteStatusUtils.getStatusByTextEng(params?.value, true)] }, }, { @@ -275,7 +282,7 @@ export default function SearchDemandNote({ recordList, reloadFun }) { const datas = rows?.filter((row) => selectedRowItems.includes(row.id) ); - if(datas.length==0){ + if (datas.length == 0) { setSelectonWarning(true); document.getElementById("uploadFileBtn").value = ""; return; @@ -293,6 +300,18 @@ export default function SearchDemandNote({ recordList, reloadFun }) { + + + - - - + setIsErrorPopUp(false)} > + Action Fail + + Number of DN record must less than 100.
Please edit search form.
+
+ + + +
+
setSelectonWarning(false)} > Warning diff --git a/src/pages/DemandNote/Search/SearchForm.js b/src/pages/DemandNote/Search/SearchForm.js index d983aaa..d58283d 100644 --- a/src/pages/DemandNote/Search/SearchForm.js +++ b/src/pages/DemandNote/Search/SearchForm.js @@ -51,12 +51,6 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue applySearch(temp); }; - const findReadyToSend=()=>{ - const temp = { - status: 'pending', - }; - applySearch(temp); - } React.useEffect(() => { if (orgComboData && orgComboData.length > 0) { @@ -264,20 +258,6 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue {/*last row*/} - - - - - + > + + @@ -266,7 +270,9 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => {
setIsWarningPopUp(false)} > - 注意 + + + {warningText} diff --git a/src/pages/PublicNotice/ListPanel/BaseGrid.js b/src/pages/PublicNotice/ListPanel/BaseGrid.js index 40b7e49..fa03cf4 100644 --- a/src/pages/PublicNotice/ListPanel/BaseGrid.js +++ b/src/pages/PublicNotice/ListPanel/BaseGrid.js @@ -6,18 +6,20 @@ import { Typography, useMediaQuery } from '@mui/material'; import * as DateUtils from "utils/DateUtils" -import * as StatusUtils from "utils/statusUtils/PublicNoteStatusUtils"; import {useNavigate} from "react-router-dom"; import { isORGLoggedIn, } from "utils/Utils"; import {useTheme} from "@emotion/react"; +import {getStatusIntl} from "utils/statusUtils/PublicNoteStatusUtils"; +import {useIntl} from "react-intl"; // ==============================|| EVENT TABLE ||============================== // export default function BaseGrid({rows}) { const navigate = useNavigate() const theme = useTheme(); const isMdOrLg = useMediaQuery(theme.breakpoints.up('md')); + const intl = useIntl(); const handleDetailClick = (params) => () => { navigate('/publicNotice/'+ params.id); @@ -93,7 +95,7 @@ export default function BaseGrid({rows}) { width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, renderCell: (params) => { - return [StatusUtils.getStatus(params)] + return [getStatusIntl(params,intl)] }, }, { diff --git a/src/pages/PublicNotice/ListPanel/SearchPublicNoticeForm.js b/src/pages/PublicNotice/ListPanel/SearchPublicNoticeForm.js index 3f50227..eaa272c 100644 --- a/src/pages/PublicNotice/ListPanel/SearchPublicNoticeForm.js +++ b/src/pages/PublicNotice/ListPanel/SearchPublicNoticeForm.js @@ -15,14 +15,14 @@ import { } from "utils/Utils"; import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; import {ThemeProvider} from "@emotion/react"; -import {FormattedMessage} from "react-intl"; +import {FormattedMessage, useIntl} from "react-intl"; // ==============================|| DASHBOARD - DEFAULT ||============================== // const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { - + const intl = useIntl(); const [type, setType] = React.useState([]); - const [status, setStatus] = React.useState([{ key: 0, label: 'All', labelCht: "全部", type: 'all' }]); + const [status, setStatus] = React.useState([{ key: 0, label: 'all', type: 'all' }]); const [minDate, setMinDate] = React.useState(searchCriteria.dateFrom); const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo); @@ -160,7 +160,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { } value={status} // inputValue={status?.labelCht} - getOptionLabel={(option) => option.labelCht} + getOptionLabel={(option) => intl.formatMessage({id: option.label})} onChange={(event, newValue) => { console.log(newValue) const findAllIndex = newValue.findIndex((ele) => { diff --git a/src/pages/PublicNotice/ListPanel/index.js b/src/pages/PublicNotice/ListPanel/index.js index dfe6192..72112f0 100644 --- a/src/pages/PublicNotice/ListPanel/index.js +++ b/src/pages/PublicNotice/ListPanel/index.js @@ -25,7 +25,7 @@ const SearchTab = Loadable(lazy(() => import('./SearchPublicNoticeTab'))); import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' import {PNSPS_LONG_BUTTON_THEME} from "../../../themes/buttonConst"; import {ThemeProvider} from "@emotion/react"; -import {FormattedMessage} from "react-intl"; +import {FormattedMessage, useIntl} from "react-intl"; // ==============================|| DASHBOARD - DEFAULT ||============================== // @@ -37,6 +37,7 @@ const PublicNotice = () => { const [isLoading, setLoding] = useState(true); const [selectedTab, setSelectedTab] = useState("1"); const navigate = useNavigate(); + const intl = useIntl(); const _sx = { padding: "4 2 4 2", @@ -118,7 +119,7 @@ const PublicNotice = () => { @@ -132,10 +133,10 @@ const PublicNotice = () => { - - - - + + + + @@ -169,10 +170,10 @@ const PublicNotice = () => { - - - - + + + + diff --git a/src/pages/dashboard/Public/index.js b/src/pages/dashboard/Public/index.js index 116dcd6..941e79b 100644 --- a/src/pages/dashboard/Public/index.js +++ b/src/pages/dashboard/Public/index.js @@ -10,6 +10,7 @@ import { isORGLoggedIn, } from "utils/Utils"; import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' +import {FormattedMessage} from "react-intl"; // ==============================|| DASHBOARD - DEFAULT ||============================== // const DashboardDefault = () => { @@ -30,7 +31,9 @@ const DashboardDefault = () => {
{/* 我的公共啟事 */} - {isORGLoggedIn() ?userData.fullenName:userData.fullchName}, 午安! 請選擇所需服務。 + + {isORGLoggedIn() ?userData.fullenName:userData.fullchName}, +
diff --git a/src/translations/en.json b/src/translations/en.json index f3ae6f8..d67bf33 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -24,6 +24,7 @@ "onlinePaymentHistory": "Online Payment History", "setting": "Setting", "companyOrUserRecord": "Company/Institutional User Records", + "welcomeMsg": "Good afternoon! Please select the required service.", "login": "Login", "iAmSmartLogin": "iAM Smart Login", @@ -86,7 +87,7 @@ "businessChName": "Chinese name of Organization/Company", "preview": "Preview", "finishSubmission": "Finish Submission", - "reset": "reset", + "reset": "Reset", "requireString": "Items marked with * must be filled in", "confirmPassword": "Confirm password", "pleaseConfirmPassword": "Please confirm password", @@ -181,6 +182,24 @@ "lammaIslandCombo": "Lamma Island District", "pengChauCombo": "Peng Chau District", + "applyPublicNotice": "Apply for public notice", + "attention": "attention", + "all": "All", + "processing": "Processing", + "pendingPayment": "Pending payment", + "pendingPublish": "To be Published", + "completed": "Completed", + "notAccepted": "Not accepted", + "resubmit": "Re-submit Required", + "cancelled": "Cancelled", + "withdrawn": "Withdrawn", + "searchApplyRecord": "Search application record", + "applicationId": "Application number", + "submitDate": "submit date", + "myRemarks": "My notes", + "status": "status", + "viewDetail": "View details", + "Dashboard": "Dashboard", "event": "Event" } \ No newline at end of file diff --git a/src/translations/zh-CN.json b/src/translations/zh-CN.json index d2739f2..fc30631 100644 --- a/src/translations/zh-CN.json +++ b/src/translations/zh-CN.json @@ -24,6 +24,7 @@ "onlinePaymentHistory": "网上付款记录", "setting": "设置", "companyOrUserRecord": "公司/机构用户记录", + "welcomeMsg": "午安! 请选择所需服务。", "login": "登录", "iAmSmartLogin": "智方便登录", @@ -181,6 +182,24 @@ "lammaIslandCombo": "南丫岛区", "pengChauCombo": "坪洲区", + "applyPublicNotice": "申請公共啟事", + "attention": "注意", + "all": "全部", + "processing": "處理中", + "pendingPayment": "待付款", + "pendingPublish": "待發佈", + "completed": "已完成", + "notAccepted": "不接受", + "resubmit": "需重新提交", + "cancelled": "已取消", + "withdrawn": "已撤銷", + "searchApplyRecord": "搜尋申請記錄", + "applicationId": "申請編號", + "submitDate": "提交日期", + "myRemarks": "我的備註", + "status": "狀態", + "viewDetail": "查看詳細", + "Dashboard": "仪表板", "event": "活动" } \ No newline at end of file diff --git a/src/translations/zh-HK.json b/src/translations/zh-HK.json index 4f85b13..60437f0 100644 --- a/src/translations/zh-HK.json +++ b/src/translations/zh-HK.json @@ -24,6 +24,7 @@ "onlinePaymentHistory": "網上付款記錄", "setting": "設定", "companyOrUserRecord": "公司/機構用戶記錄", + "welcomeMsg": "午安! 請選擇所需服務。", "login": "登入", "iAmSmartLogin": "智方便登入", @@ -181,6 +182,24 @@ "lammaIslandCombo": "南丫島區", "pengChauCombo": "坪洲區", + "applyPublicNotice": "申請公共啟事", + "attention": "注意", + "all": "全部", + "processing": "處理中", + "pendingPayment": "待付款", + "pendingPublish": "待發佈", + "completed": "已完成", + "notAccepted": "不接受", + "resubmit": "需重新提交", + "cancelled": "已取消", + "withdrawn": "已撤銷", + "searchApplyRecord": "搜尋申請記錄", + "applicationId": "申請編號", + "submitDate": "提交日期", + "myRemarks": "我的備註", + "status": "狀態", + "viewDetail": "查看詳細", + "Dashboard": "儀表板", "event": "活動" } \ No newline at end of file diff --git a/src/utils/ComboData.js b/src/utils/ComboData.js index c7ffa59..52c4adb 100644 --- a/src/utils/ComboData.js +++ b/src/utils/ComboData.js @@ -24,27 +24,27 @@ export const country = (intl) => { export const accountFilter = [{ id: 1, key: 1, label: 'Active', type: 'active' }, { id: 2, key: 2, label: 'Locked', type: 'locked' }, { id: 3, key: 3, label: 'Not verified', type: 'notVerified' }]; export const publicNoticeStatic = [ - { key: 0, labelCht: '全部', label: 'All', type: 'all' }, - { key: 1, labelCht: '處理中', label: 'Processing', type: 'processing' }, // submitted and reviewed - { key: 2, labelCht: '待付款', label: 'Pending Payment', type: 'confirmed' }, - { key: 3, labelCht: '待發布', label: 'To be published', type: 'paid' }, - { key: 4, labelCht: '已完成', label: 'Completed', type: 'completed' }, - { key: 5, labelCht: '不接受', label: 'Not accepted', type: 'notAccepted' }, - { key: 6, labelCht: '需重新提交', label: 'Re-submit Required', type: 'resubmit' }, - { key: 7, labelCht: '已取消', label: 'Cancelled', type: 'cancelled' }, - { key: 8, labelCht: '已撤銷', label: 'Withdrawn', type: 'withdrawn' }, + { key: 0, label: 'all', type: 'all' }, + { key: 1, label: 'processing', type: 'processing' }, // submitted and reviewed + { key: 2, label: 'pendingPayment', type: 'confirmed' }, + { key: 3, label: 'pendingPublish', type: 'paid' }, + { key: 4, label: 'completed', type: 'completed' }, + { key: 5, label: 'notAccepted', type: 'notAccepted' }, + { key: 6, label: 'resubmit', type: 'resubmit' }, + { key: 7, label: 'cancelled', type: 'cancelled' }, + { key: 8, label: 'withdrawn', type: 'withdrawn' }, ]; export const publicNoticeStatic_Creditor = [ - { key: 0, labelCht: '全部', label: 'All', type: 'all' }, - { key: 1, labelCht: '處理中', label: 'Processing', type: 'processing' }, // submitted and reviewed - { key: 2, labelCht: '待發布', label: 'To be published', type: 'confirmed' }, - { key: 3, labelCht: '待付款', label: 'Pending Payment', type: 'published' }, - { key: 4, labelCht: '已完成', label: 'Completed', type: 'completed' }, - { key: 5, labelCht: '不接受', label: 'Not accepted', type: 'notAccepted' }, - { key: 6, labelCht: '需重新提交', label: 'Re-submit Required', type: 'resubmit' }, - { key: 7, labelCht: '已取消', label: 'Cancelled', type: 'cancelled' }, - { key: 8, labelCht: '已撤銷', label: 'Withdrawn', type: 'withdrawn' }, + { key: 0, label: 'all', type: 'all' }, + { key: 1, label: 'processing', type: 'processing' }, // submitted and reviewed + { key: 2, label: 'pendingPublish', type: 'confirmed' }, + { key: 3, label: 'pendingPayment', type: 'published' }, + { key: 4, label: 'completed', type: 'completed' }, + { key: 5, label: 'notAccepted', type: 'notAccepted' }, + { key: 6, label: 'resubmit', type: 'resubmit' }, + { key: 7, label: 'cancelled', type: 'cancelled' }, + { key: 8, label: 'withdrawn', type: 'withdrawn' }, ]; diff --git a/src/utils/statusUtils/Base.js b/src/utils/statusUtils/Base.js index 60d03cb..4ed3754 100644 --- a/src/utils/statusUtils/Base.js +++ b/src/utils/statusUtils/Base.js @@ -2,6 +2,10 @@ import { Typography } from "@mui/material" export function getStatusTag({ color = "#000", textColor = "#FFF", text = "" }) { return ( -
{text}
+
+ + {text} + +
) } \ No newline at end of file diff --git a/src/utils/statusUtils/PublicNoteStatusUtils.js b/src/utils/statusUtils/PublicNoteStatusUtils.js index 4c6c592..64cdc31 100644 --- a/src/utils/statusUtils/PublicNoteStatusUtils.js +++ b/src/utils/statusUtils/PublicNoteStatusUtils.js @@ -14,13 +14,13 @@ export function getStatusByText(status, creditor) { return getStatusTag({ color: "#f5a83d", text: "處理中" }) case "confirmed": if (creditor) - return getStatusTag({ color: "#22a13f", text: "待發布" }) + return getStatusTag({ color: "#22a13f", text: "待發佈" }) else return getStatusTag({ color: "#22a13f", text: "待付款" }) case "published": return getStatusTag({ color: "#22a13f", text: "待付款" }) case "paid": - return getStatusTag({ color: "#22a13f", text: "待發布" }) + return getStatusTag({ color: "#22a13f", text: "待發佈" }) case "complated": return getStatusTag({ color: "#8a8784", text: "已完成" }) case "notAccepted": @@ -68,3 +68,37 @@ export function getStatusByTextEng(status, creditor) { return getStatusTag({ text: status }) } } + +export function getStatusIntl(params, intl) { + return getStatusByTextIntl(params.row.status, params.row.creditor, intl); +} + +export function getStatusByTextIntl(status, creditor, intl) { + switch (status) { + case "submitted": + return getStatusTag({ color: "#f5a83d", text: intl.formatMessage({id: 'processing'}) }) + case "reviewed": + return getStatusTag({ color: "#f5a83d", text: intl.formatMessage({id: 'processing'}) }) + case "confirmed": + if (creditor) + return getStatusTag({ color: "#22a13f", text: intl.formatMessage({id: 'pendingPublish'}) }) + else + return getStatusTag({ color: "#22a13f", text: intl.formatMessage({id: 'pendingPayment'}) }) + case "published": + return getStatusTag({ color: "#22a13f", text: intl.formatMessage({id: 'pendingPayment'}) }) + case "paid": + return getStatusTag({ color: "#22a13f", text: intl.formatMessage({id: 'pendingPublish'}) }) + case "complated": + return getStatusTag({ color: "#8a8784", text: intl.formatMessage({id: 'completed'}) }) + case "notAccepted": + return getStatusTag({ color: "#d9372b", text: intl.formatMessage({id: 'notAccepted'}) }) + case "resubmit": + return getStatusTag({ color: "#757373", text: intl.formatMessage({id: 'resubmit'}) }) + case "cancelled": + return getStatusTag({ color: "#909497", text: intl.formatMessage({id: 'cancelled'}) }) + case "withdrawn": + return getStatusTag({ color: "#909497", text: intl.formatMessage({id: 'withdrawn'}) }) + default: + return getStatusTag({ text: status }) + } +} From 25b748eba934e14acc7a3df666e180c63d6dff9a Mon Sep 17 00:00:00 2001 From: "jason.lam" Date: Fri, 12 Jan 2024 15:45:17 +0800 Subject: [PATCH 08/10] update locale --- .../DemandNote/Search_Public/DataGrid.js | 6 ++- .../DemandNote/Search_Public/SearchForm.js | 8 ++-- src/pages/Payment/Card/index.js | 5 ++- src/pages/Payment/Details_Public/DataGrid.js | 6 ++- .../Payment/Details_Public/PaymentDetails.js | 11 +++--- src/pages/Payment/Details_Public/index.js | 5 ++- src/pages/Payment/FPS/FPS.js | 7 +++- src/pages/Payment/FPS/FPSTest.js | 5 ++- src/pages/Payment/MultiPaymentWindow.js | 7 ++-- src/pages/Payment/Search_Public/DataGrid.js | 10 +++-- src/pages/Payment/Search_Public/SearchForm.js | 12 +++--- src/pages/Payment/index.js | 4 +- src/pages/Proof/Payment/Pay.js | 4 +- .../Proof/Reply_Public/ApplicationDetails.js | 13 +++++-- src/pages/Proof/Search_Public/DataGrid.js | 4 +- src/pages/Proof/Search_Public/SearchForm.js | 8 ++-- .../ApplyForm/PublicNoticeApplyForm.js | 4 +- .../Details_Public/ApplicationDetailCard.js | 12 ++++-- .../tabTableDetail/PaymentTab.js | 8 ++-- .../Details_Public/tabTableDetail/ProofTab.js | 5 ++- src/pages/PublicNotice/ListPanel/BaseGrid.js | 18 +++++---- .../ListPanel/PendingPaymentTab.js | 36 ++++++++++++------ .../ListPanel/SearchPublicNoticeForm.js | 10 ++--- .../ListPanel/SearchPublicNoticeTable.js | 18 ++++++--- src/pages/User/ManagePage_OrgPublic/index.js | 5 ++- src/translations/en.json | 25 +++++++++++-- src/translations/zh-CN.json | 37 ++++++++++++++----- src/translations/zh-HK.json | 19 ++++++++++ 28 files changed, 217 insertions(+), 95 deletions(-) diff --git a/src/pages/DemandNote/Search_Public/DataGrid.js b/src/pages/DemandNote/Search_Public/DataGrid.js index 76dd4f5..3b4d47a 100644 --- a/src/pages/DemandNote/Search_Public/DataGrid.js +++ b/src/pages/DemandNote/Search_Public/DataGrid.js @@ -9,10 +9,12 @@ import * as StatusUtils from "utils/statusUtils/DnStatus"; import { FiDataGrid } from "components/FiDataGrid"; import * as HttpUtils from "utils/HttpUtils"; +import {useIntl} from "react-intl"; // ==============================|| EVENT TABLE ||============================== // export default function SearchDemandNote({ recordList }) { const [rows, setRows] = React.useState(recordList); + const intl = useIntl(); React.useEffect(() => { setRows(recordList); @@ -34,7 +36,7 @@ export default function SearchDemandNote({ recordList }) { }, { field: 'appNo', - headerName: '申請編號', + headerName: intl.formatMessage({id: 'applicationId'}), width: 150, }, { @@ -48,7 +50,7 @@ export default function SearchDemandNote({ recordList }) { }, { field: 'status', - headerName: '狀態', + headerName: intl.formatMessage({id: 'status'}), width: 175, renderCell: (params) => { return [StatusUtils.getStatus_Cht(params)] diff --git a/src/pages/DemandNote/Search_Public/SearchForm.js b/src/pages/DemandNote/Search_Public/SearchForm.js index 8bb018d..fa5a2a3 100644 --- a/src/pages/DemandNote/Search_Public/SearchForm.js +++ b/src/pages/DemandNote/Search_Public/SearchForm.js @@ -12,13 +12,13 @@ import * as React from "react"; import * as ComboData from "utils/ComboData"; import * as DateUtils from "utils/DateUtils"; import * as FormatUtils from "utils/FormatUtils"; -import {FormattedMessage} from "react-intl"; +import {FormattedMessage, useIntl} from "react-intl"; // ==============================|| DASHBOARD - DEFAULT ||============================== // const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData }) => { - + const intl = useIntl(); const [type, setType] = React.useState([]); const [issueSelected, setIssueSelected] = React.useState({}); const [issueCombo, setIssueCombo] = React.useState([]); @@ -118,7 +118,7 @@ const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData fullWidth {...register("appNo")} id='appNo' - label={"申請編號"} + label={intl.formatMessage({id: 'applicationId'})} defaultValue={searchCriteria.appNo} InputLabelProps={{ shrink: true @@ -192,7 +192,7 @@ const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData renderInput={(params) => ( )} InputLabelProps={{ diff --git a/src/pages/Payment/Card/index.js b/src/pages/Payment/Card/index.js index ce0cca5..d40a987 100644 --- a/src/pages/Payment/Card/index.js +++ b/src/pages/Payment/Card/index.js @@ -22,6 +22,7 @@ import Loadable from 'components/Loadable'; const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' +import {FormattedMessage} from "react-intl"; const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, width: '100%', @@ -160,7 +161,9 @@ const Index = () => { cancelPayment(); }} sx={{ m: 4 }} - >取消付款 + > + + diff --git a/src/pages/Payment/Details_Public/DataGrid.js b/src/pages/Payment/Details_Public/DataGrid.js index 15ec6c3..09f5930 100644 --- a/src/pages/Payment/Details_Public/DataGrid.js +++ b/src/pages/Payment/Details_Public/DataGrid.js @@ -10,6 +10,7 @@ import * as FormatUtils from "utils/FormatUtils" import { FiDataGrid } from "components/FiDataGrid"; import * as DateUtils from "utils/DateUtils" import {useTheme} from "@emotion/react"; +import {FormattedMessage} from "react-intl"; // import * as Utils from "utils/Utils" // ==============================|| EVENT TABLE ||============================== // @@ -18,6 +19,7 @@ export default function SearchPublicNoticeTable({ recordList }) { const [total, setTotal] = React.useState(0); const theme = useTheme(); const isMdOrLg = useMediaQuery(theme.breakpoints.up('md')); + //const intl = useIntl(); React.useEffect(() => { const indexedData = recordList.map((obj, index) => ({ index_number: index + 1, ...obj })); @@ -51,7 +53,7 @@ export default function SearchPublicNoticeTable({ recordList }) { // console.log(params) return
憲報第6號副刊公告
{isORGLoggedIn()?<>Care Of: {params.row.careOf}
:null} - 申請編號: {appNo}
+ : {appNo}
憲報日期: {DateUtils.dateStr_Cht(params.row.issueDate)}
長度: {params.row.length+ " cm"}
}, @@ -81,7 +83,7 @@ export default function SearchPublicNoticeTable({ recordList }) { }} /> - 付款總額: + : (HK$) {FormatUtils.currencyFormat(total)} diff --git a/src/pages/Payment/Details_Public/PaymentDetails.js b/src/pages/Payment/Details_Public/PaymentDetails.js index c24c444..748f75b 100644 --- a/src/pages/Payment/Details_Public/PaymentDetails.js +++ b/src/pages/Payment/Details_Public/PaymentDetails.js @@ -13,6 +13,7 @@ import Loadable from 'components/Loadable'; const MainCard = Loadable(React.lazy(() => import('components/MainCard'))); const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); import DownloadIcon from '@mui/icons-material/Download'; +import {FormattedMessage} from "react-intl"; // ==============================|| DASHBOARD - DEFAULT ||============================== // const PaymentDetails = ({ formData,doPrint }) => { @@ -48,7 +49,7 @@ const PaymentDetails = ({ formData,doPrint }) => { content={false} > - 付款詳情 +
@@ -58,7 +59,7 @@ const PaymentDetails = ({ formData,doPrint }) => { - 狀態: + : @@ -128,7 +129,7 @@ const PaymentDetails = ({ formData,doPrint }) => { - 付款總額: + : @@ -142,7 +143,7 @@ const PaymentDetails = ({ formData,doPrint }) => { - 付款方式: + : @@ -156,7 +157,7 @@ const PaymentDetails = ({ formData,doPrint }) => { - 付款收據: + : diff --git a/src/pages/Payment/Details_Public/index.js b/src/pages/Payment/Details_Public/index.js index e667fa3..d851721 100644 --- a/src/pages/Payment/Details_Public/index.js +++ b/src/pages/Payment/Details_Public/index.js @@ -18,6 +18,7 @@ const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/Loa const PaymentDetails = Loadable(React.lazy(() => import('./PaymentDetails'))); const DataGrid = Loadable(React.lazy(() => import('./DataGrid'))); import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' +import {FormattedMessage} from "react-intl"; const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, width: '100%', @@ -92,7 +93,9 @@ const Index = () => {
- 付款詳情 + + +
diff --git a/src/pages/Payment/FPS/FPS.js b/src/pages/Payment/FPS/FPS.js index 6ff13bd..e7428d9 100644 --- a/src/pages/Payment/FPS/FPS.js +++ b/src/pages/Payment/FPS/FPS.js @@ -18,6 +18,7 @@ import Loadable from 'components/Loadable'; const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' +import {FormattedMessage} from "react-intl"; const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, width: '100%', @@ -266,7 +267,7 @@ const Index = () => { FPS
- 付款總額 +
{"HK$ " + currencyFormat(paymentData.amount)}
@@ -318,7 +319,9 @@ const Index = () => { cancelPayment(); }} sx={{ m: 4 }} - >取消付款 + > + +
diff --git a/src/pages/Payment/FPS/FPSTest.js b/src/pages/Payment/FPS/FPSTest.js index 5487379..ee921d0 100644 --- a/src/pages/Payment/FPS/FPSTest.js +++ b/src/pages/Payment/FPS/FPSTest.js @@ -17,6 +17,7 @@ import Loadable from 'components/Loadable'; const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' +import {FormattedMessage} from "react-intl"; const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, width: '100%', @@ -324,7 +325,9 @@ const Index = () => { cancelPayment(); }} sx={{ m: 4 }} - >取消付款 + > + +
diff --git a/src/pages/Payment/MultiPaymentWindow.js b/src/pages/Payment/MultiPaymentWindow.js index 77e3131..6ce558f 100644 --- a/src/pages/Payment/MultiPaymentWindow.js +++ b/src/pages/Payment/MultiPaymentWindow.js @@ -30,10 +30,11 @@ import JcbIcon from "assets/images/icons/jcb.svg"; import UnionPayIcon from "assets/images/icons/unionpay.svg"; import PpsIcon from "assets/images/icons/ppshk.svg"; import FpsIcon from "assets/images/icons/fps.svg"; +import {FormattedMessage, useIntl} from "react-intl"; const MultiPaymentWindow = (props) => { - - const windowTitle = "請選擇付款方式"; + const intl = useIntl(); + const windowTitle = intl.formatMessage({id: 'selectPaymentMethod'}); // const [content, setContent] = useState(); const [loadtTransactionData, setLoadtTransactionData] = useState({}); const [loadAvailableMethodData, setLoadAvailableMethodData] = useState([]); @@ -225,7 +226,7 @@ const MultiPaymentWindow = (props) => { - 付款總額(HK$):  + (HK$):  diff --git a/src/pages/Payment/Search_Public/DataGrid.js b/src/pages/Payment/Search_Public/DataGrid.js index c00eedd..61ef146 100644 --- a/src/pages/Payment/Search_Public/DataGrid.js +++ b/src/pages/Payment/Search_Public/DataGrid.js @@ -9,6 +9,7 @@ import * as PaymentStatus from "utils/statusUtils/PaymentStatus" import { useNavigate } from "react-router-dom"; import { FiDataGrid } from "components/FiDataGrid"; import {useTheme} from "@emotion/react"; +import {useIntl} from "react-intl"; // ==============================|| EVENT TABLE ||============================== // export default function SearchPublicNoticeTable({ recordList }) { @@ -16,6 +17,7 @@ export default function SearchPublicNoticeTable({ recordList }) { const navigate = useNavigate() const theme = useTheme(); const isMdOrLg = useMediaQuery(theme.breakpoints.up('md')); + const intl = useIntl(); const _sx = { padding: "4 2 4 2", @@ -44,7 +46,7 @@ export default function SearchPublicNoticeTable({ recordList }) { const columns = [ { field: 'actions', - headerName: '付款編號', + headerName: intl.formatMessage({id: 'payId'}), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, cellClassName: 'actions', @@ -55,7 +57,7 @@ export default function SearchPublicNoticeTable({ recordList }) { { id: 'appNos', field: 'appNos', - headerName: '申請編號', + headerName: intl.formatMessage({id: 'applicationId'}), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, renderCell: (params) => { @@ -66,7 +68,7 @@ export default function SearchPublicNoticeTable({ recordList }) { { id: 'transDateTime', field: 'transDateTime', - headerName: '付款日期', + headerName: intl.formatMessage({id: 'payDate'}), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, valueGetter: (params) => { @@ -75,7 +77,7 @@ export default function SearchPublicNoticeTable({ recordList }) { }, { field: 'action', - headerName: '付款狀況', + headerName: intl.formatMessage({id: 'payStatus'}), width: 150, renderCell: (params) => { return PaymentStatus.getStatus_Cht(params); diff --git a/src/pages/Payment/Search_Public/SearchForm.js b/src/pages/Payment/Search_Public/SearchForm.js index 75dcb15..076fde9 100644 --- a/src/pages/Payment/Search_Public/SearchForm.js +++ b/src/pages/Payment/Search_Public/SearchForm.js @@ -13,12 +13,12 @@ import * as DateUtils from "utils/DateUtils"; import * as ComboData from "utils/ComboData"; import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; import {ThemeProvider} from "@emotion/react"; -import {FormattedMessage} from "react-intl"; +import {FormattedMessage, useIntl} from "react-intl"; // ==============================|| DASHBOARD - DEFAULT ||============================== // const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { - + const intl = useIntl(); const [minDate, setMinDate] = React.useState(searchCriteria.dateFrom); const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo); const [status, setStatus] = React.useState(ComboData.paymentStatus[0]); @@ -80,7 +80,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { fullWidth {...register("code")} id='code' - label="申請編號:" + label={intl.formatMessage({id: 'applicationId'}) + ":"} defaultValue={searchCriteria.code} InputLabelProps={{ shrink: true @@ -96,7 +96,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { {...register("dateFrom")} id="dateFrom" type="date" - label="付款日期(從)" + label={intl.formatMessage({id: 'payDateFrom'})} defaultValue={searchCriteria.dateFrom} InputProps={{ inputProps: { max: maxDate } }} onChange={(newValue) => { @@ -137,7 +137,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { fullWidth {...register("tarnsNo")} id='tarnsNo' - label="付款編號:" + label={intl.formatMessage({id: 'payId'})+":"} defaultValue={searchCriteria.tarnsNo} InputLabelProps={{ shrink: true @@ -163,7 +163,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { }} renderInput={(params) => ( )} InputLabelProps={{ diff --git a/src/pages/Payment/index.js b/src/pages/Payment/index.js index fbf037d..cf59fd1 100644 --- a/src/pages/Payment/index.js +++ b/src/pages/Payment/index.js @@ -31,6 +31,7 @@ import { import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' import {ThemeProvider} from "@emotion/react"; import {PNSPS_BUTTON_THEME} from "../../themes/buttonConst"; +import {FormattedMessage} from "react-intl"; const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, width: '100%', @@ -418,7 +419,8 @@ const Index = () => { // color="error" onClick={() => paymentClick()} sx={{ mt: 4 }} - >付款 + > + ; + return ; }, } ]; diff --git a/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js b/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js index 4608213..9c42fb9 100644 --- a/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js +++ b/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js @@ -21,6 +21,7 @@ import { } from "utils/Utils"; import {ThemeProvider, useTheme} from "@emotion/react"; import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; +import {FormattedMessage, useIntl} from "react-intl"; // ==============================|| EVENT TABLE ||============================== // export default function SubmittedTab({ rows }) { @@ -35,6 +36,7 @@ export default function SubmittedTab({ rows }) { const [expiryDateErr, setExpiryDateErr] = React.useState(false); const theme = useTheme(); const isMdOrLg = useMediaQuery(theme.breakpoints.up('md')); + const intl = useIntl(); //const [amount, setAmount] = React.useState(0); const navigate = useNavigate() @@ -115,14 +117,14 @@ export default function SubmittedTab({ rows }) { { id: 'appNo', field: 'appNo', - headerName: '申請編號', + headerName: intl.formatMessage({id: 'applicationId'}), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, }, { id: 'created', field: 'created', - headerName: '提交日期', + headerName: intl.formatMessage({id: 'submitDate'}), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, valueGetter: (params) => { @@ -158,14 +160,15 @@ export default function SubmittedTab({ rows }) { { id: 'remarks', field: 'remarks', - headerName: isORGLoggedIn() ? "Care Of / 我的備註" : "我的備註", + headerName: isORGLoggedIn() ? "Care Of / 我的備註" : intl.formatMessage({id: 'myRemarks'}), width: isMdOrLg ? 'auto' : 400, flex: isMdOrLg ? 3 : undefined, renderCell: (params) => ( isORGLoggedIn() ?
Care Of: {params.row.careOf} - 我的備註: {params.row.remarks} + + : {params.row.remarks}
:
{params.row.remarks} @@ -175,7 +178,7 @@ export default function SubmittedTab({ rows }) { { id: 'fee', field: 'fee', - headerName: '價錢', + headerName: intl.formatMessage({id: 'price'}), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, renderCell: (params) => { @@ -185,21 +188,23 @@ export default function SubmittedTab({ rows }) { { id: 'status', field: 'status', - headerName: '狀態', + headerName: intl.formatMessage({id: 'status'}), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, renderCell: (params) => { - return [StatusUtils.getStatus(params)] + return [StatusUtils.getStatusIntl(params,intl)] }, }, { field: 'actions', type: 'actions', headerName: '', - width: 120, + width: 150, cellClassName: 'actions', renderCell: (params) => { - return ; + return ; }, } ]; @@ -212,7 +217,12 @@ export default function SubmittedTab({ rows }) { ); for (var i = 0; i < datas?.length; i++) { content.push(<> - 申請編號: {datas[i].appNo}({DateUtils.datetimeStr(datas[i].created)}) + + + : {datas[i].appNo} + + ({DateUtils.datetimeStr(datas[i].created)}) + 備註: {datas[i].remarks}

); @@ -315,7 +325,7 @@ export default function SubmittedTab({ rows }) { onClick={() => { handlePaymentBtn() }} sx={{mt:2, ml:1}} > - 付款 +
@@ -333,7 +343,9 @@ export default function SubmittedTab({ rows }) { }} > - 確認付款 + + + diff --git a/src/pages/PublicNotice/ListPanel/SearchPublicNoticeForm.js b/src/pages/PublicNotice/ListPanel/SearchPublicNoticeForm.js index eaa272c..0408720 100644 --- a/src/pages/PublicNotice/ListPanel/SearchPublicNoticeForm.js +++ b/src/pages/PublicNotice/ListPanel/SearchPublicNoticeForm.js @@ -75,7 +75,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { fullWidth {...register("appNo")} id='appNo' - label="申請編號" + label={intl.formatMessage({id: 'applicationId'})} defaultValue={searchCriteria.appNo} InputLabelProps={{ shrink: true @@ -89,7 +89,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { {...register("dateFrom")} id="dateFrom" type="date" - label="提交日期(從)" + label={intl.formatMessage({id: 'submitDateFrom'})} defaultValue={searchCriteria.dateFrom} InputProps={{ inputProps: { max: maxDate } }} onChange={(newValue) => { @@ -110,7 +110,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { {...register("dateTo")} id="dateTo" type="date" - label="提交日期(到)" + label={intl.formatMessage({id: 'submitDateTo'})} defaultValue={searchCriteria.dateTo} InputProps={{ inputProps: { min: minDate } }} onChange={(newValue) => { @@ -138,7 +138,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { fullWidth {...register("contact")} id="contact" - label="聯絡人" + label={intl.formatMessage({id: 'contactPerson'})} defaultValue={searchCriteria.contact} InputLabelProps={{ shrink: true @@ -182,7 +182,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { }} renderInput={(params) => ( () => { navigate('/publicNotice/'+ params.id); @@ -32,14 +34,14 @@ export default function SearchPublicNoticeTable({ recordList }) { { id: 'appNo', field: 'appNo', - headerName: '申請編號', + headerName: intl.formatMessage({id: 'applicationId'}), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, }, { id: 'created', field: 'created', - headerName: '提交日期', + headerName: intl.formatMessage({id: 'submitDate'}), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, valueGetter: (params) => { @@ -75,14 +77,16 @@ export default function SearchPublicNoticeTable({ recordList }) { { id: 'remarks', field: 'remarks', - headerName: isORGLoggedIn()?"Care Of / 我的備註":"我的備註", + headerName: isORGLoggedIn()?"Care Of / 我的備註": intl.formatMessage({id: 'myRemarks'}), width: isMdOrLg ? 'auto' : 400, flex: isMdOrLg ? 3 : undefined, renderCell: (params) => ( isORGLoggedIn()?
Care Of: {params.row.careOf} - 我的備註: {params.row.remarks} + + : {params.row.remarks} +
:
{params.row.remarks} @@ -92,7 +96,7 @@ export default function SearchPublicNoticeTable({ recordList }) { { id: 'status', field: 'status', - headerName: '狀態', + headerName: intl.formatMessage({id: 'status'}), width: 160, renderCell: (params) => { return [StatusUtils.getStatus(params)] @@ -105,7 +109,9 @@ export default function SearchPublicNoticeTable({ recordList }) { width: 150, cellClassName: 'actions', renderCell: (params) => { - return ; + return ; }, } ]; diff --git a/src/pages/User/ManagePage_OrgPublic/index.js b/src/pages/User/ManagePage_OrgPublic/index.js index 4a6865e..5e505af 100644 --- a/src/pages/User/ManagePage_OrgPublic/index.js +++ b/src/pages/User/ManagePage_OrgPublic/index.js @@ -12,7 +12,7 @@ import * as React from "react"; import * as HttpUtils from "utils/HttpUtils"; import * as UrlUtils from "utils/ApiPathConst"; import * as DateUtils from "utils/DateUtils"; -import {FormattedMessage} from "react-intl"; +import {FormattedMessage, useIntl} from "react-intl"; const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, @@ -30,6 +30,7 @@ const BackgroundHead = { const ManageOrgUserPage = () => { const [rows, setRows] = React.useState([]); + const intl = useIntl(); const _sx = { padding: "4 2 4 2", @@ -164,7 +165,7 @@ const ManageOrgUserPage = () => { { field: 'actions', type: 'actions', - headerName: getHeader('狀態'), + headerName: getHeader(intl.formatMessage({id: 'status'})), flex: 1, cellClassName: 'actions', getActions: (params) => { diff --git a/src/translations/en.json b/src/translations/en.json index d67bf33..d7ed279 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -195,10 +195,29 @@ "withdrawn": "Withdrawn", "searchApplyRecord": "Search application record", "applicationId": "Application number", - "submitDate": "submit date", - "myRemarks": "My notes", - "status": "status", + "submitDate": "Submit date", + "submitDateFrom": "Submit date (from)", + "submitDateTo": "Submit date (to)", + "myRemarks": "Remarks", + "status": "Status", "viewDetail": "View details", + "price": "Price", + "pay": "Pay", + "payDate": "Payment Date", + "payDateFrom": "Payment date (from)", + "payStatus": "Payment Status", + "payId": "Payment Code", + "payConfirm": "Confirm payment", + "payCancel": "Cancel payment", + "payTotal": "Payment total", + "payDetail": "Payment details", + "payMethod": "Payment method", + "selectPaymentMethod": "Please select a payment method", + "payReceipt": "Payment receipt", + "contactPerson": "Contact Person", + "requireContactPerson": "Please enter contact person", + "search": "Search", + "cancel": "Cancel", "Dashboard": "Dashboard", "event": "Event" diff --git a/src/translations/zh-CN.json b/src/translations/zh-CN.json index fc30631..92f299a 100644 --- a/src/translations/zh-CN.json +++ b/src/translations/zh-CN.json @@ -182,23 +182,42 @@ "lammaIslandCombo": "南丫岛区", "pengChauCombo": "坪洲区", - "applyPublicNotice": "申請公共啟事", + "applyPublicNotice": "申请公共启事", "attention": "注意", "all": "全部", - "processing": "處理中", + "processing": "处理中", "pendingPayment": "待付款", - "pendingPublish": "待發佈", + "pendingPublish": "待发布", "completed": "已完成", "notAccepted": "不接受", "resubmit": "需重新提交", "cancelled": "已取消", - "withdrawn": "已撤銷", - "searchApplyRecord": "搜尋申請記錄", - "applicationId": "申請編號", + "withdrawn": "已撤销", + "searchApplyRecord": "搜寻申请记录", + "applicationId": "申请编号", "submitDate": "提交日期", - "myRemarks": "我的備註", - "status": "狀態", - "viewDetail": "查看詳細", + "submitDateFrom": "提交日期(从)", + "submitDateTo": "提交日期(到)", + "myRemarks": "我的备注", + "status": "状态", + "viewDetail": "查看详细", + "price": "价钱", + "pay": "付款", + "payDate": "付款日期", + "payDateFrom": "付款日期(从)", + "payStatus": "付款状况", + "payId": "付款编号", + "payConfirm": "确认付款", + "payCancel": "取消付款", + "payTotal": "付款总额", + "payDetail": "付款详情", + "payMethod": "付款方式", + "selectPaymentMethod": "请选择付款方式", + "payReceipt": "付款收据", + "contactPerson": "联络人", + "requireContactPerson": "请输入联络人", + "search": "搜寻", + "cancel": "取消", "Dashboard": "仪表板", "event": "活动" diff --git a/src/translations/zh-HK.json b/src/translations/zh-HK.json index 60437f0..8720a19 100644 --- a/src/translations/zh-HK.json +++ b/src/translations/zh-HK.json @@ -196,9 +196,28 @@ "searchApplyRecord": "搜尋申請記錄", "applicationId": "申請編號", "submitDate": "提交日期", + "submitDateFrom": "提交日期(從)", + "submitDateTo": "提交日期(到)", "myRemarks": "我的備註", "status": "狀態", "viewDetail": "查看詳細", + "price": "價錢", + "pay": "付款", + "payDate": "付款日期", + "payDateFrom": "付款日期(從)", + "payStatus": "付款狀況", + "payId": "付款編號", + "payConfirm": "確認付款", + "payCancel": "取消付款", + "payTotal": "付款總額", + "payDetail": "付款詳情", + "payMethod": "付款方式", + "selectPaymentMethod": "請選擇付款方式", + "payReceipt": "付款收據", + "contactPerson": "聯絡人", + "requireContactPerson": "請輸入聯絡人", + "search": "搜尋", + "cancel": "取消", "Dashboard": "儀表板", "event": "活動" From c91c3d50c54e9722a770564c27b2bbac37286cae Mon Sep 17 00:00:00 2001 From: "jason.lam" Date: Fri, 12 Jan 2024 16:39:54 +0800 Subject: [PATCH 09/10] update public notice search --- .../DemandNote/Search_Public/SearchForm.js | 4 ++- src/pages/Payment/Details_Public/DataGrid.js | 17 ++++++----- src/pages/Payment/FPS/AckPage.js | 13 +++++++-- src/pages/Payment/FPS/FPS.js | 4 ++- src/pages/Payment/FPS/FPSTest.js | 4 ++- src/pages/Payment/FPS/fpscallback.js | 13 +++++++-- src/pages/Payment/MultiPaymentWindow.js | 12 ++++---- src/pages/Payment/PaymentCallback.js | 13 +++++++-- src/pages/Payment/Search_Public/SearchForm.js | 4 ++- src/pages/Payment/index.js | 11 +++++-- src/pages/Proof/Payment/Pay.js | 15 +++++++--- src/pages/Proof/Payment/Pay_Creditor.js | 2 +- .../Proof/Reply_Public/ApplicationDetails.js | 2 +- src/pages/Proof/Reply_Public/ProofForm.js | 2 +- src/pages/Proof/Search_Public/SearchForm.js | 4 ++- .../ApplyForm/PublicNoticeApplyForm.js | 2 +- .../Details_Public/ApplicationDetailCard.js | 29 +++++++++++++------ .../Details_Public/StatusChangeDialog.js | 5 ++-- .../ListPanel/PendingPaymentTab.js | 28 +++++++++++++----- .../ListPanel/SearchPublicNoticeForm.js | 6 ++-- .../ListPanel/SearchPublicNoticeTable.js | 4 +-- .../auth-forms/PasswordAlertDialog.js | 3 +- src/translations/en.json | 21 ++++++++++++++ src/translations/zh-CN.json | 21 ++++++++++++++ src/translations/zh-HK.json | 21 ++++++++++++++ 25 files changed, 199 insertions(+), 61 deletions(-) diff --git a/src/pages/DemandNote/Search_Public/SearchForm.js b/src/pages/DemandNote/Search_Public/SearchForm.js index fa5a2a3..843bf2e 100644 --- a/src/pages/DemandNote/Search_Public/SearchForm.js +++ b/src/pages/DemandNote/Search_Public/SearchForm.js @@ -81,7 +81,9 @@ const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData - 搜尋 + + + diff --git a/src/pages/Payment/Details_Public/DataGrid.js b/src/pages/Payment/Details_Public/DataGrid.js index 09f5930..86216ee 100644 --- a/src/pages/Payment/Details_Public/DataGrid.js +++ b/src/pages/Payment/Details_Public/DataGrid.js @@ -10,7 +10,7 @@ import * as FormatUtils from "utils/FormatUtils" import { FiDataGrid } from "components/FiDataGrid"; import * as DateUtils from "utils/DateUtils" import {useTheme} from "@emotion/react"; -import {FormattedMessage} from "react-intl"; +import {FormattedMessage, useIntl} from "react-intl"; // import * as Utils from "utils/Utils" // ==============================|| EVENT TABLE ||============================== // @@ -19,6 +19,8 @@ export default function SearchPublicNoticeTable({ recordList }) { const [total, setTotal] = React.useState(0); const theme = useTheme(); const isMdOrLg = useMediaQuery(theme.breakpoints.up('md')); + const intl = useIntl(); + const { locale } = intl; //const intl = useIntl(); React.useEffect(() => { @@ -45,24 +47,25 @@ export default function SearchPublicNoticeTable({ recordList }) { { id: 'appNo', field: 'appNo', - headerName:'項目', + headerName: intl.formatMessage({id: 'terms'}), width: isMdOrLg ? 'auto' : 300, flex: isMdOrLg ? 1 : undefined, renderCell: (params) => { let appNo = params.row.appNo; // console.log(params) - return
憲報第6號副刊公告
+ return
+
{isORGLoggedIn()?<>Care Of: {params.row.careOf}
:null} : {appNo}
- 憲報日期: {DateUtils.dateStr_Cht(params.row.issueDate)}
- 長度: {params.row.length+ " cm"}
+ : {locale === 'en' ? DateUtils.dateStr(params.row.issueDate) : DateUtils.dateStr_Cht(params.row.issueDate)}
+ : {params.row.length+ " cm"}
}, }, { id: 'fee', field: 'fee', - headerName: '金額 (HK$)', - width: 150, + headerName: intl.formatMessage({id: 'currencyPrice'}) + ' (HK$)', + width: 200, valueGetter: (params) => { return (params?.value) ? "$ " + FormatUtils.currencyFormat(params?.value) : ""; } diff --git a/src/pages/Payment/FPS/AckPage.js b/src/pages/Payment/FPS/AckPage.js index e8a0539..ba0b67c 100644 --- a/src/pages/Payment/FPS/AckPage.js +++ b/src/pages/Payment/FPS/AckPage.js @@ -23,6 +23,7 @@ const PaymentDetails = Loadable(React.lazy(() => import('../Details_Public/Payme const DataGrid = Loadable(React.lazy(() => import('../Details_Public/DataGrid'))); import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' +import {FormattedMessage} from "react-intl"; const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, width: '100%', @@ -159,7 +160,9 @@ const AckPage = () => {
- 公共啟事:付款成功 + + +
@@ -204,7 +207,9 @@ const AckPage = () => {
- 公共啟事:付款取消 + + +
@@ -246,7 +251,9 @@ const AckPage = () => {
- 公共啟事:付款失敗 + + +
diff --git a/src/pages/Payment/FPS/FPS.js b/src/pages/Payment/FPS/FPS.js index e7428d9..6835a46 100644 --- a/src/pages/Payment/FPS/FPS.js +++ b/src/pages/Payment/FPS/FPS.js @@ -254,7 +254,9 @@ const Index = () => {
- 公共啟事:FPS付款 + + +
diff --git a/src/pages/Payment/FPS/FPSTest.js b/src/pages/Payment/FPS/FPSTest.js index ee921d0..c0866a4 100644 --- a/src/pages/Payment/FPS/FPSTest.js +++ b/src/pages/Payment/FPS/FPSTest.js @@ -269,7 +269,9 @@ const Index = () => {
- 公共啟事:FPS付款 + + +
diff --git a/src/pages/Payment/FPS/fpscallback.js b/src/pages/Payment/FPS/fpscallback.js index 4c56035..d8e407c 100644 --- a/src/pages/Payment/FPS/fpscallback.js +++ b/src/pages/Payment/FPS/fpscallback.js @@ -23,6 +23,7 @@ const PaymentDetails = Loadable(React.lazy(() => import('../Details_Public/Payme const DataGrid = Loadable(React.lazy(() => import('../Details_Public/DataGrid'))); import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' +import {FormattedMessage} from "react-intl"; const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, width: '100%', @@ -146,7 +147,9 @@ const Fpscallback = () => {
- 公共啟事:付款成功 + + +
@@ -198,7 +201,9 @@ const Fpscallback = () => {
- 公共啟事:付款取消 + + +
@@ -235,7 +240,9 @@ const Fpscallback = () => {
- 公共啟事:付款失敗 + + +
diff --git a/src/pages/Payment/MultiPaymentWindow.js b/src/pages/Payment/MultiPaymentWindow.js index 6ce558f..0c82d31 100644 --- a/src/pages/Payment/MultiPaymentWindow.js +++ b/src/pages/Payment/MultiPaymentWindow.js @@ -149,7 +149,7 @@ const MultiPaymentWindow = (props) => {
- 交易參考編號: {transactionData.transactionid} + : {transactionData.transactionid} {/* @@ -163,7 +163,7 @@ const MultiPaymentWindow = (props) => { - 請選擇付款方法: + : @@ -203,7 +203,7 @@ const MultiPaymentWindow = (props) => { - 已選擇付款方法:  + @@ -217,7 +217,7 @@ const MultiPaymentWindow = (props) => { : - 付款功能現在不可用。 + } @@ -247,12 +247,12 @@ const MultiPaymentWindow = (props) => { diff --git a/src/pages/Payment/PaymentCallback.js b/src/pages/Payment/PaymentCallback.js index 4c5a0e6..987f2cb 100644 --- a/src/pages/Payment/PaymentCallback.js +++ b/src/pages/Payment/PaymentCallback.js @@ -20,6 +20,7 @@ const PaymentDetails = Loadable(React.lazy(() => import('./Details_Public/Paymen const DataGrid = Loadable(React.lazy(() => import('./Details_Public/DataGrid'))); import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' +import {FormattedMessage} from "react-intl"; const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, width: '100%', @@ -162,7 +163,9 @@ const Index = () => {
- 公共啟事:付款成功 + + +
@@ -207,7 +210,9 @@ const Index = () => {
- 公共啟事:付款取消 + + +
@@ -249,7 +254,9 @@ const Index = () => {
- 公共啟事:付款失敗 + + +
diff --git a/src/pages/Payment/Search_Public/SearchForm.js b/src/pages/Payment/Search_Public/SearchForm.js index 076fde9..e44eca3 100644 --- a/src/pages/Payment/Search_Public/SearchForm.js +++ b/src/pages/Payment/Search_Public/SearchForm.js @@ -68,7 +68,9 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { {/*row 1*/} - 搜尋 + + + diff --git a/src/pages/Payment/index.js b/src/pages/Payment/index.js index cf59fd1..0a85dec 100644 --- a/src/pages/Payment/index.js +++ b/src/pages/Payment/index.js @@ -394,7 +394,9 @@ const Index = () => {
- 公共啟事:付款 + + +
@@ -428,7 +430,8 @@ const Index = () => { // color="error" onClick={() => { navigate("/publicNotice") }} sx={{ mt: 4 }} - >取消 + > + @@ -446,7 +449,9 @@ const Index = () => { - +
diff --git a/src/pages/Proof/Payment/Pay.js b/src/pages/Proof/Payment/Pay.js index dd65ee3..7f1d7fe 100644 --- a/src/pages/Proof/Payment/Pay.js +++ b/src/pages/Proof/Payment/Pay.js @@ -96,7 +96,7 @@ const Index = () => {
- 公共啟事:校對完成及付款 + @@ -162,12 +162,19 @@ const Index = () => { - 總額(HK$): {FormatUtils.currencyFormat(fee)} + + (HK$): {FormatUtils.currencyFormat(fee)} + - - + +
diff --git a/src/pages/Proof/Payment/Pay_Creditor.js b/src/pages/Proof/Payment/Pay_Creditor.js index 2447ed4..9596f42 100644 --- a/src/pages/Proof/Payment/Pay_Creditor.js +++ b/src/pages/Proof/Payment/Pay_Creditor.js @@ -79,7 +79,7 @@ const Index = () => {
- 公共啟事:校對完成 + diff --git a/src/pages/Proof/Reply_Public/ApplicationDetails.js b/src/pages/Proof/Reply_Public/ApplicationDetails.js index 4d6bd65..e7783d4 100644 --- a/src/pages/Proof/Reply_Public/ApplicationDetails.js +++ b/src/pages/Proof/Reply_Public/ApplicationDetails.js @@ -66,7 +66,7 @@ const ApplicationDetailCard = ({ formData, }) => { content={false} > - 公共啟事:校對資料 + diff --git a/src/pages/Proof/Reply_Public/ProofForm.js b/src/pages/Proof/Reply_Public/ProofForm.js index c96053d..c998c29 100644 --- a/src/pages/Proof/Reply_Public/ProofForm.js +++ b/src/pages/Proof/Reply_Public/ProofForm.js @@ -143,7 +143,7 @@ const FormPanel = ({ formData }) => { content={false}> - 公共啟事:校對回覆 + diff --git a/src/pages/Proof/Search_Public/SearchForm.js b/src/pages/Proof/Search_Public/SearchForm.js index bad2b20..b5a3338 100644 --- a/src/pages/Proof/Search_Public/SearchForm.js +++ b/src/pages/Proof/Search_Public/SearchForm.js @@ -102,7 +102,9 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria, issueComboData {/*row 1*/} - 搜尋 + + + diff --git a/src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js b/src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js index 0fcb142..5a3e0a7 100644 --- a/src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js +++ b/src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js @@ -246,7 +246,7 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => { } {FieldUtils.getTextArea({ - label: "備註:", + label: intl.formatMessage({id: 'extraMark'}) + ":", valueName: "remarks", form: formik, inputProps: { maxLength: 255 } diff --git a/src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js b/src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js index 711cb73..d533a65 100644 --- a/src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js +++ b/src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js @@ -40,7 +40,7 @@ import DownloadIcon from '@mui/icons-material/Download'; import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; import {ThemeProvider} from "@emotion/react"; import * as React from "react"; -import {FormattedMessage} from "react-intl"; +import {FormattedMessage, useIntl} from "react-intl"; // ==============================|| DASHBOARD - DEFAULT ||============================== // const ApplicationDetailCard = ( { applicationDetailData, @@ -64,6 +64,7 @@ const ApplicationDetailCard = ( // getValues } = useForm(); const navigate = useNavigate(); + const intl = useIntl(); useEffect(() => { //if user data from parent are not null @@ -166,11 +167,10 @@ const ApplicationDetailCard = ( onClick={cancelledClick()} color="edit" disabled={currentApplicationDetailData.status !== "submitted"} - title={"取消"} + title={intl.formatMessage({id: 'cancel'})} startIcon={} > - - 取消 + @@ -564,7 +564,9 @@ const ApplicationDetailCard = ( - 備註: + + : + {currentApplicationDetailData.remarks} @@ -592,12 +594,18 @@ const ApplicationDetailCard = ( - 總額(HK$): {FormatUtils.currencyFormat(fee)} + + (HK$): {FormatUtils.currencyFormat(fee)} + - - + + @@ -613,7 +621,10 @@ const ApplicationDetailCard = ( - + diff --git a/src/pages/PublicNotice/Details_Public/StatusChangeDialog.js b/src/pages/PublicNotice/Details_Public/StatusChangeDialog.js index 743adf5..4c786b6 100644 --- a/src/pages/PublicNotice/Details_Public/StatusChangeDialog.js +++ b/src/pages/PublicNotice/Details_Public/StatusChangeDialog.js @@ -20,6 +20,7 @@ import { useFormik,FormikProvider } from 'formik'; import * as yup from 'yup'; import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; import {ThemeProvider} from "@emotion/react"; +import {FormattedMessage} from "react-intl"; const StatusChangeDialog = (props) => { @@ -83,7 +84,7 @@ const StatusChangeDialog = (props) => { autoFocus color="delete" > - 取消 + @@ -93,7 +94,7 @@ const StatusChangeDialog = (props) => { onClick={acceptedHandle()} autoFocus > - 確定 + diff --git a/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js b/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js index 9c42fb9..ebdc1d8 100644 --- a/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js +++ b/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js @@ -223,14 +223,15 @@ export default function SubmittedTab({ rows }) { ({DateUtils.datetimeStr(datas[i].created)}) - 備註: {datas[i].remarks} + : {datas[i].remarks}

); totalAmount += datas[i].fee; } content.push( - 總額(HK$): {FormatUtils.currencyFormat(totalAmount)}

+ (HK$): {FormatUtils.currencyFormat(totalAmount)} +

); //setAmount(totalAmount); return content; @@ -353,8 +354,13 @@ export default function SubmittedTab({ rows }) { - - + + @@ -371,8 +377,13 @@ export default function SubmittedTab({ rows }) { - - + + @@ -389,7 +400,10 @@ export default function SubmittedTab({ rows }) { - + diff --git a/src/pages/PublicNotice/ListPanel/SearchPublicNoticeForm.js b/src/pages/PublicNotice/ListPanel/SearchPublicNoticeForm.js index 0408720..e0b5508 100644 --- a/src/pages/PublicNotice/ListPanel/SearchPublicNoticeForm.js +++ b/src/pages/PublicNotice/ListPanel/SearchPublicNoticeForm.js @@ -65,7 +65,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { {/*row 1*/} - 搜尋 + {/*row 2*/} @@ -224,7 +224,9 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { variant="contained" type="submit" > - 搜尋 + + +
diff --git a/src/pages/PublicNotice/ListPanel/SearchPublicNoticeTable.js b/src/pages/PublicNotice/ListPanel/SearchPublicNoticeTable.js index 6cb3524..2872274 100644 --- a/src/pages/PublicNotice/ListPanel/SearchPublicNoticeTable.js +++ b/src/pages/PublicNotice/ListPanel/SearchPublicNoticeTable.js @@ -97,9 +97,9 @@ export default function SearchPublicNoticeTable({ recordList }) { id: 'status', field: 'status', headerName: intl.formatMessage({id: 'status'}), - width: 160, + width: 200, renderCell: (params) => { - return [StatusUtils.getStatus(params)] + return [StatusUtils.getStatusIntl(params, intl)] }, }, { diff --git a/src/pages/authentication/auth-forms/PasswordAlertDialog.js b/src/pages/authentication/auth-forms/PasswordAlertDialog.js index 33b83b3..ba25ac5 100644 --- a/src/pages/authentication/auth-forms/PasswordAlertDialog.js +++ b/src/pages/authentication/auth-forms/PasswordAlertDialog.js @@ -16,6 +16,7 @@ import { DialogTitle } from '@mui/material'; import CancelOutlinedIcon from '@mui/icons-material/CancelOutlined'; +import {FormattedMessage} from "react-intl"; const PasswordAlertDialog = (props) => { return ( @@ -54,7 +55,7 @@ const PasswordAlertDialog = (props) => { diff --git a/src/translations/en.json b/src/translations/en.json index d7ed279..087123c 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -6,6 +6,9 @@ "PNSPS": "PNSPS", "HKSARGOV": "HKSAR Government", "Gazette": "Gazette", + "gazetteDate": "GazetteDate", + "gazetteLength": "length", + "gazetteSampleName": "Gazette Supplement No. 6", "registerTitle1": "Become", "registerTitle2": "Gazette Notice", @@ -20,6 +23,15 @@ "mainPage": "Main Page", "myPublicNotice": "My Public Notice", + "publicNoticePayment": "Public Notice: Payment", + "publicNoticePaymentFail": "Public Notice: Payment Failed", + "publicNoticePaymentSuccess": "Public Notice: Payment Success", + "publicNoticePaymentCancel": "Public Notice: Payment Canceled", + "publicNoticePaymentFPSPay": "Public Notice: FPS Payment", + "publicNoticePaymentProofDone": "Public Notice: Proofreading completed", + "publicNoticePaymentProofDoneAndPaid": "Public Notice: Proofreading Completed and Payment", + "publicNoticePaymentProofComment": "Public Notice: Proofreading Reply", + "publicNoticePaymentProofInfo": "Public Notice: Proofreading Information", "proofRecord": "Proof Record", "onlinePaymentHistory": "Online Payment History", "setting": "Setting", @@ -218,6 +230,15 @@ "requireContactPerson": "Please enter contact person", "search": "Search", "cancel": "Cancel", + "extraMark": "Remarks", + "totalAmount": "Total Amount", + "close": "Close", + "confirm": "Confirm", + "terms": "Terms", + "currencyPrice": "Price", + "transactionRefNo": "Transaction Reference Number", + "selectedPaymentMethod": "Selected payment method", + "paymentMethodNotAvailable":"The payment function is currently not available", "Dashboard": "Dashboard", "event": "Event" diff --git a/src/translations/zh-CN.json b/src/translations/zh-CN.json index 92f299a..1bb747f 100644 --- a/src/translations/zh-CN.json +++ b/src/translations/zh-CN.json @@ -6,6 +6,9 @@ "PNSPS": "公共启事提交及缴费系统", "HKSARGOV": "香港特别行政区政府", "Gazette": "宪报", + "gazetteDate": "宪报日期", + "gazetteLength": "长度", + "gazetteSampleName": "宪报第6号副刊公告", "registerTitle1": "立即成为", "registerTitle2": "宪报刊登公告", @@ -20,6 +23,15 @@ "mainPage": "主页", "myPublicNotice": "我的公共启事", + "publicNoticePayment": "公共启事:付款", + "publicNoticePaymentFail": "公共启事:付款失败", + "publicNoticePaymentSuccess": "公共启事:付款成功", + "publicNoticePaymentCancel": "公共启事:付款取消", + "publicNoticePaymentFPSPay": "公共启事:FPS付款", + "publicNoticePaymentProofDone": "公共启事:校对完成", + "publicNoticePaymentProofDoneAndPaid": "公共启事:校对完成及付款", + "publicNoticePaymentProofComment": "公共启事:校对回覆", + "publicNoticePaymentProofInfo": "公共启事:校对资料", "proofRecord": "校对记录", "onlinePaymentHistory": "网上付款记录", "setting": "设置", @@ -218,6 +230,15 @@ "requireContactPerson": "请输入联络人", "search": "搜寻", "cancel": "取消", + "extraMark": "备注", + "totalAmount": "总额", + "close": "关闭", + "confirm": "确认", + "terms": "项目", + "currencyPrice": "金额", + "transactionRefNo": "交易參考編號", + "selectedPaymentMethod": "已選擇付款方法", + "paymentMethodNotAvailable":"付款功能現在不可用", "Dashboard": "仪表板", "event": "活动" diff --git a/src/translations/zh-HK.json b/src/translations/zh-HK.json index 8720a19..8b656b1 100644 --- a/src/translations/zh-HK.json +++ b/src/translations/zh-HK.json @@ -6,6 +6,9 @@ "PNSPS": "公共啟事提交及繳費系統", "HKSARGOV": "香港特別行政區政府", "Gazette": "憲報", + "gazetteDate": "憲報日期", + "gazetteLength": "長度", + "gazetteSampleName": "憲報第6號副刊公告", "registerTitle1": "立即成為", "registerTitle2": "憲報刊登公告", @@ -20,6 +23,15 @@ "mainPage": "主頁", "myPublicNotice": "我的公共啟事", + "publicNoticePayment": "公共啟事:付款", + "publicNoticePaymentFail": "公共啟事:付款失敗", + "publicNoticePaymentSuccess": "公共啟事:付款成功", + "publicNoticePaymentCancel": "公共啟事:付款取消", + "publicNoticePaymentFPSPay": "公共啟事:FPS付款", + "publicNoticePaymentProofDone": "公共啟事:校對完成", + "publicNoticePaymentProofDoneAndPaid": "公共啟事:校對完成及付款", + "publicNoticePaymentProofComment": "公共啟事:校對回覆", + "publicNoticePaymentProofInfo": "公共啟事:校對資料", "proofRecord": "校對記錄", "onlinePaymentHistory": "網上付款記錄", "setting": "設定", @@ -218,6 +230,15 @@ "requireContactPerson": "請輸入聯絡人", "search": "搜尋", "cancel": "取消", + "extraMark": "備註", + "totalAmount": "總額", + "close": "關閉", + "confirm": "確認", + "terms": "項目", + "currencyPrice": "金額", + "transactionRefNo": "交易參考編號", + "selectedPaymentMethod": "已選擇付款方法", + "paymentMethodNotAvailable":"付款功能現在不可用", "Dashboard": "儀表板", "event": "活動" From 899deb36a66d4cd320503e64183d7644cc3aaa94 Mon Sep 17 00:00:00 2001 From: "jason.lam" Date: Fri, 12 Jan 2024 17:53:48 +0800 Subject: [PATCH 10/10] update locale --- src/layout/MainLayout/Header/index.js | 4 ++- .../DemandNote/Search_Public/SearchForm.js | 2 +- src/pages/Payment/Card/index.js | 2 +- .../Payment/Details_Public/PaymentDetails.js | 4 ++- src/pages/Payment/FPS/FPSTest.js | 2 +- src/pages/Payment/Search_Public/DataGrid.js | 2 +- src/pages/Payment/Search_Public/index.js | 5 ++- .../Proof/Reply_Public/ApplicationDetails.js | 21 ++++++++---- src/pages/Proof/Search_Public/DataGrid.js | 8 ++--- src/pages/Proof/Search_Public/SearchForm.js | 6 ++-- .../ApplyForm/PublicNoticeApplyForm.js | 4 ++- .../Details_Public/ApplicationDetailCard.js | 34 +++++++++++++------ .../tabTableDetail/PaymentTab.js | 2 +- .../Details_Public/tabTableDetail/ProofTab.js | 11 +++--- .../Details_Public/tabTableDetail/TabTable.js | 2 +- src/translations/en.json | 17 ++++++++++ src/translations/zh-CN.json | 17 ++++++++++ src/translations/zh-HK.json | 17 ++++++++++ 18 files changed, 121 insertions(+), 39 deletions(-) diff --git a/src/layout/MainLayout/Header/index.js b/src/layout/MainLayout/Header/index.js index f3f776b..a1f27a9 100644 --- a/src/layout/MainLayout/Header/index.js +++ b/src/layout/MainLayout/Header/index.js @@ -154,7 +154,9 @@ function Header(props) { {isCreditorLoggedIn() ? <> - 付款記錄 + + +
    diff --git a/src/pages/DemandNote/Search_Public/SearchForm.js b/src/pages/DemandNote/Search_Public/SearchForm.js index 843bf2e..d9e87cb 100644 --- a/src/pages/DemandNote/Search_Public/SearchForm.js +++ b/src/pages/DemandNote/Search_Public/SearchForm.js @@ -106,7 +106,7 @@ const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData }} renderInput={(params) => ( { {paymentData.type}
    - 支付金額 +
    {"$HK " + paymentData.amount}
    diff --git a/src/pages/Payment/Details_Public/PaymentDetails.js b/src/pages/Payment/Details_Public/PaymentDetails.js index 748f75b..363f456 100644 --- a/src/pages/Payment/Details_Public/PaymentDetails.js +++ b/src/pages/Payment/Details_Public/PaymentDetails.js @@ -163,7 +163,9 @@ const PaymentDetails = ({ formData,doPrint }) => { diff --git a/src/pages/Payment/FPS/FPSTest.js b/src/pages/Payment/FPS/FPSTest.js index c0866a4..531d255 100644 --- a/src/pages/Payment/FPS/FPSTest.js +++ b/src/pages/Payment/FPS/FPSTest.js @@ -284,7 +284,7 @@ const Index = () => { FPS
    - 支付金額 +
    {"$HK " + paymentData.amount}
    diff --git a/src/pages/Payment/Search_Public/DataGrid.js b/src/pages/Payment/Search_Public/DataGrid.js index 61ef146..97a7f39 100644 --- a/src/pages/Payment/Search_Public/DataGrid.js +++ b/src/pages/Payment/Search_Public/DataGrid.js @@ -86,7 +86,7 @@ export default function SearchPublicNoticeTable({ recordList }) { { id: 'payAmount', field: 'payAmount', - headerName: '費用', + headerName: intl.formatMessage({id: 'fee'}), width: 150, valueGetter: (params) => { return (params?.value) ? "$ " + FormatUtils.currencyFormat(params?.value) : ""; diff --git a/src/pages/Payment/Search_Public/index.js b/src/pages/Payment/Search_Public/index.js index faf7400..0930897 100644 --- a/src/pages/Payment/Search_Public/index.js +++ b/src/pages/Payment/Search_Public/index.js @@ -15,6 +15,7 @@ const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/Loa const SearchForm = Loadable(React.lazy(() => import('./SearchForm'))); const EventTable = Loadable(React.lazy(() => import('./DataGrid'))); import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' +import {FormattedMessage} from "react-intl"; const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, @@ -68,7 +69,9 @@ const Index = () => {
    - 付款記錄 + + +
    diff --git a/src/pages/Proof/Reply_Public/ApplicationDetails.js b/src/pages/Proof/Reply_Public/ApplicationDetails.js index e7783d4..63b486a 100644 --- a/src/pages/Proof/Reply_Public/ApplicationDetails.js +++ b/src/pages/Proof/Reply_Public/ApplicationDetails.js @@ -17,11 +17,12 @@ import Loadable from 'components/Loadable'; const MainCard = Loadable(React.lazy(() => import('components/MainCard'))); import * as StatusUtils from "utils/statusUtils/PublicNoteStatusUtils"; import FileList from "components/FileList" -import {FormattedMessage} from "react-intl"; +import {FormattedMessage, useIntl} from "react-intl"; // ==============================|| DASHBOARD - DEFAULT ||============================== // const ApplicationDetailCard = ({ formData, }) => { const params = useParams(); + const intl = useIntl(); const [data, setData] = React.useState({}); //const [proofId, setProofId] = React.useState(); @@ -91,12 +92,14 @@ const ApplicationDetailCard = ({ formData, }) => { - 申請狀態: + + : + - {StatusUtils.getStatusByText(data.appStatus)} + {StatusUtils.getStatusByTextIntl(data.appStatus, false, intl)} @@ -108,7 +111,9 @@ const ApplicationDetailCard = ({ formData, }) => { - 申請人: + + : + @@ -126,7 +131,9 @@ const ApplicationDetailCard = ({ formData, }) => { - 憲報期數: + + : + @@ -225,7 +232,9 @@ const ApplicationDetailCard = ({ formData, }) => { - 應繳費用: + + : + {FormatUtils.currencyFormat(data.fee)} diff --git a/src/pages/Proof/Search_Public/DataGrid.js b/src/pages/Proof/Search_Public/DataGrid.js index 2441f71..47aaf71 100644 --- a/src/pages/Proof/Search_Public/DataGrid.js +++ b/src/pages/Proof/Search_Public/DataGrid.js @@ -67,7 +67,7 @@ export default function SearchPublicNoticeTable({ recordList }) { const columns = [ { field: 'actions', - headerName: '校對編號', + headerName: intl.formatMessage({id: 'proofId'}), width: isMdOrLg ? 'auto' : 250, flex: isMdOrLg ? 1.5 : undefined, cellClassName: 'actions', @@ -96,7 +96,7 @@ export default function SearchPublicNoticeTable({ recordList }) { { id: 'created', field: 'created', - headerName: '校對日期', + headerName: intl.formatMessage({id: 'proofDate'}), width: isMdOrLg ? 'auto' : 250, flex: isMdOrLg ? 1.5 : undefined, valueGetter: (params) => { @@ -118,7 +118,7 @@ export default function SearchPublicNoticeTable({ recordList }) { { id: 'replyDate', field: 'replyDate', - headerName: '回覆日期', + headerName: intl.formatMessage({id: 'replyDate'}), width: isMdOrLg ? 'auto' : 250, flex: isMdOrLg ? 1.5 : undefined, valueGetter: (params) => { @@ -137,7 +137,7 @@ export default function SearchPublicNoticeTable({ recordList }) { { id: 'fee', field: 'fee', - headerName: '費用', + headerName: intl.formatMessage({id: 'fee'}), width: isMdOrLg ? 'auto' : 250, flex: isMdOrLg ? 1.5 : undefined, valueGetter: (params) => { diff --git a/src/pages/Proof/Search_Public/SearchForm.js b/src/pages/Proof/Search_Public/SearchForm.js index b5a3338..a939936 100644 --- a/src/pages/Proof/Search_Public/SearchForm.js +++ b/src/pages/Proof/Search_Public/SearchForm.js @@ -115,7 +115,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria, issueComboData fullWidth {...register("refNo")} id='refNo' - label="校對編號:" + label={intl.formatMessage({id: 'proofId'}) + ":"} defaultValue={searchCriteria.refNo} InputLabelProps={{ shrink: true @@ -150,7 +150,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria, issueComboData }} renderInput={(params) => ( { diff --git a/src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js b/src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js index 5a3e0a7..e3e448a 100644 --- a/src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js +++ b/src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js @@ -208,7 +208,9 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => { - 稿件檔案 ({"檔案大小應<10MB"}): + + ({"檔案大小應<10MB"}): + } > - 支付 + : null } @@ -177,7 +177,7 @@ const ApplicationDetailCard = ( - 公共啟事申請資料 + @@ -218,12 +218,14 @@ const ApplicationDetailCard = ( - 申請狀態: + + : + - {StatusUtils.getStatusByText(currentApplicationDetailData.status)} + {currentApplicationDetailData.status? StatusUtils.getStatusByTextIntl(currentApplicationDetailData.status, false,intl) : ""} { @@ -255,7 +257,9 @@ const ApplicationDetailCard = ( - 申請人: + + : + @@ -300,7 +304,9 @@ const ApplicationDetailCard = ( - 憲報期數: + + : + @@ -362,7 +368,9 @@ const ApplicationDetailCard = ( - 發布日期: + + : + @@ -444,7 +452,9 @@ const ApplicationDetailCard = ( - 金額(HK$): + + (HK$): + @@ -512,7 +522,9 @@ const ApplicationDetailCard = ( - 稿件檔案: + + : + @@ -532,11 +544,11 @@ const ApplicationDetailCard = ( diff --git a/src/pages/PublicNotice/Details_Public/tabTableDetail/PaymentTab.js b/src/pages/PublicNotice/Details_Public/tabTableDetail/PaymentTab.js index cc36abe..f30e650 100644 --- a/src/pages/PublicNotice/Details_Public/tabTableDetail/PaymentTab.js +++ b/src/pages/PublicNotice/Details_Public/tabTableDetail/PaymentTab.js @@ -58,7 +58,7 @@ export default function SubmittedTab({ rows }) { { id: 'payAmount', field: 'payAmount', - headerName: '費用', + headerName: intl.formatMessage({id: 'fee'}), width: 150, valueGetter: (params) => { return (params?.value) ? "$ " + FormatUtils.currencyFormat(params?.value) : ""; diff --git a/src/pages/PublicNotice/Details_Public/tabTableDetail/ProofTab.js b/src/pages/PublicNotice/Details_Public/tabTableDetail/ProofTab.js index 999af82..45e6d6f 100644 --- a/src/pages/PublicNotice/Details_Public/tabTableDetail/ProofTab.js +++ b/src/pages/PublicNotice/Details_Public/tabTableDetail/ProofTab.js @@ -17,6 +17,7 @@ export default function ProofTab({rows}) { const navigate = useNavigate() const theme = useTheme(); const isMdOrLg = useMediaQuery(theme.breakpoints.up('md')); + const { locale } = intl; const handleEditClick = (params) => () => { navigate('/proof/reply/' + params.row.id); @@ -26,7 +27,7 @@ export default function ProofTab({rows}) { { field: 'actions', - headerName: '校對編號', + headerName: intl.formatMessage({id: 'proofId'}), width: 200, cellClassName: 'actions', renderCell: (params) => { @@ -39,13 +40,13 @@ export default function ProofTab({rows}) { width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, renderCell: (params) => { - return ProofStatus.getStatus_Cht(params); + return locale === 'en' ? ProofStatus.getStatus_Eng(params) : ProofStatus.getStatus_Cht(params); }, }, { id: 'created', field: 'created', - headerName: '校對日期', + headerName: intl.formatMessage({id: 'proofDate'}), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, valueGetter: (params) => { @@ -55,7 +56,7 @@ export default function ProofTab({rows}) { { id: 'replyDate', field: 'replyDate', - headerName: '回覆日期', + headerName: intl.formatMessage({id: 'replyDate'}), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, valueGetter: (params) => { @@ -65,7 +66,7 @@ export default function ProofTab({rows}) { { id: 'fee', field: 'fee', - headerName: '費用', + headerName: intl.formatMessage({id: 'fee'}), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, valueGetter: (params) => { diff --git a/src/pages/PublicNotice/Details_Public/tabTableDetail/TabTable.js b/src/pages/PublicNotice/Details_Public/tabTableDetail/TabTable.js index f511237..5e34b08 100644 --- a/src/pages/PublicNotice/Details_Public/tabTableDetail/TabTable.js +++ b/src/pages/PublicNotice/Details_Public/tabTableDetail/TabTable.js @@ -59,7 +59,7 @@ const PublicNotice = ({ proofList, paymentList }) => { - + diff --git a/src/translations/en.json b/src/translations/en.json index 087123c..4120eac 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -240,6 +240,23 @@ "selectedPaymentMethod": "Selected payment method", "paymentMethodNotAvailable":"The payment function is currently not available", + "publicNoticeDetailTitle": "Public Notice Application Information", + "applyPerson": "Applicant", + "applyStatus": "Application Status", + "gazetteCount": "Gazette issues date", + "publishDate": "Publish date", + "draftFile": "Manuscript file", + "download": "Download", + "paymentHistory": "Payment History", + "proofId": "Proof Code", + "proofDate": "Proofing date", + "proofDateFrom": "Proofing date (from)", + "replyDate": "Reply date", + "fee": "Fee", + "payFeeFor": "Pay for", + "payFor": "Pay", + "payFee": "Payment Amount", + "Dashboard": "Dashboard", "event": "Event" } \ No newline at end of file diff --git a/src/translations/zh-CN.json b/src/translations/zh-CN.json index 1bb747f..8786dfe 100644 --- a/src/translations/zh-CN.json +++ b/src/translations/zh-CN.json @@ -240,6 +240,23 @@ "selectedPaymentMethod": "已選擇付款方法", "paymentMethodNotAvailable":"付款功能現在不可用", + "publicNoticeDetailTitle": "公共启事申请资料", + "applyPerson": "申请人", + "applyStatus": "申请状态", + "gazetteCount": "宪报期数", + "publishDate": "发布日期", + "draftFile": "稿件档案", + "download": "下载", + "paymentHistory": "付款记录", + "proofId": "校对编号", + "proofDate": "校对日期", + "proofDateFrom": "校对日期(从)", + "replyDate": "回覆日期", + "fee": "费用", + "payFeeFor": "应缴费用", + "payFor": "支付", + "payFee": "支付金額", + "Dashboard": "仪表板", "event": "活动" } \ No newline at end of file diff --git a/src/translations/zh-HK.json b/src/translations/zh-HK.json index 8b656b1..5a6de35 100644 --- a/src/translations/zh-HK.json +++ b/src/translations/zh-HK.json @@ -240,6 +240,23 @@ "selectedPaymentMethod": "已選擇付款方法", "paymentMethodNotAvailable":"付款功能現在不可用", + "publicNoticeDetailTitle": "公共啟事申請資料", + "applyPerson": "申請人", + "applyStatus": "申請狀態", + "gazetteCount": "憲報期數", + "publishDate": "發佈日期", + "draftFile": "稿件檔案", + "download": "下載", + "paymentHistory": "付款記錄", + "proofId": "校對編號", + "proofDate": "校對日期", + "proofDateFrom": "校對日期(從)", + "replyDate": "回覆日期", + "fee": "費用", + "payFeeFor": "應繳費用", + "payFor": "支付", + "payFee": "支付金額", + "Dashboard": "儀表板", "event": "活動" } \ No newline at end of file