From 3f565e5fba8c02ada1eff0d4af39723be198bcac Mon Sep 17 00:00:00 2001 From: anna Date: Wed, 11 Oct 2023 12:13:34 +0800 Subject: [PATCH] update ui and combo --- src/components/FileList.js | 12 +- .../ProofReply_Public/ApplicationDetails.js | 29 +-- src/pages/ProofReply_Public/ProofForm.js | 188 ++++++++++-------- src/pages/ProofReply_Public/index.js | 93 +++++---- src/pages/ProofSearch_Public/DataGrid.js | 77 +++---- src/pages/ProofSearch_Public/SearchForm.js | 59 +----- src/pages/ProofSearch_Public/index.js | 18 +- .../ListPanel/SearchPublicNoticeForm.js | 3 +- src/utils/ComboData.js | 75 +++---- src/utils/DateUtils.js | 2 +- 10 files changed, 250 insertions(+), 306 deletions(-) diff --git a/src/components/FileList.js b/src/components/FileList.js index b44d711..045f3fe 100644 --- a/src/components/FileList.js +++ b/src/components/FileList.js @@ -10,7 +10,7 @@ import * as DateUtils from "../utils/DateUtils" import { FiDataGrid } from './FiDataGrid'; // ==============================|| EVENT TABLE ||============================== // -export default function FileList({ refType, refId, allowDelete, sx, dateHideable, ...props }) { +export default function FileList({ refType, refId, allowDelete, sx, dateHideable,lang, ...props }) { const [rows, setRows] = React.useState([]); const [rowModesModel] = React.useState({}); @@ -91,13 +91,13 @@ export default function FileList({ refType, refId, allowDelete, sx, dateHideable { id: 'filename', field: 'filename', - headerName: 'filename', + headerName: lang=="ch"?"檔案名稱":'File Name', flex: 3, }, { id: 'filesize', field: 'filesize', - headerName: 'filesize', + headerName: lang=="ch"?"檔案大小":'File Size', flex: 1, valueGetter: (params) => { return convertToStr(params.value); @@ -109,7 +109,7 @@ export default function FileList({ refType, refId, allowDelete, sx, dateHideable { id: 'created', field: 'created', - headerName: 'created', + headerName: lang=="ch"?"日期":'Created', flex: 1, valueGetter: (params) => { return DateUtils.datetimeStr(params.value); @@ -136,13 +136,13 @@ export default function FileList({ refType, refId, allowDelete, sx, dateHideable { id: 'filename', field: 'filename', - headerName: 'filename', + headerName: lang=="ch"?"檔案名稱":'File Name', flex: 3, }, { id: 'filesize', field: 'filesize', - headerName: 'filesize', + headerName: lang=="ch"?"檔案大小":'File Size', flex: 1, valueGetter: (params) => { return convertToStr(params.value); diff --git a/src/pages/ProofReply_Public/ApplicationDetails.js b/src/pages/ProofReply_Public/ApplicationDetails.js index fed44a5..8a263a0 100644 --- a/src/pages/ProofReply_Public/ApplicationDetails.js +++ b/src/pages/ProofReply_Public/ApplicationDetails.js @@ -17,7 +17,7 @@ const MainCard = Loadable(React.lazy(() => import('components/MainCard'))); import * as StatusUtils from "../PublicNotice/ListPanel/PublicNoteStatusUtils"; import FileList from "components/FileList" // ==============================|| DASHBOARD - DEFAULT ||============================== // -const ApplicationDetailCard = ({ formData,}) => { +const ApplicationDetailCard = ({ formData, }) => { const params = useParams(); @@ -25,7 +25,7 @@ const ApplicationDetailCard = ({ formData,}) => { //const [proofId, setProofId] = React.useState(); React.useEffect(() => { - if (formData){ + if (formData) { setData(formData); //setProofId(formData.id); } @@ -59,10 +59,10 @@ const ApplicationDetailCard = ({ formData,}) => { } function currencyFormat(num) { - let val = num?num:0; + let val = num ? num : 0; return val.toLocaleString('en-US', { - minimumFractionDigits: 2 - }); + minimumFractionDigits: 2 + }); } @@ -71,7 +71,7 @@ const ApplicationDetailCard = ({ formData,}) => { border={false} content={false} > - + 公共啟事:校對資料
@@ -162,7 +162,7 @@ const ApplicationDetailCard = ({ formData,}) => { - + @@ -195,6 +195,7 @@ const ApplicationDetailCard = ({ formData,}) => { { sx={{ display: 'flex', alignItems: 'center' }}> 繳費及返稿最後限期: - + {DateUtils.dateStr_Cht(data.returnBeforeDate)} 下午 2:00前 { 應繳費用: - {currencyFormat(data.fee)} + {currencyFormat(data.fee)} - + { formik.values.groupType == "A" - ? - ( {data.length} 頁 x $6,552 ) - : - ( {data.length} cm x {data.colCount==2?"$364 二格位":"$182 一格位"} ) + ? + ( {data.length} 頁 x $6,552 ) + : + ( {data.length} cm x {data.colCount == 2 ? "$364 二格位" : "$182 一格位"} ) } diff --git a/src/pages/ProofReply_Public/ProofForm.js b/src/pages/ProofReply_Public/ProofForm.js index 42b89ab..eb9e6b2 100644 --- a/src/pages/ProofReply_Public/ProofForm.js +++ b/src/pages/ProofReply_Public/ProofForm.js @@ -107,6 +107,15 @@ const FormPanel = ({ formData }) => { } } + const isOverTime = () => { + let returnBeforeDate = DateUtils.convertToDate(formik.values?.returnBeforeDate); + if (!returnBeforeDate) return true; + returnBeforeDate = returnBeforeDate.setHours(14, 0, 0, 0); + + let current = new Date(); + return current.getTime() > returnBeforeDate; + } + return ( @@ -127,10 +136,11 @@ const FormPanel = ({ formData }) => { 校對回覆日期: {DateUtils.datetimeStr_Cht(formik.values.replyDate)} - 校對回覆: {formik.values.action? "可以付印(稿件正確)":"未能付印(需要修改)"} + 校對回覆: {formik.values.action ? "可以付印(稿件正確)" : "未能付印(需要修改)"} - { disableColumnSelector hideFooter /> - + : - + ( + isOverTime() ? + + + 回覆逾時,請重新申請。 + + + : + - - - } label="可以付印(稿件正確)" /> - } label="未能付印(需要修改)" /> - - + + + } label="可以付印(稿件正確)" /> + } label="未能付印(需要修改)" /> + + - - 請上載稿件修改的檔案: - + + 請上載稿件修改的檔案: + - - = (formik.values.groupType == "A" ? 2 : 1)} - onChange={(event) => { - readFile(event) - }} - /> - - + + = (formik.values.groupType == "A" ? 2 : 1)} + onChange={(event) => { + readFile(event) + }} + /> + + - - - + + + - - - - 簽署: - - - - - + + + + 簽署: + + + + + + + + + + + + + ) - - - - } diff --git a/src/pages/ProofReply_Public/index.js b/src/pages/ProofReply_Public/index.js index de29ffd..d2604d4 100644 --- a/src/pages/ProofReply_Public/index.js +++ b/src/pages/ProofReply_Public/index.js @@ -10,6 +10,7 @@ import * as React from "react"; import * as HttpUtils from "utils/HttpUtils"; import * as DateUtils from "utils/DateUtils"; import { useParams } from "react-router-dom"; +import { useNavigate } from "react-router-dom"; import Loadable from 'components/Loadable'; const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); @@ -30,6 +31,7 @@ const BackgroundHead = { const Index = () => { const params = useParams(); + const navigate = useNavigate() const [record, setRecord] = React.useState(); const [onReady, setOnReady] = React.useState(false); @@ -49,6 +51,9 @@ const Index = () => { HttpUtils.get({ url: UrlUtils.GET_PROOF + "/" + params.id, onSuccess: (responseData) => { + if(!responseData.data?.id){ + navigate("/proof/search"); + } responseData.data["phoneNumber"] = JSON.parse(responseData.data.contactTelNo).phoneNumber; responseData.data["tel_countryCode"] = JSON.parse(responseData.data.contactTelNo).countryCode; @@ -56,13 +61,13 @@ const Index = () => { responseData.data["fax_countryCode"] = JSON.parse(responseData.data.contactFaxNo).countryCode; responseData.data["issueNoStr"] = responseData.data.issueYear - +" Vol. "+zeroPad(responseData.data.issueVolume,3) - +", No. "+zeroPad(responseData.data.issueNo,2); - - responseData.data["issueDate"] = DateUtils.dateFormat(responseData.data.issueDate, "D MMM YYYY (ddd)"); + + " Vol. " + zeroPad(responseData.data.issueVolume, 3) + + ", No. " + zeroPad(responseData.data.issueNo, 2); + + responseData.data["issueDateStr"] = DateUtils.dateFormat(responseData.data.issueDate, "D MMM YYYY (ddd)"); responseData.data["groupType"] = responseData.data.groupNo.charAt(0); - responseData.data["action"] = responseData.data.replyDate?responseData.data.action:true; + responseData.data["action"] = responseData.data.replyDate ? responseData.data.action : true; setRecord(responseData.data); } }); @@ -70,7 +75,7 @@ const Index = () => { } function zeroPad(num, places) { - num=num?num:0; + num = num ? num : 0; var zero = places - num.toString().length + 1; return Array(+(zero > 0 && zero)).join("0") + num; } @@ -80,42 +85,48 @@ const Index = () => { !onReady ? : - - -
- - 校對記錄 - -
-
- {/*row 1*/} - - -
- - - - - - - - - + ( + + +
+ + 校對記錄 + +
+
+ {/*row 1*/} + + +
+ + + + + + + + + + +
-
-
-
- {/*row 2*/} -
+ + {/*row 2*/} + + + + ) + + ); }; diff --git a/src/pages/ProofSearch_Public/DataGrid.js b/src/pages/ProofSearch_Public/DataGrid.js index b70343b..6776836 100644 --- a/src/pages/ProofSearch_Public/DataGrid.js +++ b/src/pages/ProofSearch_Public/DataGrid.js @@ -4,8 +4,8 @@ import { Button } from '@mui/material'; import * as DateUtils from "utils/DateUtils"; -import {useNavigate} from "react-router-dom"; -import {FiDataGrid} from "components/FiDataGrid"; +import { useNavigate } from "react-router-dom"; +import { FiDataGrid } from "components/FiDataGrid"; // ==============================|| EVENT TABLE ||============================== // export default function SearchPublicNoticeTable({ recordList }) { @@ -17,14 +17,14 @@ export default function SearchPublicNoticeTable({ recordList }) { }, [recordList]); const handleEditClick = (params) => () => { - navigate('/proof/reply/'+ params.row.appId); + navigate('/proof/reply/' + params.row.appId); }; const columns = [ { field: 'actions', - headerName: 'Proof No.', + headerName: '校對編號', width: 150, cellClassName: 'actions', renderCell: (params) => { @@ -34,23 +34,34 @@ export default function SearchPublicNoticeTable({ recordList }) { { id: 'appId', field: 'appId', - headerName: 'Application No./ Gazette Code/ Gazette Issue', + headerName: '申請編號/憲報編號/憲報期數', flex: 1, renderCell: (params) => { let appNo = params.row.appNo; let code = params.row.groupNo; let isssue = params.row.issueYear - +" Vol. "+zeroPad(params.row.issueVolume,3) - +", No. "+zeroPad(params.row.issueNo,2) - +", "+DateUtils.dateFormat(params.row.issueDate, "D MMM YYYY (ddd)"); + + " Vol. " + zeroPad(params.row.issueVolume, 3) + + ", No. " + zeroPad(params.row.issueNo, 2) + + ", " + DateUtils.dateFormat(params.row.issueDate, "D MMM YYYY (ddd)"); - return
App No: {appNo}
Gazette Code: {code}
Issue: {isssue}
+ return
申請編號: {appNo}
憲報編號: {code}
憲報期數: {isssue}
}, }, + { + id: 'returnBeforeDate', + field: 'returnBeforeDate', + headerName: '此日期前回覆', + flex: 1, + valueGetter: (params) => { + let returnBeforeDate = DateUtils.convertToDate(params?.value); + returnBeforeDate = returnBeforeDate.setHours(14, 0, 0, 0); + return DateUtils.datetimeStr_Cht(returnBeforeDate); + } + }, { id: 'created', field: 'created', - headerName: 'Proof Date', + headerName: '校對日期', flex: 1, valueGetter: (params) => { return DateUtils.datetimeStr(params?.value); @@ -59,69 +70,41 @@ export default function SearchPublicNoticeTable({ recordList }) { { id: 'replyDate', field: 'replyDate', - headerName: 'Confirmed/Return Date', + headerName: '回覆日期', flex: 1, valueGetter: (params) => { - return params?.value?DateUtils.datetimeStr(params?.value):""; - } - }, - { - id: 'contactPerson', - field: 'contactPerson', - headerName: 'Contact Person', - flex: 1, - renderCell: (params) => { - let company = params.row.enCompanyName!= null ?" ("+(params.row.enCompanyName)+")":""; - - let phone = JSON.parse(params.row.contactTelNo); - let faxNo = JSON.parse(params.row.contactFaxNo); - - let contact = ""; - if (phone) { - contact = "Phone No.: " + phone?.countryCode + " " + phone?.phoneNumber - } - - if (faxNo && faxNo?.faxNumber) { - if (contact != "") - contact = contact + ", " - contact = contact + "Fax No.:" + faxNo?.countryCode + " " + faxNo?.faxNumber - } - - return (<> - {params?.value + company}
- {contact} - ); + return params?.value ? DateUtils.datetimeStr(params?.value) : ""; } }, { id: 'groupTitle', field: 'groupTitle', - headerName: 'Gazette Group', + headerName: '憲報類型', flex: 1, valueGetter: (params) => { - return (params?.value)?(params?.value):""; + return (params?.value) ? (params?.value) : ""; } }, { id: 'fee', field: 'fee', - headerName: 'Fee', + headerName: '費用', flex: 1, valueGetter: (params) => { - return (params?.value)?"$ "+currencyFormat(params?.value):""; + return (params?.value) ? "$ " + currencyFormat(params?.value) : ""; } }, ]; function currencyFormat(num) { return num.toLocaleString('en-US', { - minimumFractionDigits: 2 - }); + minimumFractionDigits: 2 + }); } function zeroPad(num, places) { - num=num?num:0; + num = num ? num : 0; var zero = places - num.toString().length + 1; return Array(+(zero > 0 && zero)).join("0") + num; } diff --git a/src/pages/ProofSearch_Public/SearchForm.js b/src/pages/ProofSearch_Public/SearchForm.js index 706191c..d4bb4d2 100644 --- a/src/pages/ProofSearch_Public/SearchForm.js +++ b/src/pages/ProofSearch_Public/SearchForm.js @@ -13,13 +13,11 @@ import * as DateUtils from "utils/DateUtils"; // ==============================|| DASHBOARD - DEFAULT ||============================== // -const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issueComboData +const SearchPublicNoticeForm = ({ applySearch, searchCriteria,issueComboData }) => { const [type, setType] = React.useState([]); const [status, setStatus] = React.useState({ key: 0, label: 'All', type: 'all' }); - const [orgSelected, setOrgSelected] = React.useState({}); - const [orgCombo, setOrgCombo] = React.useState(); const [issueSelected, setIssueSelected] = React.useState({}); const [issueCombo, setIssueCombo] = React.useState([]); const [groupSelected, setGroupSelected] = React.useState({}); @@ -46,17 +44,10 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu dateTo: data.dateTo, contact: data.contact, replyed: (status?.type && status?.type != 'all') ? status?.type : "", - orgId: (orgSelected?.key && orgSelected?.key > 0) ? orgSelected?.key : "", - }; applySearch(temp); }; - React.useEffect(() => { - if (orgComboData && orgComboData.length > 0) { - setOrgCombo(orgComboData); - } - }, [orgComboData]); React.useEffect(() => { if (issueComboData && issueComboData.length > 0) { @@ -144,7 +135,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu }} renderInput={(params) => ( option.label} + inputValue={(groupSelected?.labelCht)?groupSelected?.labelCht:""} + getOptionLabel={(option)=>option.labelCht} onChange={(event, newValue) => { if (newValue !== null) { setGroupSelected(newValue); @@ -169,7 +160,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu }} renderInput={(params) => ( { @@ -209,7 +200,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu }} id="dateTo" type="date" - label="校對日期(To)" + label="校對日期(到)" defaultValue={searchCriteria.dateTo} /> @@ -236,7 +227,8 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu filterOptions={(options) => options} options={ComboData.proofStatus} value={status} - inputValue={status?.label?status?.label:""} + getOptionLabel={(option)=>option.labelCht} + inputValue={status?.labelCht?status?.labelCht:""} onChange={(event, newValue) => { if (newValue !== null) { setStatus(newValue); @@ -253,35 +245,6 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu /> - { - orgCombo ? - - { - if (newValue !== null) { - setOrgSelected(newValue); - } - }} - renderInput={(params) => ( - - )} - /> - - : <> - } - - @@ -297,7 +260,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu textTransform: 'capitalize', alignItems: 'end' }}> - Clear + 重置 @@ -310,7 +273,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu textTransform: 'capitalize', alignItems: 'end' }}> - Submit + 提交 diff --git a/src/pages/ProofSearch_Public/index.js b/src/pages/ProofSearch_Public/index.js index 95082e4..ab51859 100644 --- a/src/pages/ProofSearch_Public/index.js +++ b/src/pages/ProofSearch_Public/index.js @@ -31,7 +31,6 @@ const BackgroundHead = { const UserSearchPage_Individual = () => { const [record,setRecord] = React.useState([]); - const [orgCombo,setOrgCombo] = React.useState([]); const [issueCombo,setIssueCombo] = React.useState([]); const [searchCriteria, setSearchCriteria] = React.useState({ dateTo: DateUtils.dateStr(new Date()), @@ -40,8 +39,6 @@ const UserSearchPage_Individual = () => { const [onReady, setOnReady] = React.useState(false); React.useEffect(() => { - getUserList(); - getOrgCombo(); getIssueCombo(); }, []); @@ -50,10 +47,10 @@ const UserSearchPage_Individual = () => { }, [record]); React.useEffect(() => { - getUserList(); + loadGrid(); }, [searchCriteria]); - function getUserList(){ + function loadGrid(){ HttpUtils.get({ url: UrlUtils.LIST_PROOF, params: searchCriteria, @@ -63,16 +60,6 @@ const UserSearchPage_Individual = () => { }); } - function getOrgCombo(){ - HttpUtils.get({ - url: UrlUtils.GET_ORG_COMBO, - onSuccess: function(responseData){ - let combo = responseData; - setOrgCombo(combo); - } - }); - } - function getIssueCombo(){ HttpUtils.get({ url: UrlUtils.GET_ISSUE_COMBO, @@ -104,7 +91,6 @@ const UserSearchPage_Individual = () => { diff --git a/src/pages/PublicNotice/ListPanel/SearchPublicNoticeForm.js b/src/pages/PublicNotice/ListPanel/SearchPublicNoticeForm.js index 6a8fadc..f86b13f 100644 --- a/src/pages/PublicNotice/ListPanel/SearchPublicNoticeForm.js +++ b/src/pages/PublicNotice/ListPanel/SearchPublicNoticeForm.js @@ -135,7 +135,8 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { ComboData.publicNoticeStatic } values={status} - inputValue={status?.label} + inputValue={status?.labelCht} + getOptionLabel={(option)=>option.labelCht} onChange={(event, newValue) => { if (newValue !== null) { setStatus(newValue); diff --git a/src/utils/ComboData.js b/src/utils/ComboData.js index 9b5b3bc..8796103 100644 --- a/src/utils/ComboData.js +++ b/src/utils/ComboData.js @@ -12,52 +12,29 @@ export const country = ["香港","內地","澳門"]; 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, label: '全部', type: 'all' }, - { key: 1, label: '處理中', type: 'processing' }, // submitted and reviewed - { key: 2, label: '待付款', type: 'confirmed' }, - { key: 3, label: '待發布', type: 'paid' }, - { key: 4, label: '已完成', type: 'completed' }, - { key: 5, label: '不接受', type: 'notAccepted' }, - { key: 6, label: '需重新提交', type: 'resubmit' }, - { key: 7, label: '已取消', type: 'cancelled' }, - { key: 8, label: '已撤銷', type: 'withdrawn' }, + { 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' }, ]; export const publicNoticeStatic_Creditor = [ - { key: 0, label: '全部', type: 'all' }, - { key: 1, label: '處理中', type: 'processing' }, // submitted and reviewed - { key: 2, label: '待發布', type: 'confirmed' }, - { key: 3, label: '待付款', type: 'published' }, - { key: 4, label: '已完成', type: 'completed' }, - { key: 5, label: '不接受', type: 'notAccepted' }, - { key: 6, label: '需重新提交', type: 'resubmit' }, - { key: 7, label: '已取消', type: 'cancelled' }, - { key: 8, label: '已撤銷', type: 'withdrawn' }, + { 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' }, ]; -export const publicNoticeStaticEng = [ - { key: 0, label: 'All', type: 'all' }, - { key: 1, label: 'Processing', type: 'processing' }, // submitted and reviewed - { key: 2, label: 'Pending Payment', type: 'confirmed' }, - { key: 3, label: 'To be published', type: 'paid' }, - { key: 4, label: 'Completed', type: 'completed' }, - { key: 5, label: 'Not accepted', type: 'notAccepted' }, - { key: 6, label: 'Re-submit Required', type: 'resubmit' }, - { key: 7, label: 'Cancelled', type: 'cancelled' }, - { key: 8, label: 'Withdrawn', type: 'withdrawn' }, -]; - -export const publicNoticeStaticEng_Creditor = [ - { key: 0, label: 'All', type: 'all' }, - { key: 1, label: 'Processing', type: 'processing' }, // submitted and reviewed - { key: 2, label: 'To be published', type: 'confirmed' }, - { key: 3, label: 'Pending Payment', type: 'published' }, - { key: 4, label: 'Completed', type: 'completed' }, - { key: 5, label: 'Not accepted', type: 'notAccepted' }, - { key: 6, label: 'Re-submit Required', type: 'resubmit' }, - { key: 7, label: 'Cancelled', type: 'cancelled' }, - { key: 8, label: 'Withdrawn', type: 'withdrawn' }, -]; export const publicNoticeStatic_GLD = [ { key: 0, label: 'All', type: 'all' }, @@ -75,11 +52,11 @@ export const publicNoticeStatic_GLD = [ export const groupTitle = [ - { key: 1, label: 'A - Private Bill', title: 'Private Bill', type: 'A'}, - { key: 2, label: 'B - Companies Ordinance', title: 'Companies Ordinance', type: 'B' }, - { key: 3, label: 'C - High Court', title: 'High Court', type: 'C' }, - { key: 4, label: 'D - Notices', title: 'Notices', type: 'D' }, - { key: 5, label: 'E - Miscellaneous (Companies)', title: 'Miscellaneous  (Companies)', type: 'E' }, + { key: 1, labelCht: 'A - 私人帳單', label: 'A - Private Bill', title: 'Private Bill', type: 'A'}, + { key: 2, labelCht: 'B - 公司條例', label: 'B - Companies Ordinance', title: 'Companies Ordinance', type: 'B' }, + { key: 3, labelCht: 'C - 高等法院', label: 'C - High Court', title: 'High Court', type: 'C' }, + { key: 4, labelCht: 'D - 通知', label: 'D - Notices', title: 'Notices', type: 'D' }, + { key: 5, labelCht: 'E - 其他', label: 'E - Miscellaneous (Companies)', title: 'Miscellaneous  (Companies)', type: 'E' }, ]; export const proofPrice = [ @@ -88,7 +65,7 @@ export const proofPrice = [ ]; export const proofStatus = [ - { key: 0, label: 'All', type: 'all' }, - { key: 1, label: 'Replyed', type: 'T' }, // submitted and reviewed - { key: 2, label: 'Not reply yet', type: 'F' }, + { key: 0, labelCht: '全部', label: 'All', type: 'all' }, + { key: 1, labelCht: '已回覆', label:'Replyed', type: 'T' }, // submitted and reviewed + { key: 2, labelCht: '未回覆', label:'Not reply yet', type: 'F' }, ]; \ No newline at end of file diff --git a/src/utils/DateUtils.js b/src/utils/DateUtils.js index 9ec9e2d..a03e646 100644 --- a/src/utils/DateUtils.js +++ b/src/utils/DateUtils.js @@ -19,7 +19,7 @@ export const dateStr_Cht = (date) =>{ export const convertToDate = (date)=>{ if(typeof date == 'number'){ - return dayjs(date); + return dayjs(date).toDate(); }else if(Array.isArray(date)){ if(date.length==3){ return new Date(date[0],date[1]-1,date[2],0,0,0);